Skip to content

Latest commit

 

History

History
350 lines (243 loc) · 11.9 KB

File metadata and controls

350 lines (243 loc) · 11.9 KB

kowabunga.TokenApi

All URIs are relative to https://raw.githubusercontent.com/api/v1

Method HTTP request Description
delete_api_token DELETE /token/{tokenId}
list_api_tokens GET /token
read_api_token GET /token/{tokenId}
update_api_token PUT /token/{tokenId}

delete_api_token

delete_api_token(token_id)

Deletes an existing server-to-server authentication security token.

Example

  • Api Key Authentication (ApiKeyAuth):
  • Bearer (JWT) Authentication (BearerAuth):
import kowabunga
from kowabunga.rest import ApiException
from pprint import pprint

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

# 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 API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

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

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

# Enter a context with an instance of the API client
with kowabunga.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = kowabunga.TokenApi(api_client)
    token_id = 'token_id_example' # str | The ID of the server-to-server authentication security token.

    try:
        api_instance.delete_api_token(token_id)
    except Exception as e:
        print("Exception when calling TokenApi->delete_api_token: %s\n" % e)

Parameters

Name Type Description Notes
token_id str The ID of the server-to-server authentication security token.

Return type

void (empty response body)

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The server-to-server authentication security token has been successfully removed. -
401 Unauthorized error: Unauthorized resource access (wrong auth/credentials). -
403 Forbidden error: Forbidden resource access (restricted access control). -
404 NotFound error: Specified resource does not exist. -
409 Conflict error: A similar resource already exists or resource is still being referenced somewhere. -
422 UnprocessableEntity error: Server can't process request. -

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

list_api_tokens

List[str] list_api_tokens()

Returns the IDs of server-to-server authentication security token objects.

Example

  • Api Key Authentication (ApiKeyAuth):
  • Bearer (JWT) Authentication (BearerAuth):
import kowabunga
from kowabunga.rest import ApiException
from pprint import pprint

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

# 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 API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

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

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

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

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

Parameters

This endpoint does not need any parameter.

Return type

List[str]

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Returns an array of server-to-server authentication security token IDs. -
401 Unauthorized error: Unauthorized resource access (wrong auth/credentials). -
403 Forbidden error: Forbidden resource access (restricted access control). -

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

read_api_token

ApiToken read_api_token(token_id)

Returns a server-to-server authentication security token.

Example

  • Api Key Authentication (ApiKeyAuth):
  • Bearer (JWT) Authentication (BearerAuth):
import kowabunga
from kowabunga.models.api_token import ApiToken
from kowabunga.rest import ApiException
from pprint import pprint

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

# 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 API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

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

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

# Enter a context with an instance of the API client
with kowabunga.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = kowabunga.TokenApi(api_client)
    token_id = 'token_id_example' # str | The ID of the server-to-server authentication security token.

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

Parameters

Name Type Description Notes
token_id str The ID of the server-to-server authentication security token.

Return type

ApiToken

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Returns the server-to-server authentication security token object. -
401 Unauthorized error: Unauthorized resource access (wrong auth/credentials). -
403 Forbidden error: Forbidden resource access (restricted access control). -
404 NotFound error: Specified resource does not exist. -

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

update_api_token

ApiToken update_api_token(token_id, api_token)

Updates a server-to-server authentication security token configuration.

Example

  • Api Key Authentication (ApiKeyAuth):
  • Bearer (JWT) Authentication (BearerAuth):
import kowabunga
from kowabunga.models.api_token import ApiToken
from kowabunga.rest import ApiException
from pprint import pprint

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

# 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 API key authorization: ApiKeyAuth
configuration.api_key['ApiKeyAuth'] = os.environ["API_KEY"]

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

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

# Enter a context with an instance of the API client
with kowabunga.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = kowabunga.TokenApi(api_client)
    token_id = 'token_id_example' # str | The ID of the server-to-server authentication security token.
    api_token = kowabunga.ApiToken() # ApiToken | ApiToken payload.

    try:
        api_response = api_instance.update_api_token(token_id, api_token)
        print("The response of TokenApi->update_api_token:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TokenApi->update_api_token: %s\n" % e)

Parameters

Name Type Description Notes
token_id str The ID of the server-to-server authentication security token.
api_token ApiToken ApiToken payload.

Return type

ApiToken

Authorization

ApiKeyAuth, BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Returns the server-to-server authentication security token object. -
400 BadRequest error: Bad request (wrong input parameters). -
401 Unauthorized error: Unauthorized resource access (wrong auth/credentials). -
403 Forbidden error: Forbidden resource access (restricted access control). -
404 NotFound error: Specified resource does not exist. -
422 UnprocessableEntity error: Server can't process request. -
507 InsufficientResource error: Server can't allocate resources (logical quotas or physical limits hit). -

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