Amazon Simple Systems Manager (SSM)

2019/06/06 - Amazon Simple Systems Manager (SSM) - 5 new3 updated api methods

Changes  Update ssm client to latest version

GetOpsItem (new) Link ¶

Get information about an OpsItem by using the ID. You must have permission in AWS Identity and Access Management (IAM) to view information about an OpsItem. For more information, see Getting Started with OpsItems in the AWS Systems Manager User Guide.

Operations engineers and IT professionals use the Systems Manager OpsItems capability to view, investigate, and remediate operational issues impacting the performance and health of their AWS resources. For more information, see AWS Systems Manager OpsItems in the AWS Systems Manager User Guide.

See also: AWS API Documentation

Request Syntax

client.get_ops_item(
    OpsItemId='string'
)
type OpsItemId:

string

param OpsItemId:

[REQUIRED]

The ID of the OpsItem that you want to get.

rtype:

dict

returns:

Response Syntax

{
    'OpsItem': {
        'CreatedBy': 'string',
        'CreatedTime': datetime(2015, 1, 1),
        'Description': 'string',
        'LastModifiedBy': 'string',
        'LastModifiedTime': datetime(2015, 1, 1),
        'Notifications': [
            {
                'Arn': 'string'
            },
        ],
        'Priority': 123,
        'RelatedOpsItems': [
            {
                'OpsItemId': 'string'
            },
        ],
        'Status': 'Open'|'InProgress'|'Resolved',
        'OpsItemId': 'string',
        'Version': 'string',
        'Title': 'string',
        'Source': 'string',
        'OperationalData': {
            'string': {
                'Value': 'string',
                'Type': 'SearchableString'|'String'
            }
        }
    }
}

Response Structure

  • (dict) --

    • OpsItem (dict) --

      The OpsItem.

      • CreatedBy (string) --

        The ARN of the AWS account that created the OpsItem.

      • CreatedTime (datetime) --

        The date and time the OpsItem was created.

      • Description (string) --

        The OpsItem description.

      • LastModifiedBy (string) --

        The ARN of the AWS account that last updated the OpsItem.

      • LastModifiedTime (datetime) --

        The date and time the OpsItem was last updated.

      • Notifications (list) --

        The Amazon Resource Name (ARN) of an SNS topic where notifications are sent when this OpsItem is edited or changed.

        • (dict) --

          A notification about the OpsItem.

          • Arn (string) --

            The Amazon Resource Name (ARN) of an SNS topic where notifications are sent when this OpsItem is edited or changed.

      • Priority (integer) --

        The importance of this OpsItem in relation to other OpsItems in the system.

      • RelatedOpsItems (list) --

        One or more OpsItems that share something in common with the current OpsItems. For example, related OpsItems can include OpsItems with similar error messages, impacted resources, or statuses for the impacted resource.

        • (dict) --

          An OpsItems that shares something in common with the current OpsItems. For example, related OpsItems can include OpsItems with similar error messages, impacted resources, or statuses for the impacted resource.

          • OpsItemId (string) --

            The ID of an OpsItem related to the current OpsItem.

      • Status (string) --

        The OpsItem status. Status can be Open, In Progress, or Resolved. For more information, see Editing OpsItem Details in the AWS Systems Manager User Guide.

      • OpsItemId (string) --

        The ID of the OpsItem.

      • Version (string) --

        The version of this OpsItem. Each time the OpsItem is edited the version number increments by one.

      • Title (string) --

        A short heading that describes the nature of the OpsItem and the impacted resource.

      • Source (string) --

        The origin of the OpsItem, such as Amazon EC2 or AWS Systems Manager. The impacted resource is a subset of source.

      • OperationalData (dict) --

        Operational data is custom data that provides useful reference details about the OpsItem. For example, you can specify log files, error strings, license keys, troubleshooting tips, or other relevant data. You enter operational data as key-value pairs. The key has a maximum length of 128 characters. The value has a maximum size of 20 KB.

        This custom data is searchable, but with restrictions. For the Searchable operational data feature, all users with access to the OpsItem Overview page (as provided by the DescribeOpsItems API action) can view and search on the specified data. For the Private operational data feature, the data is only viewable by users who have access to the OpsItem (as provided by the GetOpsItem API action).

        • (string) --

          • (dict) --

            An object that defines the value of the key and its type in the OperationalData map.

            • Value (string) --

              The value of the OperationalData key.

            • Type (string) --

              The type of key-value pair. Valid types include SearchableString and String.

UpdateOpsItem (new) Link ¶

