Skip to content
This repository was archived by the owner on Mar 9, 2025. It is now read-only.

Latest commit

 

History

History
286 lines (203 loc) · 12.7 KB

TagAssignmentsApi.md

File metadata and controls

286 lines (203 loc) · 12.7 KB

OpenAPI\Client\TagAssignmentsApi

All URIs are relative to https://api.contabo.com, except if the operation defines another base path.

Method HTTP request Description
createAssignment() POST /v1/tags/{tagId}/assignments/{resourceType}/{resourceId} Create a new assignment for the tag
deleteAssignment() DELETE /v1/tags/{tagId}/assignments/{resourceType}/{resourceId} Delete existing tag assignment
retrieveAssignment() GET /v1/tags/{tagId}/assignments/{resourceType}/{resourceId} Get specific assignment for the tag
retrieveAssignmentList() GET /v1/tags/{tagId}/assignments List tag assignments

createAssignment()

createAssignment($x_request_id, $tag_id, $resource_type, $resource_id, $x_trace_id): \OpenAPI\Client\Model\CreateAssignmentResponse

Create a new assignment for the tag

Create a new tag assignment. This marks the specified resource with the specified tag for organizing purposes or to restrict access to that resource.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\TagAssignmentsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$x_request_id = 04e0f898-37b4-48bc-a794-1a57abe6aa31; // string | [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.
$resource_type = instance; // string | The identifier of the resource type. Resource type is one of `instance|image|object-storage`.
$resource_id = d65ecf3b-30db-4dc2-9e88-dfc21a14a6bc; // string | The identifier of the resource id
$x_trace_id = 'x_trace_id_example'; // string | Identifier to trace group of requests.

try {
    $result = $apiInstance->createAssignment($x_request_id, $tag_id, $resource_type, $resource_id, $x_trace_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TagAssignmentsApi->createAssignment: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
x_request_id string Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually.
tag_id int The identifier of the tag.
resource_type string The identifier of the resource type. Resource type is one of `instance image
resource_id string The identifier of the resource id
x_trace_id string Identifier to trace group of requests. [optional]

Return type

\OpenAPI\Client\Model\CreateAssignmentResponse

Authorization

bearer

HTTP request headers

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

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

deleteAssignment()

deleteAssignment($x_request_id, $tag_id, $resource_type, $resource_id, $x_trace_id)

Delete existing tag assignment

Tag assignment will be removed from the specified resource. If this tag is being used for access restrictions the affected users will no longer be able to access that resource.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\TagAssignmentsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$x_request_id = 04e0f898-37b4-48bc-a794-1a57abe6aa31; // string | [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.
$resource_type = instance; // string | The identifier of the resource type. Resource type is one of `instance|image|object-storage`.
$resource_id = d65ecf3b-30db-4dc2-9e88-dfc21a14a6bc; // string | The identifier of the resource id
$x_trace_id = 'x_trace_id_example'; // string | Identifier to trace group of requests.

try {
    $apiInstance->deleteAssignment($x_request_id, $tag_id, $resource_type, $resource_id, $x_trace_id);
} catch (Exception $e) {
    echo 'Exception when calling TagAssignmentsApi->deleteAssignment: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
x_request_id string Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually.
tag_id int The identifier of the tag.
resource_type string The identifier of the resource type. Resource type is one of `instance image
resource_id string The identifier of the resource id
x_trace_id string 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

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

retrieveAssignment()

retrieveAssignment($x_request_id, $tag_id, $resource_type, $resource_id, $x_trace_id): \OpenAPI\Client\Model\FindAssignmentResponse

Get specific assignment for the tag

Get attributes for a specific tag assignment in your account. For this the resource type and resource id is required.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\TagAssignmentsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$x_request_id = 04e0f898-37b4-48bc-a794-1a57abe6aa31; // string | [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.
$resource_type = instance; // string | The identifier of the resource type. Resource type is one of `instance|image|object-storage`.
$resource_id = d65ecf3b-30db-4dc2-9e88-dfc21a14a6bc; // string | The identifier of the resource id
$x_trace_id = 'x_trace_id_example'; // string | Identifier to trace group of requests.

try {
    $result = $apiInstance->retrieveAssignment($x_request_id, $tag_id, $resource_type, $resource_id, $x_trace_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TagAssignmentsApi->retrieveAssignment: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
x_request_id string Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually.
tag_id int The identifier of the tag.
resource_type string The identifier of the resource type. Resource type is one of `instance image
resource_id string The identifier of the resource id
x_trace_id string Identifier to trace group of requests. [optional]

Return type

\OpenAPI\Client\Model\FindAssignmentResponse

Authorization

bearer

HTTP request headers

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

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

retrieveAssignmentList()

retrieveAssignmentList($x_request_id, $tag_id, $x_trace_id, $page, $size, $order_by, $resource_type): \OpenAPI\Client\Model\ListAssignmentResponse

List tag assignments

List and filter all existing assignments for a tag in your account

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\TagAssignmentsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$x_request_id = 04e0f898-37b4-48bc-a794-1a57abe6aa31; // string | [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'; // string | Identifier to trace group of requests.
$page = 1; // int | Number of page to be fetched.
$size = 10; // int | Number of elements per page.
$order_by = name:asc; // string[] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.
$resource_type = instance; // string | Filter as substring match for assignment resource type. Resource type is one of `instance|image|object-storage`.

try {
    $result = $apiInstance->retrieveAssignmentList($x_request_id, $tag_id, $x_trace_id, $page, $size, $order_by, $resource_type);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling TagAssignmentsApi->retrieveAssignmentList: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
x_request_id string 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 string 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 string[] Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC DESC`.
resource_type string Filter as substring match for assignment resource type. Resource type is one of `instance image

Return type

\OpenAPI\Client\Model\ListAssignmentResponse

Authorization

bearer

HTTP request headers

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

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