Amazon Elastic Compute Cloud

2018/04/19 - Amazon Elastic Compute Cloud - 1 updated api methods

Changes  Update ec2 client to latest version

DescribeHosts (updated) Link ΒΆ
Changes (response)
{'Hosts': {'AllocationTime': 'timestamp', 'ReleaseTime': 'timestamp'}}

Describes one or more of your Dedicated Hosts.

The results describe only the Dedicated Hosts in the region you're currently using. All listed instances consume capacity on your Dedicated Host. Dedicated Hosts that have recently been released will be listed with the state released.

See also: AWS API Documentation

Request Syntax

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

list

param Filter:

One or more filters.

  • auto-placement - Whether auto-placement is enabled or disabled ( on | off).

  • availability-zone - The Availability Zone of the host.

  • client-token - The idempotency token you provided when you allocated the host.

  • host-reservation-id - The ID of the reservation assigned to this host.

  • instance-type - The instance type size that the Dedicated Host is configured to support.

  • state - The allocation state of the Dedicated Host ( available | under-assessment | permanent-failure | released | released-permanent-failure).

  • (dict) --

    A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs. The filters supported by a describe operation are documented with the describe operation. For example:

    • DescribeAvailabilityZones

    • DescribeImages

    • DescribeInstances

    • DescribeKeyPairs

    • DescribeSecurityGroups

    • DescribeSnapshots

    • DescribeSubnets

    • DescribeTags

    • DescribeVolumes

    • DescribeVpcs

    • 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 HostIds:

list

param HostIds:

The IDs of the Dedicated Hosts. The IDs are used for targeted instance launches.

  • (string) --

type MaxResults:

integer

param MaxResults:

The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned nextToken value. This value can be between 5 and 500; if maxResults is given a larger value than 500, you will receive an error. You cannot specify this parameter and the host IDs parameter in the same request.

type NextToken:

string

param NextToken:

The token to retrieve the next page of results.

rtype:

dict

returns:

Response Syntax

{
    'Hosts': [
        {
            'AutoPlacement': 'on'|'off',
            'AvailabilityZone': 'string',
            'AvailableCapacity': {
                'AvailableInstanceCapacity': [
                    {
                        'AvailableCapacity': 123,
                        'InstanceType': 'string',
                        'TotalCapacity': 123
                    },
                ],
                'AvailableVCpus': 123
            },
            'ClientToken': 'string',
            'HostId': 'string',
            'HostProperties': {
                'Cores': 123,
                'InstanceType': 'string',
                'Sockets': 123,
                'TotalVCpus': 123
            },
            'HostReservationId': 'string',
            'Instances': [
                {
                    'InstanceId': 'string',
                    'InstanceType': 'string'
                },
            ],
            'State': 'available'|'under-assessment'|'permanent-failure'|'released'|'released-permanent-failure',
            'AllocationTime': datetime(2015, 1, 1),
            'ReleaseTime': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    Contains the output of DescribeHosts.

    • Hosts (list) --

      Information about the Dedicated Hosts.

      • (dict) --

        Describes the properties of the Dedicated Host.

        • AutoPlacement (string) --

          Whether auto-placement is on or off.

        • AvailabilityZone (string) --

          The Availability Zone of the Dedicated Host.

        • AvailableCapacity (dict) --

          The number of new instances that can be launched onto the Dedicated Host.

          • AvailableInstanceCapacity (list) --

            The total number of instances that the Dedicated Host supports.

            • (dict) --

              Information about the instance type that the Dedicated Host supports.

              • AvailableCapacity (integer) --

                The number of instances that can still be launched onto the Dedicated Host.

              • InstanceType (string) --

                The instance type size supported by the Dedicated Host.

              • TotalCapacity (integer) --

                The total number of instances that can be launched onto the Dedicated Host.

          • AvailableVCpus (integer) --

            The number of vCPUs available on the Dedicated Host.

        • ClientToken (string) --

          Unique, case-sensitive identifier you provide to ensure idempotency of the request. For more information, see How to Ensure Idempotency in the Amazon Elastic Compute Cloud User Guide.

        • HostId (string) --

          The ID of the Dedicated Host.

        • HostProperties (dict) --

          The hardware specifications of the Dedicated Host.

          • Cores (integer) --

            The number of cores on the Dedicated Host.

          • InstanceType (string) --

            The instance type size that the Dedicated Host supports (for example, m3.medium).

          • Sockets (integer) --

            The number of sockets on the Dedicated Host.

          • TotalVCpus (integer) --

            The number of vCPUs on the Dedicated Host.

        • HostReservationId (string) --

          The reservation ID of the Dedicated Host. This returns a null response if the Dedicated Host doesn't have an associated reservation.

        • Instances (list) --

          The IDs and instance type that are currently running on the Dedicated Host.

          • (dict) --

            Describes an instance running on a Dedicated Host.

            • InstanceId (string) --

              the IDs of instances that are running on the Dedicated Host.

            • InstanceType (string) --

              The instance type size (for example, m3.medium) of the running instance.

        • State (string) --

          The Dedicated Host's state.

        • AllocationTime (datetime) --

          The time that the Dedicated Host was allocated.

        • ReleaseTime (datetime) --

          The time that the Dedicated Host was released.

    • 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.