Amazon Elastic Compute Cloud

2016/05/24 - Amazon Elastic Compute Cloud - 1 new2 updated api methods

Changes  Update ec2 client to latest version

GetConsoleScreenshot (new) Link ¶

Retrieve a JPG-format screenshot of an instance to help with troubleshooting.

For API calls, the returned content is base64-encoded. For command line tools, the decoding is performed for you.

Request Syntax

client.get_console_screenshot(
    DryRun=True|False,
    InstanceId='string',
    WakeUp=True|False
)
type DryRun:

boolean

param DryRun:

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

type InstanceId:

string

param InstanceId:

[REQUIRED]

The ID of the instance.

type WakeUp:

boolean

param WakeUp:

When set to true, acts as keystroke input and wakes up an instance that's in standby or "sleep" mode.

rtype:

dict

returns:

Response Syntax

{
    'InstanceId': 'string',
    'ImageData': 'string'
}

Response Structure

  • (dict) --

    Contains the output of the request.

    • InstanceId (string) --

      The ID of the instance.

    • ImageData (string) --

      The data that comprises the image.

CreateNatGateway (updated) Link ¶
Changes (response)
{'NatGateway': {'ProvisionedBandwidth': {'ProvisionTime': 'timestamp',
                                         'Provisioned': 'string',
                                         'RequestTime': 'timestamp',
                                         'Requested': 'string',
                                         'Status': 'string'}}}

Creates a NAT gateway in the specified subnet. A NAT gateway can be used to enable instances in a private subnet to connect to the Internet. This action creates a network interface in the specified subnet with a private IP address from the IP address range of the subnet. For more information, see NAT Gateways in the Amazon Virtual Private Cloud User Guide.

Request Syntax

client.create_nat_gateway(
    SubnetId='string',
    AllocationId='string',
    ClientToken='string'
)
type SubnetId:

string

param SubnetId:

[REQUIRED]

The subnet in which to create the NAT gateway.

type AllocationId:

string

param AllocationId:

[REQUIRED]

The allocation ID of an Elastic IP address to associate with the NAT gateway. If the Elastic IP address is associated with another resource, you must first disassociate it.

type ClientToken:

string

param ClientToken:

Unique, case-sensitive identifier you provide to ensure the idempotency of the request. For more information, see How to Ensure Idempotency.

Constraint: Maximum 64 ASCII characters.

rtype:

dict

returns:

Response Syntax

{
    'NatGateway': {
        'VpcId': 'string',
        'SubnetId': 'string',
        'NatGatewayId': 'string',
        'CreateTime': datetime(2015, 1, 1),
        'DeleteTime': datetime(2015, 1, 1),
        'NatGatewayAddresses': [
            {
                'PublicIp': 'string',
                'AllocationId': 'string',
                'PrivateIp': 'string',
                'NetworkInterfaceId': 'string'
            },
        ],
        'State': 'pending'|'failed'|'available'|'deleting'|'deleted',
        'FailureCode': 'string',
        'FailureMessage': 'string',
        'ProvisionedBandwidth': {
            'Provisioned': 'string',
            'Requested': 'string',
            'RequestTime': datetime(2015, 1, 1),
            'ProvisionTime': datetime(2015, 1, 1),
            'Status': 'string'
        }
    },
    'ClientToken': 'string'
}

