master
Models
ServersApi
All URIs are relative to https://api.ionos.com/cloudapi/v6
Method
HTTP request
Description
Delete /datacenters/{datacenterId}/servers/{serverId}/cdroms/{cdromId}
Detach CD-ROMs
Get /datacenters/{datacenterId}/servers/{serverId}/cdroms/{cdromId}
Retrieve attached CD-ROMs
Get /datacenters/{datacenterId}/servers/{serverId}/cdroms
List attached CD-ROMs
Post /datacenters/{datacenterId}/servers/{serverId}/cdroms
Attach CD-ROMs
Delete /datacenters/{datacenterId}/servers/{serverId}
Delete servers
Get /datacenters/{datacenterId}/servers/{serverId}
Retrieve servers by ID
Get /datacenters/{datacenterId}/servers
List servers
Patch /datacenters/{datacenterId}/servers/{serverId}
Partially modify servers
Post /datacenters/{datacenterId}/servers
Create servers
Put /datacenters/{datacenterId}/servers/{serverId}
Modify servers
Post /datacenters/{datacenterId}/servers/{serverId}/reboot
Reboot servers
Get /datacenters/{datacenterId}/servers/{serverId}/remoteconsole
Get Remote Console link
Post /datacenters/{datacenterId}/servers/{serverId}/resume
Resume Cubes instances
Post /datacenters/{datacenterId}/servers/{serverId}/start
Start servers
Post /datacenters/{datacenterId}/servers/{serverId}/stop
Stop VMs
Post /datacenters/{datacenterId}/servers/{serverId}/suspend
Suspend Cubes instances
Get /datacenters/{datacenterId}/servers/{serverId}/token
Get JASON Web Token
Post /datacenters/{datacenterId}/servers/{serverId}/upgrade
Upgrade servers
Delete /datacenters/{datacenterId}/servers/{serverId}/volumes/{volumeId}
Detach volumes
Get /datacenters/{datacenterId}/servers/{serverId}/volumes/{volumeId}
Retrieve attached volumes

DatacentersServersCdromsDelete

1
var result = DatacentersServersCdromsDelete(ctx, datacenterId, serverId, cdromId)
2
.Pretty(pretty)
3
.Depth(depth)
4
.XContractNumber(xContractNumber)
5
.Execute()
Copied!
Detach CD-ROMs

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
serverId := "serverId_example" // string | The unique ID of the server.
13
cdromId := "cdromId_example" // string | The unique ID of the CD-ROM.
14
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
15
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)
16
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
17
18
configuration := openapiclient.NewConfiguration()
19
apiClient := openapiclient.NewAPIClient(configuration)
20
resp, r, err := apiClient.ServersApi.DatacentersServersCdromsDelete(context.Background(), datacenterId, serverId, cdromId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
21
if err != nil {
22
fmt.Fprintf(os.Stderr, "Error when calling `ServersApi.DatacentersServersCdromsDelete``: %v\n", err)
23
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24
}
25
}
Copied!

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.
cdromId
string
The unique ID of the CD-ROM.

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersServersCdromsDeleteRequest 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

DatacentersServersCdromsFindById

1
var result Image = DatacentersServersCdromsFindById(ctx, datacenterId, serverId, cdromId)
2
.Pretty(pretty)
3
.Depth(depth)
4
.XContractNumber(xContractNumber)
5
.Execute()
Copied!
Retrieve attached CD-ROMs

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
serverId := "serverId_example" // string | The unique ID of the server.
13
cdromId := "cdromId_example" // string | The unique ID of the CD-ROM.
14
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
15
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)
16
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
17
18
configuration := openapiclient.NewConfiguration()
19
apiClient := openapiclient.NewAPIClient(configuration)
20
resp, r, err := apiClient.ServersApi.DatacentersServersCdromsFindById(context.Background(), datacenterId, serverId, cdromId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
21
if err != nil {
22
fmt.Fprintf(os.Stderr, "Error when calling `ServersApi.DatacentersServersCdromsFindById``: %v\n", err)
23
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24
}
25
// response from `DatacentersServersCdromsFindById`: Image
26
fmt.Fprintf(os.Stdout, "Response from `ServersApi.DatacentersServersCdromsFindById`: %v\n", resp)
27
}
Copied!

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.
cdromId
string
The unique ID of the CD-ROM.

