Skip to content

Latest commit

 

History

History
432 lines (303 loc) · 17.3 KB

SecretsApi.md

File metadata and controls

432 lines (303 loc) · 17.3 KB

pfruck_contabo.SecretsApi

All URIs are relative to https://api.contabo.com

Method HTTP request Description
create_secret POST /v1/secrets Create a new secret
delete_secret DELETE /v1/secrets/{secretId} Delete existing secret by id
retrieve_secret GET /v1/secrets/{secretId} Get specific secret by id
retrieve_secret_list GET /v1/secrets List secrets
update_secret PATCH /v1/secrets/{secretId} Update specific secret by id

create_secret

CreateSecretResponse create_secret(x_request_id, create_secret_request, x_trace_id=x_trace_id)

Create a new secret

Create a new secret in your account with attributes name, type and value. Attribute type can be password or ssh.

Example

  • Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.create_secret_request import CreateSecretRequest
from pfruck_contabo.models.create_secret_response import CreateSecretResponse
from pfruck_contabo.rest import ApiException
from pprint import pprint

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

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

# Enter a context with an instance of the API client
with pfruck_contabo.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pfruck_contabo.SecretsApi(api_client)
    x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.
    create_secret_request = pfruck_contabo.CreateSecretRequest() # CreateSecretRequest | 
    x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)

    try:
        # Create a new secret
        api_response = api_instance.create_secret(x_request_id, create_secret_request, x_trace_id=x_trace_id)
        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
x_request_id str Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually.
create_secret_request CreateSecretRequest
x_trace_id str Identifier to trace group of requests. [optional]

Return type

CreateSecretResponse

Authorization

bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
201 The response will be a JSON object and contains standard secret attributes. -

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

delete_secret

delete_secret(x_request_id, secret_id, x_trace_id=x_trace_id)

Delete existing secret by id

You can remove a specific secret from your account.

Example

  • Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.rest import ApiException
from pprint import pprint

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

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

# Enter a context with an instance of the API client
with pfruck_contabo.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pfruck_contabo.SecretsApi(api_client)
    x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.
    secret_id = 123 # int | The id of the secret
    x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)

    try:
        # Delete existing secret by id
        api_instance.delete_secret(x_request_id, secret_id, x_trace_id=x_trace_id)
    except Exception as e:
        print("Exception when calling SecretsApi->delete_secret: %s\n" % e)

Parameters

Name Type Description Notes
x_request_id str Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually.
secret_id int The id of the secret
x_trace_id str Identifier to trace group of requests. [optional]

Return type

void (empty response body)

Authorization

bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
204 Response body has no content -

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

retrieve_secret

FindSecretResponse retrieve_secret(x_request_id, secret_id, x_trace_id=x_trace_id)

Get specific secret by id

Get attributes values for a specific secret on your account.

Example

  • Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.find_secret_response import FindSecretResponse
from pfruck_contabo.rest import ApiException
from pprint import pprint

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

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

# Enter a context with an instance of the API client
with pfruck_contabo.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pfruck_contabo.SecretsApi(api_client)
    x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.
    secret_id = 123 # int | The id of the secret
    x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)

    try:
        # Get specific secret by id
        api_response = api_instance.retrieve_secret(x_request_id, secret_id, x_trace_id=x_trace_id)
        print("The response of SecretsApi->retrieve_secret:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SecretsApi->retrieve_secret: %s\n" % e)

Parameters

Name Type Description Notes
x_request_id str Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually.
secret_id int The id of the secret
x_trace_id str Identifier to trace group of requests. [optional]

Return type

FindSecretResponse

Authorization

bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The response will be a JSON object and contains standard secret attributes. -

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

retrieve_secret_list

ListSecretResponse retrieve_secret_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name, type=type)

List secrets

List and filter all secrets in your account.

Example

  • Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.list_secret_response import ListSecretResponse
from pfruck_contabo.rest import ApiException
from pprint import pprint

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

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

# Enter a context with an instance of the API client
with pfruck_contabo.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pfruck_contabo.SecretsApi(api_client)
    x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.
    x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)
    page = 1 # int | Number of page to be fetched. (optional)
    size = 10 # int | Number of elements per page. (optional)
    order_by = ['name:asc'] # List[str] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional)
    name = 'mysecret' # str | Filter secrets by name (optional)
    type = 'type_example' # str | Filter secrets by type (optional)

    try:
        # List secrets
        api_response = api_instance.retrieve_secret_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name, type=type)
        print("The response of SecretsApi->retrieve_secret_list:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SecretsApi->retrieve_secret_list: %s\n" % e)

Parameters

Name Type Description Notes
x_request_id str Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually.
x_trace_id str Identifier to trace group of requests. [optional]
page int Number of page to be fetched. [optional]
size int Number of elements per page. [optional]
order_by List[str] Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC DESC`.
name str Filter secrets by name [optional]
type str Filter secrets by type [optional]

Return type

ListSecretResponse

Authorization

bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The response will be a JSON object and contains a list of secrets. -

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

update_secret

UpdateSecretResponse update_secret(x_request_id, secret_id, update_secret_request, x_trace_id=x_trace_id)

Update specific secret by id

Update attributes to your secret. Attributes are optional. If not set, the attributes will retain their original values. Only name and value can be updated.

Example

  • Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.update_secret_request import UpdateSecretRequest
from pfruck_contabo.models.update_secret_response import UpdateSecretResponse
from pfruck_contabo.rest import ApiException
from pprint import pprint

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

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

# Enter a context with an instance of the API client
with pfruck_contabo.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = pfruck_contabo.SecretsApi(api_client)
    x_request_id = '04e0f898-37b4-48bc-a794-1a57abe6aa31' # str | [Uuid4](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_4_(random)) to identify individual requests for support cases. You can use [uuidgenerator](https://www.uuidgenerator.net/version4) to generate them manually.
    secret_id = 123 # int | The id of the secret
    update_secret_request = pfruck_contabo.UpdateSecretRequest() # UpdateSecretRequest | 
    x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)

    try:
        # Update specific secret by id
        api_response = api_instance.update_secret(x_request_id, secret_id, update_secret_request, x_trace_id=x_trace_id)
        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
x_request_id str Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually.
secret_id int The id of the secret
update_secret_request UpdateSecretRequest
x_trace_id str Identifier to trace group of requests. [optional]

Return type

UpdateSecretResponse

Authorization

bearer

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 The response will be a JSON object and contains standard secret attributes. -

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