Response Structure

  • (dict) --

    Contains the output of CreateNatGateway.

    • NatGateway (dict) --

      Information about the NAT gateway.

      • VpcId (string) --

        The ID of the VPC in which the NAT gateway is located.

      • SubnetId (string) --

        The ID of the subnet in which the NAT gateway is located.

      • NatGatewayId (string) --

        The ID of the NAT gateway.

      • CreateTime (datetime) --

        The date and time the NAT gateway was created.

      • DeleteTime (datetime) --

        The date and time the NAT gateway was deleted, if applicable.

      • NatGatewayAddresses (list) --

        Information about the IP addresses and network interface associated with the NAT gateway.

        • (dict) --

          Describes the IP addresses and network interface associated with a NAT gateway.

          • PublicIp (string) --

            The Elastic IP address associated with the NAT gateway.

          • AllocationId (string) --

            The allocation ID of the Elastic IP address that's associated with the NAT gateway.

          • PrivateIp (string) --

            The private IP address associated with the Elastic IP address.

          • NetworkInterfaceId (string) --

            The ID of the network interface associated with the NAT gateway.

      • State (string) --

        The state of the NAT gateway.

        • pending: The NAT gateway is being created and is not ready to process traffic.

        • failed: The NAT gateway could not be created. Check the failureCode and failureMessage fields for the reason.

        • available: The NAT gateway is able to process traffic. This status remains until you delete the NAT gateway, and does not indicate the health of the NAT gateway.

        • deleting: The NAT gateway is in the process of being terminated and may still be processing traffic.

        • deleted: The NAT gateway has been terminated and is no longer processing traffic.

      • FailureCode (string) --

        If the NAT gateway could not be created, specifies the error code for the failure. ( InsufficientFreeAddressesInSubnet | Gateway.NotAttached | InvalidAllocationID.NotFound | Resource.AlreadyAssociated | InternalError | InvalidSubnetID.NotFound)

      • FailureMessage (string) --

        If the NAT gateway could not be created, specifies the error message for the failure, that corresponds to the error code.

        • For InsufficientFreeAddressesInSubnet: "Subnet has insufficient free addresses to create this NAT gateway"

        • For Gateway.NotAttached: "Network vpc-xxxxxxxx has no Internet gateway attached"

        • For InvalidAllocationID.NotFound: "Elastic IP address eipalloc-xxxxxxxx could not be associated with this NAT gateway"

        • For Resource.AlreadyAssociated: "Elastic IP address eipalloc-xxxxxxxx is already associated"

        • For InternalError: "Network interface eni-xxxxxxxx, created and used internally by this NAT gateway is in an invalid state. Please try again."

        • For InvalidSubnetID.NotFound: "The specified subnet subnet-xxxxxxxx does not exist or could not be found."

      • ProvisionedBandwidth (dict) --

        Reserved. If you need to sustain traffic greater than the documented limits, contact us through the Support Center.

    • ClientToken (string) --

      Unique, case-sensitive identifier to ensure the idempotency of the request. Only returned if a client token was provided in the request.

DescribeNatGateways (updated) Link ¶
Changes (response)
{'NatGateways': {'ProvisionedBandwidth': {'ProvisionTime': 'timestamp',
                                          'Provisioned': 'string',
                                          'RequestTime': 'timestamp',
                                          'Requested': 'string',
                                          'Status': 'string'}}}

Describes one or more of the your NAT gateways.

Request Syntax

client.describe_nat_gateways(
    NatGatewayIds=[
        'string',
    ],
    Filter=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    MaxResults=123,
    NextToken='string'
)
type NatGatewayIds:

list

param NatGatewayIds:

One or more NAT gateway IDs.

  • (string) --

type Filter:

list

param Filter:

One or more filters.

  • nat-gateway-id - The ID of the NAT gateway.

  • state - The state of the NAT gateway ( pending | failed | available | deleting | deleted).

  • subnet-id - The ID of the subnet in which the NAT gateway resides.

  • vpc-id - The ID of the VPC in which the NAT gateway resides.

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results. Filters can be used to match a set of resources by various criteria, such as tags, attributes, or IDs.

    • Name (string) --

      The name of the filter. Filter names are case-sensitive.

    • Values (list) --

      One or more filter values. Filter values are case-sensitive.

      • (string) --

type MaxResults:

integer

param MaxResults:

The maximum number of items to return for this request. The request returns a token that you can specify in a subsequent call to get the next set of results.

Constraint: If the value specified is greater than 1000, we return only 1000 items.

type NextToken:

string

param NextToken:

The token to retrieve the next page of results.

