Skip to content

Latest commit

 

History

History
1267 lines (889 loc) · 39.5 KB

File metadata and controls

1267 lines (889 loc) · 39.5 KB

halo_client.UserV1alpha1ConsoleApi

All URIs are relative to http://localhost:8091

Method HTTP request Description
change_anyone_password PUT /apis/api.console.halo.run/v1alpha1/users/{name}/password
change_own_password PUT /apis/api.console.halo.run/v1alpha1/users/-/password
create_user POST /apis/api.console.halo.run/v1alpha1/users
delete_user_avatar DELETE /apis/api.console.halo.run/v1alpha1/users/{name}/avatar
disable_user POST /apis/console.api.security.halo.run/v1alpha1/users/{username}/disable
enable_user POST /apis/console.api.security.halo.run/v1alpha1/users/{username}/enable
get_current_user_detail GET /apis/api.console.halo.run/v1alpha1/users/-
get_permissions GET /apis/api.console.halo.run/v1alpha1/users/{name}/permissions
get_user_detail GET /apis/api.console.halo.run/v1alpha1/users/{name}
grant_permission POST /apis/api.console.halo.run/v1alpha1/users/{name}/permissions
list_users GET /apis/api.console.halo.run/v1alpha1/users
send_email_verification_code POST /apis/api.console.halo.run/v1alpha1/users/-/send-email-verification-code
update_current_user PUT /apis/api.console.halo.run/v1alpha1/users/-
upload_user_avatar POST /apis/api.console.halo.run/v1alpha1/users/{name}/avatar
verify_email POST /apis/api.console.halo.run/v1alpha1/users/-/verify-email

change_anyone_password

User change_anyone_password(name, change_password_request)

Change anyone password of user for admin.

Example

  • Basic Authentication (basicAuth):
  • Bearer (JWT) Authentication (bearerAuth):
import halo_client
from halo_client.models.change_password_request import ChangePasswordRequest
from halo_client.models.user import User
from halo_client.rest import ApiException
from pprint import pprint

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

# 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 = halo_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

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

# Enter a context with an instance of the API client
with halo_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = halo_client.UserV1alpha1ConsoleApi(api_client)
    name = 'name_example' # str | Name of user. If the name is equal to '-', it will change the password of current user.
    change_password_request = halo_client.ChangePasswordRequest() # ChangePasswordRequest | 

    try:
        api_response = api_instance.change_anyone_password(name, change_password_request)
        print("The response of UserV1alpha1ConsoleApi->change_anyone_password:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UserV1alpha1ConsoleApi->change_anyone_password: %s\n" % e)

Parameters

Name Type Description Notes
name str Name of user. If the name is equal to '-', it will change the password of current user.
change_password_request ChangePasswordRequest

Return type

User

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
0 default response -

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

change_own_password

User change_own_password(change_own_password_request)

Change own password of user.

Example

  • Basic Authentication (basicAuth):
  • Bearer (JWT) Authentication (bearerAuth):
import halo_client
from halo_client.models.change_own_password_request import ChangeOwnPasswordRequest
from halo_client.models.user import User
from halo_client.rest import ApiException
from pprint import pprint

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

# 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 = halo_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

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

# Enter a context with an instance of the API client
with halo_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = halo_client.UserV1alpha1ConsoleApi(api_client)
    change_own_password_request = halo_client.ChangeOwnPasswordRequest() # ChangeOwnPasswordRequest | 

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

Parameters

Name Type Description Notes
change_own_password_request ChangeOwnPasswordRequest

Return type

User

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
0 default response -

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

create_user

User create_user(create_user_request)

Creates a new user.

Example

  • Basic Authentication (basicAuth):
  • Bearer (JWT) Authentication (bearerAuth):
import halo_client
from halo_client.models.create_user_request import CreateUserRequest
from halo_client.models.user import User
from halo_client.rest import ApiException
from pprint import pprint

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

# 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 = halo_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

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

# Enter a context with an instance of the API client
with halo_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = halo_client.UserV1alpha1ConsoleApi(api_client)
    create_user_request = halo_client.CreateUserRequest() # CreateUserRequest | 

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

Parameters

Name Type Description Notes
create_user_request CreateUserRequest

Return type

User

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
0 default response -

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

delete_user_avatar

User delete_user_avatar(name)

delete user avatar

Example

  • Basic Authentication (basicAuth):
  • Bearer (JWT) Authentication (bearerAuth):
import halo_client
from halo_client.models.user import User
from halo_client.rest import ApiException
from pprint import pprint

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

# 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 = halo_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

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

# Enter a context with an instance of the API client
with halo_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = halo_client.UserV1alpha1ConsoleApi(api_client)
    name = 'name_example' # str | User name

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

