defectdojo_api_generated.UsersApi

All URIs are relative to http://localhost

Method HTTP request Description
create POST /api/v2/users/
delete_preview_list GET /api/v2/users/{id}/delete_preview/
destroy DELETE /api/v2/users/{id}/
list GET /api/v2/users/
partial_update PATCH /api/v2/users/{id}/
reset_api_token_create POST /api/v2/users/{id}/reset_api_token/
retrieve GET /api/v2/users/{id}/
update PUT /api/v2/users/{id}/

create

User create(user_request)

Example

  • Basic Authentication (basicAuth):
  • Api Key Authentication (cookieAuth):
  • Api Key Authentication (tokenAuth):
import defectdojo_api_generated
from defectdojo_api_generated.models.user import User
from defectdojo_api_generated.models.user_request import UserRequest
from defectdojo_api_generated.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = defectdojo_api_generated.Configuration(
    host = "http://localhost"
)

# 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 HTTP basic authorization: basicAuth
configuration = defectdojo_api_generated.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'

# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'

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

    try:
        api_response = api_instance.create(user_request)
        print("The response of UsersApi->create:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersApi->create: %s\n" % e)

Parameters

Name Type Description Notes
user_request UserRequest

Return type

User

Authorization

basicAuth, cookieAuth, tokenAuth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 -

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

delete_preview_list

PaginatedDeletePreviewList delete_preview_list(id, limit=limit, offset=offset)

Example

  • Basic Authentication (basicAuth):
  • Api Key Authentication (cookieAuth):
  • Api Key Authentication (tokenAuth):
import defectdojo_api_generated
from defectdojo_api_generated.models.paginated_delete_preview_list import PaginatedDeletePreviewList
from defectdojo_api_generated.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = defectdojo_api_generated.Configuration(
    host = "http://localhost"
)

# 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 HTTP basic authorization: basicAuth
configuration = defectdojo_api_generated.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'

# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with defectdojo_api_generated.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = defectdojo_api_generated.UsersApi(api_client)
    id = 56 # int | A unique integer value identifying this user.
    limit = 56 # int | Number of results to return per page. (optional)
    offset = 56 # int | The initial index from which to return the results. (optional)

    try:
        api_response = api_instance.delete_preview_list(id, limit=limit, offset=offset)
        print("The response of UsersApi->delete_preview_list:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersApi->delete_preview_list: %s\n" % e)

Parameters

Name Type Description Notes
id int A unique integer value identifying this user.
limit int Number of results to return per page. [optional]
offset int The initial index from which to return the results. [optional]

Return type

PaginatedDeletePreviewList

Authorization

basicAuth, cookieAuth, tokenAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 -

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

destroy

destroy(id)

Example

  • Basic Authentication (basicAuth):
  • Api Key Authentication (cookieAuth):
  • Api Key Authentication (tokenAuth):
import defectdojo_api_generated
from defectdojo_api_generated.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = defectdojo_api_generated.Configuration(
    host = "http://localhost"
)

# 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 HTTP basic authorization: basicAuth
configuration = defectdojo_api_generated.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'

# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with defectdojo_api_generated.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = defectdojo_api_generated.UsersApi(api_client)
    id = 56 # int | A unique integer value identifying this user.

    try:
        api_instance.destroy(id)
    except Exception as e:
        print("Exception when calling UsersApi->destroy: %s\n" % e)

Parameters

Name Type Description Notes
id int A unique integer value identifying this user.

Return type

void (empty response body)

Authorization

basicAuth, cookieAuth, tokenAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
204 No response body -

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

list

PaginatedUserList list(date_joined_after=date_joined_after, date_joined_before=date_joined_before, email=email, first_name=first_name, id=id, is_active=is_active, is_superuser=is_superuser, last_login_after=last_login_after, last_login_before=last_login_before, last_name=last_name, limit=limit, o=o, offset=offset, username=username)

Example

  • Basic Authentication (basicAuth):
  • Api Key Authentication (cookieAuth):
  • Api Key Authentication (tokenAuth):
