cm_client.UsersResourceApi

All URIs are relative to /api/v58

Method HTTP request Description
create_users2 POST /users
delete_user2 DELETE /users/{userName}
expire_sessions POST /users/expireSessions/{userName}
get_sessions GET /users/sessions
read_user2 GET /users/{userName}
read_users2 GET /users
update_user2 PUT /users/{userName}

create_users2

ApiUser2List create_users2(body=body)

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 v40, leading and trailing whitespace is trimmed from the user names.

Example

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:
    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)

Parameters

Name Type Description Notes
body ApiUser2List List of users to create. [optional]

Return type

ApiUser2List

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_user2

ApiUser2 delete_user2(user_name)

Deletes a user from the system.

Example

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:
    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)

Parameters

Name Type Description Notes
user_name str The name of the user to delete.

Return type

ApiUser2

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

expire_sessions

expire_sessions(user_name)

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.

Example

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:
    api_instance.expire_sessions(user_name)
except ApiException as e:
    print("Exception when calling UsersResourceApi->expire_sessions: %s\n" % e)

Parameters

Name Type Description Notes
user_name str

Return type

void (empty response body)

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_sessions

ApiUserSessionList get_sessions()

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.

Example

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:
    api_response = api_instance.get_sessions()
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UsersResourceApi->get_sessions: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ApiUserSessionList

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

read_user2

ApiUser2 read_user2(user_name)

Returns detailed information about a user.

Example

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:
    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)

Parameters

Name Type Description Notes
user_name str The user to read.

Return type

ApiUser2

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

read_users2

ApiUser2List read_users2(view=view)

Returns a list of the user names configured in the system.

Example

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:
    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)

Parameters

Name Type Description Notes
view str [optional] [default to summary]

Return type

ApiUser2List

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_user2

ApiUser2 update_user2(user_name, body=body)

Updates the given user's information. Note that the user's name cannot be changed.

Example

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:
    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)

Parameters

Name Type Description Notes
user_name str User name being updated.
body ApiUser2 The user information. [optional]

Return type

ApiUser2

Authorization

basic

HTTP request headers

[Back to top] [Back to API list] [Back to Model list] [Back to README]