diff --git a/impersonation.rst b/impersonation.rst new file mode 100644 index 0000000..9d29f77 --- /dev/null +++ b/impersonation.rst @@ -0,0 +1,503 @@ +Impersonation +=============================== + +Impersonation Management API + +This API provides endpoints for managing user impersonation within the CloudSigma platform. It allows authorized users to enable/disable impersonation, manage groups of users allowed for impersonation, and view impersonation session history. + +Resource: ``/api/2.0/impersonation/`` + +Authentication +-------------- + +All endpoints within this API require authentication using a valid CloudSigma API token. + +Endpoints +--------- + +The `ImpersonationManagementResource` is located at: `/api/2.0/impersonation/` + +Actions are performed via POST requests to this resource. +----------------------- + +.. http:post:: /api/2.0/impersonation/?do=enable_impersonation + + Enables the ability for the currently authenticated user to be impersonated by others. + + :statuscode 200: no error + :statuscode 401: unauthorized + + **Example request**: + + .. sourcecode:: http + + POST /api/2.0/impersonation/?do=enable_impersonation HTTP/1.1 + Host: api.cloudsigma.com + Accept: application/json + + + Request body + + .. parsed-literal:: + + {} + + + **Response**: + .. parsed-literal:: + + {"enabled": true} + + + +.. http:post:: /api/2.0/impersonation/?do=disable_impersonation + +Disables the ability for the currently authenticated user to be impersonated. + :statuscode 200: no error + :statuscode 401: unauthorized + + **Example request**: + + .. sourcecode:: http + + POST /api/2.0/impersonation/?do=disable_impersonation HTTP/1.1 + Host: api.cloudsigma.com + Accept: application/json + + + Request body + + .. parsed-literal:: + + {} + + + **Response**: + .. parsed-literal:: + + {"enabled": false} + + +.. http:post:: /api/2.0/impersonation/?do=enable_cs_staff_impersonation + +Enables the ability for the currently authenticated user to be impersonated by CloudSigma staff user. + :statuscode 200: no error + :statuscode 401: unauthorized + + **Example request**: + + .. sourcecode:: http + + POST /api/2.0/impersonation/?do=enable_cs_staff_impersonation HTTP/1.1 + Host: api.cloudsigma.com + Accept: application/json + + + Request body + + .. parsed-literal:: + + {} + + **Response**: + .. parsed-literal:: + + {"enabled": true} + + +.. http:post:: /api/2.0/impersonation/?do=disable_cs_staff_impersonation + +Disables the ability for the currently authenticated user to be impersonated by CloudSigma staff users. + :statuscode 200: no error + :statuscode 401: unauthorized + + **Example request**: + + .. sourcecode:: http + + POST /api/2.0/impersonation/?do=disable_cs_staff_impersonation HTTP/1.1 + Host: api.cloudsigma.com + Accept: application/json + + + Request body + + .. parsed-literal:: + + {} + + + **Response**: + .. parsed-literal:: + + {"enabled": false} + + + +.. http:post:: /api/2.0/impersonation/?do=enable_partner_staff_impersonation + +Enables the ability for the currently authenticated user to be impersonated by CloudSigma Cloud Partner staff users. + :statuscode 200: no error + :statuscode 401: unauthorized + + **Example request**: + + .. sourcecode:: http + + POST /api/2.0/impersonation/?do=enable_partner_staff_impersonation HTTP/1.1 + Host: api.cloudsigma.com + Accept: application/json + + + Request body + + .. parsed-literal:: + + {} + + + **Response**: + .. parsed-literal:: + + {"enabled": true} + + + +.. http:post:: /api/2.0/impersonation/?do=disable_partner_staff_impersonation + +Disables the ability for the currently authenticated user to be impersonated by CloudSigma Cloud Partner staff users. + :statuscode 200: no error + :statuscode 401: unauthorized + + **Example request**: + + .. sourcecode:: http + + POST /api/2.0/impersonation/?do=disable_partner_staff_impersonation HTTP/1.1 + Host: api.cloudsigma.com + Accept: application/json + + + Request body + + .. parsed-literal:: + + {} + + + **Response**: + .. parsed-literal:: + + {"enabled": false} + + +.. http:post:: /api/2.0/impersonation/?do=add_user_to_personal_impersonation_group + +Adds a user to the currently authenticated user's personal impersonation group, allowing the authenticated user to be impersonated by the that user. + + :statuscode 200: no error + :statuscode 401: unauthorized + + **Example request**: + + .. sourcecode:: http + + POST /api/2.0/impersonation/?do=add_user_to_personal_impersonation_group HTTP/1.1 + Host: api.cloudsigma.com + Accept: application/json + + + Request body + + .. parsed-literal:: + + { + "uuid": "", + "label": "" + } + + + **Response**: + .. parsed-literal:: + + {} + +.. http:post:: /api/2.0/impersonation/?do=remove_user_from_personal_impersonation_group + +Removes a user to the currently authenticated user's personal impersonation group, preventing the authenticated user to be impersonated by the that user. + + :statuscode 200: no error + :statuscode 401: unauthorized + + **Example request**: + + .. sourcecode:: http + + POST /api/2.0/impersonation/?do=remove_user_from_personal_impersonation_group HTTP/1.1 + Host: api.cloudsigma.com + Accept: application/json + + + Request body + + .. parsed-literal:: + + { + "uuid": "" + } + + + **Response**: + .. parsed-literal:: + + {} + + +.. http:post:: /api/2.0/impersonation/?do=update_user_in_personal_impersonation_group + +Update user label in currently authenticated user's personal impersonation group. + + :statuscode 200: no error + :statuscode 401: unauthorized + + **Example request**: + + .. sourcecode:: http + + POST /api/2.0/impersonation/?do=update_user_in_personal_impersonation_group HTTP/1.1 + Host: api.cloudsigma.com + Accept: application/json + + + Request body + + .. parsed-literal:: + + { + "uuid": "", + "label": "