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 |
CreateServerResponse assignTag(serverId, tagList)
Assign tag to a server
Servers can be tagged with one or more tags. The tags used must exist
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.TagApi();
var serverId = "serverId_example"; // String | Server id
var tagList = "tagList_example"; // String | List of tags
apiInstance.assignTag(serverId, tagList).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
serverId | String | Server id | |
tagList | String | List of tags |
- Content-Type: application/json
- Accept: application/json
CreateNewTagResponse createTag(tag)
Create a new tag
Creates a new tag. Existing servers can be tagged in same request
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.TagApi();
var tag = new upcloud.TagCreateRequest(); // TagCreateRequest |
apiInstance.createTag(tag).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
tag | TagCreateRequest |
- Content-Type: application/json
- Accept: application/json
deleteTag(tagName)
Delete tag
Deleting existing tag untags all servers from specified tag and deletes tag definition
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.TagApi();
var tagName = "tagName_example"; // String | Tag name
apiInstance.deleteTag(tagName).then(function() {
console.log('API called successfully.');
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
tagName | String | Tag name |
null (empty response body)
- Content-Type: application/json
- Accept: application/json
TagListResponse listTags()
List existing tags
Returns all existing tags with their properties and servers tagged
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.TagApi();
apiInstance.listTags().then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
This endpoint does not need any parameter.
- Content-Type: application/json
- Accept: application/json
CreateNewTagResponse modifyTag(tagNametag)
Modify existing tag
Changes attributes of an existing tag
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.TagApi();
var tagName = "tagName_example"; // String | Tag name
var tag = new upcloud.ModifyTagRequest(); // ModifyTagRequest |
apiInstance.modifyTag(tagNametag).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
tagName | String | Tag name | |
tag | ModifyTagRequest |
- Content-Type: application/json
- Accept: application/json
CreateServerResponse untag(serverId, tagName)
Remove tag from server
Untags tags from given server. The tag(s) must exist
var upcloud = require('upcloud');
var defaultClient = upcloud.ApiClient.instance;
// Configure HTTP basic authorization: baseAuth
var baseAuth = defaultClient.authentications['baseAuth'];
baseAuth.username = 'YOUR USERNAME';
baseAuth.password = 'YOUR PASSWORD';
var apiInstance = new upcloud.TagApi();
var serverId = "serverId_example"; // String | Server id
var tagName = "tagName_example"; // String | Tag name
apiInstance.untag(serverId, tagName).then(function(data) {
console.log('API called successfully. Returned data: ' + data);
}, function(error) {
console.error(error);
});
Name | Type | Description | Notes |
---|---|---|---|
serverId | String | Server id | |
tagName | String | Tag name |
- Content-Type: application/json
- Accept: application/json