Amazon Simple Systems Management Service

2016/05/12 - Amazon Simple Systems Management Service - 2 new4 updated api methods

Changes  Update ssm client to latest version

DescribeDocumentPermission (new) Link ¶

Describes the permissions for an SSM document. If you created the document, you are the owner. If a document is shared, it can either be shared privately (by specifying a user’s AWS account ID) or publicly (All).

Request Syntax

client.describe_document_permission(
    Name='string',
    PermissionType='Share'
)
type Name:

string

param Name:

[REQUIRED]

The name of the document for which you are the owner.

type PermissionType:

string

param PermissionType:

[REQUIRED]

The permission type for the document. The permission type can be Share.

rtype:

dict

returns:

Response Syntax

{
    'AccountIds': [
        'string',
    ]
}

Response Structure

  • (dict) --

    • AccountIds (list) --

      The account IDs that have permission to use this document. The ID can be either an AWS account or All.

      • (string) --

ModifyDocumentPermission (new) Link ¶

Share a document publicly or privately. If you share a document privately, you must specify the AWS user account IDs for those people who can use the document. If you share a document publicly, you must specify All as the account ID.

Request Syntax

client.modify_document_permission(
    Name='string',
    PermissionType='Share',
    AccountIdsToAdd=[
        'string',
    ],
    AccountIdsToRemove=[
        'string',
    ]
)
type Name:

string

param Name:

[REQUIRED]

The name of the document that you want to share.

type PermissionType:

string

param PermissionType:

[REQUIRED]

The permission type for the document. The permission type can be Share.

type AccountIdsToAdd:

list

param AccountIdsToAdd:

The AWS user accounts that should have access to the document. The account IDs can either be a group of account IDs or All.

  • (string) --

type AccountIdsToRemove:

list

param AccountIdsToRemove:

The AWS user accounts that should no longer have access to the document. The AWS user account can either be a group of account IDs or All. This action has a higher priority than AccountIdsToAdd. If you specify an account ID to add and the same ID to remove, the system removes access to the document.

  • (string) --

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

CreateDocument (updated) Link ¶
Changes (response)
{'DocumentDescription': {'Hash': 'string',
                         'HashType': 'Sha256 | Sha1',
                         'Owner': 'string'}}

Creates an SSM document.

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

Request Syntax

client.create_document(
    Content='string',
    Name='string'
)
type Content:

string

param Content:

[REQUIRED]

A valid JSON string.

type Name:

string

param Name:

[REQUIRED]

A name for the SSM document.

rtype:

dict

returns:

Response Syntax

{
    'DocumentDescription': {
        'Sha1': 'string',
        'Hash': 'string',
        'HashType': 'Sha256'|'Sha1',
        'Name': 'string',
        'Owner': 'string',
        'CreatedDate': datetime(2015, 1, 1),
        'Status': 'Creating'|'Active'|'Deleting',
        'Description': 'string',
        'Parameters': [
            {
                'Name': 'string',
                'Type': 'String'|'StringList',
                'Description': 'string',
                'DefaultValue': 'string'
            },
        ],
        'PlatformTypes': [
            'Windows'|'Linux',
        ]
    }
}

Response Structure

  • (dict) --

    • DocumentDescription (dict) --

      Information about the SSM document.

      • Sha1 (string) --

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

      • Hash (string) --

        The Sha256 or Sha1 hash created by the system when the document was created.

      • HashType (string) --

        Sha256 or Sha1.

      • Name (string) --

        The name of the SSM document.

      • Owner (string) --

        The AWS user account of the person who created the document.

      • CreatedDate (datetime) --

        The date when the SSM document was created.

      • Status (string) --

        The status of the SSM document.

      • Description (string) --

        A description of the document.

      • Parameters (list) --

        A description of the parameters for a document.

        • (dict) --

          Parameters specified in the SSM document that execute on the server when the command is run.

          • Name (string) --

            The name of the parameter.

          • Type (string) --

            The type of parameter. The type can be either “String” or “StringList”.

          • Description (string) --

            A description of what the parameter does, how to use it, the default value, and whether or not the parameter is optional.

          • DefaultValue (string) --

            If specified, the default values for the parameters. Parameters without a default value are required. Parameters with a default value are optional.

      • PlatformTypes (list) --

        The list of OS platforms compatible with this SSM document.

        • (string) --

DescribeDocument (updated) Link ¶
Changes (response)
{'Document': {'Hash': 'string', 'HashType': 'Sha256 | Sha1', 'Owner': 'string'}}

Describes the specified SSM document.

Request Syntax

client.describe_document(
    Name='string'
)
type Name:

string

param Name:

[REQUIRED]

The name of the SSM document.

rtype:

dict

returns:

Response Syntax

{
    'Document': {
        'Sha1': 'string',
        'Hash': 'string',
        'HashType': 'Sha256'|'Sha1',
        'Name': 'string',
        'Owner': 'string',
        'CreatedDate': datetime(2015, 1, 1),
        'Status': 'Creating'|'Active'|'Deleting',
        'Description': 'string',
        'Parameters': [
            {
                'Name': 'string',
                'Type': 'String'|'StringList',
                'Description': 'string',
                'DefaultValue': 'string'
            },
        ],
        'PlatformTypes': [
            'Windows'|'Linux',
        ]
    }
}

