Return the datastores that can accommodate the new virtual disks
based on the provided attributes.
The action will fail on these scenarios:
* The instance does not exist. (404)
* The provided cores are more than the available cores of instance
node. (422)
* The provided memory is greater than the available memory. (422)
* The provided memory is less than the minimum mem. of instance's
image. (422)
* The provided disk size is less than the minimum disk size of
instance's image. (422)
* The provided disk size is less than the disk size of instance.
We permit only disk expansion. (422)
curl -X GET "http://docs.sunlight.io/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();
Integer instanceId = 56; // Integer | 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 {
inline_response_200_4 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();
Integer instanceId = 56; // Integer | 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 {
inline_response_200_4 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();
}
}
}
Integer *instanceId = 56; // 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.
Integer *vcpus = 56; // The new cores of the instance.
Integer *memoryMb = 56; // The new memory of the instance.
Integer *rootDiskGb = 56; // The root disk size of the instance.
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 list of available datastores of instance for new extra disks will be
used on resize.
[apiInstance instancesInstanceIdResizeDatastoresGetWith:instanceId
flavorId:flavorId
vcpus:vcpus
memoryMb:memoryMb
rootDiskGb:rootDiskGb
extraDisk1Gb:extraDisk1Gb
extraDisk2Gb:extraDisk2Gb
completionHandler: ^(inline_response_200_4 output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var SunlightDashboard = require('sunlight_dashboard');
var api = new SunlightDashboard.InstancesApi()
var instanceId = 56; // {Integer} 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.
var vcpus = 56; // {Integer} The new cores of the instance.
var memoryMb = 56; // {Integer} The new memory of the instance.
var rootDiskGb = 56; // {Integer} The root disk size of the instance.
var opts = {
'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(instanceIdflavorId, vcpus, memoryMb, rootDiskGb, 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 = 56; // Integer | 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.
var vcpus = 56; // Integer | The new cores of the instance.
var memoryMb = 56; // Integer | The new memory of the instance.
var rootDiskGb = 56; // Integer | The root disk size of the instance.
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 list of available datastores of instance for new extra disks will be
used on resize.
inline_response_200_4 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\Api\InstancesApi();
$instanceId = 56; // Integer | 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 = 56; # Integer | 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 = 56 # Integer | 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). (optional)
extraDisk2Gb = 56 # Integer | The extra disk 2 size of the instance (optional). (optional)
try:
# Get list of available datastores of instance for new extra disks will be
used on resize.
api_response = api_instance.instances_instance_id_resize_datastores_get(instanceId, flavorId, vcpus, memoryMb, rootDiskGb, extraDisk1Gb=extraDisk1Gb, extraDisk2Gb=extraDisk2Gb)
pprint(api_response)
except ApiException as e:
print("Exception when calling InstancesApi->instancesInstanceIdResizeDatastoresGet: %s\n" % e)
{code=404, message=Resource with id 1123 does not exist.}
{code=422, message=Validation failed}