Skip to content

Commit

Permalink
api: add docs for detach endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasmoura committed Apr 10, 2024
1 parent 6454da0 commit fca8e6e
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions docs/references/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ The currently available endpoints are:
- `u.pro.attach.auto.full_auto_attach.v1`_
- `u.pro.attach.auto.configure_retry_service.v1`_
- `u.pro.attach.token.full_token_attach.v1`_
- `u.pro.detach.v1`_
- `u.pro.security.fix.cve.execute.v1`_
- `u.pro.security.fix.usn.execute.v1`_
- `u.pro.security.fix.cve.plan.v1`_
Expand Down Expand Up @@ -715,6 +716,65 @@ a token.
"reboot_required": false
}
u.pro.detach.v1
============================================

This endpoint allow the user to detach the machine from a Pro subscription.

- Introduced in Ubuntu Pro Client Version: ``32~``

.. tab-set::

.. tab-item:: Python API interaction
:sync: python

- Calling from Python code:

.. code-block:: python
from uaclient.api.u.pro.detach.v1 import detach
result = detach()
- Expected return object:

- ``uaclient.api.u.pro.detach.v1.DetachResult``

.. list-table::
:header-rows: 1

* - Field Name
- Type
- Description
* - ``disabled``
- *List[str]*
- The services disabled during the detach operation
* - ``reboot_required``
- *bool*
- If the system requires a reboot after the detach operation

- Raised exceptions:

- ``NonRootUserError``: Raised if a non-root user executes this endpoint

.. tab-item:: CLI interaction
:sync: CLI

- Calling from the CLI:

.. code-block:: bash
pro api u.pro.detach.v1
- Expected attributes in JSON structure:

.. code-block:: json
{
"disabled": ["service1", "service2"],
"reboot_required": false
}
.. _cve-execute-api-v1:

u.pro.security.fix.cve.execute.v1
Expand Down

0 comments on commit fca8e6e

Please sign in to comment.