### Start Compute Instance Go Example Source: https://github.com/contabo/cntb/blob/main/openapi/docs/InstanceActionsApi.md Use this snippet to start a compute instance in rescue mode. Ensure you provide a valid instance ID and a unique request ID. The optional trace ID can help in tracking requests. ```go package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { xRequestId := "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. instanceId := int64(12345) // int64 | The identifier of the compute instance / resource to be started in rescue mode. xTraceId := "xTraceId_example" // string | Identifier to trace group of requests. (optional) configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.InstanceActionsApi.Start(context.Background(), instanceId).XRequestId(xRequestId).XTraceId(xTraceId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `InstanceActionsApi.Start``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `Start`: InstanceStartActionResponse fmt.Fprintf(os.Stdout, "Response from `InstanceActionsApi.Start`: %v\n", resp) } ``` -------------------------------- ### Get Remedy Example (Go) Source: https://github.com/contabo/cntb/blob/main/openapi/docs/RemediesApi.md Demonstrates how to retrieve details for a specific remedy using its ID. This is useful for checking the status or details of an ongoing or completed remedy. ```go package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { xRequestId := "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. remedyId := float32(12345) // float32 | Remedy's id xTraceId := "xTraceId_example" // string | Identifier to trace group of requests. (optional) configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.RemediesApi.GetExtRemedy(context.Background(), remedyId).XRequestId(xRequestId).XTraceId(xTraceId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `RemediesApi.GetExtRemedy``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetExtRemedy`: ExtRemediesGetResponse fmt.Fprintf(os.Stdout, "Response from `RemediesApi.GetExtRemedy`: %v\n", resp) } ``` -------------------------------- ### Start Instance Source: https://github.com/contabo/cntb/blob/main/openapi/docs/InstanceActionsApi.md Initiates the start action for a specified compute instance. This is useful for bringing an instance back online after it has been stopped. ```APIDOC ## Start Instance ### Description Starts a compute instance / resource by its ID. ### Method POST ### Endpoint `/v2/compute/instances/{instance_id}/actions/start` ### Parameters #### Path Parameters - **instanceId** (int64) - Required - The identifier of the compute instance / resource to be started in rescue mode. #### Header Parameters - **xRequestId** (string) - Required - [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. - **xTraceId** (string) - Optional - Identifier to trace group of requests. ### Response #### Success Response (200) - **InstanceStartActionResponse** - Details about the start action performed on the instance. ### Authorization [bearer](../README.md#bearer) ``` -------------------------------- ### Start Instance Source: https://github.com/contabo/cntb/blob/main/openapi/README.md Starts a compute instance identified by its ID. ```APIDOC ## Start Instance ### Description Start a compute instance / resource identified by its id ### Method Post ### Endpoint /v1/compute/instances/{instanceId}/actions/start ``` -------------------------------- ### Start Instance Source: https://context7.com/contabo/cntb/llms.txt Starts a stopped instance. ```APIDOC ## `cntb start instance` — Start a stopped instance ### Usage ```sh cntb start instance 100001 # INSTANCEID ACTION # 100001 start ``` ``` -------------------------------- ### Create DNS Zone Record - Go Example Source: https://github.com/contabo/cntb/blob/main/openapi/docs/DNSApi.md This example demonstrates how to create a DNS zone record. You must specify the zone name and provide the record details, including type, TTL, and IP address. ```go package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { xRequestId := "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. zoneName := "example.com" // string | Zone name createDnsZoneRecordRequest := *openapiclient.NewCreateDnsZoneRecordRequest("A", float32(86400), float32(0), "10.0.0.1") // CreateDnsZoneRecordRequest | xTraceId := "xTraceId_example" // string | Identifier to trace group of requests. (optional) configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.DNSApi.CreateDnsZoneRecord(context.Background(), zoneName).XRequestId(xRequestId).CreateDnsZoneRecordRequest(createDnsZoneRecordRequest).XTraceId(xTraceId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `DNSApi.CreateDnsZoneRecord``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `CreateDnsZoneRecord`: ApiDnsZoneRecordResponse fmt.Fprintf(os.Stdout, "Response from `DNSApi.CreateDnsZoneRecord`: %v\n", resp) } ``` -------------------------------- ### Get Remedy Go Example Source: https://github.com/contabo/cntb/blob/main/openapi/docs/InternalRemediesApi.md Shows how to retrieve details of a specific remedy using its ID and organization ID. The `X-Request-ID` header is used for request identification. This example requires the `context` package and the OpenAPI client library. ```go package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { xRequestId := "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. remedyId := float32(12345) // float32 | Remedy's id orgId := "cntb" // string | Org ID xTraceId := "xTraceId_example" // string | Identifier to trace group of requests. (optional) configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.InternalRemediesApi.GetRemedy(context.Background(), remedyId, orgId).XRequestId(xRequestId).XTraceId(xTraceId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `InternalRemediesApi.GetRemedy``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetRemedy`: RemediesGetResponse fmt.Fprintf(os.Stdout, "Response from `InternalRemediesApi.GetRemedy`: %v\n", resp) } ``` -------------------------------- ### Install Dependencies for Go Client Source: https://github.com/contabo/cntb/blob/main/openapi/README.md Install necessary dependencies for the Go API client. Ensure these are present before using the client. ```shell go get github.com/stretchr/testify/assert go get golang.org/x/oauth2 go get golang.org/x/net/context ``` -------------------------------- ### Start Check Collection Go Example Source: https://github.com/contabo/cntb/blob/main/openapi/docs/InternalCheckCollectionsApi.md Demonstrates how to initiate a check collection using the Go SDK. Ensure you have the OpenAPI client generated and configured. The X-Request-ID is a mandatory unique identifier for support cases. ```go package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { xRequestId := "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. checkCollectionCreateRequest := *openapiclient.NewCheckCollectionCreateRequest("vserver", "4711", float32(12345), "cntb", "DE-123") // CheckCollectionCreateRequest | xTraceId := "xTraceId_example" // string | Identifier to trace group of requests. (optional) configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.InternalCheckCollectionsApi.StartCheckCollection(context.Background()).XRequestId(xRequestId).CheckCollectionCreateRequest(checkCollectionCreateRequest).XTraceId(xTraceId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `InternalCheckCollectionsApi.StartCheckCollection``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `StartCheckCollection`: CheckCollectionsGetResponse fmt.Fprintf(os.Stdout, "Response from `InternalCheckCollectionsApi.StartCheckCollection`: %v\n", resp) } ``` -------------------------------- ### Start Compute Instance Source: https://github.com/contabo/cntb/blob/main/README.md Start a stopped compute instance by providing its ID. ```sh cntb start instance 12345 ``` -------------------------------- ### Start a Check using Go Source: https://github.com/contabo/cntb/blob/main/openapi/docs/InternalChecksApi.md Initiates a check by making a POST request to the API. Requires a request ID, check details, and optionally a trace ID. The response contains details of the started check. ```go package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { xRequestId := "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. checkCreateRequest := *openapiclient.NewCheckCreateRequest("vserver", "4711", float32(12345), "cntb", "DE-123") // CheckCreateRequest | xTraceId := "xTraceId_example" // string | Identifier to trace group of requests. (optional) configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.InternalChecksApi.StartCheck(context.Background()).XRequestId(xRequestId).CheckCreateRequest(checkCreateRequest).XTraceId(xTraceId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `InternalChecksApi.StartCheck``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `StartCheck`: ChecksGetResponse fmt.Fprintf(os.Stdout, "Response from `InternalChecksApi.StartCheck`: %v\n", resp) } ``` -------------------------------- ### StartExtRemedy Source: https://github.com/contabo/cntb/blob/main/openapi/README.md Start a remedy. ```APIDOC ## POST /v1/troubleshooting/remedies ### Description Start remedy. ### Method POST ### Endpoint /v1/troubleshooting/remedies ``` -------------------------------- ### StartExtCheckCollection Source: https://github.com/contabo/cntb/blob/main/openapi/docs/CheckCollectionsApi.md Starts a new check collection process. ```APIDOC ## StartExtCheckCollection ### Description Start check collection ### Method POST ### Endpoint /v1/troubleshooting/check-collections ### Parameters #### Query Parameters - **xRequestId** (string) - Required - [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. - **xTraceId** (string) - Optional - Identifier to trace group of requests. ### Request Body - **CheckCollectionRequest** (CheckCollectionRequest) - Required - ### Request Example ```json { "example": "request body" } ``` ### Response #### Success Response (200) - **ExtCheckCollectionsGetResponse** - Description of the response object #### Response Example ```json { "example": "response body" } ``` ``` -------------------------------- ### Upgrade Instance Go Example Source: https://github.com/contabo/cntb/blob/main/openapi/docs/InstancesApi.md Demonstrates how to upgrade an instance using the Go SDK. Ensure you have the necessary context, instance ID, and request body. The `X-Request-Id` header is mandatory for tracking. ```go package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { xRequestId := "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. instanceId := int64(12345) // int64 | The identifier of the instance upgradeInstanceRequest := *openapiclient.NewUpgradeInstanceRequest() // UpgradeInstanceRequest | xTraceId := "xTraceId_example" // string | Identifier to trace group of requests. (optional) configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.InstancesApi.UpgradeInstance(context.Background(), instanceId).XRequestId(xRequestId).UpgradeInstanceRequest(upgradeInstanceRequest).XTraceId(xTraceId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `InstancesApi.UpgradeInstance``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `UpgradeInstance`: PatchInstanceResponse fmt.Fprintf(os.Stdout, "Response from `InstancesApi.UpgradeInstance`: %v\n", resp) } ``` -------------------------------- ### Get List of Instances (PowerShell) Source: https://github.com/contabo/cntb/blob/main/openapi/README.md This example shows how to retrieve a list of your Contabo instances using PowerShell. ```APIDOC ## GET /v1/compute/instances ### Description Retrieves a list of all compute instances associated with your Contabo account. ### Method GET ### Endpoint https://api.contabo.com/v1/compute/instances ### Parameters #### Headers - **Authorization** (string) - Required - Bearer token for authentication. - **x-request-id** (string) - Optional - A unique identifier for the request. ### Request Example ```powershell $client_id='' $client_secret='' $api_user='' $api_password='' $body = @{grant_type='password' client_id=$client_id client_secret=$client_secret username=$api_user password=$api_password} $response = Invoke-WebRequest -Uri 'https://auth.contabo.com/auth/realms/contabo/protocol/openid-connect/token' -Method 'POST' -Body $body $access_token = (ConvertFrom-Json $([String]::new($response.Content))).access_token # get list of your instances $headers = @{} $headers.Add("Authorization","Bearer $access_token") $headers.Add("x-request-id","51A87ECD-754E-4104-9C54-D01AD0F83406") Invoke-WebRequest -Uri 'https://api.contabo.com/v1/compute/instances' -Method 'GET' -Headers $headers ``` ### Response #### Success Response (200) - **instances** (array) - A list of instance objects. - **id** (string) - The unique identifier of the instance. - **name** (string) - The name of the instance. - **status** (string) - The current status of the instance (e.g., 'running', 'stopped'). - **image** (string) - The image used for the instance. - **plan** (string) - The plan or type of the instance. - **created_at** (string) - The timestamp when the instance was created. - **updated_at** (string) - The timestamp when the instance was last updated. #### Response Example ```json { "instances": [ { "id": "123e4567-e89b-12d3-a456-426614174000", "name": "my-instance-1", "status": "running", "image": "ubuntu-20.04", "plan": "v-cpu-2", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:05:00Z" } ] } ``` ``` -------------------------------- ### Get List of Instances (curl) Source: https://github.com/contabo/cntb/blob/main/openapi/README.md This example demonstrates how to retrieve a list of your Contabo instances using `curl`. ```APIDOC ## GET /v1/compute/instances ### Description Retrieves a list of all compute instances associated with your Contabo account. ### Method GET ### Endpoint https://api.contabo.com/v1/compute/instances ### Parameters #### Headers - **Authorization** (string) - Required - Bearer token for authentication. - **x-request-id** (string) - Optional - A unique identifier for the request. ### Request Example ```sh CLIENT_ID= CLIENT_SECRET= API_USER= API_PASSWORD='' ACCESS_TOKEN=$(curl -d "client_id=$CLIENT_ID" -d "client_secret=$CLIENT_SECRET" --data-urlencode "username=$API_USER" --data-urlencode "password=$API_PASSWORD" -d 'grant_type=password' 'https://auth.contabo.com/auth/realms/contabo/protocol/openid-connect/token' | jq -r '.access_token') # get list of your instances curl -X GET -H "Authorization: Bearer $ACCESS_TOKEN" -H "x-request-id: 51A87ECD-754E-4104-9C54-D01AD0F83406" "https://api.contabo.com/v1/compute/instances" | jq ``` ### Response #### Success Response (200) - **instances** (array) - A list of instance objects. - **id** (string) - The unique identifier of the instance. - **name** (string) - The name of the instance. - **status** (string) - The current status of the instance (e.g., 'running', 'stopped'). - **image** (string) - The image used for the instance. - **plan** (string) - The plan or type of the instance. - **created_at** (string) - The timestamp when the instance was created. - **updated_at** (string) - The timestamp when the instance was last updated. #### Response Example ```json { "instances": [ { "id": "123e4567-e89b-12d3-a456-426614174000", "name": "my-instance-1", "status": "running", "image": "ubuntu-20.04", "plan": "v-cpu-2", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:05:00Z" } ] } ``` ``` -------------------------------- ### Create Firewall Example Source: https://github.com/contabo/cntb/blob/main/openapi/docs/FirewallsApi.md Demonstrates how to create a new firewall. Ensure you provide a valid UUID for x-request-id and a CreateFirewallRequest object. ```go package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { xRequestId := "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. createFirewallRequest := *openapiclient.NewCreateFirewallRequest("My Firewall", "active") // CreateFirewallRequest | xTraceId := "xTraceId_example" // string | Identifier to trace group of requests. (optional) configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.FirewallsApi.CreateFirewall(context.Background()).XRequestId(xRequestId).CreateFirewallRequest(createFirewallRequest).XTraceId(xTraceId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `FirewallsApi.CreateFirewall``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `CreateFirewall`: CreateFirewallResponse fmt.Fprintf(os.Stdout, "Response from `FirewallsApi.CreateFirewall`: %v\n", resp) } ``` -------------------------------- ### Create Instance with Go Source: https://github.com/contabo/cntb/blob/main/openapi/docs/InstancesApi.md Use this snippet to create a new instance. Ensure you provide a valid X-Request-Id and the necessary instance configuration. The response will contain details of the created instance. ```go package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { xRequestId := "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. createInstanceRequest := *openapiclient.NewCreateInstanceRequest(int64(6)) // CreateInstanceRequest | xTraceId := "xTraceId_example" // string | Identifier to trace group of requests. (optional) configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.InstancesApi.CreateInstance(context.Background()).XRequestId(xRequestId).CreateInstanceRequest(createInstanceRequest).XTraceId(xTraceId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `InstancesApi.CreateInstance``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `CreateInstance`: CreateInstanceResponse fmt.Fprintf(os.Stdout, "Response from `InstancesApi.CreateInstance`: %v\n", resp) } ``` -------------------------------- ### Get Instances (cntb CLI) Source: https://github.com/contabo/cntb/blob/main/openapi/README.md This example shows how to retrieve a list of your Contabo instances using the `cntb` CLI tool. ```APIDOC ## cntb get instances ### Description Retrieves a list of all compute instances associated with your Contabo account using the `cntb` CLI. ### Command `cntb get instances` ### Usage Ensure you have configured your credentials using `cntb config set-credentials`. ### Example ```sh # get list of your instances cntb get instances ``` ### Response (The output format will be similar to the API response, typically JSON or a human-readable table depending on CLI options.) Example JSON output: ```json [ { "id": "123e4567-e89b-12d3-a456-426614174000", "name": "my-instance-1", "status": "running", "image": "ubuntu-20.04", "plan": "v-cpu-2", "created_at": "2023-10-27T10:00:00Z", "updated_at": "2023-10-27T10:05:00Z" } ] ``` ``` -------------------------------- ### Create User Go Example Source: https://github.com/contabo/cntb/blob/main/openapi/docs/UsersApi.md Demonstrates how to create a new user using the Users API. Ensure you provide a valid UUID for x-request-id and a properly formatted CreateUserRequest object. The x-trace-id is optional. ```go package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { xRequestId := "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. createUserRequest := *openapiclient.NewCreateUserRequest("john.doe@example.com", false, false, "de") // CreateUserRequest | xTraceId := "xTraceId_example" // string | Identifier to trace group of requests. (optional) configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.UsersApi.CreateUser(context.Background()).XRequestId(xRequestId).CreateUserRequest(createUserRequest).XTraceId(xTraceId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `UsersApi.CreateUser``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `CreateUser`: CreateUserResponse fmt.Fprintf(os.Stdout, "Response from `UsersApi.CreateUser`: %v\n", resp) } ``` -------------------------------- ### Retrieve Instances List Go Example Source: https://github.com/contabo/cntb/blob/main/openapi/docs/InstancesApi.md Demonstrates how to call the RetrieveInstancesList API in Go. It shows how to set various optional parameters like request IDs, pagination, sorting, and filtering by instance properties. Ensure you have the OpenAPI client library configured. ```go package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { xRequestId := "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. xTraceId := "xTraceId_example" // string | Identifier to trace group of requests. (optional) page := int64(1) // int64 | Number of page to be fetched. (optional) size := int64(10) // int64 | Number of elements per page. (optional) orderBy := []string{"Inner_example"} // []string | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) name := "vmd12345" // string | The name of the instance (optional) displayName := "myTestInstance" // string | The display name of the instance (optional) dataCenter := "European Union 1" // string | The data center of the instance (optional) region := "EU" // string | The Region of the instance (optional) instanceId := int64(100) // int64 | The identifier of the instance (deprecated) (optional) instanceIds := "100, 101, 102" // string | Comma separated instances identifiers (optional) status := "provisioning,installing" // string | The status of the instance (optional) productIds := "V68,V77" // string | Identifiers of the instance products (optional) addOnIds := "1044,827" // string | Identifiers of Addons the instances have (optional) productTypes := "ssd, hdd, nvme" // string | Comma separated instance's category depending on Product Id (optional) ipConfig := true // bool | Filter instances that have an ip config (optional) search := "vmd12345" // string | Full text search when listing the instances. Can be searched by `name`, `displayName`, `ipAddress` (optional) customerId := "22223" // string | Filter by customer ID (optional) tenantId := "DE" // string | Filter by tenant ID (optional) configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.InstancesApi.RetrieveInstancesList(context.Background()).XRequestId(xRequestId).XTraceId(xTraceId).Page(page).Size(size).OrderBy(orderBy).Name(name).DisplayName(displayName).DataCenter(dataCenter).Region(region).InstanceId(instanceId).InstanceIds(instanceIds).Status(status).ProductIds(productIds).AddOnIds(addOnIds).ProductTypes(productTypes).IpConfig(ipConfig).Search(search).CustomerId(customerId).TenantId(tenantId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `InstancesApi.RetrieveInstancesList``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `RetrieveInstancesList`: ListInstancesResponse fmt.Fprintf(os.Stdout, "Response from `InstancesApi.RetrieveInstancesList`: %v\n", resp) } ``` -------------------------------- ### Get Check Collection Template Go Example Source: https://github.com/contabo/cntb/blob/main/openapi/docs/InternalCheckCollectionTemplatesApi.md Demonstrates how to retrieve a specific check collection template using its ID. Requires setting request IDs and organization details. ```go package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { xRequestId := "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. orgId := "cntb" // string | Org ID checkCollectionTemplateId := float32(12345) // float32 | Check collection template's id xTraceId := "xTraceId_example" // string | Identifier to trace group of requests. (optional) configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.InternalCheckCollectionTemplatesApi.GetCheckCollectionTemplate(context.Background(), orgId, checkCollectionTemplateId).XRequestId(xRequestId).XTraceId(xTraceId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `InternalCheckCollectionTemplatesApi.GetCheckCollectionTemplate``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetCheckCollectionTemplate`: CheckCollectionTemplatesGetResponse fmt.Fprintf(os.Stdout, "Response from `InternalCheckCollectionTemplatesApi.GetCheckCollectionTemplate`: %v\n", resp) } ``` -------------------------------- ### Retrieve Snapshot List Go Example Source: https://github.com/contabo/cntb/blob/main/openapi/docs/SnapshotsApi.md Demonstrates how to retrieve a list of snapshots for a given instance. Includes setting various optional query parameters like pagination, sorting, and filtering by name. Ensure the `openapiclient` package is correctly imported. ```go package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { xRequestId := "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. instanceId := int64(12345) // int64 | The identifier of the instance xTraceId := "xTraceId_example" // string | Identifier to trace group of requests. (optional) page := int64(1) // int64 | Number of page to be fetched. (optional) size := int64(10) // int64 | Number of elements per page. (optional) orderBy := []string{"Inner_example"} // []string | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`. (optional) name := "Snapshot.Server" // string | Filter as substring match for snapshots names. (optional) configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.SnapshotsApi.RetrieveSnapshotList(context.Background(), instanceId).XRequestId(xRequestId).XTraceId(xTraceId).Page(page).Size(size).OrderBy(orderBy).Name(name).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `SnapshotsApi.RetrieveSnapshotList``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `RetrieveSnapshotList`: ListSnapshotResponse fmt.Fprintf(os.Stdout, "Response from `SnapshotsApi.RetrieveSnapshotList`: %v\n", resp) } ``` -------------------------------- ### Get Check Template Go Example Source: https://github.com/contabo/cntb/blob/main/openapi/docs/InternalCheckTemplatesApi.md Demonstrates how to retrieve a specific check template using its ID and organization ID. Requires setting request IDs for tracing and support. Ensure the OpenAPI client is configured. ```go package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { xRequestId := "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. orgId := "cntb" // string | Org ID checkTemplateId := float32(12345) // float32 | Check template's id xTraceId := "xTraceId_example" // string | Identifier to trace group of requests. (optional) configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.InternalCheckTemplatesApi.GetCheckTemplate(context.Background(), orgId, checkTemplateId).XRequestId(xRequestId).XTraceId(xTraceId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `InternalCheckTemplatesApi.GetCheckTemplate``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `GetCheckTemplate`: CheckTemplatesGetResponse fmt.Fprintf(os.Stdout, "Response from `InternalCheckTemplatesApi.GetCheckTemplate`: %v\n", resp) } ``` -------------------------------- ### Start Remedy with Go Source: https://github.com/contabo/cntb/blob/main/openapi/docs/InternalRemediesApi.md Demonstrates how to initiate a remedy using the StartRemedy method. Ensure you have the OpenAPI client library configured. The xRequestId is mandatory for tracking support cases. ```go package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { xRequestId := "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. remediesCreateRequest := *openapiclient.NewRemediesCreateRequest("vserver", "4711", float32(12345), "cntb", "DE-123") // RemediesCreateRequest | xTraceId := "xTraceId_example" // string | Identifier to trace group of requests. (optional) configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.InternalRemediesApi.StartRemedy(context.Background()).XRequestId(xRequestId).RemediesCreateRequest(remediesCreateRequest).XTraceId(xTraceId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `InternalRemediesApi.StartRemedy``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `StartRemedy`: RemediesGetResponse fmt.Fprintf(os.Stdout, "Response from `InternalRemediesApi.StartRemedy`: %v\n", resp) } ``` -------------------------------- ### Start Check Collection Source: https://github.com/contabo/cntb/blob/main/openapi/README.md Starts a new check collection. ```APIDOC ## Start Check Collection ### Description Start check collection ### Method Post ### Endpoint /internal/v1/troubleshooting/check-collections ``` -------------------------------- ### Create Instance Snapshot Source: https://github.com/contabo/cntb/blob/main/openapi/docs/SnapshotsApi.md Demonstrates how to create a new snapshot for a given instance. Ensure you provide a valid instance ID and a snapshot name. The X-Request-ID is crucial for tracking requests. ```go package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { xRequestId := "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. instanceId := int64(12345) // int64 | The identifier of the instance createSnapshotRequest := *openapiclient.NewCreateSnapshotRequest("Snapshot-Server") // CreateSnapshotRequest | xTraceId := "xTraceId_example" // string | Identifier to trace group of requests. (optional) configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.SnapshotsApi.CreateSnapshot(context.Background(), instanceId).XRequestId(xRequestId).CreateSnapshotRequest(createSnapshotRequest).XTraceId(xTraceId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `SnapshotsApi.CreateSnapshot``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `CreateSnapshot`: CreateSnapshotResponse fmt.Fprintf(os.Stdout, "Response from `SnapshotsApi.CreateSnapshot`: %v\n", resp) } ``` -------------------------------- ### Create Compute Instance with Apache and SSH Key Source: https://github.com/contabo/cntb/blob/main/README.md Create a new compute instance, install Apache, and configure SSH access using Cloud-Init. Specify image ID, product ID, region, SSH keys, and user data for package management. ```sh cntb create instance --imageId "ae423751-50fa-4bf6-9978-015673bf51c4" --productId "V92" --region "EU" --sshKeys '1,2' --userData 'package_update: true package_upgrade: true packages: - httpd' ``` -------------------------------- ### Changes Methods Source: https://github.com/contabo/cntb/blob/main/openapi/docs/ObjectStorageAuditResponse.md Provides methods to get, get with existence check, and set the Changes field. ```APIDOC ## GetChanges ### Description GetChanges returns the Changes field if non-nil, zero value otherwise. ### Signature `func (o *ObjectStorageAuditResponse) GetChanges() map[string]interface{}` ## GetChangesOk ### Description GetChangesOk returns a tuple with the Changes field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### Signature `func (o *ObjectStorageAuditResponse) GetChangesOk() (*map[string]interface{}, bool)` ## SetChanges ### Description SetChanges sets Changes field to given value. ### Signature `func (o *ObjectStorageAuditResponse) SetChanges(v map[string]interface{})` ``` -------------------------------- ### TraceId Methods Source: https://github.com/contabo/cntb/blob/main/openapi/docs/ObjectStorageAuditResponse.md Provides methods to get, get with existence check, and set the TraceId field. ```APIDOC ## GetTraceId ### Description GetTraceId returns the TraceId field if non-nil, zero value otherwise. ### Signature `func (o *ObjectStorageAuditResponse) GetTraceId() string` ## GetTraceIdOk ### Description GetTraceIdOk returns a tuple with the TraceId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### Signature `func (o *ObjectStorageAuditResponse) GetTraceIdOk() (*string, bool)` ## SetTraceId ### Description SetTraceId sets TraceId field to given value. ### Signature `func (o *ObjectStorageAuditResponse) SetTraceId(v string)` ``` -------------------------------- ### RequestId Methods Source: https://github.com/contabo/cntb/blob/main/openapi/docs/ObjectStorageAuditResponse.md Provides methods to get, get with existence check, and set the RequestId field. ```APIDOC ## GetRequestId ### Description GetRequestId returns the RequestId field if non-nil, zero value otherwise. ### Signature `func (o *ObjectStorageAuditResponse) GetRequestId() string` ## GetRequestIdOk ### Description GetRequestIdOk returns a tuple with the RequestId field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### Signature `func (o *ObjectStorageAuditResponse) GetRequestIdOk() (*string, bool)` ## SetRequestId ### Description SetRequestId sets RequestId field to given value. ### Signature `func (o *ObjectStorageAuditResponse) SetRequestId(v string)` ``` -------------------------------- ### Get Instances with Different Output Formats Source: https://context7.com/contabo/cntb/llms.txt Demonstrates how to retrieve instance data using different output formats like table, wide table, and JSON. Useful for scripting and automation. ```sh # Default table output cntb get instances ``` ```sh # Wide table (more columns) cntb get instances -o wide ``` ```sh # Raw JSON output cntb get instances -o json ``` -------------------------------- ### ReplayCheck Go Example Source: https://github.com/contabo/cntb/blob/main/openapi/docs/InternalCheckReplayApi.md Demonstrates how to use the ReplayCheck method to replay changes for a check. Ensure you have the necessary client and configuration set up. The X-Request-Id is mandatory for support case identification. ```go package main import ( "context" "fmt" "os" openapiclient "./openapi" ) func main() { xRequestId := "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. checksReplayRequest := *openapiclient.NewChecksReplayRequest("cntb", "DE-123") // ChecksReplayRequest | xTraceId := "xTraceId_example" // string | Identifier to trace group of requests. (optional) configuration := openapiclient.NewConfiguration() api_client := openapiclient.NewAPIClient(configuration) resp, r, err := api_client.InternalCheckReplayApi.ReplayCheck(context.Background()).XRequestId(xRequestId).ChecksReplayRequest(checksReplayRequest).XTraceId(xTraceId).Execute() if err != nil { fmt.Fprintf(os.Stderr, "Error when calling `InternalCheckReplayApi.ReplayCheck``: %v\n", err) fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r) } // response from `ReplayCheck`: ReplayResponse fmt.Fprintf(os.Stdout, "Response from `InternalCheckReplayApi.ReplayCheck`: %v\n", resp) } ``` -------------------------------- ### Username Methods Source: https://github.com/contabo/cntb/blob/main/openapi/docs/ObjectStorageAuditResponse.md Provides methods to get, get with existence check, and set the Username field. ```APIDOC ## GetUsername ### Description GetUsername returns the Username field if non-nil, zero value otherwise. ### Signature `func (o *ObjectStorageAuditResponse) GetUsername() string` ## GetUsernameOk ### Description GetUsernameOk returns a tuple with the Username field if it's non-nil, zero value otherwise and a boolean to check if the value has been set. ### Signature `func (o *ObjectStorageAuditResponse) GetUsernameOk() (*string, bool)` ## SetUsername ### Description SetUsername sets Username field to given value. ### Signature `func (o *ObjectStorageAuditResponse) SetUsername(v string)` ```