Parameters

Name Type Description Notes
name str User name

Return type

User

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
0 default response -

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

disable_user

User disable_user(username)

Disable user by username

Example

  • Basic Authentication (basicAuth):
  • Bearer (JWT) Authentication (bearerAuth):
import halo_client
from halo_client.models.user import User
from halo_client.rest import ApiException
from pprint import pprint

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

# 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 = halo_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

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

# Enter a context with an instance of the API client
with halo_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = halo_client.UserV1alpha1ConsoleApi(api_client)
    username = 'username_example' # str | Username

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

Parameters

Name Type Description Notes
username str Username

Return type

User

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
0 The user has been disabled. -

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

enable_user

User enable_user(username)

Enable user by username

Example

  • Basic Authentication (basicAuth):
  • Bearer (JWT) Authentication (bearerAuth):
import halo_client
from halo_client.models.user import User
from halo_client.rest import ApiException
from pprint import pprint

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

# 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 = halo_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

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

# Enter a context with an instance of the API client
with halo_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = halo_client.UserV1alpha1ConsoleApi(api_client)
    username = 'username_example' # str | Username

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

Parameters

Name Type Description Notes
username str Username

Return type

User

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
0 The user has been enabled. -

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

get_current_user_detail

DetailedUser get_current_user_detail()

Get current user detail

Example

  • Basic Authentication (basicAuth):
  • Bearer (JWT) Authentication (bearerAuth):
import halo_client
from halo_client.models.detailed_user import DetailedUser
from halo_client.rest import ApiException
from pprint import pprint

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

# 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 = halo_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

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

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

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

Parameters

This endpoint does not need any parameter.

Return type

DetailedUser

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
0 default response -

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

get_permissions

UserPermission get_permissions(name)

Get permissions of user

Example

  • Basic Authentication (basicAuth):
  • Bearer (JWT) Authentication (bearerAuth):
import halo_client
from halo_client.models.user_permission import UserPermission
from halo_client.rest import ApiException
from pprint import pprint

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

# 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 = halo_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

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

# Enter a context with an instance of the API client
with halo_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = halo_client.UserV1alpha1ConsoleApi(api_client)
    name = 'name_example' # str | User name

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

Parameters

Name Type Description Notes
name str User name

Return type

UserPermission

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
0 default response -

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

get_user_detail

DetailedUser get_user_detail(name)

Get user detail by name

Example

  • Basic Authentication (basicAuth):
  • Bearer (JWT) Authentication (bearerAuth):
import halo_client
from halo_client.models.detailed_user import DetailedUser
from halo_client.rest import ApiException
from pprint import pprint

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

# 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 = halo_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

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

# Enter a context with an instance of the API client
with halo_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = halo_client.UserV1alpha1ConsoleApi(api_client)
    name = 'name_example' # str | User name

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

Parameters

Name Type Description Notes
name str User name

Return type

DetailedUser

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
0 default response -

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

grant_permission

User grant_permission(name, grant_request)

Grant permissions to user

Example

  • Basic Authentication (basicAuth):
  • Bearer (JWT) Authentication (bearerAuth):
import halo_client
from halo_client.models.grant_request import GrantRequest
from halo_client.models.user import User
from halo_client.rest import ApiException
from pprint import pprint

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

# 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 = halo_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

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

# Enter a context with an instance of the API client
with halo_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = halo_client.UserV1alpha1ConsoleApi(api_client)
    name = 'name_example' # str | User name
    grant_request = halo_client.GrantRequest() # GrantRequest | 

    try:
        api_response = api_instance.grant_permission(name, grant_request)
        print("The response of UserV1alpha1ConsoleApi->grant_permission:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UserV1alpha1ConsoleApi->grant_permission: %s\n" % e)

Parameters

Name Type Description Notes
name str User name
grant_request GrantRequest

Return type

User

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
0 default response -

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

list_users

UserEndpointListedUserList list_users(page=page, size=size, label_selector=label_selector, field_selector=field_selector, sort=sort, keyword=keyword, role=role)

List users

Example

  • Basic Authentication (basicAuth):
  • Bearer (JWT) Authentication (bearerAuth):
import halo_client
from halo_client.models.user_endpoint_listed_user_list import UserEndpointListedUserList
from halo_client.rest import ApiException
from pprint import pprint

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

# 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 = halo_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

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

