Skip to content

Latest commit

 

History

History
519 lines (387 loc) · 20.8 KB

UserApi.md

File metadata and controls

519 lines (387 loc) · 20.8 KB

swagger_client.UserApi

All URIs are relative to https://localhost/api/v5

Method HTTP request Description
create_user POST /user Create a user
delete_user DELETE /user/{name} Delete a user
get_me GET /user/me Check info
get_users GET /user List users
login POST /user/login Login
logout POST /user/logout Logout
logout_redirect GET /user/logout
modify_user PUT /user/{name} Update a user

create_user

UserPermissionStruct create_user(body=body, details=details, accept=accept, pretty=pretty)

Create a user

Creates a new Web-API user with the specified username and password. Required permissions: - user.create

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyHeader
configuration = swagger_client.Configuration()
configuration.api_key['X-WebAPI-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-WebAPI-Key'] = 'Bearer'
# Configure API key authorization: ApiKeyQuery
configuration = swagger_client.Configuration()
configuration.api_key['key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['key'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
body = swagger_client.CreateUserRequest() # CreateUserRequest |  (optional)
details = true # bool | Add to include additional details, omit or false otherwise (optional)
accept = 'accept_example' # str | Override the 'Accept' request header (useful for debugging your requests) (optional)
pretty = true # bool | Add to make the Web-API pretty print the response (useful for debugging your requests) (optional)

try:
    # Create a user
    api_response = api_instance.create_user(body=body, details=details, accept=accept, pretty=pretty)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->create_user: %s\n" % e)

Parameters

Name Type Description Notes
body CreateUserRequest [optional]
details bool Add to include additional details, omit or false otherwise [optional]
accept str Override the 'Accept' request header (useful for debugging your requests) [optional]
pretty bool Add to make the Web-API pretty print the response (useful for debugging your requests) [optional]

Return type

UserPermissionStruct

Authorization

ApiKeyHeader, ApiKeyQuery

HTTP request headers

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

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

delete_user

UserPermissionStruct delete_user(name, details=details, accept=accept, pretty=pretty)

Delete a user

Removes a Web-API user. Required permissions: - user.delete

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyHeader
configuration = swagger_client.Configuration()
configuration.api_key['X-WebAPI-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-WebAPI-Key'] = 'Bearer'
# Configure API key authorization: ApiKeyQuery
configuration = swagger_client.Configuration()
configuration.api_key['key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['key'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
name = 'name_example' # str | The username of the user to delete
details = true # bool | Add to include additional details, omit or false otherwise (optional)
accept = 'accept_example' # str | Override the 'Accept' request header (useful for debugging your requests) (optional)
pretty = true # bool | Add to make the Web-API pretty print the response (useful for debugging your requests) (optional)

try:
    # Delete a user
    api_response = api_instance.delete_user(name, details=details, accept=accept, pretty=pretty)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->delete_user: %s\n" % e)

Parameters

Name Type Description Notes
name str The username of the user to delete
details bool Add to include additional details, omit or false otherwise [optional]
accept str Override the 'Accept' request header (useful for debugging your requests) [optional]
pretty bool Add to make the Web-API pretty print the response (useful for debugging your requests) [optional]

Return type

UserPermissionStruct

Authorization

ApiKeyHeader, ApiKeyQuery

HTTP request headers

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

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

get_me

PermissionStruct get_me(details=details, accept=accept, pretty=pretty)

Check info

Checks to see if the passed api key is still valid and retrieves the user info and permissions associated with this key Required permissions: - user.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyHeader
configuration = swagger_client.Configuration()
configuration.api_key['X-WebAPI-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-WebAPI-Key'] = 'Bearer'
# Configure API key authorization: ApiKeyQuery
configuration = swagger_client.Configuration()
configuration.api_key['key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['key'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
details = true # bool | Add to include additional details, omit or false otherwise (optional)
accept = 'accept_example' # str | Override the 'Accept' request header (useful for debugging your requests) (optional)
pretty = true # bool | Add to make the Web-API pretty print the response (useful for debugging your requests) (optional)

try:
    # Check info
    api_response = api_instance.get_me(details=details, accept=accept, pretty=pretty)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->get_me: %s\n" % e)

Parameters

Name Type Description Notes
details bool Add to include additional details, omit or false otherwise [optional]
accept str Override the 'Accept' request header (useful for debugging your requests) [optional]
pretty bool Add to make the Web-API pretty print the response (useful for debugging your requests) [optional]

Return type

PermissionStruct

Authorization

ApiKeyHeader, ApiKeyQuery

HTTP request headers

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

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

get_users

list[UserPermissionStruct] get_users(details=details, accept=accept, pretty=pretty)

List users

Gets a list of all the Web-API users. Required permissions: - user.list

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyHeader
configuration = swagger_client.Configuration()
configuration.api_key['X-WebAPI-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-WebAPI-Key'] = 'Bearer'
# Configure API key authorization: ApiKeyQuery
configuration = swagger_client.Configuration()
configuration.api_key['key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['key'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
details = true # bool | Add to include additional details, omit or false otherwise (optional)
accept = 'accept_example' # str | Override the 'Accept' request header (useful for debugging your requests) (optional)
pretty = true # bool | Add to make the Web-API pretty print the response (useful for debugging your requests) (optional)

try:
    # List users
    api_response = api_instance.get_users(details=details, accept=accept, pretty=pretty)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->get_users: %s\n" % e)

Parameters

Name Type Description Notes
details bool Add to include additional details, omit or false otherwise [optional]
accept str Override the 'Accept' request header (useful for debugging your requests) [optional]
pretty bool Add to make the Web-API pretty print the response (useful for debugging your requests) [optional]

Return type

list[UserPermissionStruct]

Authorization

ApiKeyHeader, ApiKeyQuery

HTTP request headers

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

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

login

PermissionStruct login(body=body, details=details, accept=accept, pretty=pretty)

Login

Tries to acquire an api key with the passed credentials.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# create an instance of the API class
api_instance = swagger_client.UserApi()
body = swagger_client.AuthenticationRequest() # AuthenticationRequest |  (optional)
details = true # bool | Add to include additional details, omit or false otherwise (optional)
accept = 'accept_example' # str | Override the 'Accept' request header (useful for debugging your requests) (optional)
pretty = true # bool | Add to make the Web-API pretty print the response (useful for debugging your requests) (optional)

try:
    # Login
    api_response = api_instance.login(body=body, details=details, accept=accept, pretty=pretty)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->login: %s\n" % e)

Parameters

Name Type Description Notes
body AuthenticationRequest [optional]
details bool Add to include additional details, omit or false otherwise [optional]
accept str Override the 'Accept' request header (useful for debugging your requests) [optional]
pretty bool Add to make the Web-API pretty print the response (useful for debugging your requests) [optional]

Return type

PermissionStruct

Authorization

No authorization required

HTTP request headers

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

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

logout

PermissionStruct logout(details=details, accept=accept, pretty=pretty)

Logout

Invalidate the current API key, logging out the active user. Required permissions: - user.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyHeader
configuration = swagger_client.Configuration()
configuration.api_key['X-WebAPI-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-WebAPI-Key'] = 'Bearer'
# Configure API key authorization: ApiKeyQuery
configuration = swagger_client.Configuration()
configuration.api_key['key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['key'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
details = true # bool | Add to include additional details, omit or false otherwise (optional)
accept = 'accept_example' # str | Override the 'Accept' request header (useful for debugging your requests) (optional)
pretty = true # bool | Add to make the Web-API pretty print the response (useful for debugging your requests) (optional)

try:
    # Logout
    api_response = api_instance.logout(details=details, accept=accept, pretty=pretty)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->logout: %s\n" % e)

Parameters

Name Type Description Notes
details bool Add to include additional details, omit or false otherwise [optional]
accept str Override the 'Accept' request header (useful for debugging your requests) [optional]
pretty bool Add to make the Web-API pretty print the response (useful for debugging your requests) [optional]

Return type

PermissionStruct

Authorization

ApiKeyHeader, ApiKeyQuery

HTTP request headers

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

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

logout_redirect

logout_redirect(redirect=redirect, details=details, accept=accept, pretty=pretty)

null Required permissions: - user.

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyHeader
configuration = swagger_client.Configuration()
configuration.api_key['X-WebAPI-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-WebAPI-Key'] = 'Bearer'
# Configure API key authorization: ApiKeyQuery
configuration = swagger_client.Configuration()
configuration.api_key['key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['key'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
redirect = 'redirect_example' # str | The URL the client should be redirect to after logout (optional)
details = true # bool | Add to include additional details, omit or false otherwise (optional)
accept = 'accept_example' # str | Override the 'Accept' request header (useful for debugging your requests) (optional)
pretty = true # bool | Add to make the Web-API pretty print the response (useful for debugging your requests) (optional)

try:
    api_instance.logout_redirect(redirect=redirect, details=details, accept=accept, pretty=pretty)
except ApiException as e:
    print("Exception when calling UserApi->logout_redirect: %s\n" % e)

Parameters

Name Type Description Notes
redirect str The URL the client should be redirect to after logout [optional]
details bool Add to include additional details, omit or false otherwise [optional]
accept str Override the 'Accept' request header (useful for debugging your requests) [optional]
pretty bool Add to make the Web-API pretty print the response (useful for debugging your requests) [optional]

Return type

void (empty response body)

Authorization

ApiKeyHeader, ApiKeyQuery

HTTP request headers

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

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

modify_user

UserPermissionStruct modify_user(name, body=body, details=details, accept=accept, pretty=pretty)

Update a user

Changes the properties of a Web-API user Required permissions: - user.modify

Example

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: ApiKeyHeader
configuration = swagger_client.Configuration()
configuration.api_key['X-WebAPI-Key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['X-WebAPI-Key'] = 'Bearer'
# Configure API key authorization: ApiKeyQuery
configuration = swagger_client.Configuration()
configuration.api_key['key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['key'] = 'Bearer'

# create an instance of the API class
api_instance = swagger_client.UserApi(swagger_client.ApiClient(configuration))
name = 'name_example' # str | The username of the user to delete
body = swagger_client.ModifyUserRequest() # ModifyUserRequest |  (optional)
details = true # bool | Add to include additional details, omit or false otherwise (optional)
accept = 'accept_example' # str | Override the 'Accept' request header (useful for debugging your requests) (optional)
pretty = true # bool | Add to make the Web-API pretty print the response (useful for debugging your requests) (optional)

try:
    # Update a user
    api_response = api_instance.modify_user(name, body=body, details=details, accept=accept, pretty=pretty)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling UserApi->modify_user: %s\n" % e)

Parameters

Name Type Description Notes
name str The username of the user to delete
body ModifyUserRequest [optional]
details bool Add to include additional details, omit or false otherwise [optional]
accept str Override the 'Accept' request header (useful for debugging your requests) [optional]
pretty bool Add to make the Web-API pretty print the response (useful for debugging your requests) [optional]

Return type

UserPermissionStruct

Authorization

ApiKeyHeader, ApiKeyQuery

HTTP request headers

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

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