rtype:

dict

returns:

Response Syntax

{
    'NatGateways': [
        {
            'VpcId': 'string',
            'SubnetId': 'string',
            'NatGatewayId': 'string',
            'CreateTime': datetime(2015, 1, 1),
            'DeleteTime': datetime(2015, 1, 1),
            'NatGatewayAddresses': [
                {
                    'PublicIp': 'string',
                    'AllocationId': 'string',
                    'PrivateIp': 'string',
                    'NetworkInterfaceId': 'string'
                },
            ],
            'State': 'pending'|'failed'|'available'|'deleting'|'deleted',
            'FailureCode': 'string',
            'FailureMessage': 'string',
            'ProvisionedBandwidth': {
                'Provisioned': 'string',
                'Requested': 'string',
                'RequestTime': datetime(2015, 1, 1),
                'ProvisionTime': datetime(2015, 1, 1),
                'Status': 'string'
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Contains the output of DescribeNatGateways.

    • NatGateways (list) --

      Information about the NAT gateways.

      • (dict) --

        Describes a NAT gateway.

        • VpcId (string) --

          The ID of the VPC in which the NAT gateway is located.

        • SubnetId (string) --

          The ID of the subnet in which the NAT gateway is located.

        • NatGatewayId (string) --

          The ID of the NAT gateway.

        • CreateTime (datetime) --

          The date and time the NAT gateway was created.

        • DeleteTime (datetime) --

          The date and time the NAT gateway was deleted, if applicable.

        • NatGatewayAddresses (list) --

          Information about the IP addresses and network interface associated with the NAT gateway.

          • (dict) --

            Describes the IP addresses and network interface associated with a NAT gateway.

            • PublicIp (string) --

              The Elastic IP address associated with the NAT gateway.

            • AllocationId (string) --

              The allocation ID of the Elastic IP address that's associated with the NAT gateway.

            • PrivateIp (string) --

              The private IP address associated with the Elastic IP address.

            • NetworkInterfaceId (string) --

              The ID of the network interface associated with the NAT gateway.

        • State (string) --

          The state of the NAT gateway.

          • pending: The NAT gateway is being created and is not ready to process traffic.

          • failed: The NAT gateway could not be created. Check the failureCode and failureMessage fields for the reason.

          • available: The NAT gateway is able to process traffic. This status remains until you delete the NAT gateway, and does not indicate the health of the NAT gateway.

          • deleting: The NAT gateway is in the process of being terminated and may still be processing traffic.

          • deleted: The NAT gateway has been terminated and is no longer processing traffic.

        • FailureCode (string) --

          If the NAT gateway could not be created, specifies the error code for the failure. ( InsufficientFreeAddressesInSubnet | Gateway.NotAttached | InvalidAllocationID.NotFound | Resource.AlreadyAssociated | InternalError | InvalidSubnetID.NotFound)

        • FailureMessage (string) --

          If the NAT gateway could not be created, specifies the error message for the failure, that corresponds to the error code.

          • For InsufficientFreeAddressesInSubnet: "Subnet has insufficient free addresses to create this NAT gateway"

          • For Gateway.NotAttached: "Network vpc-xxxxxxxx has no Internet gateway attached"

          • For InvalidAllocationID.NotFound: "Elastic IP address eipalloc-xxxxxxxx could not be associated with this NAT gateway"

          • For Resource.AlreadyAssociated: "Elastic IP address eipalloc-xxxxxxxx is already associated"

          • For InternalError: "Network interface eni-xxxxxxxx, created and used internally by this NAT gateway is in an invalid state. Please try again."

          • For InvalidSubnetID.NotFound: "The specified subnet subnet-xxxxxxxx does not exist or could not be found."

        • ProvisionedBandwidth (dict) --

          Reserved. If you need to sustain traffic greater than the documented limits, contact us through the Support Center.

    • NextToken (string) --

      The token to use to retrieve the next page of results. This value is null when there are no more results to return.