Amazon Macie 2

2020/11/17 - Amazon Macie 2 - 2 updated api methods

Changes  Update macie2 client to latest version

DescribeClassificationJob (updated) Link ¶
Changes (response)
{'lastRunErrorStatus': {'code': 'NONE | ERROR'}}

Retrieves the status and settings for a classification job.

See also: AWS API Documentation

Request Syntax

client.describe_classification_job(
    jobId='string'
)
type jobId:

string

param jobId:

[REQUIRED]

The unique identifier for the classification job.

rtype:

dict

returns:

Response Syntax

{
    'clientToken': 'string',
    'createdAt': datetime(2015, 1, 1),
    'customDataIdentifierIds': [
        'string',
    ],
    'description': 'string',
    'initialRun': True|False,
    'jobArn': 'string',
    'jobId': 'string',
    'jobStatus': 'RUNNING'|'PAUSED'|'CANCELLED'|'COMPLETE'|'IDLE'|'USER_PAUSED',
    'jobType': 'ONE_TIME'|'SCHEDULED',
    'lastRunErrorStatus': {
        'code': 'NONE'|'ERROR'
    },
    'lastRunTime': datetime(2015, 1, 1),
    'name': 'string',
    's3JobDefinition': {
        'bucketDefinitions': [
            {
                'accountId': 'string',
                'buckets': [
                    'string',
                ]
            },
        ],
        'scoping': {
            'excludes': {
                'and': [
                    {
                        'simpleScopeTerm': {
                            'comparator': 'EQ'|'GT'|'GTE'|'LT'|'LTE'|'NE'|'CONTAINS',
                            'key': 'BUCKET_CREATION_DATE'|'OBJECT_EXTENSION'|'OBJECT_LAST_MODIFIED_DATE'|'OBJECT_SIZE'|'TAG',
                            'values': [
                                'string',
                            ]
                        },
                        'tagScopeTerm': {
                            'comparator': 'EQ'|'GT'|'GTE'|'LT'|'LTE'|'NE'|'CONTAINS',
                            'key': 'string',
                            'tagValues': [
                                {
                                    'key': 'string',
                                    'value': 'string'
                                },
                            ],
                            'target': 'S3_OBJECT'
                        }
                    },
                ]
            },
            'includes': {
                'and': [
                    {
                        'simpleScopeTerm': {
                            'comparator': 'EQ'|'GT'|'GTE'|'LT'|'LTE'|'NE'|'CONTAINS',
                            'key': 'BUCKET_CREATION_DATE'|'OBJECT_EXTENSION'|'OBJECT_LAST_MODIFIED_DATE'|'OBJECT_SIZE'|'TAG',
                            'values': [
                                'string',
                            ]
                        },
                        'tagScopeTerm': {
                            'comparator': 'EQ'|'GT'|'GTE'|'LT'|'LTE'|'NE'|'CONTAINS',
                            'key': 'string',
                            'tagValues': [
                                {
                                    'key': 'string',
                                    'value': 'string'
                                },
                            ],
                            'target': 'S3_OBJECT'
                        }
                    },
                ]
            }
        }
    },
    'samplingPercentage': 123,
    'scheduleFrequency': {
        'dailySchedule': {},
        'monthlySchedule': {
            'dayOfMonth': 123
        },
        'weeklySchedule': {
            'dayOfWeek': 'SUNDAY'|'MONDAY'|'TUESDAY'|'WEDNESDAY'|'THURSDAY'|'FRIDAY'|'SATURDAY'
        }
    },
    'statistics': {
        'approximateNumberOfObjectsToProcess': 123.0,
        'numberOfRuns': 123.0
    },
    'tags': {
        'string': 'string'
    },
    'userPausedDetails': {
        'jobExpiresAt': datetime(2015, 1, 1),
        'jobImminentExpirationHealthEventArn': 'string',
        'jobPausedAt': datetime(2015, 1, 1)
    }
}