import defectdojo_api_generated
from defectdojo_api_generated.models.paginated_user_list import PaginatedUserList
from defectdojo_api_generated.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = defectdojo_api_generated.Configuration(
    host = "http://localhost"
)

# 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 HTTP basic authorization: basicAuth
configuration = defectdojo_api_generated.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'

# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with defectdojo_api_generated.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = defectdojo_api_generated.UsersApi(api_client)
    date_joined_after = '2013-10-20' # date |  (optional)
    date_joined_before = '2013-10-20' # date |  (optional)
    email = 'email_example' # str |  (optional)
    first_name = 'first_name_example' # str |  (optional)
    id = 56 # int |  (optional)
    is_active = True # bool |  (optional)
    is_superuser = True # bool |  (optional)
    last_login_after = '2013-10-20' # date |  (optional)
    last_login_before = '2013-10-20' # date |  (optional)
    last_name = 'last_name_example' # str |  (optional)
    limit = 56 # int | Number of results to return per page. (optional)
    o = ['o_example'] # List[str] | Ordering  * `username` - Username * `-username` - Username (descending) * `last_name` - Last name * `-last_name` - Last name (descending) * `first_name` - First name * `-first_name` - First name (descending) * `email` - Email * `-email` - Email (descending) * `is_active` - Is active * `-is_active` - Is active (descending) * `is_superuser` - Is superuser * `-is_superuser` - Is superuser (descending) * `date_joined` - Date joined * `-date_joined` - Date joined (descending) * `last_login` - Last login * `-last_login` - Last login (descending) (optional)
    offset = 56 # int | The initial index from which to return the results. (optional)
    username = 'username_example' # str |  (optional)

    try:
        api_response = api_instance.list(date_joined_after=date_joined_after, date_joined_before=date_joined_before, email=email, first_name=first_name, id=id, is_active=is_active, is_superuser=is_superuser, last_login_after=last_login_after, last_login_before=last_login_before, last_name=last_name, limit=limit, o=o, offset=offset, username=username)
        print("The response of UsersApi->list:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersApi->list: %s\n" % e)

Parameters

Name Type Description Notes
date_joined_after date [optional]
date_joined_before date [optional]
email str [optional]
first_name str [optional]
id int [optional]
is_active bool [optional]
is_superuser bool [optional]
last_login_after date [optional]
last_login_before date [optional]
last_name str [optional]
limit int Number of results to return per page. [optional]
o List[str] Ordering * `username` - Username * `-username` - Username (descending) * `last_name` - Last name * `-last_name` - Last name (descending) * `first_name` - First name * `-first_name` - First name (descending) * `email` - Email * `-email` - Email (descending) * `is_active` - Is active * `-is_active` - Is active (descending) * `is_superuser` - Is superuser * `-is_superuser` - Is superuser (descending) * `date_joined` - Date joined * `-date_joined` - Date joined (descending) * `last_login` - Last login * `-last_login` - Last login (descending) [optional]
offset int The initial index from which to return the results. [optional]
username str [optional]

Return type

PaginatedUserList

Authorization

basicAuth, cookieAuth, tokenAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 -

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

partial_update

User partial_update(id, patched_user_request=patched_user_request)

Example

  • Basic Authentication (basicAuth):
  • Api Key Authentication (cookieAuth):
  • Api Key Authentication (tokenAuth):
import defectdojo_api_generated
from defectdojo_api_generated.models.patched_user_request import PatchedUserRequest
from defectdojo_api_generated.models.user import User
from defectdojo_api_generated.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = defectdojo_api_generated.Configuration(
    host = "http://localhost"
)

# 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 HTTP basic authorization: basicAuth
configuration = defectdojo_api_generated.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'

# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with defectdojo_api_generated.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = defectdojo_api_generated.UsersApi(api_client)
    id = 56 # int | A unique integer value identifying this user.
    patched_user_request = defectdojo_api_generated.PatchedUserRequest() # PatchedUserRequest |  (optional)

    try:
        api_response = api_instance.partial_update(id, patched_user_request=patched_user_request)
        print("The response of UsersApi->partial_update:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersApi->partial_update: %s\n" % e)

