AWS S3 Control

2022/02/08 - AWS S3 Control - 3 updated api methods

Changes  This release adds support for S3 Batch Replication. Batch Replication lets you replicate existing objects, already replicated objects to new destinations, and objects that previously failed to replicate. Customers will receive object-level visibility of progress and a detailed completion report.

CreateJob (updated) Link ¶
Changes (request)
{'ManifestGenerator': {'S3JobManifestGenerator': {'EnableManifestOutput': 'boolean',
                                                  'ExpectedBucketOwner': 'string',
                                                  'Filter': {'CreatedAfter': 'timestamp',
                                                             'CreatedBefore': 'timestamp',
                                                             'EligibleForReplication': 'boolean',
                                                             'ObjectReplicationStatuses': ['COMPLETED '
                                                                                           '| '
                                                                                           'FAILED '
                                                                                           '| '
                                                                                           'REPLICA '
                                                                                           '| '
                                                                                           'NONE']},
                                                  'ManifestOutputLocation': {'Bucket': 'string',
                                                                             'ExpectedManifestBucketOwner': 'string',
                                                                             'ManifestEncryption': {'SSEKMS': {'KeyId': 'string'},
                                                                                                    'SSES3': {}},
                                                                             'ManifestFormat': 'S3InventoryReport_CSV_20211130',
                                                                             'ManifestPrefix': 'string'},
                                                  'SourceBucket': 'string'}},
 'Operation': {'S3PutObjectCopy': {'StorageClass': {'GLACIER_IR'}},
               'S3ReplicateObject': {}}}

You can use S3 Batch Operations to perform large-scale batch actions on Amazon S3 objects. Batch Operations can run a single action on lists of Amazon S3 objects that you specify. For more information, see S3 Batch Operations in the Amazon S3 User Guide .

This action creates a S3 Batch Operations job.

Related actions include:

See also: AWS API Documentation

Request Syntax

client.create_job(
    AccountId='string',
    ConfirmationRequired=True|False,
    Operation={
        'LambdaInvoke': {
            'FunctionArn': 'string'
        },
        'S3PutObjectCopy': {
            'TargetResource': 'string',
            'CannedAccessControlList': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control',
            'AccessControlGrants': [
                {
                    'Grantee': {
                        'TypeIdentifier': 'id'|'emailAddress'|'uri',
                        'Identifier': 'string',
                        'DisplayName': 'string'
                    },
                    'Permission': 'FULL_CONTROL'|'READ'|'WRITE'|'READ_ACP'|'WRITE_ACP'
                },
            ],
            'MetadataDirective': 'COPY'|'REPLACE',
            'ModifiedSinceConstraint': datetime(2015, 1, 1),
            'NewObjectMetadata': {
                'CacheControl': 'string',
                'ContentDisposition': 'string',
                'ContentEncoding': 'string',
                'ContentLanguage': 'string',
                'UserMetadata': {
                    'string': 'string'
                },
                'ContentLength': 123,
                'ContentMD5': 'string',
                'ContentType': 'string',
                'HttpExpiresDate': datetime(2015, 1, 1),
                'RequesterCharged': True|False,
                'SSEAlgorithm': 'AES256'|'KMS'
            },
            'NewObjectTagging': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'RedirectLocation': 'string',
            'RequesterPays': True|False,
            'StorageClass': 'STANDARD'|'STANDARD_IA'|'ONEZONE_IA'|'GLACIER'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'GLACIER_IR',
            'UnModifiedSinceConstraint': datetime(2015, 1, 1),
            'SSEAwsKmsKeyId': 'string',
            'TargetKeyPrefix': 'string',
            'ObjectLockLegalHoldStatus': 'OFF'|'ON',
            'ObjectLockMode': 'COMPLIANCE'|'GOVERNANCE',
            'ObjectLockRetainUntilDate': datetime(2015, 1, 1),
            'BucketKeyEnabled': True|False
        },
        'S3PutObjectAcl': {
            'AccessControlPolicy': {
                'AccessControlList': {
                    'Owner': {
                        'ID': 'string',
                        'DisplayName': 'string'
                    },
                    'Grants': [
                        {
                            'Grantee': {
                                'TypeIdentifier': 'id'|'emailAddress'|'uri',
                                'Identifier': 'string',
                                'DisplayName': 'string'
                            },
                            'Permission': 'FULL_CONTROL'|'READ'|'WRITE'|'READ_ACP'|'WRITE_ACP'
                        },
                    ]
                },
                'CannedAccessControlList': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control'
            }
        },
        'S3PutObjectTagging': {
            'TagSet': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ]
        },
        'S3DeleteObjectTagging': {}
        ,
        'S3InitiateRestoreObject': {
            'ExpirationInDays': 123,
            'GlacierJobTier': 'BULK'|'STANDARD'
        },
        'S3PutObjectLegalHold': {
            'LegalHold': {
                'Status': 'OFF'|'ON'
            }
        },
        'S3PutObjectRetention': {
            'BypassGovernanceRetention': True|False,
            'Retention': {
                'RetainUntilDate': datetime(2015, 1, 1),
                'Mode': 'COMPLIANCE'|'GOVERNANCE'
            }
        },
        'S3ReplicateObject': {}

    },
    Report={
        'Bucket': 'string',
        'Format': 'Report_CSV_20180820',
        'Enabled': True|False,
        'Prefix': 'string',
        'ReportScope': 'AllTasks'|'FailedTasksOnly'
    },
    ClientRequestToken='string',
    Manifest={
        'Spec': {
            'Format': 'S3BatchOperations_CSV_20180820'|'S3InventoryReport_CSV_20161130',
            'Fields': [
                'Ignore'|'Bucket'|'Key'|'VersionId',
            ]
        },
        'Location': {
            'ObjectArn': 'string',
            'ObjectVersionId': 'string',
            'ETag': 'string'
        }
    },
    Description='string',
    Priority=123,
    RoleArn='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    ManifestGenerator={
        'S3JobManifestGenerator': {
            'ExpectedBucketOwner': 'string',
            'SourceBucket': 'string',
            'ManifestOutputLocation': {
                'ExpectedManifestBucketOwner': 'string',
                'Bucket': 'string',
                'ManifestPrefix': 'string',
                'ManifestEncryption': {
                    'SSES3': {}
                    ,
                    'SSEKMS': {
                        'KeyId': 'string'
                    }
                },
                'ManifestFormat': 'S3InventoryReport_CSV_20211130'
            },
            'Filter': {
                'EligibleForReplication': True|False,
                'CreatedAfter': datetime(2015, 1, 1),
                'CreatedBefore': datetime(2015, 1, 1),
                'ObjectReplicationStatuses': [
                    'COMPLETED'|'FAILED'|'REPLICA'|'NONE',
                ]
            },
            'EnableManifestOutput': True|False
        }
    }
)
type AccountId