Response Structure

  • (dict) --

    The request succeeded.

    • clientToken (string) --

      The token that was provided to ensure the idempotency of the request to create the job.

    • createdAt (datetime) --

      The date and time, in UTC and extended ISO 8601 format, when the job was created.

    • customDataIdentifierIds (list) --

      The custom data identifiers that the job uses to analyze data.

      • (string) --

    • description (string) --

      The custom description of the job.

    • initialRun (boolean) --

      Specifies whether the job is configured to analyze all existing, eligible objects immediately after it's created.

    • jobArn (string) --

      The Amazon Resource Name (ARN) of the job.

    • jobId (string) --

      The unique identifier for the job.

    • jobStatus (string) --

      The current status of the job. Possible values are:

      • CANCELLED - You cancelled the job, or you paused the job and didn't resume it within 30 days of pausing it.

      • COMPLETE - For a one-time job, Amazon Macie finished processing all the data specified for the job. This value doesn't apply to recurring jobs.

      • IDLE - For a recurring job, the previous scheduled run is complete and the next scheduled run is pending. This value doesn't apply to one-time jobs.

      • PAUSED - Amazon Macie started running the job but completion of the job would exceed one or more quotas for your account.

      • RUNNING - For a one-time job, the job is in progress. For a recurring job, a scheduled run is in progress.

      • USER_PAUSED - You paused the job. If you don't resume the job within 30 days of pausing it, the job will expire and be cancelled.

    • jobType (string) --

      The schedule for running the job. Possible values are:

      • ONE_TIME - The job runs only once.

      • SCHEDULED - The job runs on a daily, weekly, or monthly basis. The scheduleFrequency property indicates the recurrence pattern for the job.

    • lastRunErrorStatus (dict) --

      Specifies whether any account- or bucket-level access errors occurred when the job ran. For a recurring job, this value indicates the error status of the job's most recent run.

      • code (string) --

        Specifies whether any account- or bucket-level access errors occurred when the job ran. For a recurring job, this value indicates the error status of the job's most recent run. Possible values are:

        • ERROR - One or more errors occurred. Amazon Macie didn't process all the data specified for the job.

        • NONE - No errors occurred. Macie processed all the data specified for the job.

    • lastRunTime (datetime) --

      The date and time, in UTC and extended ISO 8601 format, when the job last ran.

    • name (string) --

      The custom name of the job.

    • s3JobDefinition (dict) --

      The S3 buckets that the job is configured to analyze, and the scope of that analysis.

      • bucketDefinitions (list) --

        An array of objects, one for each bucket that contains objects to analyze.

        • (dict) --

          Specifies which S3 buckets contain the objects that a classification job analyzes.

          • accountId (string) --

            The unique identifier for the AWS account that owns one or more of the buckets. If specified, the job analyzes objects in all the buckets that are owned by the account and meet other conditions specified for the job.

          • buckets (list) --

            An array that lists the names of the buckets.

            • (string) --

      • scoping (dict) --

        The property- and tag-based conditions that determine which objects to include or exclude from the analysis.

        • excludes (dict) --

          The property- or tag-based conditions that determine which objects to exclude from the analysis.

          • and (list) --

            An array of conditions, one for each condition that determines which objects to include or exclude from the job.

            • (dict) --

              Specifies a property- or tag-based condition that defines criteria for including or excluding objects from a classification job.

              • simpleScopeTerm (dict) --

                A property-based condition that defines a property, operator, and one or more values for including or excluding an object from the job.

                • comparator (string) --

                  The operator to use in the condition. Valid operators for each supported property (key) are:

                  • OBJECT_EXTENSION - EQ (equals) or NE (not equals)

                  • OBJECT_LAST_MODIFIED_DATE - Any operator except CONTAINS

                  • OBJECT_SIZE - Any operator except CONTAINS

                  • TAG - EQ (equals) or NE (not equals)

                • key (string) --

                  The object property to use in the condition.

                • values (list) --

                  An array that lists the values to use in the condition. If the value for the key property is OBJECT_EXTENSION, this array can specify multiple values and Amazon Macie uses an OR operator to join the values. Otherwise, this array can specify only one value. Valid values for each supported property (key) are:

                  • OBJECT_EXTENSION - A string that represents the file name extension of an object. For example: doc, docx, pdf

                  • OBJECT_LAST_MODIFIED_DATE - The date and time (in UTC and extended ISO 8601 format) when an object was created or last changed, whichever is latest. For example: 2020-09-28T14:31:13Z

                  • OBJECT_SIZE - An integer that represents the storage size (in bytes) of an object.

                  • TAG - A string that represents a tag key for an object. For advanced options, use a TagScopeTerm object, instead of a SimpleScopeTerm object, to define a tag-based condition for the job.

                  • (string) --

              • tagScopeTerm (dict) --

                A tag-based condition that defines the operator and tag keys or tag key and value pairs for including or excluding an object from the job.

                • comparator (string) --

                  The operator to use in the condition. Valid operators are EQ (equals) or NE (not equals).

                • key (string) --

                  The tag key to use in the condition.

                • tagValues (list) --

                  The tag keys or tag key and value pairs to use in the condition.

                  • (dict) --

                    Specifies a tag key or tag key and value pair to use in a tag-based condition for a classification job.

                    • key (string) --

                      The value for the tag key to use in the condition.

                    • value (string) --

                      The tag value, associated with the specified tag key (key), to use in the condition. To specify only a tag key for a condition, specify the tag key for the key property and set this value to an empty string.

                • target (string) --

                  The type of object to apply the condition to.

        • includes (dict) --

          The property- or tag-based conditions that determine which objects to include in the analysis.

          • and (list) --

            An array of conditions, one for each condition that determines which objects to include or exclude from the job.

            • (dict) --

              Specifies a property- or tag-based condition that defines criteria for including or excluding objects from a classification job.

              • simpleScopeTerm (dict) --

                A property-based condition that defines a property, operator, and one or more values for including or excluding an object from the job.

                • comparator (string) --

                  The operator to use in the condition. Valid operators for each supported property (key) are:

                  • OBJECT_EXTENSION - EQ (equals) or NE (not equals)

                  • OBJECT_LAST_MODIFIED_DATE - Any operator except CONTAINS

                  • OBJECT_SIZE - Any operator except CONTAINS

                  • TAG - EQ (equals) or NE (not equals)

                • key (string) --

                  The object property to use in the condition.

                • values (list) --

                  An array that lists the values to use in the condition. If the value for the key property is OBJECT_EXTENSION, this array can specify multiple values and Amazon Macie uses an OR operator to join the values. Otherwise, this array can specify only one value. Valid values for each supported property (key) are:

                  • OBJECT_EXTENSION - A string that represents the file name extension of an object. For example: doc, docx, pdf

                  • OBJECT_LAST_MODIFIED_DATE - The date and time (in UTC and extended ISO 8601 format) when an object was created or last changed, whichever is latest. For example: 2020-09-28T14:31:13Z

                  • OBJECT_SIZE - An integer that represents the storage size (in bytes) of an object.

                  • TAG - A string that represents a tag key for an object. For advanced options, use a TagScopeTerm object, instead of a SimpleScopeTerm object, to define a tag-based condition for the job.

                  • (string) --

              • tagScopeTerm (dict) --

                A tag-based condition that defines the operator and tag keys or tag key and value pairs for including or excluding an object from the job.

                • comparator (string) --

                  The operator to use in the condition. Valid operators are EQ (equals) or NE (not equals).

                • key (string) --

                  The tag key to use in the condition.

                • tagValues (list) --

                  The tag keys or tag key and value pairs to use in the condition.

                  • (dict) --

                    Specifies a tag key or tag key and value pair to use in a tag-based condition for a classification job.

                    • key (string) --

                      The value for the tag key to use in the condition.

                    • value (string) --

                      The tag value, associated with the specified tag key (key), to use in the condition. To specify only a tag key for a condition, specify the tag key for the key property and set this value to an empty string.

                • target (string) --

                  The type of object to apply the condition to.

    • samplingPercentage (integer) --

      The sampling depth, as a percentage, that determines the percentage of eligible objects that the job analyzes.

    • scheduleFrequency (dict) --

      The recurrence pattern for running the job. If the job is configured to run only once, this value is null.

      • dailySchedule (dict) --

        Specifies a daily recurrence pattern for running the job.

      • monthlySchedule (dict) --

        Specifies a monthly recurrence pattern for running the job.

        • dayOfMonth (integer) --

          The numeric day of the month when Amazon Macie runs the job. This value can be an integer from 1 through 31.

          If this value exceeds the number of days in a certain month, Macie runs the job on the last day of that month. For example, if this value is 31 and a month has only 30 days, Macie runs the job on day 30 of that month.

      • weeklySchedule (dict) --

        Specifies a weekly recurrence pattern for running the job.

        • dayOfWeek (string) --

          The day of the week when Amazon Macie runs the job.

    • statistics (dict) --

      The number of times that the job has run and processing statistics for the job's current run.

      • approximateNumberOfObjectsToProcess (float) --

        The approximate number of objects that the job has yet to process during its current run.

      • numberOfRuns (float) --

        The number of times that the job has run.

    • tags (dict) --

      A map of key-value pairs that specifies which tags (keys and values) are associated with the classification job.

      • (string) --

        • (string) --

    • userPausedDetails (dict) --

      If the current status of the job is USER_PAUSED, specifies when the job was paused and when the job will expire and be cancelled if it isn't resumed. This value is present only if the value for jobStatus is USER_PAUSED.

      • jobExpiresAt (datetime) --

        The date and time, in UTC and extended ISO 8601 format, when the job will expire and be cancelled if you don't resume it first. If you don't resume a job within 30 days of pausing it, the job expires and Amazon Macie cancels it.

      • jobImminentExpirationHealthEventArn (string) --

        The Amazon Resource Name (ARN) of the AWS Health event that Amazon Macie sent to notify you of the job's pending expiration and cancellation. This value is null if a job has been paused for less than 23 days.

      • jobPausedAt (datetime) --

        The date and time, in UTC and extended ISO 8601 format, when you paused the job.

