NAV Navbar
boto2 (py) boto3 (py) Ruby PHP (SDK) PHP (no SDK) Golang
  • Introduction
  • Authentication
  • Cloud Machines
  • Networking
  • Images & Regions
  • SSH Keys
  • Tags
  • Instance Types
  • Attribute Types
  • Errors
  • Introduction

    Welcome to the GigeNET API version 2. This API is more secure, provides greater flexibility as well as compatibility with a large range of tools and SDKs. We recommend that all new integrations are built using this API.

    This API version has been designed to be compatible to as large degree as possible with the Amazon Webservices API focusing primarily on the so-called Elastic Compute Cloud API. Compatibility with this API means that you can use the many different SDK available for different languages to interface with GigeNET's API just as you would Amazon web services. Some tools written for AWS might work without modification for use with our API, while others might require minimal changes. In addition to that, you can of course also set-up requests and connections directly to our API by easily implementing the interface yourself.

    This guide is meant for you to aquaint yourself with the subset of the AWS API that we implement. You can also reference with the AWS API for more details, though beware that our API might ignore certain parameters specified in the AWS API documentation if they are incompatible or have no meaning with regards to our infrastructure.

    Overview of API

    For each API request you construct a query string which is then cryptographically signed using your authentication details. The API will process your request and then either return an error, a return of value or data set based on your API action. You can provide arguments to the API either as part of the query string or via parameters sent as part of the request body.

    Return values are returned as an XML document, containing the specified return values for each API function. If you need more examples of how the return values might look you can always also refer to the AWS API documentation for the corresponding API function call.

    In case of errors, you will receive an HTTP error return code (400, 401 or 500) along with an XML document describing the error.

    The GigeNET API server URL is https://api.thegcloud.com. All API actions should be sent to the API server URL.

    Supported AWS SDKs

    All standard AWS SDKs should work with the API. Compatibility has been verified for the following:

    Other SDKs can be found on the AWS pages.

    Installing the SDK

    # Install pip if required
    easy_install pip
    
    # Install the boto2 SDK
    pip install boto
    
    # Install pip if required
    easy_install pip
    
    # Install the boto2 SDK
    pip install boto3
    
    # Install composer
    curl -sS https://getcomposer.org/installer | php
    
    # Install the latest AWS SDK
    php composer.phar require aws/aws-sdk-php
    
    # Install the latest AWS SDK
    gem install aws-sdk
    
    // Install the GigeNET API library for Golang
    go get github.com/gigenet-projects/gcloud-golang-api/api
    

    The SDKs can be installed using the standard package managers for your chosen languages.

    Even though using one of these SDKs is the simplest way to access the API, you can also manually use the REST API using custom code to create integrations without an SDK. In this documentation we have provied some examples of how to authenticate and make API calls without using an SDK.

    Creating API tokens

    Before you can use the API, you will need to enable it, create a new API applications and generate API keys which you will then be using to authenticate with the API. You can access the API settings rom the GigeNET client dashboard.

    Step 1. Create a new API application in the GigeNET client dashboard.

    Create an application

    Updating application details

    Step 2. Enable the use of the GigeNET API in your API settings.

    Enabling the API

    Step 3. Now click "Update API Key and Hash" to obtain your API key and hash code.

    Update API token and hash

    You know have full access to the API.

    Connecting to the API

    import boto
    
    conn = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    import boto3
    
    conn = boto3.client('ec2', 
            endpoint_url='https://api.thegcloud.com', 
            aws_access_key_id='APIKEY', 
            aws_secret_access_key='APIHASH', 
            region_name='ord1');
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    <?php
    /** 
    * This example illustrates how to generate a signed URL to make an API request
    * without depending on any external libraries.
    */
    
    /**
    * Generates an API signature for a given request using the V2 signature method.
    */
    function signV2($method, $host, $uri, $qs, $signature_method, $secret_key) {
      $canonicalRequest = "$method\n$host\n$uri\n$qs";
      $signature_algos = 
            array('HmacSHA256' => 'sha256', 'HmacSHA1' => 'sha1' );
    
      return base64_encode(
        hash_hmac($signature_algos[$signature_method],
        $canonicalRequest,
        $secret_key,
        true));
    }
    /**
     * Constructs an API request URL
     */
    function apiRequestURL($endpoint, $access_key, $secret_key, $Action, $Parameters) {
      $timestamp = new DateTime();
      $api_endpoint = parse_url($endpoint);
    
      if(!isset($api_endpoint['host']))
        throw new Exception('Invalid endpoint URL provided');
      if(!isset($api_endpoint['scheme']))
        $api_endpoint['scheme'] = 'http';
      if(!isset($api_endpoint['path']))
        $api_endpoint['path'] = '/';
    
      $qs = 'AWSKeyId='.$access_key
        .'&Action='.$Action
        .'&SignatureMethod=HmacSHA256'
        .'&SignatureVersion=2'
        .'&Timestamp='.urlencode($timestamp->format("c"))
        .$Parameters;
    
      return $api_endpoint['scheme'].'://'.$api_endpoint['host'].'?'.$qs
        .'&Signature='.urlencode(
          signV2('GET',
              $api_endpoint['host'],
              $api_endpoint['path'],
              $qs,
              'HmacSHA256',
              $secret_key));
    }
    
    $api_url = 'https://api.thegcloud.com';
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    
    $url = apiRequestUrl($api_url, $access_key, $secret_key, 'APIACTION', '&Param1=Val&Param2=Val');
    
    // $url can now be fetched using GET HTTP Request
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Resource.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    package main
    
    import (
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
    )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
    }
    

    Make sure to replace APIKEY with your API key and APIHASH with your API hash from the API settings page.

    Once you have an API key and hash you can use them together with the SDK of your choice, or generated signed requests through your own code. Sample code for connecting to the API is available on the left.

    Authentication

    All requests to the API are required to be cryptographically signed. By first generating the request parameters and then applying a cryptographic hash function to the request before you send it you prove that the request really originated from you. In this way, we can verify the request but we can also ensure that expired requests are not re-used in case somebody gets access to the request.

    The signed requests are authenticated without transferring any secrets over the network, this means that while we recommend you always use HTTPS to ensure an SSL/TLS encrypted connection to the API, the request URLs themselves are not secret. The API hash/secret key should never be transferred over the network and should remain with you locally. Each request also has a timestamp or an expiry date affixed to it, meaning that if you want you can pre-create and pre-sign requests for a later date. Remember though that a signed request will be accepted by our servers as originating from you - if you pre-create signed URLs and subsequently loose control of them you will need to reset the API token.

    We support the same process of signing requests as the Amazon Web Services API with both the V2 and V4 signing process supported. This means that you can follow their guide with regards to how to sign requests: http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html.

    You can also generate new time limited secrets and access tokens using the GetSessionToken API call (described below). This is useful if you want to generate temporary credentials which can be used in exactly the same way as normal credentials. If you are using a temporary session token, you will need to attach it to every request as described in the AWS API documentation.

    Signing schemes

    You can use either the AWS V2 or V4 signing process to send requests to our API. The V2 process generates a signature and appends it as a query string parameter, while the V4 process uses an Authorization header. The V4 process is the recommended one and is the one that all SDKs support.

    Sample V2 signed request URL:

    https://api.thegcloud.com?&AWSAccessKeyId=APIKEY&Action=DescribeInstances&SignatureMethod=HmacSHA256&SignatureVersion=2&Timestamp=2011-10-03T15%3A19%3A30&Version=2009-03-31&Signature=calculated value

    Sample V4 Authorization header:

    Authorization: AWS4-HMAC-SHA256 Credential=APIKEY/20180304/ord1/ec2/aws4_request, SignedHeaders=content-type;host;x-amz-content-sha256;x-amz-date, Signature=calculated value

    In the AWS API documentation you can find extensive details on how to generate a V2 signature or a V4 signature.

    Session Tokens

    import boto
    import boto.sts
    from boto.regioninfo import RegionInfo
    
    sts = boto.sts.STSConnection(aws_access_key_id='APIKEY',
                                 aws_secret_access_key='APIHASH',
                                 is_secure=True,
                                 path='/'
                                 region=RegionInfo(name='ord1', 
                                          endpoint='api.thegcloud.com'))
    
    session = sts.get_session_token()
    
    import boto3
    
    sts = boto3.client('sts',
            endpoint_url='https://api.thegcloud.com',
            aws_access_key_id='APIKEY',
            aws_secret_access_key='APIHASH',
            region_name='ord1');
    
    session = sts.get_session_token()
    
    require 'aws-sdk'
    
    sts = Aws::STS::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH',
      http_wire_trace: true
    )
    
    session = sts.get_session_token()
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Sts\StsClient;
    
    $stsClient = StsClient::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $session = $stsClient->GetSessionToken();
    
    <?php
    /** 
    * This example uses Guzzle which can be installed through composer: php composer.phar require guzzle/guzzle
    */
    require('vendor/autoload.php');
    
    Guzzle\Http\StaticClient::mount();
    
    /**
    * Generates an API signature for a given request using the V2 signature method.
    */
    function signV2($method, $host, $uri, $qs, $signature_method, $secret_key) {
      $canonicalRequest = "$method\n$host\n$uri\n$qs";
      $signature_algos = 
            array('HmacSHA256' => 'sha256', 'HmacSHA1' => 'sha1' );
    
      return base64_encode(
        hash_hmac($signature_algos[$signature_method],
        $canonicalRequest,
        $secret_key,
        true));
    }
    /**
     * Constructs an API request URL
     */
    function apiRequestURL($endpoint, $access_key, $secret_key, $Action, $Parameters) {
      $timestamp = new DateTime();
      $api_endpoint = parse_url($endpoint);
    
      if(!isset($api_endpoint['host']))
        throw new Exception('Invalid endpoint URL provided');
      if(!isset($api_endpoint['scheme']))
        $api_endpoint['scheme'] = 'http';
      if(!isset($api_endpoint['path']))
        $api_endpoint['path'] = '/';
    
      $qs = 'AWSKeyId='.$access_key
        .'&Action='.$Action
        .'&SignatureMethod=HmacSHA256'
        .'&SignatureVersion=2'
        .'&Timestamp='.urlencode($timestamp->format("c"));
    
      if(is_array($Parameters)) {
        foreach($params as $key => $value) {
          $qs .= "&".$key."=".urlencode($value);
        }
      } else {
        if(substr($Parameters, 0, 1) !== '&') $qs .= '&';
        $qs .= $Parameters;
      }
    
      return $api_endpoint['scheme'].'://'.$api_endpoint['host'].'?'.$qs
        .'&Signature='.urlencode(
          signV2('GET',
              $api_endpoint['host'],
              $api_endpoint['path'],
              $qs,
              'HmacSHA256',
              $secret_key));
    }
    /**
     * Executes an API request
     */
    function apiRequest($Action, $Parameters='') {
      global $api_url, $access_key, $secret_key;
      $res = Guzzle::get(apiRequestUrl($api_url, $access_key, $secret_key, $Action, $Parameters));
      return $res->getBody();
    }
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    $sessionXml = apiRequest('GetSessionToken');
    
    package main
    
    import (
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
    )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        token, err := client.GetSessionToken(3600)
    
        if err != nil {
            panic(err)
        }
    }
    

    To get time limited session tokens, we provide a small subset of the AWS STS API to allow you to generate time limited tokens. This can be useful in the scenario where you want a trusted service to provide tokens to less trusted services or user applications. As these tokens are time limited, there is less risk of issuing and providing these than there is in providing your main API credentials.

    The GetSessionToken API call returns XML like this:

    <?xml version="1.0" encoding="utf-8"?>
    <GetSessionTokenResponse>
      <GetSessionTokenResult>
        <Credentials>
          <SessionToken>SESSIONTOKEN</SessionToken>
          <SecretAccessKey>SECRETACCESSKEY</SecretAccessKey>
          <Expiration>2018-03-04T12:21:50+00:00</Expiration>
          <AccessKeyId>SESSIONACCESSKEY</AccessKeyId>
        </Credentials>
      </GetSessionTokenResult>
      <RequestID>12e6d6095ad5912a8b209e42e466afdb</RequestID>
    </GetSessionTokenResponse>
    

    Parameters

    Parameter Default Required Description
    DurationSeconds 3600 false The number of seconds that the token should be valid for, minimum 900 and maximum 129600.

    Cloud Machines

    Use this section of the API to create, run, start, stop, reboot and change any available settings for your Cloud Machines (VMs).

    DescribeInstanceAttribute

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    i = ec2.get_instance_attribute('1111', 'instanceType')
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.describe_instance_attribute(InstanceId='1111', Attribute='instanceType')
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.describe_instance_attribute({ instance_id: '1111', attribute: 'instanceType' })
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->describeInstanceAttribute(array('InstanceId' => '1111', 'Attribute' => 'instanceType'));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('DescribeInstanceAttribute', '&InstanceId=2632&Attribute=instanceType');
    
    package main
    
    import (
        "fmt"
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        attr, err := client.DescribeInstanceAttribute("hostname", "1111")
    
        if err != nil {
            panic(err)
        }
    
        fmt.Println(attr)
    }
    

    Sample DescribeInstanceAttribute XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <DescribeInstanceAttributeResponse>
        <instanceId>1111</instanceId>
        <instanceType>
            <value>custom_bal_1vcpu_384m_10gb</value>
        </instanceType>
        <RequestID>21cd8ec650fdfc7819465beae5bc48c8</RequestID>
    </DescribeInstanceAttributeResponse>
    

    Fetches a single property for an instance.

    Parameters

    NameTypeRequired?DefaultDescription
    Attribute string Y The attribute to describe. Can be instanceType, operatingSystem, hostname or you can fetch a graph using the following pattern: graph_(cpu|disk|network)_(hour|day|week|month|year), for example graph_cpu_month to get a monthly CPU graph.
    InstanceId string Y The VM/instance ID to describe.
    DryRun boolean N

    DescribeInstanceStatus

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    i = ec2.get_all_instance_status(instance_ids=['1111'])
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.describe_instance_status(InstanceIds=['1111'])
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.describe_instance_status({ instance_ids: ['1111'] })
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->describeInstanceStatus(array(
            'InstanceIds' => array('2632')));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('DescribeInstanceStatus', 'InstanceId.1=1111');
    
    
    package main
    
    import (
        "fmt"
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        status, err := client.DescribeInstanceStatus("1111")
    
        if err != nil {
            panic(err)
        }
    
        fmt.Println(status)
    }
    

    Sample DescribeInstanceStatus XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <DescribeInstanceStatusResponse>
      <instanceStatusSet>
        <item>
          <instanceId>2632</instanceId>
          <availabilityZone>ord1</availabilityZone>
          <instanceState>
            <code>0</code>
            <name>on</name>
          </instanceState>
          <systemStatus>
            <item>
              <status>ok</status>
              <details>
                <item>
                  <name>reachability</name>
                  <status>passed</status>
                </item>
              </details>
            </item>
          </systemStatus>
          <instanceStatus>
            <item>
              <status>ok</status>
              <details>
                <item>
                  <name>reachability</name>
                  <status>passed</status>
                </item>
              </details>
            </item>
          </instanceStatus>
          <eventsSet>
            <item>
              <code>instance-modify</code>
              <description>modify</description>
              <notAfter>2018-03-22T18:39:33+00:00</notAfter>
              <notBefore>2018-03-22T18:39:33+00:00</notBefore>
            </item>
          </eventsSet>
        </item>
      </instanceStatusSet>
      <RequestID>251415cd11fc9a2b5398af5d100cd049</RequestID>
    </DescribeInstanceStatusResponse>
    

    Describe the status for one or more instances.

    Parameters

    NameTypeRequired?DefaultDescription
    InstanceId stringlist N List of instances to describe. If omitted, describes all your instances/VMs.
    DryRun boolean N

    DescribeInstanceTypes

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    i = ec2.get_all_instance_types()
    
    # Not supported by this SDK
    
    # Not supported by this SDK
    
    # Not supported by this SDK
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('DescribeInstanceTypes', '');
    
    package main
    
    import (
        "fmt"
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        gcl, err := client.DescribeInstanceTypes("")
    
        if err != nil {
            panic(err)
        }
    
        for _, re := range gcl {
            fmt.Println(re)
        }
    }
    

    Sample DescribeInstanceTypes XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <DescribeInstanceTypesResponse>
      <instanceTypeSet>
        <item>
          <name>bal.lg</name>
          <cores>1</cores>
          <memory>2048</memory>
          <disk>40</disk>
        </item>
        <item>
          <name>bal.lg2</name>
          <cores>2</cores>
          <memory>4096</memory>
          <disk>40</disk>
        </item>
        <item>
          <name>bal.small</name>
          <cores>1</cores>
          <memory>512</memory>
          <disk>10</disk>
        </item>
        <item>
          <name>bal.xlg</name>
          <cores>2</cores>
          <memory>4096</memory>
          <disk>60</disk>
        </item>
        <item>
          <name>bal.xxlg</name>
          <cores>4</cores>
          <memory>8192</memory>
          <disk>80</disk>
        </item>
        <item>
          <name>client_1544-bal.small</name>
          <cores>1</cores>
          <memory>512</memory>
          <disk>10</disk>
        </item>
        <item>
          <name>cpu.lg</name>
          <cores>4</cores>
          <memory>3200</memory>
          <disk>60</disk>
        </item>
        <item>
          <name>cpu.med</name>
          <cores>3</cores>
          <memory>2176</memory>
          <disk>40</disk>
        </item>
        <item>
          <name>cpu.xxlg</name>
          <cores>8</cores>
          <memory>8192</memory>
          <disk>80</disk>
        </item>
        <item>
          <name>mem.lg</name>
          <cores>6</cores>
          <memory>11008</memory>
          <disk>80</disk>
        </item>
        <item>
          <name>mem.med</name>
          <cores>5</cores>
          <memory>10240</memory>
          <disk>60</disk>
        </item>
        <item>
          <name>mem.small</name>
          <cores>4</cores>
          <memory>8192</memory>
          <disk>30</disk>
        </item>
        <item>
          <name>mem.xlg</name>
          <cores>7</cores>
          <memory>14080</memory>
          <disk>80</disk>
        </item>
        <item>
          <name>mem.xxlg</name>
          <cores>8</cores>
          <memory>16384</memory>
          <disk>80</disk>
        </item>
        <item>
          <name>new.small</name>
          <cores>1</cores>
          <memory>512</memory>
          <disk>10</disk>
        </item>
        <item>
          <name>promo.bal.small</name>
          <cores>1</cores>
          <memory>1024</memory>
          <disk>30</disk>
        </item>
      </instanceTypeSet>
      <RequestID>c0d9f0db011b9019bac47898096a7735</RequestID>
    </DescribeInstanceTypesResponse>
    

    Describes one or more instance types.

    Parameters

    NameTypeRequired?DefaultDescription
    InstanceType stringlist N A list of instance types to describe. If omitted returns all instance types available.
    DryRun boolean N

    DescribeInstances

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    all = ec2.get_all_instances()
    i = ec2.get_only_instances(['1111', '1112'])
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    # Get all instances
    resp = ec2.describe_instances()
    
    # Describe single instance
    resp = ec2.describe_instances(InstanceIds=['2632'])
    
    
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    # Get all instances 
    i = ec2.describe_instances()
    
    # Describe a single instance
    i = ec2.describe_instances({ instance_ids: ['1111'] })
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    // Describe all instances 
    $ret = $ec2Client->describeInstances();
    
    // Describe one instance
    $ret = $ec2Client->describeInstances(array(
            'InstanceIds' => array('1111')));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    
    // Get all instances
    print apiRequest('DescribeInstances');
    
    // Get specific instance
    print apiRequest('DescribeInstances', 'InstanceId.1=2632');
    
    package main
    
    import (
        "fmt"
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
    )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        reservations, err := client.DescribeInstances("")
    
        if err != nil {
            panic(err)
        }
    
        for _, re := range reservations {
            for _, in := range re.Instances {
                fmt.Println(in)
            }
        }
    }
    

    Sample DescribeInstances XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <DescribeInstancesResponse>
      <reservationSet>
        <item>
          <ownerId>1479</ownerId>
          <instancesSet>
            <item>
              <imageId>centos64_6.4</imageId>
              <instanceId>2632</instanceId>
              <instanceType>custom_cpu_4vcpu_3200m_60gb</instanceType>
              <placement>
                <availabilityZone>ord1</availabilityZone>
              </placement>
              <launchTime>2018-03-20T18:17:59+00:00</launchTime>
              <privateDnsName>840bde.linus.kendal</privateDnsName>
              <privateIpAddress>10.60.235.153</privateIpAddress>
              <publicIpAddress>69.39.235.150</publicIpAddress>
              <state>
                <code>0</code>
                <name>on</name>
              </state>
              <subnetId>148</subnetId>
              <architecture>x86_64</architecture>
              <virtualizationType>hvm</virtualizationType>
              <rootDeviceName>/dev/sda1</rootDeviceName>
              <hypervisor>xenserver</hypervisor>
              <platform>Centos</platform>
              <tagSet>
                <item>
                  <key>testtag</key>
                </item>
                <item>
                  <key>rextag</key>
                </item>
                <item>
                  <key>rex_t-a:g</key>
                </item>
                <item>
                  <key>test</key>
                </item>
              </tagSet>
            </item>
          </instancesSet>
        </item>
      </reservationSet>
      <RequestID>b7de420a019667e5cec50028864aa459</RequestID>
    </DescribeInstancesResponse>
    

    Describe the full properties for one or more instances.

    Parameters

    NameTypeRequired?DefaultDescription
    InstanceId stringlist N List of instances to describe. If omitted, describes all your instances/VMs.
    Filter array (Members)
    NameTypeRequired?DefaultDescription
    Name string N
    Value stringlist Y

    N Filters to apply - supported filters include tag-key, tag-value, tag:tagName, instance-id
    DryRun boolean N

    DescribeReservedInstances

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    all = ec2.get_all_reserved_instances()
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.describe_reserved_instances()
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.describe_reserved_instances({})
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->describeReservedInstances();
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('DescribeReservedInstances', '');
    
    package main
    
    import (
        "fmt"
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
    )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        res, err := client.DescribeReservedInstances("")
    
        if err != nil {
            panic(err)
        }
    
        for _, r := range res {
            fmt.Println(r)
        }
    }
    

    Sample DescribeReservedInstances XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <DescribeReservedInstancesResponse>
      <reservedInstancesSet>
        <item>
          <reservedInstancesId>2759</reservedInstancesId>
          <instanceType>custom_bal_1vcpu_2048m_40gb</instanceType>
          <availabilityZone>ord1</availabilityZone>
          <usagePrice>0.08928571428571428</usagePrice>
          <instanceCount>1</instanceCount>
          <productDescription>Linux/UNIX</productDescription>
          <start>2018-03-21T12:28:24+00:00</start>
          <state>on</state>
          <instanceTenancy>default</instanceTenancy>
          <currencyCode>USD</currencyCode>
          <offeringType>Medium Utilization</offeringType>
          <recurringCharges/>
        </item>
        <item>
          <reservedInstancesId>2669</reservedInstancesId>
          <instanceType>custom_bal_1vcpu_512m_10gb</instanceType>
          <availabilityZone>ord1</availabilityZone>
          <usagePrice>0.02896461038889516</usagePrice>
          <instanceCount>1</instanceCount>
          <productDescription>Linux/UNIX</productDescription>
          <start>2018-03-20T18:17:58+00:00</start>
          <state>on</state>
          <instanceTenancy>default</instanceTenancy>
          <currencyCode>USD</currencyCode>
          <offeringType>Medium Utilization</offeringType>
          <recurringCharges/>
        </item>
        <item>
          <reservedInstancesId>2668</reservedInstancesId>
          <instanceType>custom_bal_1vcpu_512m_10gb</instanceType>
          <availabilityZone>ord1</availabilityZone>
          <usagePrice>0.02896461038889516</usagePrice>
          <instanceCount>1</instanceCount>
          <productDescription>Linux/UNIX</productDescription>
          <start>2018-03-20T18:17:45+00:00</start>
          <state>on</state>
          <instanceTenancy>default</instanceTenancy>
          <currencyCode>USD</currencyCode>
          <offeringType>Medium Utilization</offeringType>
          <recurringCharges/>
        </item>
        <item>
          <reservedInstancesId>2632</reservedInstancesId>
          <instanceType>custom_bal_1vcpu_384m_10gb</instanceType>
          <availabilityZone>ord1</availabilityZone>
          <usagePrice>0.01553986438648480</usagePrice>
          <instanceCount>1</instanceCount>
          <productDescription>Linux/UNIX</productDescription>
          <start>2018-03-20T18:17:59+00:00</start>
          <state>on</state>
          <instanceTenancy>default</instanceTenancy>
          <currencyCode>USD</currencyCode>
          <offeringType>Medium Utilization</offeringType>
          <recurringCharges/>
        </item>
        <item>
          <reservedInstancesId>2627</reservedInstancesId>
          <instanceType>custom_bal_1vcpu_512m_10gb</instanceType>
          <availabilityZone>ord1</availabilityZone>
          <usagePrice>0.00684900000000000</usagePrice>
          <instanceCount>1</instanceCount>
          <productDescription>Linux/UNIX</productDescription>
          <start>2018-01-17T22:30:37+00:00</start>
          <state>on</state>
          <instanceTenancy>default</instanceTenancy>
          <currencyCode>USD</currencyCode>
          <offeringType>Medium Utilization</offeringType>
          <recurringCharges/>
        </item>
        <item>
          <reservedInstancesId>2621</reservedInstancesId>
          <instanceType>custom_cpu_2vcpu_2048m_45gb</instanceType>
          <availabilityZone>ord1</availabilityZone>
          <usagePrice>0.05988775565242224</usagePrice>
          <instanceCount>1</instanceCount>
          <productDescription>Linux/UNIX</productDescription>
          <start>2018-01-16T18:48:40+00:00</start>
          <state>on</state>
          <instanceTenancy>default</instanceTenancy>
          <currencyCode>USD</currencyCode>
          <offeringType>Medium Utilization</offeringType>
          <recurringCharges/>
        </item>
        <item>
          <reservedInstancesId>2620</reservedInstancesId>
          <instanceType>custom_cpu_2vcpu_512m_10gb</instanceType>
          <availabilityZone>ord1</availabilityZone>
          <usagePrice>0.02455757339034518</usagePrice>
          <instanceCount>1</instanceCount>
          <productDescription>Linux/UNIX</productDescription>
          <start>2018-01-16T18:48:40+00:00</start>
          <state>on</state>
          <instanceTenancy>default</instanceTenancy>
          <currencyCode>USD</currencyCode>
          <offeringType>Medium Utilization</offeringType>
          <recurringCharges>
            <item>
              <amount>0.00138888889000000</amount>
              <frequency>Hourly</frequency>
              <desc>1 Additional IPs</desc>
            </item>
          </recurringCharges>
        </item>
        <item>
          <reservedInstancesId>2600</reservedInstancesId>
          <instanceType>custom_bal_1vcpu_2048m_40gb</instanceType>
          <availabilityZone>ord1</availabilityZone>
          <usagePrice>0.08669750343712217</usagePrice>
          <instanceCount>1</instanceCount>
          <productDescription>Linux/UNIX</productDescription>
          <start>2018-01-15T20:33:52+00:00</start>
          <state>on</state>
          <instanceTenancy>default</instanceTenancy>
          <currencyCode>USD</currencyCode>
          <offeringType>Medium Utilization</offeringType>
          <recurringCharges/>
        </item>
        <item>
          <reservedInstancesId>2599</reservedInstancesId>
          <instanceType>custom_bal_1vcpu_2048m_40gb</instanceType>
          <availabilityZone>ord1</availabilityZone>
          <usagePrice>0.01835599000000000</usagePrice>
          <instanceCount>1</instanceCount>
          <productDescription>Linux/UNIX</productDescription>
          <start>1970-01-01T00:00:00+00:00</start>
          <state>on</state>
          <instanceTenancy>default</instanceTenancy>
          <currencyCode>USD</currencyCode>
          <offeringType>Medium Utilization</offeringType>
          <recurringCharges/>
        </item>
        <item>
          <reservedInstancesId>2587</reservedInstancesId>
          <instanceType>custom_mem_6vcpu_11008m_80gb</instanceType>
          <availabilityZone>ord1</availabilityZone>
          <usagePrice>0.37845361580000000</usagePrice>
          <instanceCount>1</instanceCount>
          <productDescription>Linux/UNIX</productDescription>
          <start>2017-11-01T13:10:48+00:00</start>
          <state>on</state>
          <instanceTenancy>default</instanceTenancy>
          <currencyCode>USD</currencyCode>
          <offeringType>Medium Utilization</offeringType>
          <recurringCharges/>
        </item>
        <item>
          <reservedInstancesId>2583</reservedInstancesId>
          <instanceType>custom_bal_1vcpu_384m_4gb</instanceType>
          <availabilityZone>ord1</availabilityZone>
          <usagePrice>0.02339383963648480</usagePrice>
          <instanceCount>1</instanceCount>
          <productDescription>Linux/UNIX</productDescription>
          <start>2017-11-01T12:46:54+00:00</start>
          <state>on</state>
          <instanceTenancy>default</instanceTenancy>
          <currencyCode>USD</currencyCode>
          <offeringType>Medium Utilization</offeringType>
          <recurringCharges/>
        </item>
        <item>
          <reservedInstancesId>2525</reservedInstancesId>
          <instanceType>custom_bal_2vcpu_2304m_10gb</instanceType>
          <availabilityZone>ord1</availabilityZone>
          <usagePrice>0.10171102509280179</usagePrice>
          <instanceCount>1</instanceCount>
          <productDescription>Linux/UNIX</productDescription>
          <start>2016-09-09T14:51:47+00:00</start>
          <state>on</state>
          <instanceTenancy>default</instanceTenancy>
          <currencyCode>USD</currencyCode>
          <offeringType>Medium Utilization</offeringType>
          <recurringCharges/>
        </item>
        <item>
          <reservedInstancesId>2524</reservedInstancesId>
          <instanceType>custom_bal_1vcpu_2048m_25gb</instanceType>
          <availabilityZone>ord1</availabilityZone>
          <usagePrice>0.08669750343712217</usagePrice>
          <instanceCount>1</instanceCount>
          <productDescription>Linux/UNIX</productDescription>
          <start>2016-09-09T14:30:44+00:00</start>
          <state>on</state>
          <instanceTenancy>default</instanceTenancy>
          <currencyCode>USD</currencyCode>
          <offeringType>Medium Utilization</offeringType>
          <recurringCharges/>
        </item>
        <item>
          <reservedInstancesId>2522</reservedInstancesId>
          <instanceType>custom_bal_1vcpu_1024m_10gb</instanceType>
          <availabilityZone>ord1</availabilityZone>
          <usagePrice>0.04862036677268064</usagePrice>
          <instanceCount>1</instanceCount>
          <productDescription>Linux/UNIX</productDescription>
          <start>2016-07-29T19:37:28+00:00</start>
          <state>on</state>
          <instanceTenancy>default</instanceTenancy>
          <currencyCode>USD</currencyCode>
          <offeringType>Medium Utilization</offeringType>
          <recurringCharges/>
        </item>
        <item>
          <reservedInstancesId>2513</reservedInstancesId>
          <instanceType>custom_cpu_6vcpu_6000m_10gb</instanceType>
          <availabilityZone>ord1</availabilityZone>
          <usagePrice>0.25998123120000000</usagePrice>
          <instanceCount>1</instanceCount>
          <productDescription>Linux/UNIX</productDescription>
          <start>2016-07-08T16:40:30+00:00</start>
          <state>on</state>
          <instanceTenancy>default</instanceTenancy>
          <currencyCode>USD</currencyCode>
          <offeringType>Medium Utilization</offeringType>
          <recurringCharges/>
        </item>
        <item>
          <reservedInstancesId>2432</reservedInstancesId>
          <instanceType>custom_bal_1vcpu_512m_20gb</instanceType>
          <availabilityZone>ord1</availabilityZone>
          <usagePrice>0.03094783505594508</usagePrice>
          <instanceCount>1</instanceCount>
          <productDescription>Linux/UNIX</productDescription>
          <start>2015-10-29T23:04:27+00:00</start>
          <state>on</state>
          <instanceTenancy>default</instanceTenancy>
          <currencyCode>USD</currencyCode>
          <offeringType>Medium Utilization</offeringType>
          <recurringCharges>
            <item>
              <amount>0.50000000000000000</amount>
              <frequency>Hourly</frequency>
              <desc>VM#2432 - VM Snapshots</desc>
            </item>
          </recurringCharges>
        </item>
      </reservedInstancesSet>
      <RequestID>fbb8dafa86e7ba6204236e8a95a52d95</RequestID>
    </DescribeReservedInstancesResponse>
    

    Describe reservation details for one or more instances.

    Parameters

    NameTypeRequired?DefaultDescription
    ReservedInstancesId stringlist N List of instances to describe. If omitted, describes all your instances/VMs.
    Filter array (Members)
    NameTypeRequired?DefaultDescription
    Name string N
    Value stringlist Y

    N Filters to apply - supported filters include tag-key, tag-value, tag:tagName, reserved-instance-id
    DryRun boolean N

    DescribeVmTypes

    # This is an API call not available in boto2.
    
    # Not supported by this SDK
    
    # Not supported by this SDK
    
    # Not supported by this SDK
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('DescribeVmTypes');
    
    package main
    
    import (
        "fmt"
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        gcl, err := client.DescribeVmTypes("")
    
        if err != nil {
            panic(err)
        }
    
        for _, re := range gcl {
            fmt.Println(re)
        }
    }
    

    Sample DescribeVmTypes XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <DescribeVmTypesResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
        <instanceTypeSet>
            <item>
                <name>gcl.1</name>
                <cores>1</cores>
                <memory>1024</memory>
                <disk>30</disk>
            </item>
            <item>
                <name>gcl.2</name>
                <cores>1</cores>
                <memory>2048</memory>
                <disk>60</disk>
            </item>
            <item>
                <name>gcl.4</name>
                <cores>2</cores>
                <memory>4096</memory>
                <disk>90</disk>
            </item>
            <item>
                <name>gcl.8</name>
                <cores>4</cores>
                <memory>8192</memory>
                <disk>120</disk>
            </item>
            <item>
                <name>gcl.core.2</name>
                <cores>2</cores>
                <memory>2048</memory>
                <disk>60</disk>
            </item>
            <item>
                <name>gcl.core.4</name>
                <cores>4</cores>
                <memory>4096</memory>
                <disk>90</disk>
            </item>
            <item>
                <name>gcl.core.8</name>
                <cores>8</cores>
                <memory>8192</memory>
                <disk>180</disk>
            </item>
            <item>
                <name>gcl.max.8</name>
                <cores>2</cores>
                <memory>8192</memory>
                <disk>180</disk>
            </item>
            <item>
                <name>gcl.max.16</name>
                <cores>4</cores>
                <memory>16384</memory>
                <disk>360</disk>
            </item>
        </instanceTypeSet>
        <RequestID>d4e0b3938bac43f61dd933567c1416dd</RequestID>
    </DescribeVmTypesResponse>
    

    Describes one or more instance types.

    Parameters

    NameTypeRequired?DefaultDescription
    InstanceType stringlist N A list of instance types to describe. If omitted returns all instance types available.
    DryRun boolean N

    GetPasswordData

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    password_data = ec2.get_password_data('1111')
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.get_password_data(InstanceId='1111')
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.get_password_data({instance_id: "1111"})
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->getPasswordData(array(
            'InstanceId' => '1111'));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('GetPasswordData', '2632');
    
    package main
    
    import (
        "fmt"
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        pwd, err := client.GetPasswordData("1111")
    
        if err != nil {
            panic(err)
        }
    
        fmt.Println(pwd)
    }
    

    Sample GetPasswordData XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <GetPasswordDataResponse>
      <instanceId>1111</instanceId>
      <passwordData>password</passwordData>
      <RequestID>623e7465548c231e1634e824ba6fe549</RequestID>
    </GetPasswordDataResponse>
    

    Get encrypted administrator password for a Windows instance.

    Parameters

    NameTypeRequired?DefaultDescription
    InstanceId string Y List of instances to destroy.
    DryRun boolean N

    ModifyInstanceAttribute

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    ret = ec2.modify_instance_attribute('1111', 'instanceType', 'cpu.lg')
    
    ret = ec2.modify_instance_attribute('1111', 'password', 'this-is-ignored')
    
    ret = ec2.modify_instance_attribute('1111', 'hostname', 'new-hostname')
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.modify_instance_attribute(
        InstanceId='1111', 
        Attribute='instanceType',
        InstanceType='cpu.lg')
    
    resp = ec2.modify_instance_attribute(
        InstanceId='1111', 
        Attribute='password',
        Value='ignored')
    
    resp = ec2.modify_instance_attribute(
        InstanceId='1111', 
        Attribute='hostname',
        Value='new-hostname')
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.modify_instance_attribute({
        attribute: "instanceType",
        instance_id: "1111",
        instance_type: "cpu.lg"})
    
    i = ec2.modify_instance_attribute({
        attribute: "password",
        instance_id: "1111",
        value: "ignored"})
    
    i = ec2.modify_instance_attribute({
        attribute: "hostname",
        instance_id: "1111",
        value: "new-hostname"})
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->modifyInstanceAttribute(array(
            'InstanceId' => '1111',
            'Attribute' => 'instanceType',
            'InstanceType' => array('Value' => 'cpu.lg')));
    
    $ret = $ec2Client->modifyInstanceAttribute(array(
            'InstanceId' => '1111',
            'Attribute' => 'password',
            'Value' => 'ignored'));
    
    $ret = $ec2Client->modifyInstanceAttribute(array(
            'InstanceId' => '1111',
            'Attribute' => 'hostname',
            'Value' => 'new-hostname'));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('ModifyInstanceAttribute', 'InstanceId=2632&Attribute=instanceType&InstanceType.Value=cpu.lg');
    
    package main
    
    import (
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        err := client.ModifyInstanceAttribute("Attribute=instanceType&InstanceType.Value=gcl.2", "1111")
        if err != nil {
            panic(err)
        }
    
        err := client.ModifyInstanceAttribute("Attribute=instanceType&hostname.Value=new-hostname", "1111")
        if err != nil {
            panic(err)
        }
    }
    

    Sample ModifyInstanceAttribute XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <ModifyInstanceAttributeResponse>
      <return>true</return>
      <RequestID>957fd7ed4e49fea8376ba2a0b571fe36</RequestID>
    </ModifyInstanceAttributeResponse>
    

    Modifies one or more attributes of a given instance. Beware that some modifications are destructive.

    Parameters

    NameTypeRequired?DefaultDescription
    Attribute string N The attribute to modify (optional: you can also just provide the modified instance value).
    InstanceType_Value string N New instance type. Beware that certain parameters cannot be downgraded such as disk. Also if you specify an instance type that is too small for the operating system used, this call will fail.
    Password_Value string N Provide any value in this field to re-generate a new random root password and set it on the instance.
    OperatingSystem_Value string N New operating system to use. Beware: This will fully reinstall the instance and will delete all data. Only supported within one family of OSes, for example Ubuntu to Ubuntu or Windows to Windows.
    Hostname_Value string N New hostname for the instance.
    InstanceId string Y The ID of the instance to modify.
    DryRun boolean N

    RebootInstances

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    ret = ec2.reboot_instances(instance_ids=['1111'])
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.reboot_instances(InstanceIds=['1111'])
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.reboot_instances({ instance_ids: ["1111"] })
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->rebootInstances(array('InstanceIds' => array('1111')));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('RebootInstances', 'InstanceId.1=2632');
    
    package main
    
    import (
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        err := client.RebootInstances("1111")
    
        if err != nil {
            panic(err)
        }
    }
    

    Reboot the provided list of instances.

    Parameters

    NameTypeRequired?DefaultDescription
    InstanceId stringlist Y List of instances to reboot.
    DryRun boolean N

    ResetInstanceAttribute

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    ret = ec2.reset_instance_attribute('1111', 'operatingSystem')
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.reset_instance_attribute(
        InstanceId='1111', 
        Attribute='operatingSystem')
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.reset_instance_attribute({
        attribute: "operatingSystem",
        instance_id: "1111"})
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->resetInstanceAttribute(array(
            'InstanceId' => '1111',
            'Attribute' => 'operatingSystem'));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('ResetInstanceAttribute', 'InstanceId=2632&Attribute=operatingSystempassword');
    
    
    package main
    
    import (
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        err := client.ResetInstanceAttribute("networkConfig", "1111")
    
        if err != nil {
            panic(err)
        }
    }
    

    Resets a given attribute on the instance to its current default value. Beware that some of these actions can be destructive.

    Parameters

    NameTypeRequired?DefaultDescription
    Attribute string Y Name of the attribute to reset. Can be "instanceType", "operatingSystem", "networkConfig", "password" or "hostname". Beware: operatingSystem reset is destructive and will reinstall the OS.
    InstanceId string Y The instance to reset the attribute for.
    DryRun boolean N

    RunInstances

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    instance = ec2.run_instances('centos64_6.4', instance_type='bal.small')
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.run_instances(
        ImageId="centos64_6.4",
        InstanceType="bal.small",
        MinCount=1,
        MaxCount=1)
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.run_instances({ image_id: "centos64_6.4", instance_type: "bal.small" })
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->runInstances(array(
            'ImageId' => 'centos64_6.4',
            'InstanceType' => 'bal.small',
            'MinCount' => 1,
            'MaxCount' => 1));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('RunInstances', 'ImageId=centos64_6.4&InstanceType=bal.small');
    
    package main
    
    import (
        "fmt"
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        extras := make(map[string]string)
        extras["keyname"] = "ssh-key-name"
        extras["placement_availabilityzone"] = "iad1"
        res, err := client.RunInstances("centos64_7", "gcl.1", extras)
    
        if err != nil {
            panic(err)
        }
    
        fmt.Println(res)
    }
    

    Sample RunInstances XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <RunInstancesResponse>
      <reservationId>0</reservationId>
      <ownerId>4444</ownerId>
      <instancesSet>
        <item>
          <imageId>centos64_6.4</imageId>
          <instanceId>2760</instanceId>
          <instanceType>custom_bal_1vcpu_512m_10gb</instanceType>
          <placement>
            <availabilityZone>ord1</availabilityZone>
          </placement>
          <launchTime>1970-01-01T00:00:00+00:00</launchTime>
          <privateDnsName>ord1-9cf49e</privateDnsName>
          <privateIpAddress>none</privateIpAddress>
          <publicIpAddress>69.39.235.179</publicIpAddress>
          <state>
            <code>4</code>
            <name>unknown</name>
          </state>
          <architecture>x86_64</architecture>
          <virtualizationType>hvm</virtualizationType>
          <rootDeviceName>/dev/sda1</rootDeviceName>
          <hypervisor>xenserver</hypervisor>
          <platform>Centos</platform>
          <tagSet/>
        </item>
      </instancesSet>
      <RequestID>7809f80abbd92cda0dbfa22e0daf1862</RequestID>
    </RunInstancesResponse>
    

    Create one or more new instances with the given specifications.

    Parameters

    NameTypeRequired?DefaultDescription
    ImageId string Y The operating system image to use for the instance.
    InstanceType string Y The instance type to use (cpu/memory specifiations). You can use the DescribeInstanceTypes to find available types. There are a number of instance types optimized for either memory, cpu or balanced types. Be aware that we do not necessarily offer the same types as AWS.
    KeyName string N The SSH key name to use for the instance. Preview: This is currently only in preview mode and not fully supported.
    NetworkInterface array (Members)
    NameTypeRequired?DefaultDescription
    AssociatePublicIpAddress boolean N

    N Used to specifiy the number of additional public IP addresses to associated with the instance. You can specify multiple NetworkInterfaces with AssociatePublicIpAddress set to true to generate multiple public IPs. If AssociatePublicIpAddress is set to false this will be ignored.
    PrivateIpAddress string N Provide any value here to allocate a private IP address to the instance.
    Placement_AvailabilityZone string N ord1 The datacenter to locate the instance in.
    MinCount int N 1 Minimum number of instances to launch.
    MaxCount int N 1 Maximum number of instances to launch (ie. requested number).
    BillingTerm int N 730 The billing term to use in hours. Valid values are 1 (hourly), 730 (monthly) and 2190 (quarterly). Note: this is an extension to the AWS API and might not be supported by SDKs.
    TagSpecification array (Members)
    NameTypeRequired?DefaultDescription
    ResourceType string N The type of resource to tag
    Tags array (Members)
    NameTypeRequired?DefaultDescription
    Key string N
    Value string N
    N
    N Set of tags to apply to the newly created instance
    DryRun boolean N

    StartInstances

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    instance = ec2.start_instances(instance_ids=['1111'])
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.start_instances(InstanceIds=['1111'])
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.start_instances({ instance_ids: ["1111"] })
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->startInstances(array('InstanceIds' => array('1111')));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('StartInstances', 'InstanceId.1=2632');
    
    package main
    
    import (
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        err := client.StartInstances("1111")
    
        if err != nil {
            panic(err)
        }
    }
    
    

    Start the provided list of instances. They need to be in "stop" or "pause" state to be started.

    Parameters

    NameTypeRequired?DefaultDescription
    InstanceId stringlist Y List of instances to start.
    DryRun boolean N

    StopInstances

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    instance = ec2.stop_instances(instance_ids=['1111'])
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.stop_instances(InstanceIds=['1111'])
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.stop_instances({ instance_ids: ["1111"] })
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->stopInstances(array('InstanceIds' => array('1111')));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('StopInstances', 'InstanceId.1=2632');
    
    package main
    
    import (
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        err := client.StopInstances("1111")
    
        if err != nil {
            panic(err)
        }
    }
    

    Stop the provided list of instances. They need to be in "started" state to be stopped.

    Parameters

    NameTypeRequired?DefaultDescription
    InstanceId stringlist Y List of instances to stop.
    Force boolean N
    DryRun boolean N

    TerminateInstances

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    instance = ec2.terminate_instnaces(instance_ids=['1111'])
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.terminate_instances(InstanceIds=['1111'])
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.terminate_instances({ instance_ids: ["1111"] })
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->terminateInstances(array('InstanceIds' => array('1111')));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('TerminateInstances', 'InstanceId.1=2632');
    
    package main
    
    import (
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        err := client.TerminateInstances("1111")
    
        if err != nil {
            panic(err)
        }
    }
    

    Destroy the provided list of instances. Warning: This will delete all data from the instances.

    Parameters

    NameTypeRequired?DefaultDescription
    InstanceId stringlist Y List of instances to destroy.
    DryRun boolean N

    Networking

    Use this section of the API to manage elastic and additional IP addresses. Elastic IP addresses can be associated and de-associated with VMs without removing them, while additional IP addresses are always directly bound to a VM.

    AllocateAddress

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    ip = ec2.allocate_address(domain='ord1')
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.allocate_address(Domain='ord1')
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.allocate_address({ domain: "ord1" })
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->allocateAddress(array('Domain' => 'ord1'));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('AllocateAddress', 'Domain=ord1');
    
    package main
    
    import (
        "fmt"
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        address, err := client.AllocateAddress("ord1")
    
        if err != nil {
            panic(err)
        }
    
        fmt.Println(address)
    }
    

    Sample AllocateAddress XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <AllocateAddressResponse>
        <publicIp>69.39.235.241</publicIp>
        <domain>ord1</domain>
        <RequestID>4882d9fd45cd1b67f9de4a078f41f7a7</RequestID>
    </AllocateAddressResponse>
    

    Allocates an elastic IP address to your account. The elastic IP will be availablein a VLAN that will be created in the provided availability zone.

    Parameters

    NameTypeRequired?DefaultDescription
    Domain string N The availability zone/data center to which to allocate the address.The address will be available for routing within that data center
    DryRun boolean N

    AssignPublicIpAddress

    # Not supported by the boto2 SDK
    
    # Not supported by this SDK
    
    # Not supported by this SDK
    
    # Not supported by this SDK
    
    package main
    
    import (
        "fmt"
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        address, err := c.AssignPublicIpAddress('1111')
    
        if err != nil {
            panic(err)
        }
    
        fmt.Println(address)
    }
    

    Assigns a new public/additional IP address to the Instance provided. This is an extension of the AWS API so likely not supported by AWS SDKs or tools.

    Parameters

    NameTypeRequired?DefaultDescription
    InstanceId string N The VM/instance to assign the public IP address to.
    DryRun boolean N

    AssociateAddress

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    ip = ec2.allocate_address(domain='ord1')
    
    ret = ec2.associate_address(instance_id='1111', public_ip=ip.public_ip)
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.associate_address(InstanceId='1111', PublicIp='69.23.22.11')
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.associate_address({ instance_id: "1111", public_ip: "69.33.235.235" })
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->associateAddress(array(
        'InstanceId' => '1111', 
        'PublicIp' => '69.39.39.39'));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('AssociateAddress', 'InstanceId=2632&PublicIp=69.39.235.242');
    
    package main
    
    import (
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        err := client.AssociateAddress("69.39.235.241")
    
        if err != nil {
            panic(err)
        }
    }
    

    Sample AssociateAddress XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <AssociateAddressResponse>
        <return>true</return>
        <RequestID>332aa29ac2f273b2b507d54ba5039fc6</RequestID>
    </AssociateAddressResponse>
    

    Creates an association between a given cloud machine instance and an elastic IP. Ensures that the Cloud Machine is added to the VLAN the IP is associated to.

    Parameters

    NameTypeRequired?DefaultDescription
    InstanceId string N The instance/cloud machine to which to associate the address.
    PublicIp string N The public IP to associate with the given instance
    DryRun boolean N

    DescribeAddresses

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    all = ec2.get_all_addresses()
    
    address = ec2.get_all_addresses(['32.44.22.11'])
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.describe_addresses(PublicIps=['69.23.22.11'])
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.describe_addresses({ public_ips: ["69.39.235.241"]})
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->describeAddresses(array(
        'PublicIp' => '69.39.39.39'));
    
    <?php
    require('vendor/autoload.php');
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('DescribeAddresses', 'PublicIp.1=69.39.235.241');
    
    package main
    
    import (
        "fmt"
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        addresses, err := client.DescribeAddresses("PublicIp.1=69.23.22.11")
    
        if err != nil {
            panic(err)
        }
    
        fmt.Println(addresses)
    }
    

    Sample DescribeAddresses XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <ReleaseAddressResponse>
        <return>true</return>
        <RequestID>2a8312d3b0214a808c15c15d9f558935</RequestID>
    </ReleaseAddressResponse>
    

    Describes one or more addresses.

    Parameters

    NameTypeRequired?DefaultDescription
    PublicIp stringlist N A list of public IPs to describe. If not provided all address will be described.
    DryRun boolean N

    DisassociateAddress

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    ret = ec2.disassociate_address(public_ip='32.44.22.11')
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.disassociate_address(PublicIp='69.23.22.11')
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.disassociate_address({ public_ip: "69.33.235.235" })
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->associateAddress(array(
        'InstanceId' => '1111', 
        'PublicIp' => '69.39.39.39'));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('DisassociateAddress', 'PublicIp=69.39.235.242');
    
    package main
    
    import (
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        err := client.DisassociateAddress("69.23.22.11")
    
        if err != nil {
            panic(err)
        }
    
    }
    

    Sample DisassociateAddress XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <DisassociateAddressResponse>
        <return>true</return>
        <RequestID>f8bef95fe215cfa684218999b4960d5e</RequestID>
    </DisassociateAddressResponse>
    

    Disassociates an address from the VM it is associated with. this does not release the elastic IP.

    Parameters

    NameTypeRequired?DefaultDescription
    PublicIp string N The public IP to disassociate from a given VM.
    DryRun boolean N

    ReleaseAddress

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    ret = ec2.release_address(public_ip='32.44.22.11')
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.release_address(PublicIp='69.23.22.11')
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.release_address({ public_ips: "69.39.235.241"})
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->releaseAddress(array(
        'PublicIp' => '69.39.39.39'));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('ReleaseAddress', 'PublicIp=69.39.235.241');
    
    package main
    
    import (
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        err := client.ReleaseAddress("69.39.235.241")
    
        if err != nil {
            panic(err)
        }
    }
    

    Sample ReleaseAddress XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <DescribeAddressesResponse>
        <addressesSet>
            <item>
                <publicIp>69.39.235.241</publicIp>
                <domain>standard</domain>
            </item>
        </addressesSet>
        <RequestID>23d4749fb8ce14714bce8f6415d5a622</RequestID>
    </DescribeAddressesResponse>
    

    Releases an elastic IP address, removing it from your account.

    Parameters

    NameTypeRequired?DefaultDescription
    PublicIp string N The elastic IP to free/release.
    DryRun boolean N

    UnassignPublicIpAddress

    # Not supported by the boto2 SDK
    
    # Not supported by this SDK
    
    # Not supported by this SDK
    
    # Not supported by this SDK
    
    package main
    
    import (
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        err := client.UnassignPublicIpAddress("69.39.235.241")
    
        if err != nil {
            panic(err)
        }
    }
    

    Removes and releases a public/additional IP address. This is an extension of the AWS API so likely not supported by AWS SDKs or tools.

    Parameters

    NameTypeRequired?DefaultDescription
    PublicIp string N The public IP to remove from the VM it is assigned to.
    DryRun boolean N

    Images & Regions

    Use this section of the API to retrieve information about the available operating system images as well as our data centers.

    DescribeImageAttribute

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    ret = ec2.get_image_attribute(image_id='ubuntu64_14.04.1', 
        attribute='description')
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.describe_image_attribute(Attribute='description', ImageId='ubuntu64_14.04.1')
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.describe_image_attribute({attribute: "description", image_id: "ubuntu64_14.04.1"})
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    // Describe all iamges
    $ret = $ec2Client->describeImages();
    
    // Describe single image
    $ret = $ec2Client->describeImages(array(
            'ImageIds' => array('ubuntu64_14.04.1')));
    
    <?php
    require('vendor/autoload.php');
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('DescribeImageAttribute', 'ImageId=ubuntu64_14.04.1&Attribute=description');
    
    package main
    
    import (
        "fmt"
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        image, err := client.DescribeImageAttribute("description", "centos64_7")
    
        if err != nil {
            panic(err)
        }
    
        fmt.Println(image)
    }
    

    Sample DescribeImageAttribute XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <DescribeImageAttributeResponse>
        <ImageId>ubuntu64_14.04.1</ImageId>
        <description>
            <value>Ubuntu 14.04.1 LTS AMD64</value>
        </description>
        <RequestID>d47a65af377300d4efbd1b79add5d7b4</RequestID>
    </DescribeImageAttributeResponse>
    

    Describes attributes of an operating system image.

    Parameters

    NameTypeRequired?DefaultDescription
    Attribute string Y
    ImageId string Y
    DryRun boolean N

    DescribeImages

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    all = ec2.get_all_images()
    
    image = ec2.get_image('ubuntu64_14.04.1')
    
    
    
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    # Describe all images
    resp = ec2.describe_images()
    
    # Describe single image
    resp = ec2.describe_images(ImageIds=['ubuntu64_14.04.1'])
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    # Describe all images
    i = ec2.describe_images({})
    
    # Describe single image
    i = ec2.describe_images({ image_ids: ["ubuntu64_14.04.1"]})
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    // Describe all images
    $ret = $ec2Client->describeImages();
    
    // Describe one image 
    $ret = $ec2Client->describeImages(array(
            'InstanceIds' => array('ubuntu64_14.04.1')));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('DescribeImages', 'ImageId.1=ubuntu64_14.04.1');
    
    package main
    
    import (
        "fmt"
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        images, err := client.DescribeImages("")
    
        if err != nil {
            panic(err)
        }
    
        fmt.Println(images)
    }
    

    Sample DescribeImages XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <DescribeImagesResponse>
      <imagesSet>
        <item>
          <imageId>ubuntu64_14.04.1</imageId>
          <imageLocation>gigenet</imageLocation>
          <imageState>active</imageState>
          <imageOwnerId>gigenet</imageOwnerId>
          <isPublic>true</isPublic>
          <architecture>x86_64</architecture>
          <imageType>machine</imageType>
          <imageOwnerAlias>gigenet</imageOwnerAlias>
          <name>ubuntu64_14.04.1</name>
          <description>Ubuntu 14.04.1 LTS AMD64</description>
          <platform>Ubuntu</platform>
          <virtualizationType>hvm</virtualizationType>
          <hypervisor>xen</hypervisor>
        </item>
      </imagesSet>
      <RequestID>122b388ffdee67b98690051c8ac6cd0d</RequestID>
    </DescribeImagesResponse>
    

    Describes available operating system images.

    Parameters

    NameTypeRequired?DefaultDescription
    ImageId stringlist N The operating system image to describe. If none is provided, describe all images.
    DryRun boolean N

    DescribeAvailabilityZones

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    all = ec2.get_all_zones()
    
    zone = ec2.get_all_zones(zones=['ord1'])
    
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.describe_availability_zones()
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.describe_availability_zones({})
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->describeAvailabilityZones();
    
    <?php
    require('vendor/autoload.php');
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('DescribeAvailabilityZones');
    
    package main
    
    import (
        "fmt"
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        zones, err := client.DescribeAvailabilityZones("")
    
        if err != nil {
            panic(err)
        }
    
        fmt.Println(zones)
    }
    

    Sample DescribeAvailabilityZones XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <DescribeAvailabilityZonesResponse>
        <availabilityZoneInfo>
            <item>
                <regionName>ord1</regionName>
                <zoneName>ord1</zoneName>
                <zoneState>available</zoneState>
                <messageSet>
                    <message>Location: Arlington Heights, IL Zone 2</message>
                </messageSet>
            </item>
            <item>
                <regionName>ord1</regionName>
                <zoneName>ord1</zoneName>
                <zoneState>unavailable</zoneState>
                <messageSet>
                    <message>Location: Arlington Heights, IL [CMAN]</message>
                </messageSet>
            </item>
            <item>
                <regionName>lax1</regionName>
                <zoneName>lax1</zoneName>
                <zoneState>unavailable</zoneState>
                <messageSet>
                    <message>Location: Los Angeles, CA</message>
                </messageSet>
            </item>
            <item>
                <regionName>ord1</regionName>
                <zoneName>ord1</zoneName>
                <zoneState>available</zoneState>
                <messageSet>
                    <message>Location: Arlington Heights, IL</message>
                </messageSet>
            </item>
        </availabilityZoneInfo>
        <RequestID>01040b5a9c1c571eaa7eb1312be6736b</RequestID>
    </DescribeAvailabilityZonesResponse>
    

    Describes one, several or all of the data centers returning information about its current status and whether you can launch new cloud machines in them.

    Parameters

    NameTypeRequired?DefaultDescription
    ZoneName stringlist N The name of the datacenter to describe. If not supplied - describe all data centers.
    DryRun boolean N

    Return Value

    NameTypeDescription
    availabilityZoneInfoSet array (Members)
    NameTypeDescription
    regionName string The name of the region/data center (at this time identical to zoneName).
    zoneName string The name of the zone/data center (at this time identical to regionName).
    zoneState string "Active" if currently accepting requests for new Cloud Machines, otherwise "Inactive".
    messageSet array Array with one member "message" providing any messages or updates about the data center.

    A set of information related to the queried data centers.

    DescribeRegions

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    all = ec2.get_all_regions()
    
    zone = ec2.get_all_regions(zones=['ord1'])
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.describe_regions()
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.describe_regions({})
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->describeRegions();
    
    <?php
    require('vendor/autoload.php');
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('DescribeRegions');
    
    package main
    
    import (
        "fmt"
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
    )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        keys, err := client.DescribeRegions("")
    
        if err != nil {
            panic(err)
        }
    
        for _, r := range regions {
            fmt.Println(r)
        }
    }
    
    

    Sample DescribeRegions XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <DescribeRegionsResponse>
        <regionInfo>
            <item>
                <regionEndpoint>api.thegcloud.com</regionEndpoint>
                <regionName>ord1</regionName>
            </item>
        </regionInfo>
        <RequestID>728f818461f481e7cc3a97671045f2a0</RequestID>
    </DescribeRegionsResponse>
    

    Describes the API end points available in different data centers/regions.

    Parameters

    NameTypeRequired?DefaultDescription
    RegionName stringlist N The name of the datacenter to describe. If not supplied - describe all data centers.
    DryRun boolean N

    Return Value

    NameTypeDescription
    regionInfoSet array (Members)
    NameTypeDescription
    regionEndpoint string The API endpoint that can be used for the region/data center.
    regionName string The name of the region/data center.

    A set describing the queried regions/API endpoints.

    SSH Keys

    Use this section of the API to add, describe and delete SSH Keys to your account. This is currently a preview feature and is not yet supported when creating new Cloud Machines.

    CreateKeyPair

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    keypair = ec2.create_key_pair('ssh-key-name')
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.create_key_pair(KeyName='test_key')
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.create_key_pair({ key_name: "my-key-name" })
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->createKeyPair(array('KeyName' => 'test-key-pair'));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('CreateKeyPair', 'KeyName=test-key-pair');
    
    package main
    
    import (
        "fmt"
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        key, err := client.CreateKeyPair("test-key-pair")
    
        if err != nil {
            panic(err)
        }
    
        fmt.Println(key)
    }
    

    Sample CreateKeyPair XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <CreateKeyPairResponse>
        <keyName>test-key-pair</keyName>
        <keyFingerprint>23:cf:b0:a4:29:b4:d3:40:0f:db:b3:49:e5:35:0c:bf:be:6b:9b:fb</keyFingerprint>
        <keyMaterial>-----BEGIN PRIVATE KEY-----
        MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC0vT/F+wvCk6eX
        GlTKXzGfZ0MweDnINmQWCzq0LGKj1VhH5VnSLJkoJEHx6pJw71iLmLztW2//ngby
        G3RIElcXWHCXMl8S7kpCuttvpSHwt6V6u/bMYc3irvzbYfk3wDXzGLgX41f+nRxE
        qW7nkIevd4crOgSOgU1v21AVI3LMs57TSVmEQd9u3RUp9OtN/Z96MCyYEYggvCKr
        kqUV93ggB9j9joZc1I7XmHOHtn1ugjrMFSrXUmotQuNuM1Y8Hysm8GQk7N+iw9+a
        24JXhQDCJVbWNR4qDPbcR/K3QXWuEe27lKCiiR52lU+mYlDWL+0x5jRidmHJ+V6P
        v07Hco41AgMBAAECggEACDfiwnnb2wkjwbcsy9bwRrNHVtjgp73xZx8zmCW8hn6Y
        +QvwvaHRhQXBCeMEraX0fMSBMrnJqfHhlviwnOZYl3MqC3X65L15GvesKrNzi6KO
        H7qUSk7YMcqLLN6Tmnle+qLRHCT2R1mVg3nA1T65LL1epBSLSH+QqdlrFsr52Vzt
        3IvgFqM2CaS3Npezvij+8YQF+fU/LOnN+xVNuaLf5FNr/sVMTfeYps3YcTm49SWO
        483VyKyvKQ/sKCmPtzwZuQC9xgJl+qkt3SvMLEl/6ckKc0zy61SL6x+zploRe3PK
        ThORUjcPmfvQqq1ahNiZIJdjfH2Ajg6hU/NNYI2rAQKBgQDu2fg9HTVJvYP8M+sD
        6cEwpKD2RWK2mOLcAYvLQxFt585d556GUTqjJMhnjKjgvRcCoCLpizo2+xtExpHA
        y2sJzktP8R/Cbun2OJoF3VMY0zxlY2hV+KEH6xeRDkW6jWssKixvqpa2EGM35R4m
        Nu3X+nhk1Jq8HzaeMCeoRK8ZRQKBgQDBtzEZcAsm+O3QLBSzAC2P8zMqIDyjTKlD
        fsqlrxwzhfFKyjqlZEPKKSYEgDGBTN1MrA5Lu+drZnbkZznR2YZYkzFh9/7wyLZ5
        KRJLVPCZpfrKlu6cL2ff2drspsYjzWKRTN1rO0Ow0Gz37WuUnO25tdacBVqywzpi
        r5pJDrNYMQKBgGRVd+vkOyBQ1gK5pH2uUhMm9N6+4uqlapbUp26pK8cpWw0jYPo3
        YRRrPSwScFaH2ASoVEIa1EeIUDoh19RPHxWtbQGV3quEgA+IU1snT+LbyUEl8ww6
        NxrmbK3oeu4UvfJ9fNEjrc+pLqSqQHH5HQxfEPf6P03LJtxoiiArSgqpAoGAMwO2
        Z3eNSE8n+bmSHe2/Efi/Ean5rhujO8YpQebSq3Lrr4GAXkwAWj3p6CeGYgHHCckJ
        3sH2WN9cEhxpKq15ZtwkliNEPU7uVwwM6E/PKPeAC1giMHl/hoEN2WK2LXmKKq+u
        Y+3wjqDlAYnB2hpVtKGBigcS8p7dQl3yaKj5bBECgYAcXJaAi28R8QJly7V2ZXH1
        pnwe5F+kE5dqeZtR+1Y1PsCb81X3e2nJoZ3yMXuVKAsuQJ7dM8tps5s+A8+WT354
        LjJLfHnVezPfcdewu7fff9y3hP/DBpBndP/MZUzMab1B4sJfePBgkjXxstZ0Xpf6
        5XfwbDE+80wPf2KkMuTi/A==
        -----END PRIVATE KEY-----
        </keyMaterial>
        <RequestID>f997fa212094383d896215550230a08d</RequestID>
    </CreateKeyPairResponse>
    
    

    Generates a new keypair returning the private key. Only do this over a secure HTTPS connection as the private key returned must be kept secret.

    Parameters

    NameTypeRequired?DefaultDescription
    KeyName string Y What to name the key pair generated.
    DryRun boolean N

    DeleteKeyPair

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    keypair = ec2.delete_key_pair('ssh-key-name')
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.delete_key_pair(KeyName='test_key')
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.delete_key_pair({ key_name: "my-key-name" })
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->deleteKeyPair(array('KeyName' => ('test-key-pair')));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('DeleteKeyPair', 'KeyName=test-key-pair');
    
    package main
    
    import (
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        err := DeleteKeyPair("test-key-pair")
    
        if err != nil {
            panic(err)
        }
    }
    

    Deletes a key from your account.

    Parameters

    NameTypeRequired?DefaultDescription
    KeyName string Y The name of the key to delete.
    DryRun boolean N

    DescribeKeyPairs

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    all = ec2.get_all_key_pairs()
    
    keypair = ec2.get_all_key_pairs(['ssh-key-name'])
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.describe_key_pairs(KeyNames=['test_key'])
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.describe_key_pairs({ key_names: [ "my-key-namea "] })
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->describeKeyPairs(array('KeyNames' => array('test-key-pair')));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('DescribeKeyPairs', 'KeyName.1=test-key-pair');
    
    package main
    
    import (
        "fmt"
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
    )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        keys, err := client.DescribeKeyPairs("KeyName.1=test-key-pair")
    
        if err != nil {
            panic(err)
        }
    
        for _, k := range keys {
            fmt.Prinln(k.Name)
        }
    }
    

    Sample DescribeKeyPairs XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <DescribeKeyPairsResponse>
        <keySet>
            <item>
                <keyName>test-key-pair</keyName>
                <keyFingerprint>50:30:71:b2:10:68:bb:7c:fa:0a:55:14:f7:f1:f0:91:47:a9:71:09</keyFingerprint>
            </item>
        </keySet>
        <RequestID>3be58fe350b32f09b9f8b834beee69bd</RequestID>
    </DescribeKeyPairsResponse>
    
    

    Describes one or more of the keys that have been added to your account.

    Parameters

    NameTypeRequired?DefaultDescription
    KeyName stringlist N The keys to describe. If omitted all keys will be returned.
    DryRun boolean N

    ImportKeyPair

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    keypair = ec2.import_key_pair('ssh-key-name',
            'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA27Qd8PiFw+FYhPOJgDp9lo9bUP6NJEGtjyAK+o+oyd8HKEqORSVzM9vG81mHkapkr3VCBkZKgF6GF8Lfc2cUlC9g4XYJErjBeWmuWYo8Fq1ch1QTQUDkJfRaI1lNSuzS/8KvKVi4yO4ydOoCM7rG5yFiwtrPcxy8CeuwkA6DpyHtoIspOpzD5C6kcTyhf3PdPk/qMTB1h9oa0gpqmh8ns1yYI3Lxud8AYf63Awm9/V1WxwCMxHailKbE0glgw95PTJGUL6FVyc+awXg3xn48TjNT9dR82Dr4OPUgZq7fZHArcSyavoWzvjeQqcCN5qkcCAUZ1ZpSgWj/FOZIENlMDw== test@thegcloud.com')
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.import_key_pair(
        KeyName='test_key',  
        PublicKeyMaterial=base64.b64encode("ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA27Qd8PiFw+FYhPOJgDp9lo9bUP6NJEGtjyAK+o+oyd8HKEqORSVzM9vG81mHkapkr3VCBkZKgF6GF8Lfc2cUlC9g4XYJErjBeWmuWYo8Fq1ch1QTQUDkJfRaI1lNSuzS/8KvKVi4yO4ydOoCM7rG5yFiwtrPcxy8CeuwkA6DpyHtoIspOpzD5C6kcTyhf3PdPk/qMTB1h9oa0gpqmh8ns1yYI3Lxud8AYf63Awm9/V1WxwCMxHailKbE0glgw95PTJGUL6FVyc+awXg3xn48TjNT9dR82Dr4OPUgZq7fZHArcSyavoWzvjeQqcCN5qkcCAUZ1ZpSgWj/FOZIENlMDw== test@thegcloud.com'"))
    
    
    
    require 'aws-sdk'
    require 'base64'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = i = ec2.import_key_pair({
        key_name: "test-key",
        public_key_material: Base64.encode64("ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA27Qd8PiFw+FYhPOJgDp9lo9bUP6NJEGtjyAK+o+oyd8HKEqORSVzM9vG81mHkapkr3VCBkZKgF6GF8Lfc2cUlC9g4XYJErjBeWmuWYo8Fq1ch1QTQUDkJfRaI1lNSuzS/8KvKVi4yO4ydOoCM7rG5yFiwtrPcxy8CeuwkA6DpyHtoIspOpzD5C6kcTyhf3PdPk/qMTB1h9oa0gpqmh8ns1yYI3Lxud8AYf63Awm9/V1WxwCMxHailKbE0glgw95PTJGUL6FVyc+awXg3xn48TjNT9dR82Dr4OPUgZq7fZHArcSyavoWzvjeQqcCN5qkcCAUZ1ZpSgWj/FOZIENlMDw== test@thegcloud.com'")})
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $
    $ret = $ec2Client->importKeyPair(
        array(
            'KeyName' => 'test-key-pair',
            'PublicKeyMaterial' => base64_encode('ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA27Qd8PiFw+FYhPOJgDp9lo9bUP6NJEGtjyAK+o+oyd8HKEqORSVzM9vG81mHkapkr3VCBkZKgF6GF8Lfc2cUlC9g4XYJErjBeWmuWYo8Fq1ch1QTQUDkJfRaI1lNSuzS/8KvKVi4yO4ydOoCM7rG5yFiwtrPcxy8CeuwkA6DpyHtoIspOpzD5C6kcTyhf3PdPk/qMTB1h9oa0gpqmh8ns1yYI3Lxud8AYf63Awm9/V1WxwCMxHailKbE0glgw95PTJGUL6FVyc+awXg3xn48TjNT9dR82Dr4OPUgZq7fZHArcSyavoWzvjeQqcCN5qkcCAUZ1ZpSgWj/FOZIENlMDw== test@thegcloud.com')));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('ImportKeyPair', 'KeyName=testkey123&PublicKeyMaterial='.base64_encode('ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA27Qd8PiFw+FYhPOJgDp9lo9bUP6NJEGtjyAK+o+oyd8HKEqORSVzM9vG81mHkapkr3VCBkZKgF6GF8Lfc2cUlC9g4XYJErjBeWmuWYo8Fq1ch1QTQUDkJfRaI1lNSuzS/8KvKVi4yO4ydOoCM7rG5yFiwtrPcxy8CeuwkA6DpyHtoIspOpzD5C6kcTyhf3PdPk/qMTB1h9oa0gpqmh8ns1yYI3Lxud8AYf63Awm9/V1WxwCMxHailKbE0glgw95PTJGUL6FVyc+awXg3xn48TjNT9dR82Dr4OPUgZq7fZHArcSyavoWzvjeQqcCN5qkcCAUZ1ZpSgWj/FOZIENlMDw== test@thegcloud.com'));
    
    package main
    
    import (
        "fmt"
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        key, err := client.ImportKeyPair("ssh-key-name", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA27Qd8PiFw+FYhPOJgDp9lo9bUP6NJEGtjyAK+o+oyd8HKEqORSVzM9vG81mHkapkr3VCBkZKgF6GF8Lfc2cUlC9g4XYJErjBeWmuWYo8Fq1ch1QTQUDkJfRaI1lNSuzS/8KvKVi4yO4ydOoCM7rG5yFiwtrPcxy8CeuwkA6DpyHtoIspOpzD5C6kcTyhf3PdPk/qMTB1h9oa0gpqmh8ns1yYI3Lxud8AYf63Awm9/V1WxwCMxHailKbE0glgw95PTJGUL6FVyc+awXg3xn48TjNT9dR82Dr4OPUgZq7fZHArcSyavoWzvjeQqcCN5qkcCAUZ1ZpSgWj/FOZIENlMDw== test@thegcloud.com")
    
        if err != nil {
            panic(err)
        }
    
        fmt.Println(key.Fingerprint)
    }
    

    Sample ImportKeyPair XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <ImportKeyPairResponse>
      <keyName>testkey123</keyName>
      <keyFingerprint>d4:1d:8c:d9:8f:00:b2:04:e9:80:09:98:ec:f8:42:7e</keyFingerprint>
      <RequestID>d57a6d9d2dce3cb6a6c60ee4b3a7a048</RequestID>
    </ImportKeyPairResponse>
    

    Imports a public key which you have generated separately.

    Parameters

    NameTypeRequired?DefaultDescription
    KeyName string Y What to name the imported public key.
    PublicKeyMaterial string Y The public key to import.
    DryRun boolean N

    Tags

    Use this section of the API create, delete and describe tags used for Cloud Machines.

    CreateTags

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    ret = ec2.create_tags(['1111'], { 'MyTag': 'optional-value'})
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.create_tags(Resources=["1111"], Tags=[ { 'Key': 'test-tag-1', 'Value': 'optional-value' } ])
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.create_tags({ resources: ["1111"], tags: [{ key: "test-tag", value: "optional-value" }] })
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->createTags(array(
            'Resources' => array('2632'),
            'Tags' => array( array( 'Key' => 'test-tag-123', 'Value' => 'optional-value' ))));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('CreateTags', 'ResourceId.1=2632&Tag.1.Key=test-tag&Tag.1.Value=optional-value');
    
    package main
    
    import (
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        err := client.CreateTags([]*Tag{
                &Tag{Key: "test-tag-1", Value: "test"},
            }, "1111")
    
        if err != nil {
            panic(err)
        }
    }
    
    

    Sample CreateTags XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <CreateTagsResponse>
        <return>true</return>
        <RequestID>87c3f0bfa83b198ab649eb96755f1a4f</RequestID>
    </CreateTagsResponse>
    

    Adds or Overwrites one or more tags for a CloudMachine resource.

    Parameters

    NameTypeRequired?DefaultDescription
    ResourceId stringlist Y List of instances to tag.
    Tag array (Members)
    NameTypeRequired?DefaultDescription
    Value string Y
    Key string Y

    Y One or more tags. If value is given, then value will be set/overwritten. If value already exists but argument is not given then value will remain the same as current.
    DryRun boolean N

    DeleteTags

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    ret = ec2.delete_tags(['1111'], { 'MyTag': 'optional-value' })
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.delete_tags(Resources=['1111'], Tags= [ {'Key': 'test-tag', 'Value': 'value-to-delete'}, {'Key': 'tag-without-value'} ])
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.delete_tags({ resources: ["1111"], tags: [{ key: "test-tag", value: "optional-value" }] })
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->deleteTags(array(
            'Resources' => array('2632'),
            'Tags' => array( array( 'Key' => 'test-tag-123', 'Value' => 'optional-value' ))));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('DeleteTags', 'ResourceId.1=2632&Tag.1.Key=test-tag&Tag.1.Value=optional-value');
    
    package main
    
    import (
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
        )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        err := client.DeleteTags([]*Tag{
                &Tag{Key: "test-tag-1"},
            }, "1111")
    
        if err != nil {
            panic(err)
        }
    }
    

    Sample DeleteTags XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <DeleteTagsResponse>
        <return>true</return>
        <RequestID>460275b13ebc0992a3cb41c5fe11f1cd</RequestID>
    </DeleteTagsResponse>
    

    Deletes specified tags from resources.

    Parameters

    NameTypeRequired?DefaultDescription
    ResourceId stringlist Y List of instances to delete tags from.
    Tag array (Members)
    NameTypeRequired?DefaultDescription
    Key string Y
    Value string N

    N One or more tags - value is optional. If tag value is given only tags with that name and value will be deleted.
    DryRun boolean N

    DescribeTags

    import boto
    
    ec2 = boto.connect_ec2_endpoint(
        'https://api.thegcloud.com', 
        'APIKEY', 
        'APIHASH')
    
    tags = ec2.get_all_tags({"resource-id": ['1111']})
    
    import boto3
    
    ec2 = boto3.client('ec2', 
        endpoint_url='https://api.thegcloud.com', 
        aws_access_key_id='APIKEY', 
        aws_secret_access_key='APIHASH', 
        region_name='ord1');
    
    resp = ec2.describe_tags(Filters=[{ 'Name': 'resource-id', 'Values': ['1111'] }])
    
    require 'aws-sdk'
    
    ec2 = Aws::EC2::Client.new(
      endpoint: 'https://api.thegcloud.com',
      region: 'ord1',
      access_key_id: 'APIKEY',
      secret_access_key: 'APIHASH'
    )
    
    i = ec2.describe_tags({ filters: [ { name: "resource-id", values: ["1111"] } ] })
    
    <?php
    
    require('vendor/autoload.php');
    
    use \Aws\Ec2\Ec2Client;
    
    
    $ec2Client = Ec2Client::factory(array(
      'endpoint' => 'https://api.thegcloud.com',
      'region' => 'ord1',
      'credentials' => array(
        'key' => 'APIKEY',
        'secret' => 'APIHASH'
      )
    ));
    
    $ret = $ec2Client->describeTags(array(
            'Filters' => array(
                array( 
                    'Name' => 'resource-id', 
                    'Values' => array('2632') )
            )));
    
    <?php
    require('vendor/autoload.php');
    
    
    $access_key = 'APIKEY';
    $secret_key = 'APIHASH';
    $api_url = 'https://api.thegcloud.com';
    
    // For documentation of the apiRequest method 
    // see the documentation section 'Connecting to the API'
    print apiRequest('DescribeTags', 'ResourceId.1=2632');
    
    package main
    
    import (
        "fmt"
        gcloud "github.com/gigenet-projects/gcloud-golang-api/api"
    )
    
    var APIKEY  = "APIKEY"
    var SECRET  = "APIHASH"
    var BASEURL = "https://api.thegcloud.com"
    
    func main() {
        client := gcloud.NewClient(BASEURL, APIKEY, SECRET)
        tags, err := client.DescribeTags("ResourceId.1=1111")
    
        if err != nil {
            panic(err)
        }
    
        for _, tag := range tags {
            fmt.Println(tag)
        }
    }
    
    

    Sample DescribeTags XML return:

    <?xml version="1.0" encoding="utf-8"?>
    <DescribeTagsResponse>
        <tagSet>
            <item>
                <resourceId>1111</resourceId>
                <resourceType>instance</resourceType>
                <key>test-tag</key>
            </item>
            <item>
                <resourceId>1111</resourceId>
                <resourceType>instance</resourceType>
                <key>value-tag</key>
                <value>the-value</value>
            </item>
        </tagSet>
        <RequestID>a13161cad1123f503e129a761d8e3249</RequestID>
    </DescribeTagsResponse>
    

    Describes one or more of tags assigned to CloudMachine.

    Parameters

    NameTypeRequired?DefaultDescription
    Filter array (Members)
    NameTypeRequired?DefaultDescription
    Name string N
    Value stringlist N

    N Filters to apply. Supported filters include key,value,resource-id
    DryRun boolean N

    Instance Types

    Below you can find our current list of instance types. A fully dynamically updated list can also be fetched using the DescribeVmTypes API call. The different types offer different performance profiles:

    Name Description Cores Memory Disk Bandwidth
    gcl.1 GCL 1 1 1024 30 1 TB
    gcl.2 GCL 2 1 2048 60 1 TB
    gcl.4 GCL 3 2 4096 90 5 TB
    gcl.8 GCL 4 4 8192 120 5 TB
    gcl.core.2 GCL Core 2 2 2048 60 5 TB
    gcl.core.4 GCL Core 4 4 4096 90 5 TB
    gcl.core.8 GCL Core 8 8 8192 180 5 TB
    gcl.max.8 GCL Max 8 2 8192 180 5 TB
    gcl.max.16 GCL Max 16 4 16384 360 5 TB

    For pricing information please see our order page.

    Attribute Types

    Below you can find description and example of the types of parameters that you can provide to the API calls.

    Data type Description Example
    string URL encoded string SSHKeyName=Macbook+Key
    stringlist List of string values InstanceId.0=1223&InstanceId.1=1333
    int Numbered value MyInt=132
    array A list of named values, each member of the array can have multiple named values. ArrayValue.0.Key=first+ip&
    ArrayValue.0.IpAddress=192.168.3.3&
    ArrayValue.1.Key=second+ip&
    ArrayValue.1.IpAddress=192.168.3.10
    boolean A true/false boolean value DryRun=True

    Errors

    Sample XML error response from the API:

    <?xml version="1.0" encoding="utf-8"?>
    <Response>
        <Errors>
            <Error>
                <Code>MalformedQueryString</Code>
                <Message>You have provided a malformed query string</Message>
            </Error>
        </Errors>
        <RequestID>35d1289884eb27ee28057a28d69b72ed</RequestID>
    </Response>
    

    The HTTP error code returned from the API response will be one of:

    4xx errors are as a result of the input you have provided to the API, while a 500 error means there has been an error in our backend - if it re-occurs please contact customer service.

    Type Exception Name Meaning
    Auth AuthFailure Your API authentication details are incorrect.
    Auth SignatureDoesNotMatch The signature you have calculated for the request is not valid.
    Sender IncompleteSignature The signature provided lacked fields.
    Sender MissingAuthenticationToken No or incomplete authentication token provied.
    Client MissingAction You did not specify an API action.
    Client InvalidAction The action you requested is not supported by our API.
    Client RequestExpired The request expired, please try again.
    Client MalformedQueryString The query string provided with the request was invalid.
    Client ValidationError Could not validate your input, one or more values are invalid.
    Client MissingParameter A required parameter for the API call is missing.
    Client AddressLimitExceeded You have used the maximum number of addresses.
    Client MaxSpotInstanceCountExceeded You have requested too many instances.
    Client RequestResourceCountExceeded You have exceedd the limit for the number of resources you are trying to create.
    Client TagLimitExceeded You have used the maximum number of tags on your account.
    Client InsufficientFunds There is too little funds to execute this operation.
    Client InvalidInstanceAttributeValue One of the attributes specified for the instance is invalid.
    Client InvalidInstanceType The instance type requested for the cloud machine was invalid.
    Client InvalidParameterValue One of the parameters provided had an invalid format.
    Client InvalidAMIID.NotFound The cloud machine image requested could not be found.
    Client InvalidAMIID.NotAvailable The cloud machine image requested is not available for new instances.
    Client InvalidHostname.Duplicate You specified a duplicate hostname.
    Client InvalidSubnetID.NotFound The network subnet id provided was not found.
    Client InvalidState The cloud machine is in an invalid state to run this action.
    Client InvalidInstanceID.NotFound The cloud machine instance you specified could not be found.
    Client InvalidZone.NotFound The region or zone you specified is invalid.
    Client InvalidAddress.NotFound The address you specified could not be found.
    Client InvalidInput An invalid input was rovided to the call.
    Client InvalidKeyPair.NotFound The corresponding SSH Key could not be found.
    Client InvalidKeyPair.Duplicate A duplicate SSH key was uploaded.
    Server DryRunOperation The DryRun succeeded, the API call could be executed and permission was given to run it.
    Server ServerError An internal error occurred, try later or contact customer service.