Convenience method that provides a quick way to add an email grant to a bucket. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then PUT’s the new ACL back to GCS.
Parameters: |
|
---|
Convenience method that provides a quick way to add an email group grant to a bucket. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then PUT’s the new ACL back to GCS.
Parameters: |
|
---|
Convenience method that provides a quick way to add a canonical user grant to a bucket. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then PUTs the new ACL back to GCS.
Parameters: |
|
---|
Configure this bucket to act as a website
Parameters: |
|
---|
returns a bucket’s acl. We include a version_id argument to support a polymorphic interface for callers, however, version_id is not relevant for Google Cloud Storage buckets and is therefore ignored here.
provides common functionality for get_acl() and get_def_acl()
returns a bucket’s CORS XML
returns a bucket’s default object acl. The key_name argument is ignored since keys have no default ACL property.
Returns the current status of website configuration on the bucket.
Return type: | dict |
---|---|
Returns: | A dictionary containing a Python representation of the XML response from GCS. The overall structure is: |
WebsiteConfiguration * MainPageSuffix: suffix that is appended to request that
is for a “directory” on the website endpoint
encounter a 404
Returns the current status of website configuration on the bucket as unparsed XML.
Return type: | 2-Tuple |
---|---|
Returns: | 2-tuple containing: |
of the XML response from GCS. The overall structure is:
WebsiteConfiguration * MainPageSuffix: suffix that is appended to request that
is for a “directory” on the website endpoint
- NotFoundPage: name of an object to serve when site visitors
encounter a 404
sets or changes a bucket’s or key’s acl (depending on whether a key_name was passed). We include a version_id argument to support a polymorphic interface for callers, however, version_id is not relevant for Google Cloud Storage buckets and is therefore ignored here.
sets or changes a bucket’s acl to a predefined (canned) value. We include a version_id argument to support a polymorphic interface for callers, however, version_id is not relevant for Google Cloud Storage buckets and is therefore ignored here.
provides common functionality for set_canned_acl() and set_def_canned_acl()
sets or changes a bucket’s CORS XML.
sets or changes a bucket’s default object acl. The key_name argument is ignored since keys have no default ACL property.
sets or changes a bucket’s default object acl to a predefined (canned) value. The key_name argument is ignored since keys have no default ACL property.
sets or changes a bucket’s default object ACL. The key_name argument is ignored since keys have no default ACL property.
Creates a new bucket. By default it’s located in the USA. You can pass Location.EU to create an European bucket. You can also pass a LocationConstraint, which (in addition to locating the bucket in the specified location) informs Google that Google services must not copy data out of that location.
Parameters: |
|
---|
Convenience method that provides a quick way to add an email grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then PUT’s the new ACL back to GS.
Parameters: |
|
---|
Convenience method that provides a quick way to add an email group grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then PUT’s the new ACL back to GS.
Parameters: |
|
---|
Convenience method that provides a quick way to add a canonical group grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then PUT’s the new ACL back to GS.
Parameters: |
|
---|
Convenience method that provides a quick way to add a canonical user grant to a key. This method retrieves the current ACL, creates a new grant based on the parameters passed in, adds that grant to the ACL and then PUT’s the new ACL back to GS.
Parameters: |
|
---|
Store an object in GS using the name of the Key object as the key in GS and the contents of the file pointed to by ‘fp’ as the contents.
Parameters: |
|
---|---|
Return type: | int |
Returns: | The number of bytes written to the key. |
TODO: At some point we should refactor the Bucket and Key classes, to move functionality common to all providers into a parent class, and provider-specific functionality into subclasses (rather than just overriding/sharing code the way it currently works).
Store an object in GS using the name of the Key object as the key in GS and the contents of the file named by ‘filename’. See set_contents_from_file method for details about the parameters.
Parameters: |
|
---|
Store an object in S3 using the name of the Key object as the key in S3 and the string ‘s’ as the contents. See set_contents_from_file method for details about the parameters.
Parameters: |
|
---|
Constructor. Instantiate once for each uploaded file.
Parameters: |
|
---|
Returns upload tracker URI, or None if the upload has not yet started.
Upload a file to a key into a bucket on GS, using GS resumable upload protocol.
Parameters: |
|
---|
Raises ResumableUploadException if a problem occurs during the transfer.