Storage Batch Operations API . projects . locations . jobs . bucketOperations

Instance Methods

close()

Close httplib2 connections.

get(name, x__xgafv=None)

Gets a BucketOperation.

list(parent, filter=None, orderBy=None, pageSize=None, pageToken=None, x__xgafv=None)

Lists BucketOperations in a given project and job.

list_next()

Retrieves the next page of results.

Method Details

close()
Close httplib2 connections.
get(name, x__xgafv=None)
Gets a BucketOperation.

Args:
  name: string, Required. `name` of the bucket operation to retrieve. Format: projects/{project_id}/locations/global/jobs/{job_id}/bucketOperations/{bucket_operation_id}. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # BucketOperation represents a bucket-level breakdown of a Job.
  "bucketName": "A String", # The bucket name of the objects to be transformed in the BucketOperation.
  "completeTime": "A String", # Output only. The time that the BucketOperation was completed.
  "counters": { # Describes details about the progress of the job. # Output only. Information about the progress of the bucket operation.
    "failedObjectCount": "A String", # Output only. Number of objects failed.
    "succeededObjectCount": "A String", # Output only. Number of objects completed.
    "totalBytesFound": "A String", # Output only. Number of bytes found from source. This field is only populated for jobs with a prefix list object configuration.
    "totalObjectCount": "A String", # Output only. Number of objects listed.
  },
  "createTime": "A String", # Output only. The time that the BucketOperation was created.
  "deleteObject": { # Describes options to delete an object. # Delete objects.
    "permanentObjectDeletionEnabled": True or False, # Required. Controls deletion behavior when versioning is enabled for the object's bucket. If true both live and noncurrent objects will be permanently deleted. Otherwise live objects in versioned buckets will become noncurrent and objects that were already noncurrent will be skipped. This setting doesn't have any impact on the Soft Delete feature. All objects deleted by this service can be be restored for the duration of the Soft Delete retention duration if enabled. If enabled and the manifest doesn't specify an object's generation, a GetObjectMetadata call (a Class B operation) will be made to determine the live object generation.
  },
  "errorSummaries": [ # Output only. Summarizes errors encountered with sample error log entries.
    { # A summary of errors by error code, plus a count and sample error log entries.
      "errorCode": "A String", # Required. The canonical error code.
      "errorCount": "A String", # Required. Number of errors encountered per `error_code`.
      "errorLogEntries": [ # Required. Sample error logs.
        { # An entry describing an error that has occurred.
          "errorDetails": [ # Optional. Output only. At most 5 error log entries are recorded for a given error code for a job.
            "A String",
          ],
          "objectUri": "A String", # Required. Output only. Object URL. e.g. gs://my_bucket/object.txt
        },
      ],
    },
  ],
  "manifest": { # Describes list of objects to be transformed. # Specifies objects in a manifest file.
    "manifestLocation": "A String", # Required. `manifest_location` must contain the manifest source file that is a CSV file in a Google Cloud Storage bucket. Each row in the file must include the object details i.e. BucketId and Name. Generation may optionally be specified. When it is not specified the live object is acted upon. `manifest_location` should either be 1) An absolute path to the object in the format of `gs://bucket_name/path/file_name.csv`. 2) An absolute path with a single wildcard character in the file name, for example `gs://bucket_name/path/file_name*.csv`. If manifest location is specified with a wildcard, objects in all manifest files matching the pattern will be acted upon.
  },
  "name": "A String", # Identifier. The resource name of the BucketOperation. This is defined by the service. Format: projects/{project}/locations/global/jobs/{job_id}/bucketOperations/{bucket_operation}.
  "prefixList": { # Describes prefixes of objects to be transformed. # Specifies objects matching a prefix set.
    "includedObjectPrefixes": [ # Optional. Include prefixes of the objects to be transformed. * Supports full object name * Supports prefix of the object name * Wildcards are not supported * Supports empty string for all objects in a bucket.
      "A String",
    ],
  },
  "putMetadata": { # Describes options for object metadata update. # Updates object metadata. Allows updating fixed-key and custom metadata and fixed-key metadata i.e. Cache-Control, Content-Disposition, Content-Encoding, Content-Language, Content-Type, Custom-Time.
    "cacheControl": "A String", # Optional. Updates objects Cache-Control fixed metadata. Unset values will be ignored. Set empty values to clear the metadata. Additionally, the value for Custom-Time cannot decrease. Refer to documentation in https://cloud.google.com/storage/docs/metadata#caching_data.
    "contentDisposition": "A String", # Optional. Updates objects Content-Disposition fixed metadata. Unset values will be ignored. Set empty values to clear the metadata. Refer https://cloud.google.com/storage/docs/metadata#content-disposition for additional documentation.
    "contentEncoding": "A String", # Optional. Updates objects Content-Encoding fixed metadata. Unset values will be ignored. Set empty values to clear the metadata. Refer to documentation in https://cloud.google.com/storage/docs/metadata#content-encoding.
    "contentLanguage": "A String", # Optional. Updates objects Content-Language fixed metadata. Refer to ISO 639-1 language codes for typical values of this metadata. Max length 100 characters. Unset values will be ignored. Set empty values to clear the metadata. Refer to documentation in https://cloud.google.com/storage/docs/metadata#content-language.
    "contentType": "A String", # Optional. Updates objects Content-Type fixed metadata. Unset values will be ignored. Set empty values to clear the metadata. Refer to documentation in https://cloud.google.com/storage/docs/metadata#content-type
    "customMetadata": { # Optional. Updates objects custom metadata. Adds or sets individual custom metadata key value pairs on objects. Keys that are set with empty custom metadata values will have its value cleared. Existing custom metadata not specified with this flag is not changed. Refer to documentation in https://cloud.google.com/storage/docs/metadata#custom-metadata
      "a_key": "A String",
    },
    "customTime": "A String", # Optional. Updates objects Custom-Time fixed metadata. Unset values will be ignored. Set empty values to clear the metadata. Refer to documentation in https://cloud.google.com/storage/docs/metadata#custom-time.
    "objectRetention": { # Describes options for object retention update. # Optional. Updates objects retention lock configuration. Unset values will be ignored. Set empty values to clear the retention for the object with existing `Unlocked` retention mode. Object with existing `Locked` retention mode cannot be cleared or reduce retain_until_time. Refer to documentation in https://cloud.google.com/storage/docs/object-lock
      "retainUntilTime": "A String", # Required. The time when the object will be retained until. UNSET will clear the retention. Must be specified in RFC 3339 format e.g. YYYY-MM-DD'T'HH:MM:SS.SS'Z' or YYYY-MM-DD'T'HH:MM:SS'Z'.
      "retentionMode": "A String", # Required. The retention mode of the object.
    },
  },
  "putObjectHold": { # Describes options to update object hold. # Changes object hold status.
    "eventBasedHold": "A String", # Required. Updates object event based holds state. When object event based hold is set, object cannot be deleted or replaced. Resets object's time in the bucket for the purposes of the retention period.
    "temporaryHold": "A String", # Required. Updates object temporary holds state. When object temporary hold is set, object cannot be deleted or replaced.
  },
  "rewriteObject": { # Describes options for object rewrite. # Rewrite the object and updates metadata like KMS key.
    "kmsKey": "A String", # Required. Resource name of the Cloud KMS key that will be used to encrypt the object. The Cloud KMS key must be located in same location as the object. Refer to https://cloud.google.com/storage/docs/encryption/using-customer-managed-keys#add-object-key for additional documentation. Format: projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key} For example: "projects/123456/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key". The object will be rewritten and set with the specified KMS key.
  },
  "startTime": "A String", # Output only. The time that the BucketOperation was started.
  "state": "A String", # Output only. State of the BucketOperation.
}
list(parent, filter=None, orderBy=None, pageSize=None, pageToken=None, x__xgafv=None)
Lists BucketOperations in a given project and job.