Other Parameters

Other parameters are passed through a pointer to a apiDatacentersServersCdromsFindByIdRequest 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

Image

HTTP request headers

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

DatacentersServersCdromsGet

1
var result Cdroms = DatacentersServersCdromsGet(ctx, datacenterId, serverId)
2
.Pretty(pretty)
3
.Depth(depth)
4
.XContractNumber(xContractNumber)
5
.Offset(offset)
6
.Limit(limit)
7
.Execute()
Copied!
List attached CD-ROMs

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
serverId := "serverId_example" // string | The unique ID of the server.
13
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
14
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)
15
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
16
offset := int32(56) // int32 | The first element (from the complete list of the elements) to include in the response (used together with <b><i>limit</i></b> for pagination). (optional) (default to 0)
17
limit := int32(56) // int32 | The maximum number of elements to return (use together with offset for pagination). (optional) (default to 1000)
18
19
configuration := openapiclient.NewConfiguration()
20
apiClient := openapiclient.NewAPIClient(configuration)
21
resp, r, err := apiClient.ServersApi.DatacentersServersCdromsGet(context.Background(), datacenterId, serverId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Offset(offset).Limit(limit).Execute()
22
if err != nil {
23
fmt.Fprintf(os.Stderr, "Error when calling `ServersApi.DatacentersServersCdromsGet``: %v\n", err)
24
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25
}
26
// response from `DatacentersServersCdromsGet`: Cdroms
27
fmt.Fprintf(os.Stdout, "Response from `ServersApi.DatacentersServersCdromsGet`: %v\n", resp)
28
}
Copied!

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 apiDatacentersServersCdromsGetRequest 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.
offset
int32
The first element (from the complete list of the elements) to include in the response (used together with <b><i>limit</i></b> for pagination).
[default to 0]
limit
int32
The maximum number of elements to return (use together with offset for pagination).
[default to 1000]

Return type

Cdroms

HTTP request headers

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

DatacentersServersCdromsPost

1
var result Image = DatacentersServersCdromsPost(ctx, datacenterId, serverId)
2
.Cdrom(cdrom)
3
.Pretty(pretty)
4
.Depth(depth)
5
.XContractNumber(xContractNumber)
6
.Execute()
Copied!
Attach CD-ROMs

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
serverId := "serverId_example" // string | The unique ID of the server.
13
cdrom := *openapiclient.NewImage(*openapiclient.NewImageProperties("LINUX")) // Image | The CD-ROM to be attached.
14
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
15
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)
16
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
17
18
configuration := openapiclient.NewConfiguration()
19
apiClient := openapiclient.NewAPIClient(configuration)
20
resp, r, err := apiClient.ServersApi.DatacentersServersCdromsPost(context.Background(), datacenterId, serverId).Cdrom(cdrom).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
21
if err != nil {
22
fmt.Fprintf(os.Stderr, "Error when calling `ServersApi.DatacentersServersCdromsPost``: %v\n", err)
23
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24
}
25
// response from `DatacentersServersCdromsPost`: Image
26
fmt.Fprintf(os.Stdout, "Response from `ServersApi.DatacentersServersCdromsPost`: %v\n", resp)
27
}
Copied!

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 apiDatacentersServersCdromsPostRequest struct via the builder pattern
Name
Type
Description
Notes
cdrom
Image
The CD-ROM to be attached.
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

Image

HTTP request headers

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

DatacentersServersDelete

