master
Models
LabelsApi
All URIs are relative to https://api.ionos.com/cloudapi/v6
Method
HTTP request
Description
Delete /datacenters/{datacenterId}/labels/{key}
Delete data center labels
Get /datacenters/{datacenterId}/labels/{key}
Retrieve data center labels
Get /datacenters/{datacenterId}/labels
List data center labels
Post /datacenters/{datacenterId}/labels
Create data center labels
Put /datacenters/{datacenterId}/labels/{key}
Modify data center labels
Delete /datacenters/{datacenterId}/servers/{serverId}/labels/{key}
Delete server labels
Get /datacenters/{datacenterId}/servers/{serverId}/labels/{key}
Retrieve server labels
Get /datacenters/{datacenterId}/servers/{serverId}/labels
List server labels
Post /datacenters/{datacenterId}/servers/{serverId}/labels
Create server labels
Put /datacenters/{datacenterId}/servers/{serverId}/labels/{key}
Modify server labels
Delete /datacenters/{datacenterId}/volumes/{volumeId}/labels/{key}
Delete volume labels
Get /datacenters/{datacenterId}/volumes/{volumeId}/labels/{key}
Retrieve volume labels
Get /datacenters/{datacenterId}/volumes/{volumeId}/labels
List volume labels
Post /datacenters/{datacenterId}/volumes/{volumeId}/labels
Create volume labels
Put /datacenters/{datacenterId}/volumes/{volumeId}/labels/{key}
Modify volume labels
Delete /ipblocks/{ipblockId}/labels/{key}
Delete IP block labels
Get /ipblocks/{ipblockId}/labels/{key}
Retrieve IP block labels
Get /ipblocks/{ipblockId}/labels
List IP block labels
Post /ipblocks/{ipblockId}/labels
Create IP block labels
Put /ipblocks/{ipblockId}/labels/{key}
Modify IP block labels
Get /labels/{labelurn}
Retrieve labels by URN
LabelsGet
Get /labels
List labels
Delete /snapshots/{snapshotId}/labels/{key}
Delete snapshot labels
Get /snapshots/{snapshotId}/labels/{key}
Retrieve snapshot labels
Get /snapshots/{snapshotId}/labels
List snapshot labels
Post /snapshots/{snapshotId}/labels
Create snapshot labels
Put /snapshots/{snapshotId}/labels/{key}
Modify snapshot labels

DatacentersLabelsDelete

var result = DatacentersLabelsDelete(ctx, datacenterId, key)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Execute()
Delete data center labels

Example

package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
key := "key_example" // string | The label key
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.LabelsApi.DatacentersLabelsDelete(context.Background(), datacenterId, key).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LabelsApi.DatacentersLabelsDelete``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
key
string
The label key

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersLabelsDeleteRequest struct via the builder pattern
Name
Type
Description
Notes
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Return type

(empty response body)

HTTP request headers

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

DatacentersLabelsFindByKey

var result LabelResource = DatacentersLabelsFindByKey(ctx, datacenterId, key)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Execute()
Retrieve data center labels

Example

package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
key := "key_example" // string | The label key
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.LabelsApi.DatacentersLabelsFindByKey(context.Background(), datacenterId, key).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LabelsApi.DatacentersLabelsFindByKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DatacentersLabelsFindByKey`: LabelResource
fmt.Fprintf(os.Stdout, "Response from `LabelsApi.DatacentersLabelsFindByKey`: %v\n", resp)
}

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
key
string
The label key

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersLabelsFindByKeyRequest struct via the builder pattern
Name
Type
Description
Notes
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Return type

HTTP request headers

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

DatacentersLabelsGet

var result LabelResources = DatacentersLabelsGet(ctx, datacenterId)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Execute()
List data center labels

Example

package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.LabelsApi.DatacentersLabelsGet(context.Background(), datacenterId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LabelsApi.DatacentersLabelsGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DatacentersLabelsGet`: LabelResources
fmt.Fprintf(os.Stdout, "Response from `LabelsApi.DatacentersLabelsGet`: %v\n", resp)
}

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersLabelsGetRequest struct via the builder pattern
Name
Type
Description
Notes
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Return type

HTTP request headers

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

DatacentersLabelsPost

var result LabelResource = DatacentersLabelsPost(ctx, datacenterId)
.Label(label)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Execute()
Create data center labels

Example

