Skip to content

Latest commit

 

History

History
732 lines (497 loc) · 25.9 KB

UsersApi.md

File metadata and controls

732 lines (497 loc) · 25.9 KB

corellium.UsersApi

Request timeouts

Every API method accepts _request_timeout in seconds: a positive float for the urllib3 total timeout, or a pair of positive floats (connect, read). This controls HTTP transport waiting, not how long the server operation may run. It is not a wall-clock deadline for the operation or for all retries combined.

Transport timeouts raise urllib3.exceptions.TimeoutError subclasses such as ReadTimeoutError and ConnectTimeoutError. When retries are exhausted, urllib3 can instead raise urllib3.exceptions.MaxRetryError; inspect its reason to distinguish a timeout from other connection failures. Retry behavior depends on the HTTP method and Configuration.retries. These are client-side exceptions, not HTTP response statuses or SDK ApiException responses.

A timeout does not guarantee cancellation or rollback of an operation accepted by the server. For example, after a start request times out, the instance may still be starting or may already be running; the timeout alone does not establish its state or mean it was stopped or destroyed. The request might not have reached the server at all, leaving the instance off. Treat the outcome as unknown and fetch the instance's current state before deciding whether to retry. If it has since been destroyed, that lookup may return not found; the timeout itself does not prove destruction. Do not blindly repeat a state-changing request.

Catch urllib3.exceptions.TimeoutError and urllib3.exceptions.MaxRetryError separately from the SDK ApiException. MaxRetryError is not a subclass of TimeoutError. With _with_http_info the same rules apply. With _without_preload_content, a read timeout may also occur later when reading the returned response body.

All URIs are relative to https://app.corellium.com/api

Method HTTP request Description
v3_agree_to_terms POST /v3/users/agree Agree to terms
v3_change_password POST /v3/users/change-password Change password
v3_create_user POST /v3/users Create a user
v3_delete_user DELETE /v3/users/{userId} Delete a user
v3_get_reset_link_info POST /v3/users/reset-link-info Get reset link info
v3_patch_user PATCH /v3/users/{userId} Update a user
v3_reset_password POST /v3/users/reset-password Reset password
v3_send_reset_link POST /v3/users/send-reset-link Send a password reset link
v3_update_own_profile PATCH /v3/users/me Update your profile

v3_agree_to_terms

AgreedAck v3_agree_to_terms()

Agree to terms

Records that you, the signed-in user, accept the current terms and conditions, and returns the time of agreement. The web interface calls this when it shows the terms; call it yourself if your domain requires agreement before using the platform.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.agreed_ack import AgreedAck
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.UsersApi(api_client)

    try:
        # Agree to terms
        api_response = api_instance.v3_agree_to_terms()
        print("The response of UsersApi->v3_agree_to_terms:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersApi->v3_agree_to_terms: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

AgreedAck

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Terms accepted. -
401 The session token is missing, invalid, or expired. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

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

v3_change_password

v3_change_password(change_password_body)

Change password

Changes a password when you know the current one. Needs no sign-in: send the user's ID in user, the current password in oldPassword, and the new one in newPassword. Returns 204 on success and 403 if the old password is wrong. If you have forgotten the password, use the reset flow instead (v3SendResetLink).

Example

import corellium
from corellium.models.change_password_body import ChangePasswordBody
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)


# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.UsersApi(api_client)
    change_password_body = corellium.ChangePasswordBody() # ChangePasswordBody | 

    try:
        # Change password
        api_instance.v3_change_password(change_password_body)
    except Exception as e:
        print("Exception when calling UsersApi->v3_change_password: %s\n" % e)

Parameters

Name Type Description Notes
change_password_body ChangePasswordBody

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 Password changed. -
400 The request was invalid, for example a missing or malformed field. The body says which field; fix it before retrying. -
401 The user does not exist or the old password is wrong. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

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

v3_create_user

UserCreated v3_create_user(create_user_body)

Create a user

Required role: Domain administrator.

Creates a user account in your domain directly, with a username and password you choose, without sending an invitation. Requires a domain administrator. Returns 201 with the new user's ID. To let people set their own password instead, invite them with POST /v3/invites. A new user has no project access until you grant it with the Roles endpoints or add them to a team.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.create_user_body import CreateUserBody
from corellium.models.user_created import UserCreated
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.UsersApi(api_client)
    create_user_body = corellium.CreateUserBody() # CreateUserBody | 

    try:
        # Create a user
        api_response = api_instance.v3_create_user(create_user_body)
        print("The response of UsersApi->v3_create_user:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersApi->v3_create_user: %s\n" % e)

Parameters

Name Type Description Notes
create_user_body CreateUserBody

Return type

UserCreated

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 User created. -
400 The request was invalid, for example a missing or malformed field. The body says which field; fix it before retrying. -
403 Domain administrator permissions required. Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

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

v3_delete_user

v3_delete_user(user_id)

Delete a user

Required role: Domain administrator.

Deletes the user identified by the given userId.

Deletes are idempotent: a userId that does not exist, including one that was already deleted, is a successful no-op that still returns 204, and repeated calls return 204 as well. A 404 means the request path did not match a delete route, not that the target was missing.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.UsersApi(api_client)
    user_id = 'e8c5b7ea-aa5f-4a4a-bdca-0c67060b5320' # str | User identifier.

    try:
        # Delete a user
        api_instance.v3_delete_user(user_id)
    except Exception as e:
        print("Exception when calling UsersApi->v3_delete_user: %s\n" % e)

Parameters

Name Type Description Notes
user_id str User identifier.

Return type

void (empty response body)

Authorization

BearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 User deleted. -
403 Domain administrator permissions required. Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

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

v3_get_reset_link_info