Edit or change an OpsItem. You must have permission in AWS Identity and Access Management (IAM) to update an OpsItem. For more information, see Getting Started with OpsItems in the AWS Systems Manager User Guide.

Operations engineers and IT professionals use the Systems Manager OpsItems capability to view, investigate, and remediate operational issues impacting the performance and health of their AWS resources. For more information, see AWS Systems Manager OpsItems in the AWS Systems Manager User Guide.

See also: AWS API Documentation

Request Syntax

client.update_ops_item(
    Description='string',
    OperationalData={
        'string': {
            'Value': 'string',
            'Type': 'SearchableString'|'String'
        }
    },
    OperationalDataToDelete=[
        'string',
    ],
    Notifications=[
        {
            'Arn': 'string'
        },
    ],
    Priority=123,
    RelatedOpsItems=[
        {
            'OpsItemId': 'string'
        },
    ],
    Status='Open'|'InProgress'|'Resolved',
    OpsItemId='string',
    Title='string'
)
type Description:

string

param Description:

Update the information about the OpsItem. Provide enough information so that users reading this OpsItem for the first time understand the issue.

type OperationalData:

dict

param OperationalData:

Add new keys or edit existing key-value pairs of the OperationalData map in the OpsItem object.

Operational data is custom data that provides useful reference details about the OpsItem. For example, you can specify log files, error strings, license keys, troubleshooting tips, or other relevant data. You enter operational data as key-value pairs. The key has a maximum length of 128 characters. The value has a maximum size of 20 KB.

This custom data is searchable, but with restrictions. For the Searchable operational data feature, all users with access to the OpsItem Overview page (as provided by the DescribeOpsItems API action) can view and search on the specified data. For the Private operational data feature, the data is only viewable by users who have access to the OpsItem (as provided by the GetOpsItem API action).

  • (string) --

    • (dict) --

      An object that defines the value of the key and its type in the OperationalData map.

      • Value (string) --

        The value of the OperationalData key.

      • Type (string) --

        The type of key-value pair. Valid types include SearchableString and String.

type OperationalDataToDelete:

list

param OperationalDataToDelete:

Keys that you want to remove from the OperationalData map.

  • (string) --

type Notifications:

list

param Notifications:

The Amazon Resource Name (ARN) of an SNS topic where notifications are sent when this OpsItem is edited or changed.

  • (dict) --

    A notification about the OpsItem.

    • Arn (string) --

      The Amazon Resource Name (ARN) of an SNS topic where notifications are sent when this OpsItem is edited or changed.

type Priority:

integer

param Priority:

The importance of this OpsItem in relation to other OpsItems in the system.

type RelatedOpsItems:

list

param RelatedOpsItems:

One or more OpsItems that share something in common with the current OpsItems. For example, related OpsItems can include OpsItems with similar error messages, impacted resources, or statuses for the impacted resource.

  • (dict) --

    An OpsItems that shares something in common with the current OpsItems. For example, related OpsItems can include OpsItems with similar error messages, impacted resources, or statuses for the impacted resource.

    • OpsItemId (string) -- [REQUIRED]

      The ID of an OpsItem related to the current OpsItem.

type Status:

string

param Status:

The OpsItem status. Status can be Open, In Progress, or Resolved. For more information, see Editing OpsItem Details in the AWS Systems Manager User Guide.

type OpsItemId:

string

param OpsItemId:

[REQUIRED]

The ID of the OpsItem.

type Title:

string

param Title:

A short heading that describes the nature of the OpsItem and the impacted resource.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

DescribeOpsItems (new) Link ¶

Query a set of OpsItems. You must have permission in AWS Identity and Access Management (IAM) to query a list of OpsItems. For more information, see Getting Started with OpsItems in the AWS Systems Manager User Guide.

Operations engineers and IT professionals use the Systems Manager OpsItems capability to view, investigate, and remediate operational issues impacting the performance and health of their AWS resources. For more information, see AWS Systems Manager OpsItems in the AWS Systems Manager User Guide.

See also: AWS API Documentation

Request Syntax

client.describe_ops_items(
    OpsItemFilters=[
        {
            'Key': 'Status'|'CreatedBy'|'Source'|'Priority'|'Title'|'OpsItemId'|'CreatedTime'|'LastModifiedTime'|'OperationalData'|'OperationalDataKey'|'OperationalDataValue'|'ResourceId'|'AutomationId',
            'Values': [
                'string',
            ],
            'Operator': 'Equal'|'Contains'|'GreaterThan'|'LessThan'
        },
    ],
    MaxResults=123,
    NextToken='string'
)
type OpsItemFilters:

list

param OpsItemFilters:

