All URIs are relative to /api/v57
Method | HTTP request | Description |
---|---|---|
create_users2 | POST /users | Creates a list of users. |
delete_user2 | DELETE /users/{userName} | Deletes a user from the system. |
expire_sessions | POST /users/expireSessions/{userName} | Expires the sessions associated with interactive authenticated user in Cloudera Manager. |
get_sessions | GET /users/sessions | Return a list of the sessions associated with interactive authenticated users in Cloudera Manager. |
read_user2 | GET /users/{userName} | Returns detailed information about a user. |
read_users2 | GET /users | Returns a list of the user names configured in the system. |
update_user2 | PUT /users/{userName} | Updates the given user's information. |
ApiUser2List create_users2(body=body)
Creates a list of users.
Creates a list of users.
When creating new users, the password property of each user should be their plain text password. The returned user information will not contain any password information.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.UsersResourceApi(cm_client.ApiClient(configuration))
body = cm_client.ApiUser2List() # ApiUser2List | List of users to create. (optional)
try:
# Creates a list of users.
api_response = api_instance.create_users2(body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling UsersResourceApi->create_users2: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
body | ApiUser2List | List of users to create. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiUser2 delete_user2(user_name)
Deletes a user from the system.
Deletes a user from the system.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.UsersResourceApi(cm_client.ApiClient(configuration))
user_name = 'user_name_example' # str | The name of the user to delete.
try:
# Deletes a user from the system.
api_response = api_instance.delete_user2(user_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling UsersResourceApi->delete_user2: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
user_name | str | The name of the user to delete. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
expire_sessions(user_name)
Expires the sessions associated with interactive authenticated user in Cloudera Manager.
Expires the sessions associated with interactive authenticated user in Cloudera Manager. This can be used by Full Admin/User Admin users only.
Note that these sessions are only associated with a user who log into the web interface. Sessions of an API user will not be affected.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.UsersResourceApi(cm_client.ApiClient(configuration))
user_name = 'user_name_example' # str |
try:
# Expires the sessions associated with interactive authenticated user in Cloudera Manager.
api_instance.expire_sessions(user_name)
except ApiException as e:
print("Exception when calling UsersResourceApi->expire_sessions: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
user_name | str |
void (empty response body)
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiUserSessionList get_sessions()
Return a list of the sessions associated with interactive authenticated users in Cloudera Manager.
Return a list of the sessions associated with interactive authenticated users in Cloudera Manager.
Note that these sessions are only associated with users who log into the web interface. API users will not appear.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.UsersResourceApi(cm_client.ApiClient(configuration))
try:
# Return a list of the sessions associated with interactive authenticated users in Cloudera Manager.
api_response = api_instance.get_sessions()
pprint(api_response)
except ApiException as e:
print("Exception when calling UsersResourceApi->get_sessions: %s\n" % e)
This endpoint does not need any parameter.
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiUser2 read_user2(user_name)
Returns detailed information about a user.
Returns detailed information about a user.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.UsersResourceApi(cm_client.ApiClient(configuration))
user_name = 'user_name_example' # str | The user to read.
try:
# Returns detailed information about a user.
api_response = api_instance.read_user2(user_name)
pprint(api_response)
except ApiException as e:
print("Exception when calling UsersResourceApi->read_user2: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
user_name | str | The user to read. |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiUser2List read_users2(view=view)
Returns a list of the user names configured in the system.
Returns a list of the user names configured in the system.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.UsersResourceApi(cm_client.ApiClient(configuration))
view = 'summary' # str | (optional) (default to summary)
try:
# Returns a list of the user names configured in the system.
api_response = api_instance.read_users2(view=view)
pprint(api_response)
except ApiException as e:
print("Exception when calling UsersResourceApi->read_users2: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
view | str | [optional] [default to summary] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
ApiUser2 update_user2(user_name, body=body)
Updates the given user's information.
Updates the given user's information. Note that the user's name cannot be changed.
from __future__ import print_function
import time
import cm_client
from cm_client.rest import ApiException
from pprint import pprint
# Configure HTTP basic authorization: basic
configuration = cm_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'
# create an instance of the API class
api_instance = cm_client.UsersResourceApi(cm_client.ApiClient(configuration))
user_name = 'user_name_example' # str | User name being updated.
body = cm_client.ApiUser2() # ApiUser2 | The user information. (optional)
try:
# Updates the given user's information.
api_response = api_instance.update_user2(user_name, body=body)
pprint(api_response)
except ApiException as e:
print("Exception when calling UsersResourceApi->update_user2: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
user_name | str | User name being updated. | |
body | ApiUser2 | The user information. | [optional] |
[Back to top] [Back to API list] [Back to Model list] [Back to README]