Skip to content

Instantly share code, notes, and snippets.

@jgeewax
Last active August 30, 2015 15:30
Show Gist options
  • Save jgeewax/c0041d8cbd24d21845f9 to your computer and use it in GitHub Desktop.
Save jgeewax/c0041d8cbd24d21845f9 to your computer and use it in GitHub Desktop.
[
{
"type": "class",
"name": "gcloud.storage.client.Client"
},
{
"return": {
"type_name": "class:`gcloud.storage.bucket.Bucket`",
"description": "The newly created bucket."
},
"arguments": {
"bucket_name": {
"type_name": "string",
"description": "The bucket name to create.",
"required": false
}
},
"name": "gcloud.storage.client.Client.create_bucket",
"type": "function",
"example": "bucket = client.create_bucket('my-bucket')\nprint bucket\n<Bucket: my-bucket>",
"description": "Create a new bucket. This implements \"storage.buckets.insert\". If the bucket already exists, will raise :class:`gcloud.exceptions.Conflict`."
},
{
"return": {
"type_name": "class:`gcloud.storage.bucket.Bucket`",
"description": "The bucket object created."
},
"arguments": {
"bucket_name": {
"type_name": "string",
"description": "The name of the bucket to be instantiated.",
"required": false
}
},
"name": "gcloud.storage.client.Client.bucket",
"type": "function",
"example": "",
"description": "Factory constructor for bucket object. .. note:: This will not make an HTTP request; it simply instantiates a bucket object owned by this client."
},
{
"return": {
"type_name": "class:`gcloud.storage.batch.Batch`",
"description": "The batch object created."
},
"arguments": {},
"name": "gcloud.storage.client.Client.batch",
"type": "function",
"example": "",
"description": "Factory constructor for batch object. .. note:: This will not make an HTTP request; it simply instantiates a batch object owned by this client."
},
{
"return": {
"type_name": "class:`gcloud.client.Client`",
"description": "The client created with the retrieved P12 credentials."
},
"arguments": {
"private_key_path": {
"type_name": "string",
"description": "The path to a private key file (this file was given to you when you created the service account). This file must be in P12 format.",
"required": false
},
"args": {
"type_name": "tuple",
"description": "Remaining positional arguments to pass to constructor.",
"required": false
},
"client_email": {
"type_name": "string",
"description": "The e-mail attached to the service account.",
"required": false
},
"kwargs": {
"type_name": "dictionary",
"description": "Remaining keyword arguments to pass to constructor.",
"required": false
}
},
"name": "gcloud.storage.client.Client.from_service_account_p12",
"type": "function",
"example": "",
"description": "Factory to retrieve P12 credentials while creating client. .. note:: Unless you have an explicit reason to use a PKCS12 key for your service account, we recommend using a JSON key."
},
{
"return": {
"type_name": "iterable of :class:`gcloud.storage.bucket.Bucket` objects.",
"description": "All buckets belonging to this project."
},
"arguments": {
"page_token": {
"type_name": "string or ``NoneType``",
"description": "Optional. Opaque marker for the next \"page\" of buckets. If not passed, will return the first page of buckets.",
"required": false
},
"max_results": {
"type_name": "integer or ``NoneType``",
"description": "Optional. Maximum number of buckets to return.",
"required": false
},
"prefix": {
"type_name": "string or ``NoneType``",
"description": "Optional. Filter results to buckets whose names begin with this prefix.",
"required": false
},
"fields": {
"type_name": "string or ``NoneType``",
"description": "Selector specifying which fields to include in a partial response. Must be a list of fields. For example to get a partial response with just the next page token and the language of each bucket returned: 'items/id,nextPageToken'",
"required": false
},
"projection": {
"type_name": "string or ``NoneType``",
"description": "If used, must be 'full' or 'noAcl'. Defaults to 'noAcl'. Specifies the set of properties to return.",
"required": false
}
},
"name": "gcloud.storage.client.Client.list_buckets",
"type": "function",
"example": "for bucket in client.list_buckets():\nprint bucket",
"description": "Get all buckets in the project associated to the client. This will not populate the list of blobs available in each bucket. This implements \"storage.buckets.list\"."
},
{
"return": {
"type_name": "class:`gcloud.storage.bucket.Bucket`",
"description": "The bucket matching the name provided or None if not found."
},
"arguments": {
"bucket_name": {
"type_name": "string",
"description": "The name of the bucket to get.",
"required": false
}
},
"name": "gcloud.storage.client.Client.lookup_bucket",
"type": "function",
"example": "bucket = client.lookup_bucket('doesnt-exist')\nprint bucket\nNone\nbucket = client.lookup_bucket('my-bucket')\nprint bucket\n<Bucket: my-bucket>",
"description": "Get a bucket by name, returning None if not found. You can use this if you would rather check for a None value than catching an exception:"
},
{
"return": {
"type_name": "class:`gcloud.pubsub.client.Client`",
"description": "The client created with the retrieved JSON credentials."
},
"arguments": {
"json_credentials_path": {
"type_name": "string",
"description": "The path to a private key file (this file was given to you when you created the service account). This file must contain a JSON object with a private key and other credentials information (downloaded from the Google APIs console).",
"required": false
},
"args": {
"type_name": "tuple",
"description": "Remaining positional arguments to pass to constructor.",
"required": false
},
"kwargs": {
"type_name": "dictionary",
"description": "Remaining keyword arguments to pass to constructor.",
"required": false
}
},
"name": "gcloud.storage.client.Client.from_service_account_json",
"type": "function",
"example": "",
"description": "Factory to retrieve JSON credentials while creating client."
},
{
"return": {
"type_name": "class:`gcloud.storage.bucket.Bucket`",
"description": "The bucket matching the name provided."
},
"arguments": {
"bucket_name": {
"type_name": "string",
"description": "The name of the bucket to get.",
"required": false
}
},
"name": "gcloud.storage.client.Client.get_bucket",
"type": "function",
"example": "try:\nbucket = client.get_bucket('my-bucket')\nexcept gcloud.exceptions.NotFound:\nprint 'Sorry, that bucket does not exist!'",
"description": "Get a bucket by name. If the bucket isn't found, this will raise a :class:`gcloud.storage.exceptions.NotFound`. This implements \"storage.buckets.get\"."
},
{
"type": "function",
"name": "gcloud.storage.client.Client.__init__"
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment