Amazon Simple Systems Manager (SSM)

2017/11/14 - Amazon Simple Systems Manager (SSM) - 2 updated api methods

Changes  EC2 Systems Manager GetInventory API adds support for aggregation.

GetInventory (updated) Link ¶
Changes (request)
{'Aggregators': [{'Aggregators': (), 'Expression': 'string'}]}

Query inventory information.

See also: AWS API Documentation

Request Syntax

client.get_inventory(
    Filters=[
        {
            'Key': 'string',
            'Values': [
                'string',
            ],
            'Type': 'Equal'|'NotEqual'|'BeginWith'|'LessThan'|'GreaterThan'
        },
    ],
    Aggregators=[
        {
            'Expression': 'string',
            'Aggregators': {'... recursive ...'}
        },
    ],
    ResultAttributes=[
        {
            'TypeName': 'string'
        },
    ],
    NextToken='string',
    MaxResults=123
)
type Filters

list

param Filters

One or more filters. Use a filter to return a more specific list of results.

  • (dict) --

    One or more filters. Use a filter to return a more specific list of results.

    • Key (string) -- [REQUIRED]

      The name of the filter key.

    • Values (list) -- [REQUIRED]

      Inventory filter values. Example: inventory filter where instance IDs are specified as values Key=AWS:InstanceInformation.InstanceId,Values= i-a12b3c4d5e6g, i-1a2b3c4d5e6,Type=Equal

      • (string) --

    • Type (string) --

      The type of filter. Valid values include the following: "Equal"|"NotEqual"|"BeginWith"|"LessThan"|"GreaterThan"

type Aggregators

list

param Aggregators

Returns counts of inventory types based on one or more expressions. For example, if you aggregate by using an expression that uses the AWS:InstanceInformation.PlatformType type, you can see a count of how many Windows and Linux instances exist in your inventoried fleet.

  • (dict) --

    Specifies the inventory type and attribute for the aggregation execution.

    • Expression (string) --

      The inventory type and attribute name for aggregation.

    • Aggregators (list) --

      Nested aggregators to further refine aggregation for an inventory type.

type ResultAttributes

list

param ResultAttributes

The list of inventory item types to return.

  • (dict) --

    The inventory item result attribute.

    • TypeName (string) -- [REQUIRED]

      Name of the inventory item type. Valid value: AWS:InstanceInformation. Default Value: AWS:InstanceInformation.

type NextToken

string

param NextToken

The token for the next set of items to return. (You received this token from a previous call.)

type MaxResults

integer

param MaxResults

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

rtype

dict

returns

Response Syntax

{
    'Entities': [
        {
            'Id': 'string',
            'Data': {
                'string': {
                    'TypeName': 'string',
                    'SchemaVersion': 'string',
                    'CaptureTime': 'string',
                    'ContentHash': 'string',
                    'Content': [
                        {
                            'string': 'string'
                        },
                    ]
                }
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Entities (list) --

      Collection of inventory entities such as a collection of instance inventory.

      • (dict) --

        Inventory query results.

        • Id (string) --

          ID of the inventory result entity. For example, for managed instance inventory the result will be the managed instance ID. For EC2 instance inventory, the result will be the instance ID.

        • Data (dict) --

          The data section in the inventory result entity json.

          • (string) --

            • (dict) --

              The inventory result item.

              • TypeName (string) --

                The name of the inventory result item type.

              • SchemaVersion (string) --

                The schema version for the inventory result item/

              • CaptureTime (string) --

                The time inventory item data was captured.

              • ContentHash (string) --

                MD5 hash of the inventory item type contents. The content hash is used to determine whether to update inventory information. The PutInventory API does not update the inventory item type contents if the MD5 hash has not changed since last update.

              • Content (list) --

                Contains all the inventory data of the item type. Results include attribute names and values.

                • (dict) --

                  • (string) --

                    • (string) --

    • NextToken (string) --

      The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

GetInventorySchema (updated) Link ¶
Changes (request, response)
Request
{'Aggregator': 'boolean'}
Response
{'Schemas': {'DisplayName': 'string'}}

Return a list of inventory type names for the account, or return a list of attribute names for a specific Inventory item type.

See also: AWS API Documentation

Request Syntax

client.get_inventory_schema(
    TypeName='string',
    NextToken='string',
    MaxResults=123,
    Aggregator=True|False,
    SubType=True|False
)
type TypeName

string

param TypeName

The type of inventory item to return.

type NextToken

string

param NextToken

The token for the next set of items to return. (You received this token from a previous call.)

type MaxResults

integer

param MaxResults

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

type Aggregator

boolean

param Aggregator

Returns inventory schemas that support aggregation. For example, this call returns the AWS:InstanceInformation type, because it supports aggregation based on the PlatformName , PlatformType , and PlatformVersion attributes.

type SubType

boolean

param SubType

Returns the sub-type schema for a specified inventory type.

rtype

dict

returns

Response Syntax

{
    'Schemas': [
        {
            'TypeName': 'string',
            'Version': 'string',
            'Attributes': [
                {
                    'Name': 'string',
                    'DataType': 'string'|'number'
                },
            ],
            'DisplayName': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Schemas (list) --

      Inventory schemas returned by the request.

      • (dict) --

        The inventory item schema definition. Users can use this to compose inventory query filters.

        • TypeName (string) --

          The name of the inventory type. Default inventory item type names start with AWS. Custom inventory type names will start with Custom. Default inventory item types include the following: AWS:AWSComponent, AWS:Application, AWS:InstanceInformation, AWS:Network, and AWS:WindowsUpdate.

        • Version (string) --

          The schema version for the inventory item.

        • Attributes (list) --

          The schema attributes for inventory. This contains data type and attribute name.

          • (dict) --

            Attributes are the entries within the inventory item content. It contains name and value.

            • Name (string) --

              Name of the inventory item attribute.

            • DataType (string) --

              The data type of the inventory item attribute.

        • DisplayName (string) --

          The alias name of the inventory type. The alias name is used for display purposes.

    • NextToken (string) --

      The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.