One or more filters to limit the reponse.

  • Key: CreatedTime Operations: GreaterThan, LessThan

  • Key: LastModifiedBy Operations: Contains, Equals

  • Key: LastModifiedTime Operations: GreaterThan, LessThan

  • Key: Priority Operations: Equals

  • Key: Source Operations: Contains, Equals

  • Key: Status Operations: Equals

  • Key: Title Operations: Contains

  • Key: OperationalData Operations: Equals

  • Key: OperationalDataKey Operations: Equals

  • Key: OperationalDataValue Operations: Equals, Contains

  • Key: OpsItemId Operations: Equals

  • Key: ResourceId Operations: Contains

  • Key: AutomationId Operations: Equals

  • (dict) --

    Describes an OpsCenter filter.

    • Key (string) -- [REQUIRED]

      The name of the filter.

    • Values (list) -- [REQUIRED]

      The filter value.

      • (string) --

    • Operator (string) -- [REQUIRED]

      The operator used by the filter 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 NextToken:

string

param NextToken:

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

rtype:

dict

returns:

Response Syntax

{
    'NextToken': 'string',
    'OpsItemSummaries': [
        {
            'CreatedBy': 'string',
            'CreatedTime': datetime(2015, 1, 1),
            'LastModifiedBy': 'string',
            'LastModifiedTime': datetime(2015, 1, 1),
            'Priority': 123,
            'Source': 'string',
            'Status': 'Open'|'InProgress'|'Resolved',
            'OpsItemId': 'string',
            'Title': 'string',
            'OperationalData': {
                'string': {
                    'Value': 'string',
                    'Type': 'SearchableString'|'String'
                }
            }
        },
    ]
}

Response Structure

  • (dict) --

    • NextToken (string) --

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

    • OpsItemSummaries (list) --

      A list of OpsItems.

      • (dict) --

        A count of OpsItems.

        • CreatedBy (string) --

          The Amazon Resource Name (ARN) of the IAM entity that created the OpsItem.

        • CreatedTime (datetime) --

          The date and time the OpsItem was created.

        • LastModifiedBy (string) --

          The Amazon Resource Name (ARN) of the IAM entity that created the OpsItem.

        • LastModifiedTime (datetime) --

          The date and time the OpsItem was last updated.

        • Priority (integer) --

          The importance of this OpsItem in relation to other OpsItems in the system.

        • Source (string) --

          The impacted AWS resource.

        • Status (string) --

          The OpsItem status. Status can be Open, In Progress, or Resolved.

        • OpsItemId (string) --

          The ID of the OpsItem.

        • Title (string) --

          A short heading that describes the nature of the OpsItem and the impacted resource.

        • OperationalData (dict) --

          Operational data is custom data that provides useful reference details about the OpsItem. For example, you can specify log files, error strings, license keys, troubleshooting tips, or other relevant data. You enter operational data as key-value pairs. The key has a maximum length of 128 characters. The value has a maximum size of 20 KB.

          This custom data is searchable, but with restrictions. For the Searchable operational data feature, all users with access to the OpsItem Overview page (as provided by the DescribeOpsItems API action) can view and search on the specified data. For the Private operational data feature, the data is only viewable by users who have access to the OpsItem (as provided by the GetOpsItem API action).

          • (string) --

            • (dict) --

              An object that defines the value of the key and its type in the OperationalData map.

              • Value (string) --

                The value of the OperationalData key.

              • Type (string) --

                The type of key-value pair. Valid types include SearchableString and String.

GetOpsSummary (new) Link ¶

View a summary of OpsItems based on specified filters and aggregators.

See also: AWS API Documentation

Request Syntax

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

list

param Filters:

Optional filters used to scope down the returned OpsItems.

  • (dict) --

    A filter for viewing OpsItem summaries.

    • Key (string) -- [REQUIRED]

      The name of the filter.

    • Values (list) -- [REQUIRED]

      The filter value.

      • (string) --

    • Type (string) --

      The type of filter.

type Aggregators:

list

param Aggregators:

[REQUIRED]

Optional aggregators that return counts of OpsItems based on one or more expressions.

  • (dict) --

    One or more aggregators for viewing counts of OpsItems using different dimensions such as Source, CreatedTime, or Source and CreatedTime, to name a few.

    • AggregatorType (string) --

      Either a Range or Count aggregator for limiting an OpsItem summary.

    • TypeName (string) --

      The data type name to use for viewing counts of OpsItems.

    • AttributeName (string) --

      The name of an OpsItem attribute on which to limit the count of OpsItems.

    • Values (dict) --

      The aggregator value.

      • (string) --

        • (string) --

    • Filters (list) --

      The aggregator filters.

      • (dict) --

        A filter for viewing OpsItem summaries.

        • Key (string) -- [REQUIRED]

          The name of the filter.

        • Values (list) -- [REQUIRED]

          The filter value.

          • (string) --

        • Type (string) --

          The type of filter.

    • Aggregators (list) --

      A nested aggregator for viewing counts of OpsItems.

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

