Amazon Lightsail

2017/10/19 - Amazon Lightsail - 3 updated api methods

Changes  This release adds support for Windows Server-based Lightsail instances. The GetInstanceAccessDetails API now returns the password of your Windows Server-based instance when using the default key pair. GetInstanceAccessDetails also returns a PasswordData object for Windows Server instances containing the ciphertext and keyPairName. The Blueprint data type now includes a list of platform values (LINUX_UNIX or WINDOWS). The Bundle data type now includes a list of SupportedPlatforms values (LINUX_UNIX or WINDOWS).

GetBlueprints (updated) Link ¶
Changes (response)
{'blueprints': {'platform': 'LINUX_UNIX | WINDOWS'}}

Returns the list of available instance images, or blueprints . You can use a blueprint to create a new virtual private server already running a specific operating system, as well as a preinstalled app or development stack. The software each instance is running depends on the blueprint image you choose.

See also: AWS API Documentation

Request Syntax

client.get_blueprints(
    includeInactive=True|False,
    pageToken='string'
)
type includeInactive

boolean

param includeInactive

A Boolean value indicating whether to include inactive results in your request.

type pageToken

string

param pageToken

A token used for advancing to the next page of results from your get blueprints request.

rtype

dict

returns

Response Syntax

{
    'blueprints': [
        {
            'blueprintId': 'string',
            'name': 'string',
            'group': 'string',
            'type': 'os'|'app',
            'description': 'string',
            'isActive': True|False,
            'minPower': 123,
            'version': 'string',
            'versionCode': 'string',
            'productUrl': 'string',
            'licenseUrl': 'string',
            'platform': 'LINUX_UNIX'|'WINDOWS'
        },
    ],
    'nextPageToken': 'string'
}

Response Structure

  • (dict) --

    • blueprints (list) --

      An array of key-value pairs that contains information about the available blueprints.

      • (dict) --

        Describes a blueprint (a virtual private server image).

        • blueprintId (string) --

          The ID for the virtual private server image (e.g., app_wordpress_4_4 or app_lamp_7_0 ).

        • name (string) --

          The friendly name of the blueprint (e.g., Amazon Linux ).

        • group (string) --

          The group name of the blueprint (e.g., amazon-linux ).

        • type (string) --

          The type of the blueprint (e.g., os or app ).

        • description (string) --

          The description of the blueprint.

        • isActive (boolean) --

          A Boolean value indicating whether the blueprint is active. When you update your blueprints, you will inactivate old blueprints and keep the most recent versions active.

        • minPower (integer) --

          The minimum bundle power required to run this blueprint. For example, you need a bundle with a power value of 500 or more to create an instance that uses a blueprint with a minimum power value of 500. 0 indicates that the blueprint runs on all instance sizes.

        • version (string) --

          The version number of the operating system, application, or stack (e.g., 2016.03.0 ).

        • versionCode (string) --

          The version code.

        • productUrl (string) --

          The product URL to learn more about the image or blueprint.

        • licenseUrl (string) --

          The end-user license agreement URL for the image or blueprint.

        • platform (string) --

          The operating system platform (either Linux/Unix-based or Windows Server-based) of the blueprint.

    • nextPageToken (string) --

      A token used for advancing to the next page of results from your get blueprints request.

GetBundles (updated) Link ¶
Changes (response)
{'bundles': {'supportedPlatforms': ['LINUX_UNIX | WINDOWS']}}

Returns the list of bundles that are available for purchase. A bundle describes the specs for your virtual private server (or instance ).

See also: AWS API Documentation

Request Syntax

client.get_bundles(
    includeInactive=True|False,
    pageToken='string'
)
type includeInactive

boolean

param includeInactive

A Boolean value that indicates whether to include inactive bundle results in your request.

type pageToken

string

param pageToken

A token used for advancing to the next page of results from your get bundles request.

rtype

dict

returns

Response Syntax

{
    'bundles': [
        {
            'price': ...,
            'cpuCount': 123,
            'diskSizeInGb': 123,
            'bundleId': 'string',
            'instanceType': 'string',
            'isActive': True|False,
            'name': 'string',
            'power': 123,
            'ramSizeInGb': ...,
            'transferPerMonthInGb': 123,
            'supportedPlatforms': [
                'LINUX_UNIX'|'WINDOWS',
            ]
        },
    ],
    'nextPageToken': 'string'
}

