SSM

Table of Contents

Client

class SSM.Client

A low-level client representing Amazon Simple Systems Management Service (SSM):

import boto3

client = boto3.client('ssm')

These are the available methods:

can_paginate(operation_name)

Check if an operation can be paginated.

Parameters:operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Returns:True if the operation can be paginated, False otherwise.
create_association(**kwargs)

Associates the specified configuration document with the specified instance.

When you associate a configuration document with an instance, the configuration agent on the instance processes the configuration document and configures the instance as specified.

If you associate a configuration document with an instance that already has an associated configuration document, we replace the current configuration document with the new configuration document.

Request Syntax

response = client.create_association(
    Name='string',
    InstanceId='string'
)
Parameters:
  • Name (string) --

    [REQUIRED]

    The name of the configuration document.

  • InstanceId (string) --

    [REQUIRED]

    The ID of the instance.

Return type:

dict

Returns:

Response Syntax

{
    'AssociationDescription': {
        'Name': 'string',
        'InstanceId': 'string',
        'Date': datetime(2015, 1, 1),
        'Status': {
            'Date': datetime(2015, 1, 1),
            'Name': 'Pending'|'Success'|'Failed',
            'Message': 'string',
            'AdditionalInfo': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • AssociationDescription (dict) --

      Information about the association.

      • Name (string) --

        The name of the configuration document.

      • InstanceId (string) --

        The ID of the instance.

      • Date (datetime) --

        The date when the association was made.

      • Status (dict) --

        The association status.

        • Date (datetime) --

          The date when the status changed.

        • Name (string) --

          The status.

        • Message (string) --

          The reason for the status.

        • AdditionalInfo (string) --

          A user-defined string.

create_association_batch(**kwargs)

Associates the specified configuration documents with the specified instances.

When you associate a configuration document with an instance, the configuration agent on the instance processes the configuration document and configures the instance as specified.

If you associate a configuration document with an instance that already has an associated configuration document, we replace the current configuration document with the new configuration document.

Request Syntax

response = client.create_association_batch(
    Entries=[
        {
            'Name': 'string',
            'InstanceId': 'string'
        },
    ]
)
Parameters:Entries (list) --

[REQUIRED]

One or more associations.

  • (dict) --

    Describes the association of a configuration document and an instance.

    • Name (string) --

      The name of the configuration document.

    • InstanceId (string) --

      The ID of the instance.

Return type:dict
Returns:Response Syntax
{
    'Successful': [
        {
            'Name': 'string',
            'InstanceId': 'string',
            'Date': datetime(2015, 1, 1),
            'Status': {
                'Date': datetime(2015, 1, 1),
                'Name': 'Pending'|'Success'|'Failed',
                'Message': 'string',
                'AdditionalInfo': 'string'
            }
        },
    ],
    'Failed': [
        {
            'Entry': {
                'Name': 'string',
                'InstanceId': 'string'
            },
            'Message': 'string',
            'Fault': 'Client'|'Server'|'Unknown'
        },
    ]
}

Response Structure

  • (dict) --
    • Successful (list) --

      Information about the associations that succeeded.

      • (dict) --

        Describes an association.

        • Name (string) --

          The name of the configuration document.

        • InstanceId (string) --

          The ID of the instance.

        • Date (datetime) --

          The date when the association was made.

        • Status (dict) --

          The association status.

          • Date (datetime) --

            The date when the status changed.

          • Name (string) --

            The status.

          • Message (string) --

            The reason for the status.

          • AdditionalInfo (string) --

            A user-defined string.

    • Failed (list) --

      Information about the associations that failed.

      • (dict) --

        Describes a failed association.

        • Entry (dict) --

          The association.

          • Name (string) --

            The name of the configuration document.

          • InstanceId (string) --

            The ID of the instance.

        • Message (string) --

          A description of the failure.

        • Fault (string) --

          The source of the failure.

create_document(**kwargs)

Creates a configuration document.

After you create a configuration document, you can use CreateAssociation to associate it with one or more running instances.

Request Syntax

response = client.create_document(
    Content='string',
    Name='string'
)
Parameters:
  • Content (string) --

    [REQUIRED]

    A valid JSON file. For more information about the contents of this file, see Configuration Document .

  • Name (string) --

    [REQUIRED]

    A name for the configuration document.

Return type:

dict

Returns:

Response Syntax

{
    'DocumentDescription': {
        'Sha1': 'string',
        'Name': 'string',
        'CreatedDate': datetime(2015, 1, 1),
        'Status': 'Creating'|'Active'|'Deleting'
    }
}

Response Structure

  • (dict) --

    • DocumentDescription (dict) --

      Information about the configuration document.

      • Sha1 (string) --

        The SHA1 hash of the document, which you can use for verification purposes.

      • Name (string) --

        The name of the configuration document.

      • CreatedDate (datetime) --

        The date when the configuration document was created.

      • Status (string) --

        The status of the configuration document.

delete_association(**kwargs)

Disassociates the specified configuration document from the specified instance.

When you disassociate a configuration document from an instance, it does not change the configuration of the instance. To change the configuration state of an instance after you disassociate a configuration document, you must create a new configuration document with the desired configuration and associate it with the instance.

Request Syntax

response = client.delete_association(
    Name='string',
    InstanceId='string'
)
Parameters:
  • Name (string) --

    [REQUIRED]

    The name of the configuration document.

  • InstanceId (string) --

    [REQUIRED]

    The ID of the instance.

Return type:

dict

Returns:

Response Syntax

{}

Response Structure

  • (dict) --

delete_document(**kwargs)

Deletes the specified configuration document.

You must use DeleteAssociation to disassociate all instances that are associated with the configuration document before you can delete it.

Request Syntax

response = client.delete_document(
    Name='string'
)
Parameters:Name (string) --

[REQUIRED]

The name of the configuration document.

Return type:dict
Returns:Response Syntax
{}

Response Structure

  • (dict) --
describe_association(**kwargs)

Describes the associations for the specified configuration document or instance.

Request Syntax

response = client.describe_association(
    Name='string',
    InstanceId='string'
)
Parameters:
  • Name (string) --

    [REQUIRED]

    The name of the configuration document.

  • InstanceId (string) --

    [REQUIRED]

    The ID of the instance.

Return type:

dict

Returns:

Response Syntax

{
    'AssociationDescription': {
        'Name': 'string',
        'InstanceId': 'string',
        'Date': datetime(2015, 1, 1),
        'Status': {
            'Date': datetime(2015, 1, 1),
            'Name': 'Pending'|'Success'|'Failed',
            'Message': 'string',
            'AdditionalInfo': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • AssociationDescription (dict) --

      Information about the association.

      • Name (string) --

        The name of the configuration document.

      • InstanceId (string) --

        The ID of the instance.

      • Date (datetime) --

        The date when the association was made.

      • Status (dict) --

        The association status.

        • Date (datetime) --

          The date when the status changed.

        • Name (string) --

          The status.

        • Message (string) --

          The reason for the status.

        • AdditionalInfo (string) --

          A user-defined string.

describe_document(**kwargs)

Describes the specified configuration document.

Request Syntax

response = client.describe_document(
    Name='string'
)
Parameters:Name (string) --

[REQUIRED]

The name of the configuration document.

Return type:dict
Returns:Response Syntax
{
    'Document': {
        'Sha1': 'string',
        'Name': 'string',
        'CreatedDate': datetime(2015, 1, 1),
        'Status': 'Creating'|'Active'|'Deleting'
    }
}

Response Structure

  • (dict) --
    • Document (dict) --

      Information about the configuration document.

      • Sha1 (string) --

        The SHA1 hash of the document, which you can use for verification purposes.

      • Name (string) --

        The name of the configuration document.

      • CreatedDate (datetime) --

        The date when the configuration document was created.

      • Status (string) --

        The status of the configuration document.

generate_presigned_url(ClientMethod, Params=None, ExpiresIn=3600, HttpMethod=None)

Generate a presigned url given a client, its method, and arguments

Parameters:
  • ClientMethod (string) -- The client method to presign for
  • Params (dict) -- The parameters normally passed to ClientMethod.
  • ExpiresIn (int) -- The number of seconds the presigned url is valid for. By default it expires in an hour (3600 seconds)
  • HttpMethod (string) -- The http method to use on the generated url. By default, the http method is whatever is used in the method's model.
Returns:

The presigned url

get_document(**kwargs)

Gets the contents of the specified configuration document.

Request Syntax

response = client.get_document(
    Name='string'
)
Parameters:Name (string) --

[REQUIRED]

The name of the configuration document.

Return type:dict
Returns:Response Syntax
{
    'Name': 'string',
    'Content': 'string'
}

Response Structure

  • (dict) --
    • Name (string) --

      The name of the configuration document.

    • Content (string) --

      The contents of the configuration document.

get_paginator(operation_name)

Create a paginator for an operation.

Parameters:operation_name (string) -- The operation name. This is the same name as the method name on the client. For example, if the method name is create_foo, and you'd normally invoke the operation as client.create_foo(**kwargs), if the create_foo operation can be paginated, you can use the call client.get_paginator("create_foo").
Raises OperationNotPageableError:
 Raised if the operation is not pageable. You can use the client.can_paginate method to check if an operation is pageable.
Return type:L{botocore.paginate.Paginator}
Returns:A paginator object.
get_waiter(waiter_name)
list_associations(**kwargs)

Lists the associations for the specified configuration document or instance.

Request Syntax

response = client.list_associations(
    AssociationFilterList=[
        {
            'key': 'InstanceId'|'Name',
            'value': 'string'
        },
    ],
    MaxResults=123,
    NextToken='string'
)
Parameters:
  • AssociationFilterList (list) --

    [REQUIRED]

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

    • (dict) --

      Describes a filter.

      • key (string) -- [REQUIRED]

        The name of the filter.

      • value (string) -- [REQUIRED]

        The filter value.

  • MaxResults (integer) -- 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.
  • NextToken (string) -- The token for the next set of items to return. (You received this token from a previous call.)
Return type:

dict

Returns:

Response Syntax

{
    'Associations': [
        {
            'Name': 'string',
            'InstanceId': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Associations (list) --

      The associations.

      • (dict) --

        Describes an association of a configuration document and an instance.

        • Name (string) --

          The name of the configuration document.

        • InstanceId (string) --

          The ID of the instance.

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

list_documents(**kwargs)

Describes one or more of your configuration documents.

Request Syntax

response = client.list_documents(
    DocumentFilterList=[
        {
            'key': 'Name',
            'value': 'string'
        },
    ],
    MaxResults=123,
    NextToken='string'
)
Parameters:
  • DocumentFilterList (list) --

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

    • (dict) --

      Describes a filter.

      • key (string) -- [REQUIRED]

        The name of the filter.

      • value (string) -- [REQUIRED]

        The value of the filter.

  • MaxResults (integer) -- 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.
  • NextToken (string) -- The token for the next set of items to return. (You received this token from a previous call.)
Return type:

dict

Returns:

Response Syntax

{
    'DocumentIdentifiers': [
        {
            'Name': 'string'
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • DocumentIdentifiers (list) --

      The names of the configuration documents.

      • (dict) --

        Describes the name of a configuration document.

        • Name (string) --

          The name of the configuration document.

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

update_association_status(**kwargs)

Updates the status of the configuration document associated with the specified instance.

Request Syntax

response = client.update_association_status(
    Name='string',
    InstanceId='string',
    AssociationStatus={
        'Date': datetime(2015, 1, 1),
        'Name': 'Pending'|'Success'|'Failed',
        'Message': 'string',
        'AdditionalInfo': 'string'
    }
)
Parameters:
  • Name (string) --

    [REQUIRED]

    The name of the configuration document.

  • InstanceId (string) --

    [REQUIRED]

    The ID of the instance.

  • AssociationStatus (dict) --

    [REQUIRED]

    The association status.

    • Date (datetime) -- [REQUIRED]

      The date when the status changed.

    • Name (string) -- [REQUIRED]

      The status.

    • Message (string) -- [REQUIRED]

      The reason for the status.

    • AdditionalInfo (string) --

      A user-defined string.

Return type:

dict

Returns:

Response Syntax

{
    'AssociationDescription': {
        'Name': 'string',
        'InstanceId': 'string',
        'Date': datetime(2015, 1, 1),
        'Status': {
            'Date': datetime(2015, 1, 1),
            'Name': 'Pending'|'Success'|'Failed',
            'Message': 'string',
            'AdditionalInfo': 'string'
        }
    }
}

Response Structure

  • (dict) --

    • AssociationDescription (dict) --

      Information about the association.

      • Name (string) --

        The name of the configuration document.

      • InstanceId (string) --

        The ID of the instance.

      • Date (datetime) --

        The date when the association was made.

      • Status (dict) --

        The association status.

        • Date (datetime) --

          The date when the status changed.

        • Name (string) --

          The status.

        • Message (string) --

          The reason for the status.

        • AdditionalInfo (string) --

          A user-defined string.