string

param AccountId

[REQUIRED]

The Amazon Web Services account ID that creates the job.

type ConfirmationRequired

boolean

param ConfirmationRequired

Indicates whether confirmation is required before Amazon S3 runs the job. Confirmation is only required for jobs created through the Amazon S3 console.

type Operation

dict

param Operation

[REQUIRED]

The action that you want this job to perform on every object listed in the manifest. For more information about the available actions, see Operations in the Amazon S3 User Guide .

  • LambdaInvoke (dict) --

    Directs the specified job to invoke an Lambda function on every object in the manifest.

    • FunctionArn (string) --

      The Amazon Resource Name (ARN) for the Lambda function that the specified job will invoke on every object in the manifest.

  • S3PutObjectCopy (dict) --

    Directs the specified job to run a PUT Copy object call on every object in the manifest.

    • TargetResource (string) --

      Specifies the destination bucket ARN for the batch copy operation. For example, to copy objects to a bucket named "destinationBucket", set the TargetResource to "arn:aws:s3:::destinationBucket".

    • CannedAccessControlList (string) --

    • AccessControlGrants (list) --

      • (dict) --

        • Grantee (dict) --

          • TypeIdentifier (string) --

          • Identifier (string) --

          • DisplayName (string) --

        • Permission (string) --

    • MetadataDirective (string) --

    • ModifiedSinceConstraint (datetime) --

    • NewObjectMetadata (dict) --

      If you don't provide this parameter, Amazon S3 copies all the metadata from the original objects. If you specify an empty set, the new objects will have no tags. Otherwise, Amazon S3 assigns the supplied tags to the new objects.

      • CacheControl (string) --

      • ContentDisposition (string) --

      • ContentEncoding (string) --

      • ContentLanguage (string) --

      • UserMetadata (dict) --

        • (string) --

          • (string) --

      • ContentLength (integer) --

      • ContentMD5 (string) --

      • ContentType (string) --

      • HttpExpiresDate (datetime) --

      • RequesterCharged (boolean) --

      • SSEAlgorithm (string) --

    • NewObjectTagging (list) --

      • (dict) --

        • Key (string) -- [REQUIRED]

        • Value (string) -- [REQUIRED]

    • RedirectLocation (string) --

      Specifies an optional metadata property for website redirects, x-amz-website-redirect-location . Allows webpage redirects if the object is accessed through a website endpoint.

    • RequesterPays (boolean) --

    • StorageClass (string) --

    • UnModifiedSinceConstraint (datetime) --

    • SSEAwsKmsKeyId (string) --

    • TargetKeyPrefix (string) --

      Specifies the folder prefix into which you would like the objects to be copied. For example, to copy objects into a folder named "Folder1" in the destination bucket, set the TargetKeyPrefix to "Folder1/".

    • ObjectLockLegalHoldStatus (string) --

      The legal hold status to be applied to all objects in the Batch Operations job.

    • ObjectLockMode (string) --

      The retention mode to be applied to all objects in the Batch Operations job.

    • ObjectLockRetainUntilDate (datetime) --

      The date when the applied object retention configuration expires on all objects in the Batch Operations job.

    • BucketKeyEnabled (boolean) --

      Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Amazon Web Services KMS (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

      Specifying this header with an object action doesn’t affect bucket-level settings for S3 Bucket Key.

  • S3PutObjectAcl (dict) --

    Directs the specified job to run a PUT Object acl call on every object in the manifest.

    • AccessControlPolicy (dict) --

      • AccessControlList (dict) --

        • Owner (dict) -- [REQUIRED]

          • ID (string) --

          • DisplayName (string) --

        • Grants (list) --

          • (dict) --

            • Grantee (dict) --

              • TypeIdentifier (string) --

              • Identifier (string) --

              • DisplayName (string) --

            • Permission (string) --

      • CannedAccessControlList (string) --

  • S3PutObjectTagging (dict) --

    Directs the specified job to run a PUT Object tagging call on every object in the manifest.

    • TagSet (list) --

      • (dict) --

        • Key (string) -- [REQUIRED]

        • Value (string) -- [REQUIRED]

  • S3DeleteObjectTagging (dict) --

    Directs the specified job to execute a DELETE Object tagging call on every object in the manifest.

  • S3InitiateRestoreObject (dict) --

    Directs the specified job to initiate restore requests for every archived object in the manifest.

    • ExpirationInDays (integer) --

      This argument specifies how long the S3 Glacier or S3 Glacier Deep Archive object remains available in Amazon S3. S3 Initiate Restore Object jobs that target S3 Glacier and S3 Glacier Deep Archive objects require ExpirationInDays set to 1 or greater.

      Conversely, do not set ExpirationInDays when creating S3 Initiate Restore Object jobs that target S3 Intelligent-Tiering Archive Access and Deep Archive Access tier objects. Objects in S3 Intelligent-Tiering archive access tiers are not subject to restore expiry, so specifying ExpirationInDays results in restore request failure.

      S3 Batch Operations jobs can operate either on S3 Glacier and S3 Glacier Deep Archive storage class objects or on S3 Intelligent-Tiering Archive Access and Deep Archive Access storage tier objects, but not both types in the same job. If you need to restore objects of both types you must create separate Batch Operations jobs.

    • GlacierJobTier (string) --

      S3 Batch Operations supports STANDARD and BULK retrieval tiers, but not the EXPEDITED retrieval tier.

  • S3PutObjectLegalHold (dict) --

    Contains the configuration for an S3 Object Lock legal hold operation that an S3 Batch Operations job passes every object to the underlying PutObjectLegalHold API. For more information, see Using S3 Object Lock legal hold with S3 Batch Operations in the Amazon S3 User Guide .

    • LegalHold (dict) -- [REQUIRED]

      Contains the Object Lock legal hold status to be applied to all objects in the Batch Operations job.

      • Status (string) -- [REQUIRED]

        The Object Lock legal hold status to be applied to all objects in the Batch Operations job.

  • S3PutObjectRetention (dict) --

    Contains the configuration parameters for the Object Lock retention action for an S3 Batch Operations job. Batch Operations passes every object to the underlying PutObjectRetention API. For more information, see Using S3 Object Lock retention with S3 Batch Operations in the Amazon S3 User Guide .

    • BypassGovernanceRetention (boolean) --

      Indicates if the action should be applied to objects in the Batch Operations job even if they have Object Lock GOVERNANCE type in place.

    • Retention (dict) -- [REQUIRED]

      Contains the Object Lock retention mode to be applied to all objects in the Batch Operations job. For more information, see Using S3 Object Lock retention with S3 Batch Operations in the Amazon S3 User Guide .

      • RetainUntilDate (datetime) --

        The date when the applied Object Lock retention will expire on all objects set by the Batch Operations job.

      • Mode (string) --

        The Object Lock retention mode to be applied to all objects in the Batch Operations job.

  • S3ReplicateObject (dict) --

    Directs the specified job to invoke ReplicateObject on every object in the job's manifest.

type Report

dict

param Report

[REQUIRED]

Configuration parameters for the optional job-completion report.

  • Bucket (string) --

    The Amazon Resource Name (ARN) for the bucket where specified job-completion report will be stored.

  • Format (string) --

    The format of the specified job-completion report.

  • Enabled (boolean) -- [REQUIRED]

    Indicates whether the specified job will generate a job-completion report.

  • Prefix (string) --

    An optional prefix to describe where in the specified bucket the job-completion report will be stored. Amazon S3 stores the job-completion report at <prefix>/job-<job-id>/report.json .

  • ReportScope (string) --

    Indicates whether the job-completion report will include details of all tasks or only failed tasks.

type ClientRequestToken

string

param ClientRequestToken

[REQUIRED]

An idempotency token to ensure that you don't accidentally submit the same request twice. You can use any string up to the maximum length.

This field is autopopulated if not provided.

type Manifest

dict

param Manifest

Configuration parameters for the manifest.

  • Spec (dict) -- [REQUIRED]

    Describes the format of the specified job's manifest. If the manifest is in CSV format, also describes the columns contained within the manifest.

    • Format (string) -- [REQUIRED]

      Indicates which of the available formats the specified manifest uses.

    • Fields (list) --

      If the specified manifest object is in the S3BatchOperations_CSV_20180820 format, this element describes which columns contain the required data.

      • (string) --

  • Location (dict) -- [REQUIRED]

    Contains the information required to locate the specified job's manifest.

    • ObjectArn (string) -- [REQUIRED]

      The Amazon Resource Name (ARN) for a manifest object.

      Warning

      Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints .

    • ObjectVersionId (string) --

      The optional version ID to identify a specific version of the manifest object.

    • ETag (string) -- [REQUIRED]

      The ETag for the specified manifest object.

type Description

string

param Description

A description for this job. You can use any string within the permitted length. Descriptions don't need to be unique and can be used for multiple jobs.

type Priority

integer

param Priority

[REQUIRED]

The numerical priority for this job. Higher numbers indicate higher priority.

type RoleArn

string

param RoleArn

[REQUIRED]

The Amazon Resource Name (ARN) for the Identity and Access Management (IAM) role that Batch Operations will use to run this job's action on every object in the manifest.

type Tags

list

param Tags

A set of tags to associate with the S3 Batch Operations job. This is an optional parameter.

  • (dict) --

    • Key (string) -- [REQUIRED]

    • Value (string) -- [REQUIRED]

type ManifestGenerator

dict

param ManifestGenerator

The attribute container for the ManifestGenerator details. Jobs must be created with either a manifest file or a ManifestGenerator, but not both.

  • S3JobManifestGenerator (dict) --

    The S3 job ManifestGenerator's configuration details.

    • ExpectedBucketOwner (string) --

      The Amazon Web Services account ID that owns the bucket the generated manifest is written to. If provided the generated manifest bucket's owner Amazon Web Services account ID must match this value, else the job fails.

    • SourceBucket (string) -- [REQUIRED]

      The source bucket used by the ManifestGenerator.

    • ManifestOutputLocation (dict) --

      Specifies the location the generated manifest will be written to.

      • ExpectedManifestBucketOwner (string) --

        The Account ID that owns the bucket the generated manifest is written to.

      • Bucket (string) -- [REQUIRED]

        The bucket ARN the generated manifest should be written to.

      • ManifestPrefix (string) --

        Prefix identifying one or more objects to which the manifest applies.

      • ManifestEncryption (dict) --

        Specifies what encryption should be used when the generated manifest objects are written.

        • SSES3 (dict) --

          Specifies the use of SSE-S3 to encrypt generated manifest objects.

        • SSEKMS (dict) --

          Configuration details on how SSE-KMS is used to encrypt generated manifest objects.

          • KeyId (string) -- [REQUIRED]

            Specifies the ID of the Amazon Web Services Key Management Service (Amazon Web Services KMS) symmetric customer managed key to use for encrypting generated manifest objects.

      • ManifestFormat (string) -- [REQUIRED]

        The format of the generated manifest.

    • Filter (dict) --

      Specifies rules the S3JobManifestGenerator should use to use to decide whether an object in the source bucket should or should not be included in the generated job manifest.

      • EligibleForReplication (boolean) --

        Include objects in the generated manifest only if they are eligible for replication according to the Replication configuration on the source bucket.

      • CreatedAfter (datetime) --

        If provided, the generated manifest should include only source bucket objects that were created after this time.

      • CreatedBefore (datetime) --

        If provided, the generated manifest should include only source bucket objects that were created before this time.

      • ObjectReplicationStatuses (list) --

        If provided, the generated manifest should include only source bucket objects that have one of the specified Replication statuses.

        • (string) --

    • EnableManifestOutput (boolean) -- [REQUIRED]

      Determines whether or not to write the job's generated manifest to a bucket.

rtype

dict

returns

Response Syntax

{
    'JobId': 'string'
}

Response Structure

  • (dict) --

    • JobId (string) --

      The ID for this job. Amazon S3 generates this ID automatically and returns it after a successful Create Job request.

DescribeJob (updated) Link ¶
Changes (response)
{'Job': {'GeneratedManifestDescriptor': {'Format': 'S3InventoryReport_CSV_20211130',
                                         'Location': {'ETag': 'string',
                                                      'ObjectArn': 'string',
                                                      'ObjectVersionId': 'string'}},
         'ManifestGenerator': {'S3JobManifestGenerator': {'EnableManifestOutput': 'boolean',
                                                          'ExpectedBucketOwner': 'string',
                                                          'Filter': {'CreatedAfter': 'timestamp',
                                                                     'CreatedBefore': 'timestamp',
                                                                     'EligibleForReplication': 'boolean',
                                                                     'ObjectReplicationStatuses': ['COMPLETED '
                                                                                                   '| '
                                                                                                   'FAILED '
                                                                                                   '| '
                                                                                                   'REPLICA '
                                                                                                   '| '
                                                                                                   'NONE']},
                                                          'ManifestOutputLocation': {'Bucket': 'string',
                                                                                     'ExpectedManifestBucketOwner': 'string',
                                                                                     'ManifestEncryption': {'SSEKMS': {'KeyId': 'string'},
                                                                                                            'SSES3': {}},
                                                                                     'ManifestFormat': 'S3InventoryReport_CSV_20211130',
                                                                                     'ManifestPrefix': 'string'},
                                                          'SourceBucket': 'string'}},
         'Operation': {'S3PutObjectCopy': {'StorageClass': {'GLACIER_IR'}},
                       'S3ReplicateObject': {}},
         'ProgressSummary': {'Timers': {'ElapsedTimeInActiveSeconds': 'long'}}}}

Retrieves the configuration parameters and status for a Batch Operations job. For more information, see S3 Batch Operations in the Amazon S3 User Guide .

Related actions include:

See also: AWS API Documentation

Request Syntax

client.describe_job(
    AccountId='string',
    JobId='string'
)
type AccountId

string

param AccountId

[REQUIRED]

The Amazon Web Services account ID associated with the S3 Batch Operations job.

type JobId

string

param JobId

[REQUIRED]

The ID for the job whose information you want to retrieve.

rtype

dict

returns

Response Syntax

{
    'Job': {
        'JobId': 'string',
        'ConfirmationRequired': True|False,
        'Description': 'string',
        'JobArn': 'string',
        'Status': 'Active'|'Cancelled'|'Cancelling'|'Complete'|'Completing'|'Failed'|'Failing'|'New'|'Paused'|'Pausing'|'Preparing'|'Ready'|'Suspended',
        'Manifest': {
            'Spec': {
                'Format': 'S3BatchOperations_CSV_20180820'|'S3InventoryReport_CSV_20161130',
                'Fields': [
                    'Ignore'|'Bucket'|'Key'|'VersionId',
                ]
            },
            'Location': {
                'ObjectArn': 'string',
                'ObjectVersionId': 'string',
                'ETag': 'string'
            }
        },
        'Operation': {
            'LambdaInvoke': {
                'FunctionArn': 'string'
            },
            'S3PutObjectCopy': {
                'TargetResource': 'string',
                'CannedAccessControlList': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control',
                'AccessControlGrants': [
                    {
                        'Grantee': {
                            'TypeIdentifier': 'id'|'emailAddress'|'uri',
                            'Identifier': 'string',
                            'DisplayName': 'string'
                        },
                        'Permission': 'FULL_CONTROL'|'READ'|'WRITE'|'READ_ACP'|'WRITE_ACP'
                    },
                ],
                'MetadataDirective': 'COPY'|'REPLACE',
                'ModifiedSinceConstraint': datetime(2015, 1, 1),
                'NewObjectMetadata': {
                    'CacheControl': 'string',
                    'ContentDisposition': 'string',
                    'ContentEncoding': 'string',
                    'ContentLanguage': 'string',
                    'UserMetadata': {
                        'string': 'string'
                    },
                    'ContentLength': 123,
                    'ContentMD5': 'string',
                    'ContentType': 'string',
                    'HttpExpiresDate': datetime(2015, 1, 1),
                    'RequesterCharged': True|False,
                    'SSEAlgorithm': 'AES256'|'KMS'
                },
                'NewObjectTagging': [
                    {
                        'Key': 'string',
                        'Value': 'string'
                    },
                ],
                'RedirectLocation': 'string',
                'RequesterPays': True|False,
                'StorageClass': 'STANDARD'|'STANDARD_IA'|'ONEZONE_IA'|'GLACIER'|'INTELLIGENT_TIERING'|'DEEP_ARCHIVE'|'GLACIER_IR',
                'UnModifiedSinceConstraint': datetime(2015, 1, 1),
                'SSEAwsKmsKeyId': 'string',
                'TargetKeyPrefix': 'string',
                'ObjectLockLegalHoldStatus': 'OFF'|'ON',
                'ObjectLockMode': 'COMPLIANCE'|'GOVERNANCE',
                'ObjectLockRetainUntilDate': datetime(2015, 1, 1),
                'BucketKeyEnabled': True|False
            },
            'S3PutObjectAcl': {
                'AccessControlPolicy': {
                    'AccessControlList': {
                        'Owner': {
                            'ID': 'string',
                            'DisplayName': 'string'
                        },
                        'Grants': [
                            {
                                'Grantee': {
                                    'TypeIdentifier': 'id'|'emailAddress'|'uri',
                                    'Identifier': 'string',
                                    'DisplayName': 'string'
                                },
                                'Permission': 'FULL_CONTROL'|'READ'|'WRITE'|'READ_ACP'|'WRITE_ACP'
                            },
                        ]
                    },
                    'CannedAccessControlList': 'private'|'public-read'|'public-read-write'|'aws-exec-read'|'authenticated-read'|'bucket-owner-read'|'bucket-owner-full-control'
                }
            },
            'S3PutObjectTagging': {
                'TagSet': [
                    {
                        'Key': 'string',
                        'Value': 'string'
                    },
                ]
            },
            'S3DeleteObjectTagging': {},
            'S3InitiateRestoreObject': {
                'ExpirationInDays': 123,
                'GlacierJobTier': 'BULK'|'STANDARD'
            },
            'S3PutObjectLegalHold': {
                'LegalHold': {
                    'Status': 'OFF'|'ON'
                }
            },
            'S3PutObjectRetention': {
                'BypassGovernanceRetention': True|False,
                'Retention': {
                    'RetainUntilDate': datetime(2015, 1, 1),
                    'Mode': 'COMPLIANCE'|'GOVERNANCE'
                }
            },
            'S3ReplicateObject': {}
        },
        'Priority': 123,
        'ProgressSummary': {
            'TotalNumberOfTasks': 123,
            'NumberOfTasksSucceeded': 123,
            'NumberOfTasksFailed': 123,
            'Timers': {
                'ElapsedTimeInActiveSeconds': 123
            }
        },
        'StatusUpdateReason': 'string',
        'FailureReasons': [
            {
                'FailureCode': 'string',
                'FailureReason': 'string'
            },
        ],
        'Report': {
            'Bucket': 'string',
            'Format': 'Report_CSV_20180820',
            'Enabled': True|False,
            'Prefix': 'string',
            'ReportScope': 'AllTasks'|'FailedTasksOnly'
        },
        'CreationTime': datetime(2015, 1, 1),
        'TerminationDate': datetime(2015, 1, 1),
        'RoleArn': 'string',
        'SuspendedDate': datetime(2015, 1, 1),
        'SuspendedCause': 'string',
        'ManifestGenerator': {
            'S3JobManifestGenerator': {
                'ExpectedBucketOwner': 'string',
                'SourceBucket': 'string',
                'ManifestOutputLocation': {
                    'ExpectedManifestBucketOwner': 'string',
                    'Bucket': 'string',
                    'ManifestPrefix': 'string',
                    'ManifestEncryption': {
                        'SSES3': {},
                        'SSEKMS': {
                            'KeyId': 'string'
                        }
                    },
                    'ManifestFormat': 'S3InventoryReport_CSV_20211130'
                },
                'Filter': {
                    'EligibleForReplication': True|False,
                    'CreatedAfter': datetime(2015, 1, 1),
                    'CreatedBefore': datetime(2015, 1, 1),
                    'ObjectReplicationStatuses': [
                        'COMPLETED'|'FAILED'|'REPLICA'|'NONE',
                    ]
                },
                'EnableManifestOutput': True|False
            }
        },
        'GeneratedManifestDescriptor': {
            'Format': 'S3InventoryReport_CSV_20211130',
            'Location': {
                'ObjectArn': 'string',
                'ObjectVersionId': 'string',
                'ETag': 'string'
            }
        }
    }
}

Response Structure

  • (dict) --

    • Job (dict) --

      Contains the configuration parameters and status for the job specified in the Describe Job request.

      • JobId (string) --

        The ID for the specified job.

      • ConfirmationRequired (boolean) --

        Indicates whether confirmation is required before Amazon S3 begins running the specified job. Confirmation is required only for jobs created through the Amazon S3 console.

      • Description (string) --

        The description for this job, if one was provided in this job's Create Job request.

      • JobArn (string) --

        The Amazon Resource Name (ARN) for this job.

      • Status (string) --

        The current status of the specified job.

      • Manifest (dict) --

        The configuration information for the specified job's manifest object.

        • Spec (dict) --

          Describes the format of the specified job's manifest. If the manifest is in CSV format, also describes the columns contained within the manifest.

          • Format (string) --

            Indicates which of the available formats the specified manifest uses.

          • Fields (list) --

            If the specified manifest object is in the S3BatchOperations_CSV_20180820 format, this element describes which columns contain the required data.

            • (string) --

        • Location (dict) --

          Contains the information required to locate the specified job's manifest.

          • ObjectArn (string) --

            The Amazon Resource Name (ARN) for a manifest object.

            Warning

            Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints .

          • ObjectVersionId (string) --

            The optional version ID to identify a specific version of the manifest object.

          • ETag (string) --

            The ETag for the specified manifest object.

      • Operation (dict) --

        The operation that the specified job is configured to run on the objects listed in the manifest.

        • LambdaInvoke (dict) --

          Directs the specified job to invoke an Lambda function on every object in the manifest.

          • FunctionArn (string) --

            The Amazon Resource Name (ARN) for the Lambda function that the specified job will invoke on every object in the manifest.

        • S3PutObjectCopy (dict) --

          Directs the specified job to run a PUT Copy object call on every object in the manifest.

          • TargetResource (string) --

            Specifies the destination bucket ARN for the batch copy operation. For example, to copy objects to a bucket named "destinationBucket", set the TargetResource to "arn:aws:s3:::destinationBucket".

          • CannedAccessControlList (string) --

          • AccessControlGrants (list) --

            • (dict) --

              • Grantee (dict) --

                • TypeIdentifier (string) --

                • Identifier (string) --

                • DisplayName (string) --

              • Permission (string) --

          • MetadataDirective (string) --

          • ModifiedSinceConstraint (datetime) --

          • NewObjectMetadata (dict) --

            If you don't provide this parameter, Amazon S3 copies all the metadata from the original objects. If you specify an empty set, the new objects will have no tags. Otherwise, Amazon S3 assigns the supplied tags to the new objects.

            • CacheControl (string) --

            • ContentDisposition (string) --

            • ContentEncoding (string) --

            • ContentLanguage (string) --

            • UserMetadata (dict) --

              • (string) --

                • (string) --

            • ContentLength (integer) --

            • ContentMD5 (string) --

            • ContentType (string) --

            • HttpExpiresDate (datetime) --

            • RequesterCharged (boolean) --

            • SSEAlgorithm (string) --

          • NewObjectTagging (list) --

            • (dict) --

              • Key (string) --

              • Value (string) --

          • RedirectLocation (string) --

            Specifies an optional metadata property for website redirects, x-amz-website-redirect-location . Allows webpage redirects if the object is accessed through a website endpoint.

          • RequesterPays (boolean) --

          • StorageClass (string) --

          • UnModifiedSinceConstraint (datetime) --

          • SSEAwsKmsKeyId (string) --

          • TargetKeyPrefix (string) --

            Specifies the folder prefix into which you would like the objects to be copied. For example, to copy objects into a folder named "Folder1" in the destination bucket, set the TargetKeyPrefix to "Folder1/".

          • ObjectLockLegalHoldStatus (string) --

            The legal hold status to be applied to all objects in the Batch Operations job.

          • ObjectLockMode (string) --

            The retention mode to be applied to all objects in the Batch Operations job.

          • ObjectLockRetainUntilDate (datetime) --

            The date when the applied object retention configuration expires on all objects in the Batch Operations job.

          • BucketKeyEnabled (boolean) --

            Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption with server-side encryption using Amazon Web Services KMS (SSE-KMS). Setting this header to true causes Amazon S3 to use an S3 Bucket Key for object encryption with SSE-KMS.

            Specifying this header with an object action doesn’t affect bucket-level settings for S3 Bucket Key.

        • S3PutObjectAcl (dict) --

          Directs the specified job to run a PUT Object acl call on every object in the manifest.

          • AccessControlPolicy (dict) --

            • AccessControlList (dict) --

              • Owner (dict) --

                • ID (string) --

                • DisplayName (string) --

              • Grants (list) --

                • (dict) --

                  • Grantee (dict) --

                    • TypeIdentifier (string) --

                    • Identifier (string) --

                    • DisplayName (string) --

                  • Permission (string) --

            • CannedAccessControlList (string) --

        • S3PutObjectTagging (dict) --

          Directs the specified job to run a PUT Object tagging call on every object in the manifest.

          • TagSet (list) --

            • (dict) --

              • Key (string) --

              • Value (string) --

        • S3DeleteObjectTagging (dict) --

          Directs the specified job to execute a DELETE Object tagging call on every object in the manifest.

        • S3InitiateRestoreObject (dict) --

          Directs the specified job to initiate restore requests for every archived object in the manifest.

          • ExpirationInDays (integer) --

            This argument specifies how long the S3 Glacier or S3 Glacier Deep Archive object remains available in Amazon S3. S3 Initiate Restore Object jobs that target S3 Glacier and S3 Glacier Deep Archive objects require ExpirationInDays set to 1 or greater.

            Conversely, do not set ExpirationInDays when creating S3 Initiate Restore Object jobs that target S3 Intelligent-Tiering Archive Access and Deep Archive Access tier objects. Objects in S3 Intelligent-Tiering archive access tiers are not subject to restore expiry, so specifying ExpirationInDays results in restore request failure.

            S3 Batch Operations jobs can operate either on S3 Glacier and S3 Glacier Deep Archive storage class objects or on S3 Intelligent-Tiering Archive Access and Deep Archive Access storage tier objects, but not both types in the same job. If you need to restore objects of both types you must create separate Batch Operations jobs.

          • GlacierJobTier (string) --

            S3 Batch Operations supports STANDARD and BULK retrieval tiers, but not the EXPEDITED retrieval tier.

        • S3PutObjectLegalHold (dict) --

          Contains the configuration for an S3 Object Lock legal hold operation that an S3 Batch Operations job passes every object to the underlying PutObjectLegalHold API. For more information, see Using S3 Object Lock legal hold with S3 Batch Operations in the Amazon S3 User Guide .

          • LegalHold (dict) --

            Contains the Object Lock legal hold status to be applied to all objects in the Batch Operations job.

            • Status (string) --

              The Object Lock legal hold status to be applied to all objects in the Batch Operations job.

        • S3PutObjectRetention (dict) --

          Contains the configuration parameters for the Object Lock retention action for an S3 Batch Operations job. Batch Operations passes every object to the underlying PutObjectRetention API. For more information, see Using S3 Object Lock retention with S3 Batch Operations in the Amazon S3 User Guide .

          • BypassGovernanceRetention (boolean) --

            Indicates if the action should be applied to objects in the Batch Operations job even if they have Object Lock GOVERNANCE type in place.

          • Retention (dict) --

            Contains the Object Lock retention mode to be applied to all objects in the Batch Operations job. For more information, see Using S3 Object Lock retention with S3 Batch Operations in the Amazon S3 User Guide .

            • RetainUntilDate (datetime) --

              The date when the applied Object Lock retention will expire on all objects set by the Batch Operations job.

            • Mode (string) --

              The Object Lock retention mode to be applied to all objects in the Batch Operations job.

        • S3ReplicateObject (dict) --

          Directs the specified job to invoke ReplicateObject on every object in the job's manifest.

      • Priority (integer) --

        The priority of the specified job.

      • ProgressSummary (dict) --

        Describes the total number of tasks that the specified job has run, the number of tasks that succeeded, and the number of tasks that failed.

        • TotalNumberOfTasks (integer) --

        • NumberOfTasksSucceeded (integer) --

        • NumberOfTasksFailed (integer) --

        • Timers (dict) --

          The JobTimers attribute of a job's progress summary.

          • ElapsedTimeInActiveSeconds (integer) --

            Indicates the elapsed time in seconds the job has been in the Active job state.

      • StatusUpdateReason (string) --

        The reason for updating the job.

      • FailureReasons (list) --

        If the specified job failed, this field contains information describing the failure.

        • (dict) --

          If this job failed, this element indicates why the job failed.

          • FailureCode (string) --

            The failure code, if any, for the specified job.

          • FailureReason (string) --

            The failure reason, if any, for the specified job.

      • Report (dict) --

        Contains the configuration information for the job-completion report if you requested one in the Create Job request.

        • Bucket (string) --

          The Amazon Resource Name (ARN) for the bucket where specified job-completion report will be stored.

        • Format (string) --

          The format of the specified job-completion report.

        • Enabled (boolean) --

          Indicates whether the specified job will generate a job-completion report.

        • Prefix (string) --

          An optional prefix to describe where in the specified bucket the job-completion report will be stored. Amazon S3 stores the job-completion report at <prefix>/job-<job-id>/report.json .

        • ReportScope (string) --

          Indicates whether the job-completion report will include details of all tasks or only failed tasks.

      • CreationTime (datetime) --

        A timestamp indicating when this job was created.

      • TerminationDate (datetime) --

        A timestamp indicating when this job terminated. A job's termination date is the date and time when it succeeded, failed, or was canceled.

      • RoleArn (string) --

        The Amazon Resource Name (ARN) for the Identity and Access Management (IAM) role assigned to run the tasks for this job.

      • SuspendedDate (datetime) --

        The timestamp when this job was suspended, if it has been suspended.

      • SuspendedCause (string) --

        The reason why the specified job was suspended. A job is only suspended if you create it through the Amazon S3 console. When you create the job, it enters the Suspended state to await confirmation before running. After you confirm the job, it automatically exits the Suspended state.

      • ManifestGenerator (dict) --

        The manifest generator that was used to generate a job manifest for this job.

        • S3JobManifestGenerator (dict) --

          The S3 job ManifestGenerator's configuration details.

          • ExpectedBucketOwner (string) --

            The Amazon Web Services account ID that owns the bucket the generated manifest is written to. If provided the generated manifest bucket's owner Amazon Web Services account ID must match this value, else the job fails.

          • SourceBucket (string) --

            The source bucket used by the ManifestGenerator.

          • ManifestOutputLocation (dict) --

            Specifies the location the generated manifest will be written to.

            • ExpectedManifestBucketOwner (string) --

              The Account ID that owns the bucket the generated manifest is written to.

            • Bucket (string) --

              The bucket ARN the generated manifest should be written to.

            • ManifestPrefix (string) --

              Prefix identifying one or more objects to which the manifest applies.

            • ManifestEncryption (dict) --

              Specifies what encryption should be used when the generated manifest objects are written.

              • SSES3 (dict) --

                Specifies the use of SSE-S3 to encrypt generated manifest objects.

              • SSEKMS (dict) --

                Configuration details on how SSE-KMS is used to encrypt generated manifest objects.

                • KeyId (string) --

                  Specifies the ID of the Amazon Web Services Key Management Service (Amazon Web Services KMS) symmetric customer managed key to use for encrypting generated manifest objects.

            • ManifestFormat (string) --

              The format of the generated manifest.

          • Filter (dict) --

            Specifies rules the S3JobManifestGenerator should use to use to decide whether an object in the source bucket should or should not be included in the generated job manifest.

            • EligibleForReplication (boolean) --

              Include objects in the generated manifest only if they are eligible for replication according to the Replication configuration on the source bucket.

            • CreatedAfter (datetime) --

              If provided, the generated manifest should include only source bucket objects that were created after this time.

            • CreatedBefore (datetime) --

              If provided, the generated manifest should include only source bucket objects that were created before this time.

            • ObjectReplicationStatuses (list) --

              If provided, the generated manifest should include only source bucket objects that have one of the specified Replication statuses.

              • (string) --

          • EnableManifestOutput (boolean) --

            Determines whether or not to write the job's generated manifest to a bucket.

      • GeneratedManifestDescriptor (dict) --

        The attribute of the JobDescriptor containing details about the job's generated manifest.

        • Format (string) --

          The format of the generated manifest.

        • Location (dict) --

          Contains the information required to locate a manifest object.

          • ObjectArn (string) --

            The Amazon Resource Name (ARN) for a manifest object.

            Warning

            Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints .

          • ObjectVersionId (string) --

            The optional version ID to identify a specific version of the manifest object.

          • ETag (string) --

            The ETag for the specified manifest object.

ListJobs (updated) Link ¶
Changes (response)
{'Jobs': {'Operation': {'S3ReplicateObject'},
          'ProgressSummary': {'Timers': {'ElapsedTimeInActiveSeconds': 'long'}}}}

Lists current S3 Batch Operations jobs and jobs that have ended within the last 30 days for the Amazon Web Services account making the request. For more information, see S3 Batch Operations in the Amazon S3 User Guide .

Related actions include:

See also: AWS API Documentation

Request Syntax

client.list_jobs(
    AccountId='string',
    JobStatuses=[
        'Active'|'Cancelled'|'Cancelling'|'Complete'|'Completing'|'Failed'|'Failing'|'New'|'Paused'|'Pausing'|'Preparing'|'Ready'|'Suspended',
    ],
    NextToken='string',
    MaxResults=123
)
type AccountId

string

param AccountId

[REQUIRED]

The Amazon Web Services account ID associated with the S3 Batch Operations job.

type JobStatuses

list

param JobStatuses

The List Jobs request returns jobs that match the statuses listed in this element.

  • (string) --

type NextToken

string

param NextToken

A pagination token to request the next page of results. Use the token that Amazon S3 returned in the NextToken element of the ListJobsResult from the previous List Jobs request.

type MaxResults

integer

param MaxResults

The maximum number of jobs that Amazon S3 will include in the List Jobs response. If there are more jobs than this number, the response will include a pagination token in the NextToken field to enable you to retrieve the next page of results.

rtype

dict

returns

Response Syntax

{
    'NextToken': 'string',
    'Jobs': [
        {
            'JobId': 'string',
            'Description': 'string',
            'Operation': 'LambdaInvoke'|'S3PutObjectCopy'|'S3PutObjectAcl'|'S3PutObjectTagging'|'S3DeleteObjectTagging'|'S3InitiateRestoreObject'|'S3PutObjectLegalHold'|'S3PutObjectRetention'|'S3ReplicateObject',
            'Priority': 123,
            'Status': 'Active'|'Cancelled'|'Cancelling'|'Complete'|'Completing'|'Failed'|'Failing'|'New'|'Paused'|'Pausing'|'Preparing'|'Ready'|'Suspended',
            'CreationTime': datetime(2015, 1, 1),
            'TerminationDate': datetime(2015, 1, 1),
            'ProgressSummary': {
                'TotalNumberOfTasks': 123,
                'NumberOfTasksSucceeded': 123,
                'NumberOfTasksFailed': 123,
                'Timers': {
                    'ElapsedTimeInActiveSeconds': 123
                }
            }
        },
    ]
}

Response Structure

  • (dict) --

    • NextToken (string) --

      If the List Jobs request produced more than the maximum number of results, you can pass this value into a subsequent List Jobs request in order to retrieve the next page of results.

    • Jobs (list) --

      The list of current jobs and jobs that have ended within the last 30 days.

      • (dict) --

        Contains the configuration and status information for a single job retrieved as part of a job list.

        • JobId (string) --

          The ID for the specified job.

        • Description (string) --

          The user-specified description that was included in the specified job's Create Job request.

        • Operation (string) --

          The operation that the specified job is configured to run on every object listed in the manifest.

        • Priority (integer) --

          The current priority for the specified job.

        • Status (string) --

          The specified job's current status.

        • CreationTime (datetime) --

          A timestamp indicating when the specified job was created.

        • TerminationDate (datetime) --

          A timestamp indicating when the specified job terminated. A job's termination date is the date and time when it succeeded, failed, or was canceled.

        • ProgressSummary (dict) --

          Describes the total number of tasks that the specified job has run, the number of tasks that succeeded, and the number of tasks that failed.

          • TotalNumberOfTasks (integer) --

          • NumberOfTasksSucceeded (integer) --

          • NumberOfTasksFailed (integer) --

          • Timers (dict) --

            The JobTimers attribute of a job's progress summary.

            • ElapsedTimeInActiveSeconds (integer) --

              Indicates the elapsed time in seconds the job has been in the Active job state.