Response Structure

  • (dict) --

    • bundles (list) --

      An array of key-value pairs that contains information about the available bundles.

      • (dict) --

        Describes a bundle, which is a set of specs describing your virtual private server (or instance ).

        • price (float) --

          The price in US dollars (e.g., 5.0 ).

        • cpuCount (integer) --

          The number of vCPUs included in the bundle (e.g., 2 ).

        • diskSizeInGb (integer) --

          The size of the SSD (e.g., 30 ).

        • bundleId (string) --

          The bundle ID (e.g., micro_1_0 ).

        • instanceType (string) --

          The Amazon EC2 instance type (e.g., t2.micro ).

        • isActive (boolean) --

          A Boolean value indicating whether the bundle is active.

        • name (string) --

          A friendly name for the bundle (e.g., Micro ).

        • power (integer) --

          A numeric value that represents the power of the bundle (e.g., 500 ). You can use the bundle's power value in conjunction with a blueprint's minimum power value to determine whether the blueprint will run on the bundle. For example, you need a bundle with a power value of 500 or more to create an instance that uses a blueprint with a minimum power value of 500.

        • ramSizeInGb (float) --

          The amount of RAM in GB (e.g., 2.0 ).

        • transferPerMonthInGb (integer) --

          The data transfer rate per month in GB (e.g., 2000 ).

        • supportedPlatforms (list) --

          The operating system platform (Linux/Unix-based or Windows Server-based) that the bundle supports. You can only launch a WINDOWS bundle on a blueprint that supports the WINDOWS platform. LINUX_UNIX blueprints require a LINUX_UNIX bundle.

          • (string) --

    • nextPageToken (string) --

      A token used for advancing to the next page of results from your get active names request.

GetInstanceAccessDetails (updated) Link ¶
Changes (response)
{'accessDetails': {'passwordData': {'ciphertext': 'string',
                                    'keyPairName': 'string'}}}

Returns temporary SSH keys you can use to connect to a specific virtual private server, or instance .

See also: AWS API Documentation

Request Syntax

client.get_instance_access_details(
    instanceName='string',
    protocol='ssh'|'rdp'
)
type instanceName

string

param instanceName

[REQUIRED]

The name of the instance to access.

type protocol

string

param protocol

The protocol to use to connect to your instance. Defaults to ssh .

rtype

dict

returns

Response Syntax

{
    'accessDetails': {
        'certKey': 'string',
        'expiresAt': datetime(2015, 1, 1),
        'ipAddress': 'string',
        'password': 'string',
        'passwordData': {
            'ciphertext': 'string',
            'keyPairName': 'string'
        },
        'privateKey': 'string',
        'protocol': 'ssh'|'rdp',
        'instanceName': 'string',
        'username': 'string'
    }
}

Response Structure

  • (dict) --

    • accessDetails (dict) --

      An array of key-value pairs containing information about a get instance access request.

      • certKey (string) --

        For SSH access, the public key to use when accessing your instance For OpenSSH clients (e.g., command line SSH), you should save this value to tempkey-cert.pub .

      • expiresAt (datetime) --

        For SSH access, the date on which the temporary keys expire.

      • ipAddress (string) --

        The public IP address of the Amazon Lightsail instance.

      • password (string) --

        For RDP access, the password for your Amazon Lightsail instance. Password will be an empty string if the password for your new instance is not ready yet. When you create an instance, it can take up to 15 minutes for the instance to be ready.

        Note

        If you create an instance using any key pair other than the default ( LightsailDefaultKeyPair ), password will always be an empty string.

        If you change the Administrator password on the instance, Lightsail will continue to return the original password value. When accessing the instance using RDP, you need to manually enter the Administrator password after changing it from the default.

      • passwordData (dict) --

        For a Windows Server-based instance, an object with the data you can use to retrieve your password. This is only needed if password is empty and the instance is not new (and therefore the password is not ready yet). When you create an instance, it can take up to 15 minutes for the instance to be ready.

        • ciphertext (string) --

          The encrypted password. Ciphertext will be an empty string if access to your new instance is not ready yet. When you create an instance, it can take up to 15 minutes for the instance to be ready.

          Note

          If you use the default key pair ( LightsailDefaultKeyPair ), the decrypted password will be available in the password field.

          If you are using a custom key pair, you need to use your own means of decryption.

          If you change the Administrator password on the instance, Lightsail will continue to return the original ciphertext value. When accessing the instance using RDP, you need to manually enter the Administrator password after changing it from the default.

        • keyPairName (string) --

          The name of the key pair that you used when creating your instance. If no key pair name was specified when creating the instance, Lightsail uses the default key pair ( LightsailDefaultKeyPair ).

          If you are using a custom key pair, you need to use your own means of decrypting your password using the ciphertext . Lightsail creates the ciphertext by encrypting your password with the public key part of this key pair.

      • privateKey (string) --

        For SSH access, the temporary private key. For OpenSSH clients (e.g., command line SSH), you should save this value to tempkey ).

      • protocol (string) --

        The protocol for these Amazon Lightsail instance access details.

      • instanceName (string) --

        The name of this Amazon Lightsail instance.

      • username (string) --

        The user name to use when logging in to the Amazon Lightsail instance.