1
var result = DatacentersServersDelete(ctx, datacenterId, serverId)
2
.Pretty(pretty)
3
.Depth(depth)
4
.XContractNumber(xContractNumber)
5
.Execute()
Copied!
Delete servers

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
serverId := "serverId_example" // string | The unique ID of the server.
13
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
14
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)
15
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
16
17
configuration := openapiclient.NewConfiguration()
18
apiClient := openapiclient.NewAPIClient(configuration)
19
resp, r, err := apiClient.ServersApi.DatacentersServersDelete(context.Background(), datacenterId, serverId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
20
if err != nil {
21
fmt.Fprintf(os.Stderr, "Error when calling `ServersApi.DatacentersServersDelete``: %v\n", err)
22
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23
}
24
}
Copied!

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 apiDatacentersServersDeleteRequest 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

DatacentersServersFindById

1
var result Server = DatacentersServersFindById(ctx, datacenterId, serverId)
2
.Pretty(pretty)
3
.Depth(depth)
4
.XContractNumber(xContractNumber)
5
.Execute()
Copied!
Retrieve servers by ID

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
serverId := "serverId_example" // string | The unique ID of the server.
13
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
14
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)
15
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
16
17
configuration := openapiclient.NewConfiguration()
18
apiClient := openapiclient.NewAPIClient(configuration)
19
resp, r, err := apiClient.ServersApi.DatacentersServersFindById(context.Background(), datacenterId, serverId).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
20
if err != nil {
21
fmt.Fprintf(os.Stderr, "Error when calling `ServersApi.DatacentersServersFindById``: %v\n", err)
22
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23
}
24
// response from `DatacentersServersFindById`: Server
25
fmt.Fprintf(os.Stdout, "Response from `ServersApi.DatacentersServersFindById`: %v\n", resp)
26
}
Copied!

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 apiDatacentersServersFindByIdRequest 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

Server

HTTP request headers

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

DatacentersServersGet

1
var result Servers = DatacentersServersGet(ctx, datacenterId)
2
.Pretty(pretty)
3
.Depth(depth)
4
.UpgradeNeeded(upgradeNeeded)
5
.XContractNumber(xContractNumber)
6
.Offset(offset)
7
.Limit(limit)
8
.Execute()
Copied!
List servers

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
13
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)
14
upgradeNeeded := true // bool | Filter servers that can or that cannot be upgraded. (optional)
15
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
16
offset := int32(56) // int32 | The first element (from the complete list of the elements) to include in the response (used together with <b><i>limit</i></b> for pagination). (optional) (default to 0)
17
limit := int32(56) // int32 | The maximum number of elements to return (use together with offset for pagination). (optional) (default to 1000)
18
19
configuration := openapiclient.NewConfiguration()
20
apiClient := openapiclient.NewAPIClient(configuration)
21
resp, r, err := apiClient.ServersApi.DatacentersServersGet(context.Background(), datacenterId).Pretty(pretty).Depth(depth).UpgradeNeeded(upgradeNeeded).XContractNumber(xContractNumber).Offset(offset).Limit(limit).Execute()
22
if err != nil {
23
fmt.Fprintf(os.Stderr, "Error when calling `ServersApi.DatacentersServersGet``: %v\n", err)
24
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
25
}
26
// response from `DatacentersServersGet`: Servers
27
fmt.Fprintf(os.Stdout, "Response from `ServersApi.DatacentersServersGet`: %v\n", resp)
28
}
Copied!

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 apiDatacentersServersGetRequest 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]
upgradeNeeded
bool
Filter servers that can or that cannot be upgraded.
xContractNumber
int32
Users with multiple contracts must provide the contract number, for which all API requests are to be executed.
offset
int32
The first element (from the complete list of the elements) to include in the response (used together with <b><i>limit</i></b> for pagination).
[default to 0]
limit
int32
The maximum number of elements to return (use together with offset for pagination).
[default to 1000]

Return type

Servers

HTTP request headers

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

DatacentersServersPatch

