Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)



Buckets

The Buckets resource represents a bucket in Google Cloud Storage. There is a single global namespace shared by all buckets. For more information, see Bucket Name Requirements .

Buckets contain objects which can be accessed by their own methods. In addition to the acl property, buckets contain bucketAccessControls , for use in fine-grained manipulation of an existing bucket's access controls.

A bucket is always owned by its project team's owner group.



For a list of methods for this resource, see the end of this page.

Resource representations

{
  "kind": "storage#bucket",
  "id": string,
  "selfLink": string,
  "projectNumber": unsigned long,
  "name": string,
  "timeCreated": datetime,
  "metageneration": long,
  "acl": [
    bucketAccessControls Resource
  ],
  "defaultObjectAcl": [
    defaultObjectAccessControls Resource
  ],
  "owner": {
    "entity": string,
    "entityId": string
  },
  "location": string,
  "website": {
    "mainPageSuffix": string,
    "notFoundPage": string
  },
  "logging": {
    "logBucket": string,
    "logObjectPrefix": string
  },
  "versioning": {
    "enabled": boolean
  },
  "cors": [
    {
      "origin": [
        string
      ],
      "method": [
        string
      ],
      "responseHeader": [
        string
      ],
      "maxAgeSeconds": integer
    }
  ],
  "lifecycle": {
    "rule": [
      {
        "action": {
          "type": string
        },
        "condition": {
          "age": integer,
          "createdBefore": date,
          "isLive": boolean,
          "numNewerVersions": integer
        }
      }
    ]
  },
  "storageClass": string,
  "etag": string
}
Property name Value Description Notes
acl[] list Access controls on the bucket. writable
cors[] list The bucket's Cross-Origin Resource Sharing (CORS) configuration. writable
cors[]. maxAgeSeconds integer The value, in seconds, to return in the Access-Control-Max-Age header used in preflight responses. writable
cors[]. method[] list The list of HTTP methods on which to include CORS response headers, ( GET , OPTIONS , POST , etc) Note: "*" is permitted in the list of methods, and means "any method". writable
cors[]. origin[] list The list of Origins eligible to receive CORS response headers. Note: "*" is permitted in the list of origins, and means "any Origin". writable
cors[]. responseHeader[] list The list of HTTP headers other than the simple response headers to give permission for the user-agent to share across domains. writable
defaultObjectAcl[] list Default access controls to apply to new objects when no ACL is provided. writable
etag string HTTP 1.1 Entity tag for the bucket.
id string The ID of the bucket.
kind string The kind of item this is. For buckets, this is always storage#bucket .
lifecycle object The bucket's lifecycle configuration. See lifecycle management for more information. writable
lifecycle. rule[] list A lifecycle management rule, which is made of an action to take and the condition(s) under which the action will be taken.
lifecycle.rule[]. action object The action to take.
lifecycle.rule[].action. type string Type of the action. Currently, only Delete is supported.
lifecycle.rule[]. condition object The condition(s) under which the action will be taken.
lifecycle.rule[].condition. age integer Age of an object (in days). This condition is satisfied when an object reaches the specified age.
lifecycle.rule[].condition. createdBefore date A date in RFC 3339 format with only the date part (for instance, "2013-01-15"). This condition is satisfied when an object is created before midnight of the specified date in UTC.
lifecycle.rule[].condition. isLive boolean Relevant only for versioned objects. If the value is true , this condition matches live objects; if the value is false , it matches archived objects.
lifecycle.rule[].condition. numNewerVersions integer Relevant only for versioned objects. If the value is N , this condition is satisfied when there are at least N versions (including the live version) newer than this version of the object.
location string The location of the bucket. Object data for objects in the bucket resides in physical storage within this region. Defaults to US . See the developer's guide for the authoritative list. writable
logging object The bucket's logging configuration, which defines the destination bucket and optional name prefix for the current bucket's logs. writable
logging. logBucket string The destination bucket where the current bucket's logs should be placed. writable
logging. logObjectPrefix string A prefix for log object names. writable
metageneration long The metadata generation of this bucket.
name string The name of the bucket.
owner object The owner of the bucket. This is always the project team's owner group.
owner. entity string The entity, in the form project-owner- projectId .
owner. entityId string The ID for the entity.
projectNumber unsigned long The project number of the project the bucket belongs to.
storageClass string The bucket's storage class. This defines how objects in the bucket are stored and determines the SLA and the cost of storage. Typical values are STANDARD and DURABLE_REDUCED_AVAILABILITY . Defaults to STANDARD . See the developer's guide for the authoritative list. writable
timeCreated datetime Creation time of the bucket in RFC 3339 format.
versioning object The bucket's versioning configuration. writable
versioning. enabled boolean While set to true, versioning is fully enabled for this bucket. writable
website object The bucket's website configuration. writable
website. mainPageSuffix string Behaves as the bucket's directory index where missing objects are treated as potential directories. writable
website. notFoundPage string The custom object to return when a requested resource is not found. writable

Methods

Available methods for Buckets resources are as follows:

delete
Permanently deletes an empty bucket.
get
Returns metadata for the specified bucket.
insert
Creates a new bucket.
list
Retrieves a list of buckets for a given project.
patch
Updates a bucket. This method supports patch semantics.
update
Updates a bucket.

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.