Question
How to remove a service user if corresponding subscription is disabled?
Answer
This could be achieved in two ways: via Provider Control Panel and OpenAPI.
To remove a service user using Provider Control Panel:
- Temporary enable disabled subscription.
- Log in into the CCP as a Staff Member
- Remove the service user
- Disable subscription back in OA
To remove via API the pem.removeUser method should be used:
Obtain user ID as it is not shown in OA UI. It can be done using the API method pem.getUserByLogin. See the example below:
1.1 Create a file
pem.getUserByLogin.xml
with the content like below:<?xml version="1.0"?> <methodCall> <methodName>pem.getUserByLogin</methodName> <params> <param> <value> <struct> <member> <name>login</name> <value><string>user1</string></value> </member> </struct> </value> </param> </params> </methodCall>
where
user1
is the login name of the service user supposed to be deleted.1.2 Execute the followin request in the management node command line:
# curl -d@pem.getUserByLogin.xml http://localhost:8440
The output like below will contain the service user ID::
<?xml version="1.0" encoding="utf-8"?> <methodResponse><params><param><value><struct><member><name>result</name>value><struct><member><name>user_id</name><value><i4>12345</i4></value></member>/struct></value></member><member><name>status</name><value><i4>0</i4></value></member></struct></value></param></params></methodResponse>
the user ID here is
12345
.Use OpenAPI method pem.removeUser to delete the service user. See the below example:
2.1 Create a file
pem.removeUser.xml
with the content as below:<?xml version="1.0"?> <methodCall> <methodName>pem.removeUser</methodName> <params> <param> <value> <struct> <member> <name>user_id</name> <value><int>12345</int></value> </member> </struct> </value> </param> </params> </methodCall>
(do not forget to specify required service user ID instead of
12345
)2.2 Execute the following request in the management node command line:
# curl -d@pem.removeUser.xml http://localhost:8440
The output as below should be returned:
<?xml version="1.0" encoding="utf-8"?><methodResponse><params><param><value><struct><member><name>status</name><value><i4>0</i4></value></member></struct></value></param></params></methodResponse>
Status
0
means the command has been completed successfully.