package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
label := *openapiclient.NewLabelResource(*openapiclient.NewLabelResourceProperties()) // LabelResource | The label to create.
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.LabelsApi.DatacentersLabelsPost(context.Background(), datacenterId).Label(label).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LabelsApi.DatacentersLabelsPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DatacentersLabelsPost`: LabelResource
fmt.Fprintf(os.Stdout, "Response from `LabelsApi.DatacentersLabelsPost`: %v\n", resp)
}

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersLabelsPostRequest struct via the builder pattern
Name
Type
Description
Notes
label
The label to create.
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Return type

HTTP request headers

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

DatacentersLabelsPut

var result LabelResource = DatacentersLabelsPut(ctx, datacenterId, key)
.Label(label)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Execute()
Modify data center labels

Example

package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
key := "key_example" // string | The label key
label := *openapiclient.NewLabelResource(*openapiclient.NewLabelResourceProperties()) // LabelResource | The modified label
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.LabelsApi.DatacentersLabelsPut(context.Background(), datacenterId, key).Label(label).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LabelsApi.DatacentersLabelsPut``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DatacentersLabelsPut`: LabelResource
fmt.Fprintf(os.Stdout, "Response from `LabelsApi.DatacentersLabelsPut`: %v\n", resp)
}

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
key
string
The label key

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersLabelsPutRequest struct via the builder pattern
Name
Type
Description
Notes
label
The modified label
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Return type

HTTP request headers

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

DatacentersServersLabelsDelete

var result = DatacentersServersLabelsDelete(ctx, datacenterId, serverId, key)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Execute()
Delete server labels

Example

package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
serverId := "serverId_example" // string | The unique ID of the server.
key := "key_example" // string | The label key
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.LabelsApi.DatacentersServersLabelsDelete(context.Background(), datacenterId, serverId, key).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LabelsApi.DatacentersServersLabelsDelete``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
}

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
serverId
string
The unique ID of the server.
key
string
The label key

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersServersLabelsDeleteRequest struct via the builder pattern
Name
Type
Description
Notes
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Return type

(empty response body)

HTTP request headers

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

DatacentersServersLabelsFindByKey

var result LabelResource = DatacentersServersLabelsFindByKey(ctx, datacenterId, serverId, key)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Execute()
Retrieve server labels

Example

package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
serverId := "serverId_example" // string | The unique ID of the server.
key := "key_example" // string | The label key
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.LabelsApi.DatacentersServersLabelsFindByKey(context.Background(), datacenterId, serverId, key).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LabelsApi.DatacentersServersLabelsFindByKey``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DatacentersServersLabelsFindByKey`: LabelResource
fmt.Fprintf(os.Stdout, "Response from `LabelsApi.DatacentersServersLabelsFindByKey`: %v\n", resp)
}

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
serverId
string
The unique ID of the server.
key
string
The label key

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersServersLabelsFindByKeyRequest struct via the builder pattern
Name
Type
Description
Notes
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Return type

HTTP request headers

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

DatacentersServersLabelsGet

var result LabelResources = DatacentersServersLabelsGet(ctx, datacenterId, serverId)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Execute()
List server labels

Example

package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
serverId := "serverId_example" // string | The unique ID of the server.
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.LabelsApi.DatacentersServersLabelsGet(context.Background(), datacenterId, serverId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LabelsApi.DatacentersServersLabelsGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DatacentersServersLabelsGet`: LabelResources
fmt.Fprintf(os.Stdout, "Response from `LabelsApi.DatacentersServersLabelsGet`: %v\n", resp)
}

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
serverId
string
The unique ID of the server.

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersServersLabelsGetRequest struct via the builder pattern
Name
Type
Description
Notes
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Return type

HTTP request headers

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

DatacentersServersLabelsPost

var result LabelResource = DatacentersServersLabelsPost(ctx, datacenterId, serverId)
.Label(label)
.Pretty(pretty)
.Depth(depth)
.XContractNumber(xContractNumber)
.Execute()
Create server labels

Example

package main
import (
"context"
"fmt"
"os"
openapiclient "./openapi"
)
func main() {
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
serverId := "serverId_example" // string | The unique ID of the server.
label := *openapiclient.NewLabelResource(*openapiclient.NewLabelResourceProperties()) // LabelResource | The label to create.
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
depth := int32(56) // int32 | Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on (optional) (default to 0)
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.LabelsApi.DatacentersServersLabelsPost(context.Background(), datacenterId, serverId).Label(label).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `LabelsApi.DatacentersServersLabelsPost``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DatacentersServersLabelsPost`: LabelResource
fmt.Fprintf(os.Stdout, "Response from `LabelsApi.DatacentersServersLabelsPost`: %v\n", resp)
}

Path Parameters

Name
Type
Description
Notes
ctx
context.Context
context for authentication, logging, cancellation, deadlines, tracing, etc.
datacenterId
string
The unique ID of the data center.
serverId
string
The unique ID of the server.

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersServersLabelsPostRequest struct via the builder pattern
Name
Type
Description
Notes
label
The label to create.
pretty
bool
Controls whether the response is pretty-printed (with indentations and new lines).
[default to true]
depth
int32
Controls the detail depth of the response objects. GET /datacenters/[ID] - depth=0: Only direct properties are included; children (servers and other elements) are not included. - depth=1: Direct properties and children references are included. - depth=2: Direct properties and children properties are included. - depth=3: Direct properties and children properties and children's children are included. - depth=... and so on
[default to 0]
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.

Return type

HTTP request headers

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

DatacentersServersLabelsPut

var result LabelResource = DatacentersServersLabelsPut(ctx, datacenterId, serverId, key)
.