Args:
  parent: string, Required. Format: projects/{project_id}/locations/global/jobs/{job_id}. (required)
  filter: string, Optional. Filters results as defined by https://google.aip.dev/160.
  orderBy: string, Optional. Field to sort by. Supported fields are name, create_time.
  pageSize: integer, Optional. The list page size. Default page size is 100.
  pageToken: string, Optional. The list page token.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Message for response to listing BucketOperations
  "bucketOperations": [ # A list of storage batch bucket operations.
    { # BucketOperation represents a bucket-level breakdown of a Job.
      "bucketName": "A String", # The bucket name of the objects to be transformed in the BucketOperation.
      "completeTime": "A String", # Output only. The time that the BucketOperation was completed.
      "counters": { # Describes details about the progress of the job. # Output only. Information about the progress of the bucket operation.
        "failedObjectCount": "A String", # Output only. Number of objects failed.
        "succeededObjectCount": "A String", # Output only. Number of objects completed.
        "totalBytesFound": "A String", # Output only. Number of bytes found from source. This field is only populated for jobs with a prefix list object configuration.
        "totalObjectCount": "A String", # Output only. Number of objects listed.
      },
      "createTime": "A String", # Output only. The time that the BucketOperation was created.
      "deleteObject": { # Describes options to delete an object. # Delete objects.
        "permanentObjectDeletionEnabled": True or False, # Required. Controls deletion behavior when versioning is enabled for the object's bucket. If true both live and noncurrent objects will be permanently deleted. Otherwise live objects in versioned buckets will become noncurrent and objects that were already noncurrent will be skipped. This setting doesn't have any impact on the Soft Delete feature. All objects deleted by this service can be be restored for the duration of the Soft Delete retention duration if enabled. If enabled and the manifest doesn't specify an object's generation, a GetObjectMetadata call (a Class B operation) will be made to determine the live object generation.
      },
      "errorSummaries": [ # Output only. Summarizes errors encountered with sample error log entries.
        { # A summary of errors by error code, plus a count and sample error log entries.
          "errorCode": "A String", # Required. The canonical error code.
          "errorCount": "A String", # Required. Number of errors encountered per `error_code`.
          "errorLogEntries": [ # Required. Sample error logs.
            { # An entry describing an error that has occurred.
              "errorDetails": [ # Optional. Output only. At most 5 error log entries are recorded for a given error code for a job.
                "A String",
              ],
              "objectUri": "A String", # Required. Output only. Object URL. e.g. gs://my_bucket/object.txt
            },
          ],
        },
      ],
      "manifest": { # Describes list of objects to be transformed. # Specifies objects in a manifest file.
        "manifestLocation": "A String", # Required. `manifest_location` must contain the manifest source file that is a CSV file in a Google Cloud Storage bucket. Each row in the file must include the object details i.e. BucketId and Name. Generation may optionally be specified. When it is not specified the live object is acted upon. `manifest_location` should either be 1) An absolute path to the object in the format of `gs://bucket_name/path/file_name.csv`. 2) An absolute path with a single wildcard character in the file name, for example `gs://bucket_name/path/file_name*.csv`. If manifest location is specified with a wildcard, objects in all manifest files matching the pattern will be acted upon.
      },
      "name": "A String", # Identifier. The resource name of the BucketOperation. This is defined by the service. Format: projects/{project}/locations/global/jobs/{job_id}/bucketOperations/{bucket_operation}.
      "prefixList": { # Describes prefixes of objects to be transformed. # Specifies objects matching a prefix set.
        "includedObjectPrefixes": [ # Optional. Include prefixes of the objects to be transformed. * Supports full object name * Supports prefix of the object name * Wildcards are not supported * Supports empty string for all objects in a bucket.
          "A String",
        ],
      },
      "putMetadata": { # Describes options for object metadata update. # Updates object metadata. Allows updating fixed-key and custom metadata and fixed-key metadata i.e. Cache-Control, Content-Disposition, Content-Encoding, Content-Language, Content-Type, Custom-Time.
        "cacheControl": "A String", # Optional. Updates objects Cache-Control fixed metadata. Unset values will be ignored. Set empty values to clear the metadata. Additionally, the value for Custom-Time cannot decrease. Refer to documentation in https://cloud.google.com/storage/docs/metadata#caching_data.
        "contentDisposition": "A String", # Optional. Updates objects Content-Disposition fixed metadata. Unset values will be ignored. Set empty values to clear the metadata. Refer https://cloud.google.com/storage/docs/metadata#content-disposition for additional documentation.
        "contentEncoding": "A String", # Optional. Updates objects Content-Encoding fixed metadata. Unset values will be ignored. Set empty values to clear the metadata. Refer to documentation in https://cloud.google.com/storage/docs/metadata#content-encoding.
        "contentLanguage": "A String", # Optional. Updates objects Content-Language fixed metadata. Refer to ISO 639-1 language codes for typical values of this metadata. Max length 100 characters. Unset values will be ignored. Set empty values to clear the metadata. Refer to documentation in https://cloud.google.com/storage/docs/metadata#content-language.
        "contentType": "A String", # Optional. Updates objects Content-Type fixed metadata. Unset values will be ignored. Set empty values to clear the metadata. Refer to documentation in https://cloud.google.com/storage/docs/metadata#content-type
        "customMetadata": { # Optional. Updates objects custom metadata. Adds or sets individual custom metadata key value pairs on objects. Keys that are set with empty custom metadata values will have its value cleared. Existing custom metadata not specified with this flag is not changed. Refer to documentation in https://cloud.google.com/storage/docs/metadata#custom-metadata
          "a_key": "A String",
        },
        "customTime": "A String", # Optional. Updates objects Custom-Time fixed metadata. Unset values will be ignored. Set empty values to clear the metadata. Refer to documentation in https://cloud.google.com/storage/docs/metadata#custom-time.
        "objectRetention": { # Describes options for object retention update. # Optional. Updates objects retention lock configuration. Unset values will be ignored. Set empty values to clear the retention for the object with existing `Unlocked` retention mode. Object with existing `Locked` retention mode cannot be cleared or reduce retain_until_time. Refer to documentation in https://cloud.google.com/storage/docs/object-lock
          "retainUntilTime": "A String", # Required. The time when the object will be retained until. UNSET will clear the retention. Must be specified in RFC 3339 format e.g. YYYY-MM-DD'T'HH:MM:SS.SS'Z' or YYYY-MM-DD'T'HH:MM:SS'Z'.
          "retentionMode": "A String", # Required. The retention mode of the object.
        },
      },
      "putObjectHold": { # Describes options to update object hold. # Changes object hold status.
        "eventBasedHold": "A String", # Required. Updates object event based holds state. When object event based hold is set, object cannot be deleted or replaced. Resets object's time in the bucket for the purposes of the retention period.
        "temporaryHold": "A String", # Required. Updates object temporary holds state. When object temporary hold is set, object cannot be deleted or replaced.
      },
      "rewriteObject": { # Describes options for object rewrite. # Rewrite the object and updates metadata like KMS key.
        "kmsKey": "A String", # Required. Resource name of the Cloud KMS key that will be used to encrypt the object. The Cloud KMS key must be located in same location as the object. Refer to https://cloud.google.com/storage/docs/encryption/using-customer-managed-keys#add-object-key for additional documentation. Format: projects/{project}/locations/{location}/keyRings/{keyring}/cryptoKeys/{key} For example: "projects/123456/locations/us-central1/keyRings/my-keyring/cryptoKeys/my-key". The object will be rewritten and set with the specified KMS key.
      },
      "startTime": "A String", # Output only. The time that the BucketOperation was started.
      "state": "A String", # Output only. State of the BucketOperation.
    },
  ],
  "nextPageToken": "A String", # A token identifying a page of results.
  "unreachable": [ # Locations that could not be reached.
    "A String",
  ],
}
list_next()
Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call 'execute()' on to request the next
          page. Returns None if there are no more items in the collection.