Skip to content

Latest commit

 

History

History
400 lines (274 loc) · 11.5 KB

File metadata and controls

400 lines (274 loc) · 11.5 KB

hotdata.SecretsApi

All URIs are relative to https://app.hotdata.dev

Method HTTP request Description
create_secret POST /v1/secrets Create secret
delete_secret DELETE /v1/secrets/{name} Delete secret
get_secret GET /v1/secrets/{name} Get secret
list_secrets GET /v1/secrets List secrets
update_secret PUT /v1/secrets/{name} Update secret

create_secret

CreateSecretResponse create_secret(create_secret_request)

Create secret

Store a new named secret. The value is encrypted at rest and can be referenced by connections for authentication. Secret names must be unique.

Example

  • Bearer Authentication (BearerAuth):
import hotdata
from hotdata.models.create_secret_request import CreateSecretRequest
from hotdata.models.create_secret_response import CreateSecretResponse
from hotdata.rest import ApiException
from pprint import pprint

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

# 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: BearerAuth
configuration = hotdata.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with hotdata.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = hotdata.SecretsApi(api_client)
    create_secret_request = hotdata.CreateSecretRequest() # CreateSecretRequest | 

    try:
        # Create secret
        api_response = api_instance.create_secret(create_secret_request)
        print("The response of SecretsApi->create_secret:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SecretsApi->create_secret: %s\n" % e)

Parameters

Name Type Description Notes
create_secret_request CreateSecretRequest

Return type

CreateSecretResponse

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 Secret created -
409 Secret already exists -

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

delete_secret

delete_secret(name)

Delete secret

Example

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

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

# 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: BearerAuth
configuration = hotdata.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

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

    try:
        # Delete secret
        api_instance.delete_secret(name)
    except Exception as e:
        print("Exception when calling SecretsApi->delete_secret: %s\n" % e)

Parameters

Name Type Description Notes
name str Secret name

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 Secret deleted -
404 Secret not found -

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

get_secret

GetSecretResponse get_secret(name)

Get secret

Get metadata for a secret. The secret value is never returned.

Example

  • Bearer Authentication (BearerAuth):
import hotdata
from hotdata.models.get_secret_response import GetSecretResponse
from hotdata.rest import ApiException
from pprint import pprint

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

# 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: BearerAuth
configuration = hotdata.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

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

    try:
        # Get secret
        api_response = api_instance.get_secret(name)
        print("The response of SecretsApi->get_secret:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SecretsApi->get_secret: %s\n" % e)

Parameters

Name Type Description Notes
name str Secret name

Return type

GetSecretResponse

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Secret metadata -
404 Secret not found -

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

list_secrets

ListSecretsResponse list_secrets()

List secrets

List all stored secrets. Only metadata (name, timestamps) is returned — secret values are never exposed.

Example

  • Bearer Authentication (BearerAuth):
import hotdata
from hotdata.models.list_secrets_response import ListSecretsResponse
from hotdata.rest import ApiException
from pprint import pprint

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

# 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: BearerAuth
configuration = hotdata.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

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

    try:
        # List secrets
        api_response = api_instance.list_secrets()
        print("The response of SecretsApi->list_secrets:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SecretsApi->list_secrets: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

ListSecretsResponse

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 List of secrets -

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

update_secret

UpdateSecretResponse update_secret(name, update_secret_request)

Update secret

Example

  • Bearer Authentication (BearerAuth):
import hotdata
from hotdata.models.update_secret_request import UpdateSecretRequest
from hotdata.models.update_secret_response import UpdateSecretResponse
from hotdata.rest import ApiException
from pprint import pprint

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

# 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: BearerAuth
configuration = hotdata.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with hotdata.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = hotdata.SecretsApi(api_client)
    name = 'name_example' # str | Secret name
    update_secret_request = hotdata.UpdateSecretRequest() # UpdateSecretRequest | 

    try:
        # Update secret
        api_response = api_instance.update_secret(name, update_secret_request)
        print("The response of SecretsApi->update_secret:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SecretsApi->update_secret: %s\n" % e)

Parameters

Name Type Description Notes
name str Secret name
update_secret_request UpdateSecretRequest

Return type

UpdateSecretResponse

Authorization

BearerAuth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 Secret updated -
404 Secret not found -

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