ListClassificationJobs (updated) Link ¶
Changes (response)
{'items': {'lastRunErrorStatus': {'code': 'NONE | ERROR'}}}

Retrieves a subset of information about one or more classification jobs.

See also: AWS API Documentation

Request Syntax

client.list_classification_jobs(
    filterCriteria={
        'excludes': [
            {
                'comparator': 'EQ'|'GT'|'GTE'|'LT'|'LTE'|'NE'|'CONTAINS',
                'key': 'jobType'|'jobStatus'|'createdAt'|'name',
                'values': [
                    'string',
                ]
            },
        ],
        'includes': [
            {
                'comparator': 'EQ'|'GT'|'GTE'|'LT'|'LTE'|'NE'|'CONTAINS',
                'key': 'jobType'|'jobStatus'|'createdAt'|'name',
                'values': [
                    'string',
                ]
            },
        ]
    },
    maxResults=123,
    nextToken='string',
    sortCriteria={
        'attributeName': 'createdAt'|'jobStatus'|'name'|'jobType',
        'orderBy': 'ASC'|'DESC'
    }
)
type filterCriteria:

dict

param filterCriteria:

The criteria to use to filter the results.

  • excludes (list) --

    An array of objects, one for each condition that determines which jobs to exclude from the results.

    • (dict) --

      Specifies a condition that filters the results of a request for information about classification jobs. Each condition consists of a property, an operator, and one or more values.

      • comparator (string) --

        The operator to use to filter the results.

      • key (string) --

        The property to use to filter the results.

      • values (list) --

        An array that lists one or more values to use to filter the results.

        • (string) --

  • includes (list) --

    An array of objects, one for each condition that determines which jobs to include in the results.

    • (dict) --

      Specifies a condition that filters the results of a request for information about classification jobs. Each condition consists of a property, an operator, and one or more values.

      • comparator (string) --

        The operator to use to filter the results.

      • key (string) --

        The property to use to filter the results.

      • values (list) --

        An array that lists one or more values to use to filter the results.

        • (string) --