ResetLinkInfo v3_get_reset_link_info(get_reset_link_info_body)

Get reset link info

Step 2 (optional) of resetting a forgotten password: checks the token from a reset email and returns the account it belongs to (user ID, username and domain), so a reset page can show whose password is being changed. Needs no sign-in. Returns 400 or 401 if the token is missing, invalid or expired.

Example

import corellium
from corellium.models.get_reset_link_info_body import GetResetLinkInfoBody
from corellium.models.reset_link_info import ResetLinkInfo
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)


# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.UsersApi(api_client)
    get_reset_link_info_body = corellium.GetResetLinkInfoBody() # GetResetLinkInfoBody | 

    try:
        # Get reset link info
        api_response = api_instance.v3_get_reset_link_info(get_reset_link_info_body)
        print("The response of UsersApi->v3_get_reset_link_info:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersApi->v3_get_reset_link_info: %s\n" % e)

Parameters

Name Type Description Notes
get_reset_link_info_body GetResetLinkInfoBody

Return type

ResetLinkInfo

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Reset link info. -
400 Token was not supplied, or is not a password reset token. -
401 The reset token failed verification: malformed, tampered with, or expired. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

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

v3_patch_user

v3_patch_user(user_id, patch_user_body=patch_user_body)

Update a user

Changes a user's account details, such as their name, display label, email or password. Send only the fields you want to change. Only cluster administrators may set or change clusterAdministrator, which gives a user control over the whole cluster.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.patch_user_body import PatchUserBody
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.UsersApi(api_client)
    user_id = 'e8c5b7ea-aa5f-4a4a-bdca-0c67060b5320' # str | User identifier.
    patch_user_body = corellium.PatchUserBody() # PatchUserBody |  (optional)

    try:
        # Update a user
        api_instance.v3_patch_user(user_id, patch_user_body=patch_user_body)
    except Exception as e:
        print("Exception when calling UsersApi->v3_patch_user: %s\n" % e)

Parameters

Name Type Description Notes
user_id str User identifier.
patch_user_body PatchUserBody [optional]

Return type

void (empty response body)

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 User updated. -
400 The request was invalid, for example a missing or malformed field. The body says which field; fix it before retrying. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

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

v3_reset_password

v3_reset_password(reset_password_body)

Reset password

Step 3 of resetting a forgotten password. Send the token from the reset email, the newPassword, and, if the account has two-factor sign-in turned on, a current six-digit code in totpToken. Returns 204 when the password has been changed; sign in with the new password.

Reset flow:

  1. v3SendResetLink with the account's email address.
  2. Optionally v3GetResetLinkInfo with the token from the email, to show which account is being reset.
  3. v3ResetPassword (this call).

Returns 401 if the token is invalid or expired, or the two-factor code is wrong.

Example

import corellium
from corellium.models.reset_password_body import ResetPasswordBody
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)


# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.UsersApi(api_client)
    reset_password_body = corellium.ResetPasswordBody() # ResetPasswordBody | 

    try:
        # Reset password
        api_instance.v3_reset_password(reset_password_body)
    except Exception as e:
        print("Exception when calling UsersApi->v3_reset_password: %s\n" % e)

Parameters

Name Type Description Notes
reset_password_body ResetPasswordBody

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 Password reset. -
400 Password reset token must be supplied. -
401 The one-time code is incorrect, or the reset token failed verification. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

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

v3_send_reset_link

v3_send_reset_link(send_reset_link_body=send_reset_link_body)

Send a password reset link

Step 1 of resetting a forgotten password: emails a password reset link to the given address, if it belongs to an account in the domain you are calling. Needs no sign-in. Always returns 204, whether or not the address matched an account, so the response does not reveal which emails are registered. The link contains the token used by v3ResetPassword.

Example

import corellium
from corellium.models.send_reset_link_body import SendResetLinkBody
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)


# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.UsersApi(api_client)
    send_reset_link_body = corellium.SendResetLinkBody() # SendResetLinkBody |  (optional)

    try:
        # Send a password reset link
        api_instance.v3_send_reset_link(send_reset_link_body=send_reset_link_body)
    except Exception as e:
        print("Exception when calling UsersApi->v3_send_reset_link: %s\n" % e)

Parameters

Name Type Description Notes
send_reset_link_body SendResetLinkBody [optional]

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 Reset link sent (if the email matched an account). -
400 The request body failed validation. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

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

v3_update_own_profile

v3_update_own_profile(update_own_profile_body)

Update your profile

Updates the caller's own display name. Needs no administrator role. Users created through an authentication provider cannot change their label, because the provider owns it.

Example

  • Bearer (JWT) Authentication (BearerAuth):
import corellium
from corellium.models.update_own_profile_body import UpdateOwnProfileBody
from corellium.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://app.corellium.com/api
# See configuration.py for a list of all supported configuration parameters.
configuration = corellium.Configuration(
    host = "https://app.corellium.com/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): BearerAuth
configuration = corellium.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with corellium.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = corellium.UsersApi(api_client)
    update_own_profile_body = corellium.UpdateOwnProfileBody() # UpdateOwnProfileBody | 

    try:
        # Update your profile
        api_instance.v3_update_own_profile(update_own_profile_body)
    except Exception as e:
        print("Exception when calling UsersApi->v3_update_own_profile: %s\n" % e)

Parameters

Name Type Description Notes
update_own_profile_body UpdateOwnProfileBody

Return type

void (empty response body)

Authorization

BearerAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
204 Profile updated. -
400 The label is missing, empty, or longer than 100 characters; the body has a field other than `label`; or the user was created through an authentication provider. -
401 The session token is missing, invalid, or expired. -
403 Signed in, but not allowed to do this: you lack the required role, have no access to the project, or your license does not include the feature. -

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