Amazon Simple Systems Manager (SSM)

2018/04/19 - Amazon Simple Systems Manager (SSM) - 2 new1 updated api methods

Changes  Update ssm client to latest version

DescribeInventoryDeletions (new) Link ¶

Describes a specific delete inventory operation.

See also: AWS API Documentation

Request Syntax

client.describe_inventory_deletions(
    DeletionId='string',
    NextToken='string',
    MaxResults=123
)
type DeletionId:

string

param DeletionId:

Specify the delete inventory ID for which you want information. This ID was returned by the DeleteInventory action.

type NextToken:

string

param NextToken:

A token to start the list. Use this token to get the next set of results.

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

{
    'InventoryDeletions': [
        {
            'DeletionId': 'string',
            'TypeName': 'string',
            'DeletionStartTime': datetime(2015, 1, 1),
            'LastStatus': 'InProgress'|'Complete',
            'LastStatusMessage': 'string',
            'DeletionSummary': {
                'TotalCount': 123,
                'RemainingCount': 123,
                'SummaryItems': [
                    {
                        'Version': 'string',
                        'Count': 123,
                        'RemainingCount': 123
                    },
                ]
            },
            'LastStatusUpdateTime': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • InventoryDeletions (list) --

      A list of status items for deleted inventory.

      • (dict) --

        Status information returned by the DeleteInventory action.

        • DeletionId (string) --

          The deletion ID returned by the DeleteInventory action.

        • TypeName (string) --

          The name of the inventory data type.

        • DeletionStartTime (datetime) --

          The UTC timestamp when the delete operation started.

        • LastStatus (string) --

          The status of the operation. Possible values are InProgress and Complete.

        • LastStatusMessage (string) --

          Information about the status.

        • DeletionSummary (dict) --

          Information about the delete operation. For more information about this summary, see Understanding the Delete Inventory Summary.

          • TotalCount (integer) --

            The total number of items to delete. This count does not change during the delete operation.

          • RemainingCount (integer) --

            Remaining number of items to delete.

          • SummaryItems (list) --

            A list of counts and versions for deleted items.

            • (dict) --

              Either a count, remaining count, or a version number in a delete inventory summary.

              • Version (string) --

                The inventory type version.

              • Count (integer) --

                A count of the number of deleted items.

              • RemainingCount (integer) --

                The remaining number of items to delete.

        • LastStatusUpdateTime (datetime) --

          The UTC timestamp of when the last status report.

    • NextToken (string) --

      The token for the next set of items to return. Use this token to get the next set of results.

DeleteInventory (new) Link ¶

Delete a custom inventory type, or the data associated with a custom Inventory type. Deleting a custom inventory type is also referred to as deleting a custom inventory schema.

See also: AWS API Documentation

Request Syntax

client.delete_inventory(
    TypeName='string',
    SchemaDeleteOption='DisableSchema'|'DeleteSchema',
    DryRun=True|False,
    ClientToken='string'
)
type TypeName:

string

param TypeName:

[REQUIRED]

The name of the custom inventory type for which you want to delete either all previously collected data, or the inventory type itself.

type SchemaDeleteOption:

string

param SchemaDeleteOption:

Use the SchemaDeleteOption to delete a custom inventory type (schema). If you don't choose this option, the system only deletes existing inventory data associated with the custom inventory type. Choose one of the following options:

DisableSchema: If you choose this option, the system ignores all inventory data for the specified version, and any earlier versions. To enable this schema again, you must call the PutInventory action for a version greater than the disbled version.

DeleteSchema: This option deletes the specified custom type from the Inventory service. You can recreate the schema later, if you want.

type DryRun:

boolean

param DryRun:

Use this option to view a summary of the deletion request without deleting any data or the data type. This option is useful when you only want to understand what will be deleted. Once you validate that the data to be deleted is what you intend to delete, you can run the same command without specifying the DryRun option.

type ClientToken:

string

param ClientToken:

User-provided idempotency token.

This field is autopopulated if not provided.

rtype:

dict

returns:

Response Syntax

{
    'DeletionId': 'string',
    'TypeName': 'string',
    'DeletionSummary': {
        'TotalCount': 123,
        'RemainingCount': 123,
        'SummaryItems': [
            {
                'Version': 'string',
                'Count': 123,
                'RemainingCount': 123
            },
        ]
    }
}

Response Structure

  • (dict) --

    • DeletionId (string) --

      Every DeleteInventory action is assigned a unique ID. This option returns a unique ID. You can use this ID to query the status of a delete operation. This option is useful for ensuring that a delete operation has completed before you begin other actions.

    • TypeName (string) --

      The name of the inventory data type specified in the request.

    • DeletionSummary (dict) --

      A summary of the delete operation. For more information about this summary, see Understanding the Delete Inventory Summary.

      • TotalCount (integer) --

        The total number of items to delete. This count does not change during the delete operation.

      • RemainingCount (integer) --

        Remaining number of items to delete.

      • SummaryItems (list) --

        A list of counts and versions for deleted items.

        • (dict) --

          Either a count, remaining count, or a version number in a delete inventory summary.

          • Version (string) --

            The inventory type version.

          • Count (integer) --

            A count of the number of deleted items.

          • RemainingCount (integer) --

            The remaining number of items to delete.

PutInventory (updated) Link ¶
Changes (response)
{'Message': 'string'}

Bulk update custom inventory items on one more instance. The request adds an inventory item, if it doesn't already exist, or updates an inventory item, if it does exist.

See also: AWS API Documentation

Request Syntax

client.put_inventory(
    InstanceId='string',
    Items=[
        {
            'TypeName': 'string',
            'SchemaVersion': 'string',
            'CaptureTime': 'string',
            'ContentHash': 'string',
            'Content': [
                {
                    'string': 'string'
                },
            ],
            'Context': {
                'string': 'string'
            }
        },
    ]
)
type InstanceId:

string

param InstanceId:

[REQUIRED]

One or more instance IDs where you want to add or update inventory items.

type Items:

list

param Items:

[REQUIRED]

The inventory items that you want to add or update on instances.

  • (dict) --

    Information collected from managed instances based on your inventory policy document

    • TypeName (string) -- [REQUIRED]

      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.

    • SchemaVersion (string) -- [REQUIRED]

      The schema version for the inventory item.

    • CaptureTime (string) -- [REQUIRED]

      The time the inventory information was collected.

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

      The inventory data of the inventory type.

      • (dict) --

        • (string) --

          • (string) --

    • Context (dict) --

      A map of associated properties for a specified inventory type. For example, with this attribute, you can specify the ExecutionId, ExecutionType, ComplianceType properties of the AWS:ComplianceItem type.

      • (string) --

        • (string) --

rtype:

dict

returns:

Response Syntax

{
    'Message': 'string'
}

Response Structure

  • (dict) --

    • Message (string) --

      Information about the request.