1
var result Server = DatacentersServersPatch(ctx, datacenterId, serverId)
2
.Server(server)
3
.Pretty(pretty)
4
.Depth(depth)
5
.XContractNumber(xContractNumber)
6
.Execute()
Copied!
Partially modify servers

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
serverId := "serverId_example" // string | The unique ID of the server.
13
server := *openapiclient.NewServerProperties(int32(4), int32(4096)) // ServerProperties | The properties of the server to be updated.
14
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
15
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)
16
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
17
18
configuration := openapiclient.NewConfiguration()
19
apiClient := openapiclient.NewAPIClient(configuration)
20
resp, r, err := apiClient.ServersApi.DatacentersServersPatch(context.Background(), datacenterId, serverId).Server(server).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
21
if err != nil {
22
fmt.Fprintf(os.Stderr, "Error when calling `ServersApi.DatacentersServersPatch``: %v\n", err)
23
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
24
}
25
// response from `DatacentersServersPatch`: Server
26
fmt.Fprintf(os.Stdout, "Response from `ServersApi.DatacentersServersPatch`: %v\n", resp)
27
}
Copied!

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 apiDatacentersServersPatchRequest struct via the builder pattern
Name
Type
Description
Notes
server
The properties of the server to be updated.
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

Server

HTTP request headers

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

DatacentersServersPost

1
var result Server = DatacentersServersPost(ctx, datacenterId)
2
.Server(server)
3
.Pretty(pretty)
4
.Depth(depth)
5
.XContractNumber(xContractNumber)
6
.Execute()
Copied!
Create servers

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
server := *openapiclient.NewServer(*openapiclient.NewServerProperties(int32(4), int32(4096))) // Server | The server to create.
13
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
14
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)
15
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
16
17
configuration := openapiclient.NewConfiguration()
18
apiClient := openapiclient.NewAPIClient(configuration)
19
resp, r, err := apiClient.ServersApi.DatacentersServersPost(context.Background(), datacenterId).Server(server).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
20
if err != nil {
21
fmt.Fprintf(os.Stderr, "Error when calling `ServersApi.DatacentersServersPost``: %v\n", err)
22
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
23
}
24
// response from `DatacentersServersPost`: Server
25
fmt.Fprintf(os.Stdout, "Response from `ServersApi.DatacentersServersPost`: %v\n", resp)
26
}
Copied!

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 apiDatacentersServersPostRequest struct via the builder pattern
Name
Type
Description
Notes
server
Server
The server 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

Server

HTTP request headers

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

DatacentersServersPut

1
var result Server = DatacentersServersPut(ctx, datacenterId, serverId)
2
.Server(server)
3
.Pretty(pretty)
4
.Depth(depth)
5
.XContractNumber(xContractNumber)
6
.Execute()
Copied!
Modify servers

Example

1
package main
2
3
import (
4
"context"
5
"fmt"
6
"os"
7
openapiclient "./openapi"
8
)
9
10
func main() {
11
datacenterId := "datacenterId_example" // string | The unique ID of the data center.
12
serverId := "serverId_example" // string | The unique ID of the server.
13
server := *openapiclient.NewServer(*openapiclient.NewServerProperties(int32(4), int32(4096))) // Server | The modified server
14
pretty := true // bool | Controls whether the response is pretty-printed (with indentations and new lines). (optional) (default to true)
15
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)
16
xContractNumber := int32(56) // int32 | Users with multiple contracts must provide the contract number, for which all API requests are to be executed. (optional)
17
18
configuration := openapiclient.NewConfiguration()
19
apiClient := openapiclient.NewAPIClient(configuration)
20
resp, r, err := apiClient.ServersApi.DatacentersServersPut(context.Background(), datacenterId, serverId).Server(server).Pretty(pretty).Depth(depth).XContractNumber(xContractNumber).Execute()
21
if err != nil {
22
fmt.Fprintf(os.Stderr, "Error when calling `ServersApi.DatacentersServersPut``: %v\n", err)
23
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r