Skip to content

Latest commit

 

History

History
430 lines (301 loc) · 17 KB

TagsApi.md

File metadata and controls

430 lines (301 loc) · 17 KB

pfruck_contabo.TagsApi

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

Method HTTP request Description
create_tag POST /v1/tags Create a new tag
delete_tag DELETE /v1/tags/{tagId} Delete existing tag by id
retrieve_tag GET /v1/tags/{tagId} Get specific tag by id
retrieve_tag_list GET /v1/tags List tags
update_tag PATCH /v1/tags/{tagId} Update specific tag by id

create_tag

CreateTagResponse create_tag(x_request_id, create_tag_request, x_trace_id=x_trace_id)

Create a new tag

Create a new tag in your account with attribute name and optional attribute color.

Example

  • Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.create_tag_request import CreateTagRequest
from pfruck_contabo.models.create_tag_response import CreateTagResponse
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.TagsApi(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_tag_request = pfruck_contabo.CreateTagRequest() # CreateTagRequest | 
    x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)

    try:
        # Create a new tag
        api_response = api_instance.create_tag(x_request_id, create_tag_request, x_trace_id=x_trace_id)
        print("The response of TagsApi->create_tag:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TagsApi->create_tag: %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_tag_request CreateTagRequest
x_trace_id str Identifier to trace group of requests. [optional]

Return type

CreateTagResponse

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 tag attributes. -

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

delete_tag

delete_tag(x_request_id, tag_id, x_trace_id=x_trace_id)

Delete existing tag by id

Your tag can be deleted if it is not assigned to any resource on your account. Check tag assigments before deleting tag.

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.TagsApi(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.
    tag_id = 12345 # int | The identifier of the tag
    x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)

    try:
        # Delete existing tag by id
        api_instance.delete_tag(x_request_id, tag_id, x_trace_id=x_trace_id)
    except Exception as e:
        print("Exception when calling TagsApi->delete_tag: %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.
tag_id int The identifier of the tag
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_tag

FindTagResponse retrieve_tag(x_request_id, tag_id, x_trace_id=x_trace_id)

Get specific tag by id

Get attributes values to a specific tag on your account.

Example

  • Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.find_tag_response import FindTagResponse
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.TagsApi(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.
    tag_id = 12345 # int | The identifier of the tag
    x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)

    try:
        # Get specific tag by id
        api_response = api_instance.retrieve_tag(x_request_id, tag_id, x_trace_id=x_trace_id)
        print("The response of TagsApi->retrieve_tag:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TagsApi->retrieve_tag: %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.
tag_id int The identifier of the tag
x_trace_id str Identifier to trace group of requests. [optional]

Return type

FindTagResponse

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 tag attributes. -

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

retrieve_tag_list

ListTagResponse retrieve_tag_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name)

List tags

List and filter all tags in your account

Example

  • Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.list_tag_response import ListTagResponse
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.TagsApi(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 = 'web' # str | Filter as substring match for tag names. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. (optional)

    try:
        # List tags
        api_response = api_instance.retrieve_tag_list(x_request_id, x_trace_id=x_trace_id, page=page, size=size, order_by=order_by, name=name)
        print("The response of TagsApi->retrieve_tag_list:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TagsApi->retrieve_tag_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 as substring match for tag names. Tags may contain letters, numbers, colons, dashes, and underscores. There is a limit of 255 characters per tag. [optional]

Return type

ListTagResponse

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 paginated list of tags. -

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

update_tag

UpdateTagResponse update_tag(x_request_id, tag_id, update_tag_request, x_trace_id=x_trace_id)

Update specific tag by id

Update attributes to your tag. Attributes are optional. If not set, the attributes will retain their original values.

Example

  • Bearer (JWT) Authentication (bearer):
import pfruck_contabo
from pfruck_contabo.models.update_tag_request import UpdateTagRequest
from pfruck_contabo.models.update_tag_response import UpdateTagResponse
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.TagsApi(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.
    tag_id = 12345 # int | The identifier of the tag
    update_tag_request = pfruck_contabo.UpdateTagRequest() # UpdateTagRequest | 
    x_trace_id = 'x_trace_id_example' # str | Identifier to trace group of requests. (optional)

    try:
        # Update specific tag by id
        api_response = api_instance.update_tag(x_request_id, tag_id, update_tag_request, x_trace_id=x_trace_id)
        print("The response of TagsApi->update_tag:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling TagsApi->update_tag: %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.
tag_id int The identifier of the tag
update_tag_request UpdateTagRequest
x_trace_id str Identifier to trace group of requests. [optional]

Return type

UpdateTagResponse

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 tag attributes. -

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