Skip to content

Latest commit

 

History

History
494 lines (351 loc) · 22.7 KB

InstancesApi.md

File metadata and controls

494 lines (351 loc) · 22.7 KB

OpenAPI\Client\InstancesApi

All URIs are relative to https://api.contabo.com, except if the operation defines another base path.

Method HTTP request Description
cancelInstance() POST /v1/compute/instances/{instanceId}/cancel Cancel specific instance by id
createInstance() POST /v1/compute/instances Create a new instance
patchInstance() PATCH /v1/compute/instances/{instanceId} Update specific instance
reinstallInstance() PUT /v1/compute/instances/{instanceId} Reinstall specific instance
retrieveInstance() GET /v1/compute/instances/{instanceId} Get specific instance by id
retrieveInstancesList() GET /v1/compute/instances List instances
upgradeInstance() POST /v1/compute/instances/{instanceId}/upgrade Upgrading instance capabilities

cancelInstance()

cancelInstance($x_request_id, $instance_id, $x_trace_id): \OpenAPI\Client\Model\CancelInstanceResponse

Cancel specific instance by id

Your are free to cancel a previously created instance at any time.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\InstancesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$x_request_id = 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.
$instance_id = 12345; // int | The identifier of the instance
$x_trace_id = 'x_trace_id_example'; // string | Identifier to trace group of requests.

try {
    $result = $apiInstance->cancelInstance($x_request_id, $instance_id, $x_trace_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InstancesApi->cancelInstance: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
x_request_id string Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually.
instance_id int The identifier of the instance
x_trace_id string Identifier to trace group of requests. [optional]

Return type

\OpenAPI\Client\Model\CancelInstanceResponse

Authorization

bearer

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createInstance()

createInstance($x_request_id, $create_instance_request, $x_trace_id): \OpenAPI\Client\Model\CreateInstanceResponse

Create a new instance

Create a new instance for your account with the provided parameters.

ProductIdProductDisk Size
V45VPS 1 SSD400 GB SSD
V47VPS 1 Storage800 GB SSD
V46VPS 1 NVMe100 GB NVMe
V48VPS 2 SSD400 GB SSD
V50VPS 2 Storage800 GB SSD
V49VPS 2 NVMe200 GB NVMe
V51VPS 3 SSD1200 GB SSD
V53VPS 3 Storage2400 GB SSD
V52VPS 3 NVMe300 GB NVMe
V54VPS 4 SSD1600 GB SSD
V56VPS 4 Storage3200 GB SSD
V55VPS 4 NVMe400 GB NVMe
V57VPS 5 SSD2000 GB SSD
V59VPS 5 Storage4000 GB SSD
V58VPS 5 NVMe500 GB NVMe
V60VPS 6 SSD2400 GB SSD
V62VPS 6 Storage4800 GB SSD
V61VPS 6 NVMe600 GB NVMe
V8VDS S180 GB NVMe
V9VDS M240 GB NVMe
V10VDS L360 GB NVMe
V11VDS XL480 GB NVMe
V16VDS XXL720 GB NVMe

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\InstancesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$x_request_id = 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.
$create_instance_request = new \OpenAPI\Client\Model\CreateInstanceRequest(); // \OpenAPI\Client\Model\CreateInstanceRequest
$x_trace_id = 'x_trace_id_example'; // string | Identifier to trace group of requests.

try {
    $result = $apiInstance->createInstance($x_request_id, $create_instance_request, $x_trace_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InstancesApi->createInstance: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
x_request_id string Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually.
create_instance_request \OpenAPI\Client\Model\CreateInstanceRequest
x_trace_id string Identifier to trace group of requests. [optional]

Return type

\OpenAPI\Client\Model\CreateInstanceResponse

Authorization

bearer

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

patchInstance()

patchInstance($x_request_id, $instance_id, $patch_instance_request, $x_trace_id): \OpenAPI\Client\Model\PatchInstanceResponse

Update specific instance

Update specific instance by instanceId.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\InstancesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$x_request_id = 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.
$instance_id = 12345; // int | The identifier of the instance
$patch_instance_request = new \OpenAPI\Client\Model\PatchInstanceRequest(); // \OpenAPI\Client\Model\PatchInstanceRequest
$x_trace_id = 'x_trace_id_example'; // string | Identifier to trace group of requests.

try {
    $result = $apiInstance->patchInstance($x_request_id, $instance_id, $patch_instance_request, $x_trace_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InstancesApi->patchInstance: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
x_request_id string Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually.
instance_id int The identifier of the instance
patch_instance_request \OpenAPI\Client\Model\PatchInstanceRequest
x_trace_id string Identifier to trace group of requests. [optional]

Return type

\OpenAPI\Client\Model\PatchInstanceResponse

Authorization

bearer

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

reinstallInstance()

reinstallInstance($x_request_id, $instance_id, $reinstall_instance_request, $x_trace_id): \OpenAPI\Client\Model\ReinstallInstanceResponse

Reinstall specific instance

You can reinstall a specific instance with a new image and optionally add ssh keys, a root password or cloud-init.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\InstancesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$x_request_id = 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.
$instance_id = 12345; // int | The identifier of the instance
$reinstall_instance_request = new \OpenAPI\Client\Model\ReinstallInstanceRequest(); // \OpenAPI\Client\Model\ReinstallInstanceRequest
$x_trace_id = 'x_trace_id_example'; // string | Identifier to trace group of requests.

try {
    $result = $apiInstance->reinstallInstance($x_request_id, $instance_id, $reinstall_instance_request, $x_trace_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InstancesApi->reinstallInstance: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
x_request_id string Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually.
instance_id int The identifier of the instance
reinstall_instance_request \OpenAPI\Client\Model\ReinstallInstanceRequest
x_trace_id string Identifier to trace group of requests. [optional]

Return type

\OpenAPI\Client\Model\ReinstallInstanceResponse

Authorization

bearer

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

retrieveInstance()

retrieveInstance($x_request_id, $instance_id, $x_trace_id): \OpenAPI\Client\Model\FindInstanceResponse

Get specific instance by id

Get attributes values to a specific instance on your account.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\InstancesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$x_request_id = 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.
$instance_id = 12345; // int | The identifier of the instance
$x_trace_id = 'x_trace_id_example'; // string | Identifier to trace group of requests.

try {
    $result = $apiInstance->retrieveInstance($x_request_id, $instance_id, $x_trace_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InstancesApi->retrieveInstance: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
x_request_id string Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually.
instance_id int The identifier of the instance
x_trace_id string Identifier to trace group of requests. [optional]

Return type

\OpenAPI\Client\Model\FindInstanceResponse

Authorization

bearer

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

retrieveInstancesList()

retrieveInstancesList($x_request_id, $x_trace_id, $page, $size, $order_by, $name, $display_name, $data_center, $region, $instance_id, $instance_ids, $status, $add_on_ids, $product_types, $ip_config, $search): \OpenAPI\Client\Model\ListInstancesResponse

List instances

List and filter all instances in your account

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\InstancesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$x_request_id = 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.
$x_trace_id = 'x_trace_id_example'; // string | Identifier to trace group of requests.
$page = 1; // int | Number of page to be fetched.
$size = 10; // int | Number of elements per page.
$order_by = name:asc; // string[] | Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC|DESC`.
$name = vmd12345; // string | The name of the instance
$display_name = myTestInstance; // string | The display name of the instance
$data_center = European Union 1; // string | The data center of the instance
$region = EU; // string | The Region of the instance
$instance_id = 100; // int | The identifier of the instance (deprecated)
$instance_ids = 100, 101, 102; // string | Comma separated instances identifiers
$status = provisioning,installing; // string | The status of the instance
$add_on_ids = 1044,827; // string | Identifiers of Addons the instances have
$product_types = ssd, hdd, nvme; // string | Comma separated instance's category depending on Product Id
$ip_config = true; // bool | Filter instances that have an ip config
$search = vmd12345; // string | Full text search when listing the instances. Can be searched by `name`, `displayName`, `ipAddress`

try {
    $result = $apiInstance->retrieveInstancesList($x_request_id, $x_trace_id, $page, $size, $order_by, $name, $display_name, $data_center, $region, $instance_id, $instance_ids, $status, $add_on_ids, $product_types, $ip_config, $search);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InstancesApi->retrieveInstancesList: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
x_request_id string Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually.
x_trace_id string Identifier to trace group of requests. [optional]
page int Number of page to be fetched. [optional]
size int Number of elements per page. [optional]
order_by string[] Specify fields and ordering (ASC for ascending, DESC for descending) in following format `field:ASC DESC`.
name string The name of the instance [optional]
display_name string The display name of the instance [optional]
data_center string The data center of the instance [optional]
region string The Region of the instance [optional]
instance_id int The identifier of the instance (deprecated) [optional]
instance_ids string Comma separated instances identifiers [optional]
status string The status of the instance [optional]
add_on_ids string Identifiers of Addons the instances have [optional]
product_types string Comma separated instance's category depending on Product Id [optional]
ip_config bool Filter instances that have an ip config [optional]
search string Full text search when listing the instances. Can be searched by `name`, `displayName`, `ipAddress` [optional]

Return type

\OpenAPI\Client\Model\ListInstancesResponse

Authorization

bearer

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

upgradeInstance()

upgradeInstance($x_request_id, $instance_id, $upgrade_instance_request, $x_trace_id): \OpenAPI\Client\Model\PatchInstanceResponse

Upgrading instance capabilities

In order to enhance your instance with additional features you can purchase add-ons. Currently only firewalling and private network addon is allowed.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure Bearer (JWT) authorization: bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new OpenAPI\Client\Api\InstancesApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$x_request_id = 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.
$instance_id = 12345; // int | The identifier of the instance
$upgrade_instance_request = new \OpenAPI\Client\Model\UpgradeInstanceRequest(); // \OpenAPI\Client\Model\UpgradeInstanceRequest
$x_trace_id = 'x_trace_id_example'; // string | Identifier to trace group of requests.

try {
    $result = $apiInstance->upgradeInstance($x_request_id, $instance_id, $upgrade_instance_request, $x_trace_id);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling InstancesApi->upgradeInstance: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
x_request_id string Uuid4 to identify individual requests for support cases. You can use uuidgenerator to generate them manually.
instance_id int The identifier of the instance
upgrade_instance_request \OpenAPI\Client\Model\UpgradeInstanceRequest
x_trace_id string Identifier to trace group of requests. [optional]

Return type

\OpenAPI\Client\Model\PatchInstanceResponse

Authorization

bearer

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]