Parameters

Name Type Description Notes
id int A unique integer value identifying this user.
patched_user_request PatchedUserRequest [optional]

Return type

User

Authorization

basicAuth, cookieAuth, tokenAuth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

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

reset_api_token_create

User reset_api_token_create(id, user_request)

Example

  • Basic Authentication (basicAuth):
  • Api Key Authentication (cookieAuth):
  • Api Key Authentication (tokenAuth):
import defectdojo_api_generated
from defectdojo_api_generated.models.user import User
from defectdojo_api_generated.models.user_request import UserRequest
from defectdojo_api_generated.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = defectdojo_api_generated.Configuration(
    host = "http://localhost"
)

# 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 HTTP basic authorization: basicAuth
configuration = defectdojo_api_generated.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'

# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with defectdojo_api_generated.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = defectdojo_api_generated.UsersApi(api_client)
    id = 56 # int | A unique integer value identifying this user.
    user_request = defectdojo_api_generated.UserRequest() # UserRequest | 

    try:
        api_response = api_instance.reset_api_token_create(id, user_request)
        print("The response of UsersApi->reset_api_token_create:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersApi->reset_api_token_create: %s\n" % e)

Parameters

Name Type Description Notes
id int A unique integer value identifying this user.
user_request UserRequest

Return type

User

Authorization

basicAuth, cookieAuth, tokenAuth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

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

retrieve

User retrieve(id)

Example

  • Basic Authentication (basicAuth):
  • Api Key Authentication (cookieAuth):
  • Api Key Authentication (tokenAuth):
import defectdojo_api_generated
from defectdojo_api_generated.models.user import User
from defectdojo_api_generated.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = defectdojo_api_generated.Configuration(
    host = "http://localhost"
)

# 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 HTTP basic authorization: basicAuth
configuration = defectdojo_api_generated.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'

# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with defectdojo_api_generated.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = defectdojo_api_generated.UsersApi(api_client)
    id = 56 # int | A unique integer value identifying this user.

    try:
        api_response = api_instance.retrieve(id)
        print("The response of UsersApi->retrieve:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersApi->retrieve: %s\n" % e)

Parameters

Name Type Description Notes
id int A unique integer value identifying this user.

Return type

User

Authorization

basicAuth, cookieAuth, tokenAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 -

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

update

User update(id, user_request)

Example

  • Basic Authentication (basicAuth):
  • Api Key Authentication (cookieAuth):
  • Api Key Authentication (tokenAuth):
import defectdojo_api_generated
from defectdojo_api_generated.models.user import User
from defectdojo_api_generated.models.user_request import UserRequest
from defectdojo_api_generated.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to http://localhost
# See configuration.py for a list of all supported configuration parameters.
configuration = defectdojo_api_generated.Configuration(
    host = "http://localhost"
)

# 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 HTTP basic authorization: basicAuth
configuration = defectdojo_api_generated.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

# Configure API key authorization: cookieAuth
configuration.api_key['cookieAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['cookieAuth'] = 'Bearer'

# Configure API key authorization: tokenAuth
configuration.api_key['tokenAuth'] = os.environ["API_KEY"]

# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['tokenAuth'] = 'Bearer'

# Enter a context with an instance of the API client
with defectdojo_api_generated.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = defectdojo_api_generated.UsersApi(api_client)
    id = 56 # int | A unique integer value identifying this user.
    user_request = defectdojo_api_generated.UserRequest() # UserRequest | 

    try:
        api_response = api_instance.update(id, user_request)
        print("The response of UsersApi->update:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UsersApi->update: %s\n" % e)

Parameters

Name Type Description Notes
id int A unique integer value identifying this user.
user_request UserRequest

Return type

User

Authorization

basicAuth, cookieAuth, tokenAuth

HTTP request headers

  • Content-Type: application/json, application/x-www-form-urlencoded, multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 -

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