# Enter a context with an instance of the API client
with halo_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = halo_client.UserV1alpha1ConsoleApi(api_client)
    page = 56 # int | Page number. Default is 0. (optional)
    size = 56 # int | Size number. Default is 0. (optional)
    label_selector = ['label_selector_example'] # List[str] | Label selector. e.g.: hidden!=true (optional)
    field_selector = ['field_selector_example'] # List[str] | Field selector. e.g.: metadata.name==halo (optional)
    sort = ['sort_example'] # List[str] | Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. (optional)
    keyword = 'keyword_example' # str | Keyword to search (optional)
    role = 'role_example' # str | Role name (optional)

    try:
        api_response = api_instance.list_users(page=page, size=size, label_selector=label_selector, field_selector=field_selector, sort=sort, keyword=keyword, role=role)
        print("The response of UserV1alpha1ConsoleApi->list_users:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UserV1alpha1ConsoleApi->list_users: %s\n" % e)

Parameters

Name Type Description Notes
page int Page number. Default is 0. [optional]
size int Size number. Default is 0. [optional]
label_selector List[str] Label selector. e.g.: hidden!=true [optional]
field_selector List[str] Field selector. e.g.: metadata.name==halo [optional]
sort List[str] Sorting criteria in the format: property,(asc desc). Default sort order is ascending. Multiple sort criteria are supported.
keyword str Keyword to search [optional]
role str Role name [optional]

Return type

UserEndpointListedUserList

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
0 default response -

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

send_email_verification_code

send_email_verification_code(email_verify_request)

Send email verification code for user

Example

  • Basic Authentication (basicAuth):
  • Bearer (JWT) Authentication (bearerAuth):
import halo_client
from halo_client.models.email_verify_request import EmailVerifyRequest
from halo_client.rest import ApiException
from pprint import pprint

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

# 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 = halo_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

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

# Enter a context with an instance of the API client
with halo_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = halo_client.UserV1alpha1ConsoleApi(api_client)
    email_verify_request = halo_client.EmailVerifyRequest() # EmailVerifyRequest | 

    try:
        api_instance.send_email_verification_code(email_verify_request)
    except Exception as e:
        print("Exception when calling UserV1alpha1ConsoleApi->send_email_verification_code: %s\n" % e)

Parameters

Name Type Description Notes
email_verify_request EmailVerifyRequest

Return type

void (empty response body)

Authorization

basicAuth, bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
0 default response -

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

update_current_user

User update_current_user(user)

Update current user profile, but password.

Example

  • Basic Authentication (basicAuth):
  • Bearer (JWT) Authentication (bearerAuth):
import halo_client
from halo_client.models.user import User
from halo_client.rest import ApiException
from pprint import pprint

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

# 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 = halo_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

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

# Enter a context with an instance of the API client
with halo_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = halo_client.UserV1alpha1ConsoleApi(api_client)
    user = halo_client.User() # User | 

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

Parameters

Name Type Description Notes
user User

Return type

User

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

HTTP response details

Status code Description Response headers
0 default response -

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

upload_user_avatar

User upload_user_avatar(name, file)

upload user avatar

Example

  • Basic Authentication (basicAuth):
  • Bearer (JWT) Authentication (bearerAuth):
import halo_client
from halo_client.models.user import User
from halo_client.rest import ApiException
from pprint import pprint

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

# 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 = halo_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

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

# Enter a context with an instance of the API client
with halo_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = halo_client.UserV1alpha1ConsoleApi(api_client)
    name = 'name_example' # str | User name
    file = None # bytearray | 

    try:
        api_response = api_instance.upload_user_avatar(name, file)
        print("The response of UserV1alpha1ConsoleApi->upload_user_avatar:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling UserV1alpha1ConsoleApi->upload_user_avatar: %s\n" % e)

Parameters

Name Type Description Notes
name str User name
file bytearray

Return type

User

Authorization

basicAuth, bearerAuth

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: /

HTTP response details

Status code Description Response headers
0 default response -

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

verify_email

verify_email(verify_code_request)

Verify email for user by code.

Example

  • Basic Authentication (basicAuth):
  • Bearer (JWT) Authentication (bearerAuth):
import halo_client
from halo_client.models.verify_code_request import VerifyCodeRequest
from halo_client.rest import ApiException
from pprint import pprint

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

# 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 = halo_client.Configuration(
    username = os.environ["USERNAME"],
    password = os.environ["PASSWORD"]
)

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

# Enter a context with an instance of the API client
with halo_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = halo_client.UserV1alpha1ConsoleApi(api_client)
    verify_code_request = halo_client.VerifyCodeRequest() # VerifyCodeRequest | 

    try:
        api_instance.verify_email(verify_code_request)
    except Exception as e:
        print("Exception when calling UserV1alpha1ConsoleApi->verify_email: %s\n" % e)

Parameters

Name Type Description Notes
verify_code_request VerifyCodeRequest

Return type

void (empty response body)

Authorization

basicAuth, bearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
0 default response -

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