type maxResults:

integer

param maxResults:

The maximum number of items to include in each page of the response.

type nextToken:

string

param nextToken:

The nextToken string that specifies which page of results to return in a paginated response.

type sortCriteria:

dict

param sortCriteria:

The criteria to use to sort the results.

  • attributeName (string) --

    The property to sort the results by.

  • orderBy (string) --

    The sort order to apply to the results, based on the value for the property specified by the attributeName property. Valid values are: ASC, sort the results in ascending order; and, DESC, sort the results in descending order.

rtype:

dict

returns:

Response Syntax

{
    'items': [
        {
            'bucketDefinitions': [
                {
                    'accountId': 'string',
                    'buckets': [
                        'string',
                    ]
                },
            ],
            'createdAt': datetime(2015, 1, 1),
            'jobId': 'string',
            'jobStatus': 'RUNNING'|'PAUSED'|'CANCELLED'|'COMPLETE'|'IDLE'|'USER_PAUSED',
            'jobType': 'ONE_TIME'|'SCHEDULED',
            'lastRunErrorStatus': {
                'code': 'NONE'|'ERROR'
            },
            'name': 'string',
            'userPausedDetails': {
                'jobExpiresAt': datetime(2015, 1, 1),
                'jobImminentExpirationHealthEventArn': 'string',
                'jobPausedAt': datetime(2015, 1, 1)
            }
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) --

    The request succeeded.

    • items (list) --

      An array of objects, one for each job that meets the filter criteria specified in the request.

      • (dict) --

        Provides information about a classification job, including the current status of the job.

        • bucketDefinitions (list) --

          The S3 buckets that the job is configured to analyze.

          • (dict) --

            Specifies which S3 buckets contain the objects that a classification job analyzes.

            • accountId (string) --

              The unique identifier for the AWS account that owns one or more of the buckets. If specified, the job analyzes objects in all the buckets that are owned by the account and meet other conditions specified for the job.

            • buckets (list) --

              An array that lists the names of the buckets.

              • (string) --

        • createdAt (datetime) --

          The date and time, in UTC and extended ISO 8601 format, when the job was created.

        • jobId (string) --

          The unique identifier for the job.

        • jobStatus (string) --

          The current status of the job. Possible values are:

          • CANCELLED - You cancelled the job, or you paused the job and didn't resume it within 30 days of pausing it.

          • COMPLETE - For a one-time job, Amazon Macie finished processing all the data specified for the job. This value doesn't apply to recurring jobs.

          • IDLE - For a recurring job, the previous scheduled run is complete and the next scheduled run is pending. This value doesn't apply to one-time jobs.

          • PAUSED - Amazon Macie started running the job but completion of the job would exceed one or more quotas for your account.

          • RUNNING - For a one-time job, the job is in progress. For a recurring job, a scheduled run is in progress.

          • USER_PAUSED - You paused the job. If you don't resume the job within 30 days of pausing it, the job will expire and be cancelled.

        • jobType (string) --

          The schedule for running the job. Possible values are:

          • ONE_TIME - The job runs only once.

          • SCHEDULED - The job runs on a daily, weekly, or monthly basis.

        • lastRunErrorStatus (dict) --

          Specifies whether any account- or bucket-level access errors occurred when the job ran. For a recurring job, this value indicates the error status of the job's most recent run.

          • code (string) --

            Specifies whether any account- or bucket-level access errors occurred when the job ran. For a recurring job, this value indicates the error status of the job's most recent run. Possible values are:

            • ERROR - One or more errors occurred. Amazon Macie didn't process all the data specified for the job.

            • NONE - No errors occurred. Macie processed all the data specified for the job.

        • name (string) --

          The custom name of the job.

        • userPausedDetails (dict) --

          If the current status of the job is USER_PAUSED, specifies when the job was paused and when the job will expire and be cancelled if it isn't resumed. This value is present only if the value for jobStatus is USER_PAUSED.

          • jobExpiresAt (datetime) --

            The date and time, in UTC and extended ISO 8601 format, when the job will expire and be cancelled if you don't resume it first. If you don't resume a job within 30 days of pausing it, the job expires and Amazon Macie cancels it.

          • jobImminentExpirationHealthEventArn (string) --

            The Amazon Resource Name (ARN) of the AWS Health event that Amazon Macie sent to notify you of the job's pending expiration and cancellation. This value is null if a job has been paused for less than 23 days.

          • jobPausedAt (datetime) --

            The date and time, in UTC and extended ISO 8601 format, when you paused the job.

    • nextToken (string) --

      The string to use in a subsequent request to get the next page of results in a paginated response. This value is null if there are no additional pages.