Response Structure

  • (dict) --

    • Document (dict) --

      Information about the SSM document.

      • Sha1 (string) --

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

      • Hash (string) --

        The Sha256 or Sha1 hash created by the system when the document was created.

      • HashType (string) --

        Sha256 or Sha1.

      • Name (string) --

        The name of the SSM document.

      • Owner (string) --

        The AWS user account of the person who created the document.

      • CreatedDate (datetime) --

        The date when the SSM document was created.

      • Status (string) --

        The status of the SSM document.

      • Description (string) --

        A description of the document.

      • Parameters (list) --

        A description of the parameters for a document.

        • (dict) --

          Parameters specified in the SSM document that execute on the server when the command is run.

          • Name (string) --

            The name of the parameter.

          • Type (string) --

            The type of parameter. The type can be either “String” or “StringList”.

          • Description (string) --

            A description of what the parameter does, how to use it, the default value, and whether or not the parameter is optional.

          • DefaultValue (string) --

            If specified, the default values for the parameters. Parameters without a default value are required. Parameters with a default value are optional.

      • PlatformTypes (list) --

        The list of OS platforms compatible with this SSM document.

        • (string) --

ListDocuments (updated) Link ¶
Changes (response)
{'DocumentIdentifiers': {'Owner': 'string'}}

Describes one or more of your SSM documents.

Request Syntax

client.list_documents(
    DocumentFilterList=[
        {
            'key': 'Name'|'Owner'|'PlatformTypes',
            'value': 'string'
        },
    ],
    MaxResults=123,
    NextToken='string'
)
type DocumentFilterList:

list

param DocumentFilterList:

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.

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 NextToken:

string

param NextToken:

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

rtype:

dict

returns:

Response Syntax

{
    'DocumentIdentifiers': [
        {
            'Name': 'string',
            'Owner': 'string',
            'PlatformTypes': [
                'Windows'|'Linux',
            ]
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • DocumentIdentifiers (list) --

      The names of the SSM documents.

      • (dict) --

        Describes the name of an SSM document.

        • Name (string) --

          The name of the SSM document.

        • Owner (string) --

          The AWS user account of the person who created the document.

        • PlatformTypes (list) --

          The operating system platform.

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

SendCommand (updated) Link ¶
Changes (request)
{'DocumentHash': 'string', 'DocumentHashType': 'Sha256 | Sha1'}

Executes commands on one or more remote instances.

Request Syntax

client.send_command(
    InstanceIds=[
        'string',
    ],
    DocumentName='string',
    DocumentHash='string',
    DocumentHashType='Sha256'|'Sha1',
    TimeoutSeconds=123,
    Comment='string',
    Parameters={
        'string': [
            'string',
        ]
    },
    OutputS3BucketName='string',
    OutputS3KeyPrefix='string'
)
type InstanceIds:

list

param InstanceIds:

[REQUIRED]

Required. The instance IDs where the command should execute.

  • (string) --

type DocumentName:

string

param DocumentName:

[REQUIRED]

Required. The name of the SSM document to execute. This can be an SSM public document or a custom document.

type DocumentHash:

string

param DocumentHash:

The Sha256 or Sha1 hash created by the system when the document was created.

type DocumentHashType:

string

param DocumentHashType:

Sha256 or Sha1.

type TimeoutSeconds:

integer

param TimeoutSeconds:

If this time is reached and the command has not already started executing, it will not execute.

type Comment:

string

param Comment:

User-specified information about the command, such as a brief description of what the command should do.

type Parameters:

dict

param Parameters:

The required and optional parameters specified in the SSM document being executed.

  • (string) --

    • (list) --

      • (string) --

type OutputS3BucketName:

string

param OutputS3BucketName:

The name of the S3 bucket where command execution responses should be stored.

type OutputS3KeyPrefix:

string

param OutputS3KeyPrefix:

The directory structure within the S3 bucket where the responses should be stored.

rtype:

dict

returns:

Response Syntax

{
    'Command': {
        'CommandId': 'string',
        'DocumentName': 'string',
        'Comment': 'string',
        'ExpiresAfter': datetime(2015, 1, 1),
        'Parameters': {
            'string': [
                'string',
            ]
        },
        'InstanceIds': [
            'string',
        ],
        'RequestedDateTime': datetime(2015, 1, 1),
        'Status': 'Pending'|'InProgress'|'Cancelling'|'Success'|'TimedOut'|'Cancelled'|'Failed',
        'OutputS3BucketName': 'string',
        'OutputS3KeyPrefix': 'string'
    }
}

Response Structure

  • (dict) --

    • Command (dict) --

      The request as it was received by SSM. Also provides the command ID which can be used future references to this request.

      • CommandId (string) --

        A unique identifier for this command.

      • DocumentName (string) --

        The name of the SSM document requested for execution.

      • Comment (string) --

        User-specified information about the command, such as a brief description of what the command should do.

      • ExpiresAfter (datetime) --

        If this time is reached and the command has not already started executing, it will not execute. Calculated based on the ExpiresAfter user input provided as part of the SendCommand API.

      • Parameters (dict) --

        The parameter values to be inserted in the SSM document when executing the command.

        • (string) --

          • (list) --

            • (string) --

      • InstanceIds (list) --

        The instance IDs against which this command was requested.

        • (string) --

      • RequestedDateTime (datetime) --

        The date and time the command was requested.

      • Status (string) --

        The status of the command.

      • OutputS3BucketName (string) --

        The S3 bucket where the responses to the command executions should be stored. This was requested when issuing the command.

      • OutputS3KeyPrefix (string) --

        The S3 directory path inside the bucket where the responses to the command executions should be stored. This was requested when issuing the command.