{
    'Entities': [
        {
            'Id': 'string',
            'Data': {
                'string': {
                    'Content': [
                        {
                            'string': 'string'
                        },
                    ]
                }
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • Entities (list) --

      The list of aggregated and filtered OpsItems.

      • (dict) --

        The result of the query.

        • Id (string) --

          The query ID.

        • Data (dict) --

          The data returned by the query.

          • (string) --

            • (dict) --

              The OpsItem summaries result item.

              • Content (list) --

                The detailed data content for an OpsItem summaries result item.

                • (dict) --

                  • (string) --

                    • (string) --

    • NextToken (string) --

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

CreateOpsItem (new) Link ¶

Creates a new OpsItem. You must have permission in AWS Identity and Access Management (IAM) to create a new OpsItem. For more information, see Getting Started with OpsItems in the AWS Systems Manager User Guide.

Operations engineers and IT professionals use the Systems Manager OpsItems capability to view, investigate, and remediate operational issues impacting the performance and health of their AWS resources. For more information, see AWS Systems Manager OpsItems in the AWS Systems Manager User Guide.

See also: AWS API Documentation

Request Syntax

client.create_ops_item(
    Description='string',
    OperationalData={
        'string': {
            'Value': 'string',
            'Type': 'SearchableString'|'String'
        }
    },
    Notifications=[
        {
            'Arn': 'string'
        },
    ],
    Priority=123,
    RelatedOpsItems=[
        {
            'OpsItemId': 'string'
        },
    ],
    Source='string',
    Title='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type Description:

string

param Description:

[REQUIRED]

Information about the OpsItem.

type OperationalData:

dict

param OperationalData:

Operational data is custom data that provides useful reference details about the OpsItem. For example, you can specify log files, error strings, license keys, troubleshooting tips, or other relevant data. You enter operational data as key-value pairs. The key has a maximum length of 128 characters. The value has a maximum size of 20 KB.

This custom data is searchable, but with restrictions. For the Searchable operational data feature, all users with access to the OpsItem Overview page (as provided by the DescribeOpsItems API action) can view and search on the specified data. For the Private operational data feature, the data is only viewable by users who have access to the OpsItem (as provided by the GetOpsItem API action).

  • (string) --

    • (dict) --

      An object that defines the value of the key and its type in the OperationalData map.

      • Value (string) --

        The value of the OperationalData key.

      • Type (string) --

        The type of key-value pair. Valid types include SearchableString and String.

type Notifications:

list

param Notifications:

The Amazon Resource Name (ARN) of an SNS topic where notifications are sent when this OpsItem is edited or changed.

  • (dict) --

    A notification about the OpsItem.

    • Arn (string) --

      The Amazon Resource Name (ARN) of an SNS topic where notifications are sent when this OpsItem is edited or changed.

type Priority:

integer

param Priority:

The importance of this OpsItem in relation to other OpsItems in the system.

type RelatedOpsItems:

list

param RelatedOpsItems:

One or more OpsItems that share something in common with the current OpsItems. For example, related OpsItems can include OpsItems with similar error messages, impacted resources, or statuses for the impacted resource.

  • (dict) --

    An OpsItems that shares something in common with the current OpsItems. For example, related OpsItems can include OpsItems with similar error messages, impacted resources, or statuses for the impacted resource.

    • OpsItemId (string) -- [REQUIRED]

      The ID of an OpsItem related to the current OpsItem.

type Source:

string

param Source:

[REQUIRED]

The origin of the OpsItem, such as Amazon EC2 or AWS Systems Manager.

type Title:

string

param Title:

[REQUIRED]

A short heading that describes the nature of the OpsItem and the impacted resource.

type Tags:

list

param Tags:

Optional metadata that you assign to a resource. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For example, you might want to tag an OpsItem to identify the AWS resource or the type of issue. In this case, you could specify the following key name/value pairs:

  • Key=source,Value=EC2-instance

  • Key=status,Value=stopped

  • (dict) --

    Metadata that you assign to your AWS resources. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment. In Systems Manager, you can apply tags to documents, managed instances, maintenance windows, Parameter Store parameters, and patch baselines.

    • Key (string) -- [REQUIRED]

      The name of the tag.

    • Value (string) -- [REQUIRED]

      The value of the tag.

rtype:

dict

returns:

Response Syntax

{
    'OpsItemId': 'string'
}

Response Structure

  • (dict) --

    • OpsItemId (string) --

      The ID of the OpsItem.

AddTagsToResource (updated) Link ¶
Changes (request)
{'ResourceType': {'OpsItem'}}

Adds or overwrites one or more tags for the specified resource. Tags are metadata that you can assign to your documents, managed instances, maintenance windows, Parameter Store parameters, and patch baselines. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value, both of which you define. For example, you could define a set of tags for your account's managed instances that helps you track each instance's owner and stack level. For example: Key=Owner and Value=DbAdmin, SysAdmin, or Dev. Or Key=Stack and Value=Production, Pre-Production, or Test.

Each resource can have a maximum of 50 tags.

We recommend that you devise a set of tag keys that meets your needs for each resource type. Using a consistent set of tag keys makes it easier for you to manage your resources. You can search and filter the resources based on the tags you add. Tags don't have any semantic meaning to Amazon EC2 and are interpreted strictly as a string of characters.

For more information about tags, see Tagging Your Amazon EC2 Resources in the Amazon EC2 User Guide.

See also: AWS API Documentation

Request Syntax

client.add_tags_to_resource(
    ResourceType='Document'|'ManagedInstance'|'MaintenanceWindow'|'Parameter'|'PatchBaseline'|'OpsItem',
    ResourceId='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
)
type ResourceType:

string

param ResourceType:

[REQUIRED]

Specifies the type of resource you are tagging.

type ResourceId:

string

param ResourceId:

[REQUIRED]

The resource ID you want to tag.

Use the ID of the resource. Here are some examples:

ManagedInstance: mi-012345abcde

MaintenanceWindow: mw-012345abcde

PatchBaseline: pb-012345abcde

For the Document and Parameter values, use the name of the resource.

type Tags:

list

param Tags:

[REQUIRED]

One or more tags. The value parameter is required, but if you don't want the tag to have a value, specify the parameter with no value, and we set the value to an empty string.

  • (dict) --

    Metadata that you assign to your AWS resources. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment. In Systems Manager, you can apply tags to documents, managed instances, maintenance windows, Parameter Store parameters, and patch baselines.

    • Key (string) -- [REQUIRED]

      The name of the tag.

    • Value (string) -- [REQUIRED]

      The value of the tag.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

ListTagsForResource (updated) Link ¶
Changes (request)
{'ResourceType': {'OpsItem'}}

Returns a list of the tags assigned to the specified resource.

See also: AWS API Documentation

Request Syntax

client.list_tags_for_resource(
    ResourceType='Document'|'ManagedInstance'|'MaintenanceWindow'|'Parameter'|'PatchBaseline'|'OpsItem',
    ResourceId='string'
)
type ResourceType:

string

param ResourceType:

[REQUIRED]

Returns a list of tags for a specific resource type.

type ResourceId:

string

param ResourceId:

[REQUIRED]

The resource ID for which you want to see a list of tags.

rtype:

dict

returns:

Response Syntax

{
    'TagList': [
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    • TagList (list) --

      A list of tags.

      • (dict) --

        Metadata that you assign to your AWS resources. Tags enable you to categorize your resources in different ways, for example, by purpose, owner, or environment. In Systems Manager, you can apply tags to documents, managed instances, maintenance windows, Parameter Store parameters, and patch baselines.

        • Key (string) --

          The name of the tag.

        • Value (string) --

          The value of the tag.

RemoveTagsFromResource (updated) Link ¶
Changes (request)
{'ResourceType': {'OpsItem'}}

Removes all tags from the specified resource.

See also: AWS API Documentation

Request Syntax

client.remove_tags_from_resource(
    ResourceType='Document'|'ManagedInstance'|'MaintenanceWindow'|'Parameter'|'PatchBaseline'|'OpsItem',
    ResourceId='string',
    TagKeys=[
        'string',
    ]
)
type ResourceType:

string

param ResourceType:

[REQUIRED]

The type of resource of which you want to remove a tag.

type ResourceId:

string

param ResourceId:

[REQUIRED]

The resource ID for which you want to remove tags. Use the ID of the resource. Here are some examples:

ManagedInstance: mi-012345abcde

MaintenanceWindow: mw-012345abcde

PatchBaseline: pb-012345abcde

For the Document and Parameter values, use the name of the resource.

type TagKeys:

list

param TagKeys:

[REQUIRED]

Tag keys that you want to remove from the specified resource.

  • (string) --

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --