Retrieves the available datastores for instance resize. Different datastores are returned
for extra disk 1 and extra disk 2 based on the provided attributes.
curl -X GET\
-H "Accept: application/json,text/plain"\
"/api/instances/{instance_id}/resize/datastores?flavor_id=&vcpus=&memory_mb=&root_disk_gb=&extra_disk_1_gb=&extra_disk_2_gb="
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.InstancesApi;
import java.io.File;
import java.util.*;
public class InstancesApiExample {
public static void main(String[] args) {
InstancesApi apiInstance = new InstancesApi();
Long instanceId = 789; // Long | The instance id.
Integer flavorId = 56; // Integer | The new flavor ID of the instance. If it is empty, then the parameters vcpus, memory_mb, and root_disk_gb must be contained in the query.
Integer vcpus = 56; // Integer | The new cores of the instance.
Integer memoryMb = 56; // Integer | The new memory of the instance.
Integer rootDiskGb = 56; // Integer | The root disk size of the instance.
Integer extraDisk1Gb = 56; // Integer | The extra disk 1 size of the instance (optional).
Integer extraDisk2Gb = 56; // Integer | The extra disk 2 size of the instance (optional).
try {
InstanceResizeDatastores result = apiInstance.instancesInstanceIdResizeDatastoresGet(instanceId, flavorId, vcpus, memoryMb, rootDiskGb, extraDisk1Gb, extraDisk2Gb);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InstancesApi#instancesInstanceIdResizeDatastoresGet");
e.printStackTrace();
}
}
}
import io.swagger.client.api.InstancesApi;
public class InstancesApiExample {
public static void main(String[] args) {
InstancesApi apiInstance = new InstancesApi();
Long instanceId = 789; // Long | The instance id.
Integer flavorId = 56; // Integer | The new flavor ID of the instance. If it is empty, then the parameters vcpus, memory_mb, and root_disk_gb must be contained in the query.
Integer vcpus = 56; // Integer | The new cores of the instance.
Integer memoryMb = 56; // Integer | The new memory of the instance.
Integer rootDiskGb = 56; // Integer | The root disk size of the instance.
Integer extraDisk1Gb = 56; // Integer | The extra disk 1 size of the instance (optional).
Integer extraDisk2Gb = 56; // Integer | The extra disk 2 size of the instance (optional).
try {
InstanceResizeDatastores result = apiInstance.instancesInstanceIdResizeDatastoresGet(instanceId, flavorId, vcpus, memoryMb, rootDiskGb, extraDisk1Gb, extraDisk2Gb);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling InstancesApi#instancesInstanceIdResizeDatastoresGet");
e.printStackTrace();
}
}
}
Long *instanceId = 789; // The instance id.
Integer *flavorId = 56; // The new flavor ID of the instance. If it is empty, then the parameters vcpus, memory_mb, and root_disk_gb must be contained in the query. (optional)
Integer *vcpus = 56; // The new cores of the instance. (optional)
Integer *memoryMb = 56; // The new memory of the instance. (optional)
Integer *rootDiskGb = 56; // The root disk size of the instance. (optional)
Integer *extraDisk1Gb = 56; // The extra disk 1 size of the instance (optional). (optional)
Integer *extraDisk2Gb = 56; // The extra disk 2 size of the instance (optional). (optional)
InstancesApi *apiInstance = [[InstancesApi alloc] init];
// Get the available datastores for instance resize
[apiInstance instancesInstanceIdResizeDatastoresGetWith:instanceId
flavorId:flavorId
vcpus:vcpus
memoryMb:memoryMb
rootDiskGb:rootDiskGb
extraDisk1Gb:extraDisk1Gb
extraDisk2Gb:extraDisk2Gb
completionHandler: ^(InstanceResizeDatastores output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var Sim2Api = require('sim2_api');
var api = new Sim2Api.InstancesApi()
var instanceId = 789; // {{Long}} The instance id.
var opts = {
'flavorId': 56, // {{Integer}} The new flavor ID of the instance. If it is empty, then the parameters vcpus, memory_mb, and root_disk_gb must be contained in the query.
'vcpus': 56, // {{Integer}} The new cores of the instance.
'memoryMb': 56, // {{Integer}} The new memory of the instance.
'rootDiskGb': 56, // {{Integer}} The root disk size of the instance.
'extraDisk1Gb': 56, // {{Integer}} The extra disk 1 size of the instance (optional).
'extraDisk2Gb': 56 // {{Integer}} The extra disk 2 size of the instance (optional).
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.instancesInstanceIdResizeDatastoresGet(instanceId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class instancesInstanceIdResizeDatastoresGetExample
{
public void main()
{
var apiInstance = new InstancesApi();
var instanceId = 789; // Long | The instance id.
var flavorId = 56; // Integer | The new flavor ID of the instance. If it is empty, then the parameters vcpus, memory_mb, and root_disk_gb must be contained in the query. (optional)
var vcpus = 56; // Integer | The new cores of the instance. (optional)
var memoryMb = 56; // Integer | The new memory of the instance. (optional)
var rootDiskGb = 56; // Integer | The root disk size of the instance. (optional)
var extraDisk1Gb = 56; // Integer | The extra disk 1 size of the instance (optional). (optional)
var extraDisk2Gb = 56; // Integer | The extra disk 2 size of the instance (optional). (optional)
try
{
// Get the available datastores for instance resize
InstanceResizeDatastores result = apiInstance.instancesInstanceIdResizeDatastoresGet(instanceId, flavorId, vcpus, memoryMb, rootDiskGb, extraDisk1Gb, extraDisk2Gb);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling InstancesApi.instancesInstanceIdResizeDatastoresGet: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiInstancesApi();
$instanceId = 789; // Long | The instance id.
$flavorId = 56; // Integer | The new flavor ID of the instance. If it is empty, then the parameters vcpus, memory_mb, and root_disk_gb must be contained in the query.
$vcpus = 56; // Integer | The new cores of the instance.
$memoryMb = 56; // Integer | The new memory of the instance.
$rootDiskGb = 56; // Integer | The root disk size of the instance.
$extraDisk1Gb = 56; // Integer | The extra disk 1 size of the instance (optional).
$extraDisk2Gb = 56; // Integer | The extra disk 2 size of the instance (optional).
try {
$result = $api_instance->instancesInstanceIdResizeDatastoresGet($instanceId, $flavorId, $vcpus, $memoryMb, $rootDiskGb, $extraDisk1Gb, $extraDisk2Gb);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling InstancesApi->instancesInstanceIdResizeDatastoresGet: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::InstancesApi;
my $api_instance = WWW::SwaggerClient::InstancesApi->new();
my $instanceId = 789; # Long | The instance id.
my $flavorId = 56; # Integer | The new flavor ID of the instance. If it is empty, then the parameters vcpus, memory_mb, and root_disk_gb must be contained in the query.
my $vcpus = 56; # Integer | The new cores of the instance.
my $memoryMb = 56; # Integer | The new memory of the instance.
my $rootDiskGb = 56; # Integer | The root disk size of the instance.
my $extraDisk1Gb = 56; # Integer | The extra disk 1 size of the instance (optional).
my $extraDisk2Gb = 56; # Integer | The extra disk 2 size of the instance (optional).
eval {
my $result = $api_instance->instancesInstanceIdResizeDatastoresGet(instanceId => $instanceId, flavorId => $flavorId, vcpus => $vcpus, memoryMb => $memoryMb, rootDiskGb => $rootDiskGb, extraDisk1Gb => $extraDisk1Gb, extraDisk2Gb => $extraDisk2Gb);
print Dumper($result);
};
if ($@) {
warn "Exception when calling InstancesApi->instancesInstanceIdResizeDatastoresGet: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.InstancesApi()
instanceId = 789 # Long | The instance id.
flavorId = 56 # Integer | The new flavor ID of the instance. If it is empty, then the parameters vcpus, memory_mb, and root_disk_gb must be contained in the query. (optional)
vcpus = 56 # Integer | The new cores of the instance. (optional)
memoryMb = 56 # Integer | The new memory of the instance. (optional)
rootDiskGb = 56 # Integer | The root disk size of the instance. (optional)
extraDisk1Gb = 56 # Integer | The extra disk 1 size of the instance (optional). (optional)
extraDisk2Gb = 56 # Integer | The extra disk 2 size of the instance (optional). (optional)
try:
# Get the available datastores for instance resize
api_response = api_instance.instances_instance_id_resize_datastores_get(instanceId, flavorId=flavorId, vcpus=vcpus, memoryMb=memoryMb, rootDiskGb=rootDiskGb, extraDisk1Gb=extraDisk1Gb, extraDisk2Gb=extraDisk2Gb)
pprint(api_response)
except ApiException as e:
print("Exception when calling InstancesApi->instancesInstanceIdResizeDatastoresGet: %s\n" % e)
{"code":401,"message":"Unauthorized access."}
{"code":403,"message":"Unauthorized access."}
{"code":404,"message":"Not found."}
{"code":422,"message":"Validation failed","errors":[{"field":"description","message":"Description must be up to 50 characters long.","code":234532},{"field":"units","message":"Units cannot be negative.","code":234332}]}
{"code":500,"message":"Operation X did something wrong during processing"}