All URIs are relative to https://api.upcloud.com/1.2
Method | HTTP request | Description |
---|---|---|
assignTag | POST /server/{serverId}/tag/{tagList} | Assign tag to a server |
createTag | POST /tag | Create a new tag |
deleteTag | DELETE /tag/{tagName} | Delete tag |
listTags | GET /tag | List existing tags |
modifyTag | PUT /tag/{tagName} | Modify existing tag |
untag | POST /server/{serverId}/untag/{tagName} | Remove tag from server |
\Upcloud\ApiClient\Model\CreateServerResponse assignTag($server_id, $tag_list)
Assign tag to a server
Servers can be tagged with one or more tags. The tags used must exist
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: baseAuth
Upcloud\ApiClient\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Upcloud\ApiClient\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$api_instance = new Upcloud\ApiClient\Upcloud\TagApi();
$server_id = "server_id_example"; // string | Server id
$tag_list = "tag_list_example"; // string | List of tags
try {
$result = $api_instance->assignTag($server_id, $tag_list);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TagApi->assignTag: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
server_id | string | Server id | |
tag_list | string | List of tags |
\Upcloud\ApiClient\Model\CreateServerResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Upcloud\ApiClient\Model\CreateNewTagResponse createTag($tag)
Create a new tag
Creates a new tag. Existing servers can be tagged in same request
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: baseAuth
Upcloud\ApiClient\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Upcloud\ApiClient\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$api_instance = new Upcloud\ApiClient\Upcloud\TagApi();
$tag = new \Upcloud\ApiClient\Model\TagCreateRequest(); // \Upcloud\ApiClient\Model\TagCreateRequest |
try {
$result = $api_instance->createTag($tag);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TagApi->createTag: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
tag | \Upcloud\ApiClient\Model\TagCreateRequest |
\Upcloud\ApiClient\Model\CreateNewTagResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteTag($tag_name)
Delete tag
Deleting existing tag untags all servers from specified tag and deletes tag definition
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: baseAuth
Upcloud\ApiClient\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Upcloud\ApiClient\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$api_instance = new Upcloud\ApiClient\Upcloud\TagApi();
$tag_name = "tag_name_example"; // string | Tag name
try {
$api_instance->deleteTag($tag_name);
} catch (Exception $e) {
echo 'Exception when calling TagApi->deleteTag: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
tag_name | string | Tag name |
void (empty response body)
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Upcloud\ApiClient\Model\TagListResponse listTags()
List existing tags
Returns all existing tags with their properties and servers tagged
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: baseAuth
Upcloud\ApiClient\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Upcloud\ApiClient\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$api_instance = new Upcloud\ApiClient\Upcloud\TagApi();
try {
$result = $api_instance->listTags();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TagApi->listTags: ', $e->getMessage(), PHP_EOL;
}
?>
This endpoint does not need any parameter.
\Upcloud\ApiClient\Model\TagListResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Upcloud\ApiClient\Model\CreateNewTagResponse modifyTag($tag_name, $tag)
Modify existing tag
Changes attributes of an existing tag
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: baseAuth
Upcloud\ApiClient\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Upcloud\ApiClient\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$api_instance = new Upcloud\ApiClient\Upcloud\TagApi();
$tag_name = "tag_name_example"; // string | Tag name
$tag = new \Upcloud\ApiClient\Model\ModifyTagRequest(); // \Upcloud\ApiClient\Model\ModifyTagRequest |
try {
$result = $api_instance->modifyTag($tag_name, $tag);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TagApi->modifyTag: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
tag_name | string | Tag name | |
tag | \Upcloud\ApiClient\Model\ModifyTagRequest |
\Upcloud\ApiClient\Model\CreateNewTagResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\Upcloud\ApiClient\Model\CreateServerResponse untag($server_id, $tag_name)
Remove tag from server
Untags tags from given server. The tag(s) must exist
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: baseAuth
Upcloud\ApiClient\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Upcloud\ApiClient\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
$api_instance = new Upcloud\ApiClient\Upcloud\TagApi();
$server_id = "server_id_example"; // string | Server id
$tag_name = "tag_name_example"; // string | Tag name
try {
$result = $api_instance->untag($server_id, $tag_name);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling TagApi->untag: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
server_id | string | Server id | |
tag_name | string | Tag name |
\Upcloud\ApiClient\Model\CreateServerResponse
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]