diff --git a/index.html b/index.html index dedafe85eeb6..689412caee22 100755 --- a/index.html +++ b/index.html @@ -68,7 +68,7 @@

One-line install

- + Report an Issue @@ -73,7 +73,7 @@

Python

- Version History (0.7.0) + Version History (777c6ac)
@@ -537,8 +537,8 @@

Source code for gcloud.connection

 
  • ACL
  • Pub/Sub
  • Using the API
  • -
  • Subscriptions
  • Topics
  • +
  • Subscriptions
  • BigQuery
  • diff --git a/latest/_modules/gcloud/credentials.html b/latest/_modules/gcloud/credentials.html index 54e0bb38fd46..95dc804dbc57 100644 --- a/latest/_modules/gcloud/credentials.html +++ b/latest/_modules/gcloud/credentials.html @@ -5,7 +5,7 @@ - gcloud.credentials — gcloud 0.7.0 documentation + gcloud.credentials — gcloud 777c6ac documentation @@ -15,7 +15,7 @@ - + @@ -59,7 +59,7 @@

    - + Report an Issue @@ -73,7 +73,7 @@

    Python

    @@ -465,8 +465,8 @@

    Source code for gcloud.credentials

     
  • ACL
  • Pub/Sub
  • Using the API
  • -
  • Subscriptions
  • Topics
  • +
  • Subscriptions
  • BigQuery
  • diff --git a/latest/_modules/gcloud/datastore/batch.html b/latest/_modules/gcloud/datastore/batch.html index da2ad1705849..1e10dbbd5721 100644 --- a/latest/_modules/gcloud/datastore/batch.html +++ b/latest/_modules/gcloud/datastore/batch.html @@ -5,7 +5,7 @@ - gcloud.datastore.batch — gcloud 0.7.0 documentation + gcloud.datastore.batch — gcloud 777c6ac documentation @@ -15,7 +15,7 @@ - + @@ -59,7 +59,7 @@

    - + Report an Issue @@ -73,7 +73,7 @@

    Python

    @@ -394,8 +394,8 @@

    Source code for gcloud.datastore.batch

     
  • ACL
  • Pub/Sub
  • Using the API
  • -
  • Subscriptions
  • Topics
  • +
  • Subscriptions
  • BigQuery
  • diff --git a/latest/_modules/gcloud/datastore/client.html b/latest/_modules/gcloud/datastore/client.html index 0bccf4f5eb1c..be2ba3239521 100644 --- a/latest/_modules/gcloud/datastore/client.html +++ b/latest/_modules/gcloud/datastore/client.html @@ -5,7 +5,7 @@ - gcloud.datastore.client — gcloud 0.7.0 documentation + gcloud.datastore.client — gcloud 777c6ac documentation @@ -15,7 +15,7 @@ - + @@ -59,7 +59,7 @@

    - + Report an Issue @@ -73,7 +73,7 @@

    Python

    @@ -107,6 +107,7 @@

    Source code for gcloud.datastore.client

     from gcloud._helpers import _LocalStack
     from gcloud._helpers import _app_engine_id
     from gcloud._helpers import _compute_engine_id
    +from gcloud.client import Client as _BaseClient
     from gcloud.datastore import helpers
     from gcloud.datastore.connection import Connection
     from gcloud.datastore.batch import Batch
    @@ -114,26 +115,22 @@ 

    Source code for gcloud.datastore.client

     from gcloud.datastore.key import Key
     from gcloud.datastore.query import Query
     from gcloud.datastore.transaction import Transaction
    +from gcloud.environment_vars import DATASET
    +from gcloud.environment_vars import GCD_DATASET
     
     
     _MAX_LOOPS = 128
     """Maximum number of iterations to wait for deferred keys."""
     
    -_DATASET_ENV_VAR_NAME = 'GCLOUD_DATASET_ID'
    -"""Environment variable defining default dataset ID."""
    -
    -_GCD_DATASET_ENV_VAR_NAME = 'DATASTORE_DATASET'
    -"""Environment variable defining default dataset ID under GCD."""
    -
     
     def _get_production_dataset_id():
         """Gets the production application ID if it can be inferred."""
    -    return os.getenv(_DATASET_ENV_VAR_NAME)
    +    return os.getenv(DATASET)
     
     
     def _get_gcd_dataset_id():
         """Gets the GCD application ID if it can be inferred."""
    -    return os.getenv(_GCD_DATASET_ENV_VAR_NAME)
    +    return os.getenv(GCD_DATASET)
     
     
     def _determine_default_dataset_id(dataset_id=None):
    @@ -247,7 +244,7 @@ 

    Source code for gcloud.datastore.client

         return results
     
     
    -
    [docs]class Client(object): +
    [docs]class Client(_BaseClient): """Convenience wrapper for invoking APIs/factories w/ a dataset ID. :type dataset_id: string @@ -256,20 +253,29 @@

    Source code for gcloud.datastore.client

         :type namespace: string
         :param namespace: (optional) namespace to pass to proxied API methods.
     
    -    :type connection: :class:`gcloud.datastore.connection.Connection`, or None
    -    :param connection: (optional) connection to pass to proxied API methods
    +    :type credentials: :class:`oauth2client.client.OAuth2Credentials` or
    +                       :class:`NoneType`
    +    :param credentials: The OAuth2 Credentials to use for the connection
    +                        owned by this client. If not passed (and if no ``http``
    +                        object is passed), falls back to the default inferred
    +                        from the environment.
    +
    +    :type http: :class:`httplib2.Http` or class that defines ``request()``.
    +    :param http: An optional HTTP object to make requests. If not passed, an
    +                 ``http`` object is created that is bound to the
    +                 ``credentials`` for the current object.
         """
    +    _connection_class = Connection
     
    -    def __init__(self, dataset_id=None, namespace=None, connection=None):
    +    def __init__(self, dataset_id=None, namespace=None,
    +                 credentials=None, http=None):
             dataset_id = _determine_default_dataset_id(dataset_id)
             if dataset_id is None:
                 raise EnvironmentError('Dataset ID could not be inferred.')
             self.dataset_id = dataset_id
    -        if connection is None:
    -            connection = Connection.from_environment()
    -        self.connection = connection
    -        self._batch_stack = _LocalStack()
             self.namespace = namespace
    +        self._batch_stack = _LocalStack()
    +        super(Client, self).__init__(credentials, http)
     
         def _push_batch(self, batch):
             """Push a batch/transaction onto our stack.
    @@ -563,8 +569,8 @@ 

    Source code for gcloud.datastore.client

     
  • ACL
  • Pub/Sub
  • Using the API
  • -
  • Subscriptions
  • Topics
  • +
  • Subscriptions
  • BigQuery
  • diff --git a/latest/_modules/gcloud/datastore/entity.html b/latest/_modules/gcloud/datastore/entity.html index 4cfdb46a63d0..7e5d84425d8a 100644 --- a/latest/_modules/gcloud/datastore/entity.html +++ b/latest/_modules/gcloud/datastore/entity.html @@ -5,7 +5,7 @@ - gcloud.datastore.entity — gcloud 0.7.0 documentation + gcloud.datastore.entity — gcloud 777c6ac documentation @@ -15,7 +15,7 @@ - + @@ -59,7 +59,7 @@

    - + Report an Issue @@ -73,7 +73,7 @@

    Python

    @@ -244,8 +244,8 @@

    Source code for gcloud.datastore.entity

     
  • ACL
  • Pub/Sub
  • Using the API
  • -
  • Subscriptions
  • Topics
  • +
  • Subscriptions
  • BigQuery
  • diff --git a/latest/_modules/gcloud/datastore/key.html b/latest/_modules/gcloud/datastore/key.html index 112d107e064f..a2065e34369e 100644 --- a/latest/_modules/gcloud/datastore/key.html +++ b/latest/_modules/gcloud/datastore/key.html @@ -5,7 +5,7 @@ - gcloud.datastore.key — gcloud 0.7.0 documentation + gcloud.datastore.key — gcloud 777c6ac documentation @@ -15,7 +15,7 @@ - + @@ -59,7 +59,7 @@

    - + Report an Issue @@ -73,7 +73,7 @@

    Python

    @@ -562,8 +562,8 @@

    Source code for gcloud.datastore.key

     
  • ACL
  • Pub/Sub
  • Using the API
  • -
  • Subscriptions
  • Topics
  • +
  • Subscriptions
  • BigQuery
  • diff --git a/latest/_modules/gcloud/datastore/query.html b/latest/_modules/gcloud/datastore/query.html index 542b3b92ca2a..9958907e4674 100644 --- a/latest/_modules/gcloud/datastore/query.html +++ b/latest/_modules/gcloud/datastore/query.html @@ -5,7 +5,7 @@ - gcloud.datastore.query — gcloud 0.7.0 documentation + gcloud.datastore.query — gcloud 777c6ac documentation @@ -15,7 +15,7 @@ - + @@ -59,7 +59,7 @@

    - + Report an Issue @@ -73,7 +73,7 @@

    Python

    @@ -422,7 +422,31 @@

    Source code for gcloud.datastore.query

     
     
    [docs]class Iterator(object): - """Represent the state of a given execution of a Query.""" + """Represent the state of a given execution of a Query. + + :type query: :class:`gcloud.datastore.query.Query` + :param query: Query object holding permanent configuration (i.e. + things that don't change on with each page in + a results set). + + :type client: :class:`gcloud.datastore.client.Client` + :param client: The client used to make a request. + + :type limit: integer + :param limit: (Optional) Limit the number of results returned. + + :type offset: integer + :param offset: (Optional) Defaults to 0. Offset used to begin + a query. + + :type start_cursor: bytes + :param start_cursor: (Optional) Cursor to begin paging through + query results. + + :type end_cursor: bytes + :param end_cursor: (Optional) Cursor to end paging through + query results. + """ _NOT_FINISHED = datastore_pb.QueryResultBatch.NOT_FINISHED @@ -597,8 +621,8 @@

    Source code for gcloud.datastore.query

     
  • ACL
  • Pub/Sub
  • Using the API
  • -
  • Subscriptions
  • Topics
  • +
  • Subscriptions
  • BigQuery
  • diff --git a/latest/_modules/gcloud/datastore/transaction.html b/latest/_modules/gcloud/datastore/transaction.html index 5bd2067b71c0..97ee1d476405 100644 --- a/latest/_modules/gcloud/datastore/transaction.html +++ b/latest/_modules/gcloud/datastore/transaction.html @@ -5,7 +5,7 @@ - gcloud.datastore.transaction — gcloud 0.7.0 documentation + gcloud.datastore.transaction — gcloud 777c6ac documentation @@ -15,7 +15,7 @@ - + @@ -59,7 +59,7 @@

    - + Report an Issue @@ -73,7 +73,7 @@

    Python

    @@ -281,8 +281,8 @@

    Source code for gcloud.datastore.transaction

    ACL
     
  • Pub/Sub
  • Using the API
  • -
  • Subscriptions
  • Topics
  • +
  • Subscriptions
  • BigQuery
  • diff --git a/latest/_modules/gcloud/exceptions.html b/latest/_modules/gcloud/exceptions.html index ae2128526e57..d9dca18b13f7 100644 --- a/latest/_modules/gcloud/exceptions.html +++ b/latest/_modules/gcloud/exceptions.html @@ -5,7 +5,7 @@ - gcloud.exceptions — gcloud 0.7.0 documentation + gcloud.exceptions — gcloud 777c6ac documentation @@ -15,7 +15,7 @@ - + @@ -59,7 +59,7 @@

    - + Report an Issue @@ -73,7 +73,7 @@

    Python

    @@ -326,8 +326,8 @@

    Source code for gcloud.exceptions

     
  • ACL
  • Pub/Sub
  • Using the API
  • -
  • Subscriptions
  • Topics
  • +
  • Subscriptions
  • BigQuery
  • diff --git a/latest/_modules/gcloud/pubsub/client.html b/latest/_modules/gcloud/pubsub/client.html index 69f1a97e5c5d..f675ae7de5c9 100644 --- a/latest/_modules/gcloud/pubsub/client.html +++ b/latest/_modules/gcloud/pubsub/client.html @@ -5,7 +5,7 @@ - gcloud.pubsub.client — gcloud 0.7.0 documentation + gcloud.pubsub.client — gcloud 777c6ac documentation @@ -15,7 +15,7 @@ - + @@ -59,7 +59,7 @@

    - + Report an Issue @@ -73,7 +73,7 @@

    Python

    @@ -253,8 +253,8 @@

    Source code for gcloud.pubsub.client

     
  • ACL
  • Pub/Sub
  • Using the API
  • -
  • Subscriptions
  • Topics
  • +
  • Subscriptions
  • BigQuery
  • diff --git a/latest/_modules/gcloud/pubsub/connection.html b/latest/_modules/gcloud/pubsub/connection.html index f789fbab8259..b37fbafdfce9 100644 --- a/latest/_modules/gcloud/pubsub/connection.html +++ b/latest/_modules/gcloud/pubsub/connection.html @@ -5,7 +5,7 @@ - gcloud.pubsub.connection — gcloud 0.7.0 documentation + gcloud.pubsub.connection — gcloud 777c6ac documentation @@ -15,7 +15,7 @@ - + @@ -59,7 +59,7 @@

    - + Report an Issue @@ -73,7 +73,7 @@

    Python

    @@ -146,8 +146,8 @@

    Source code for gcloud.pubsub.connection

     
  • ACL
  • Pub/Sub
  • Using the API
  • -
  • Subscriptions
  • Topics
  • +
  • Subscriptions
  • BigQuery
  • diff --git a/latest/_modules/gcloud/pubsub/subscription.html b/latest/_modules/gcloud/pubsub/subscription.html index c2b1f3af4148..3a326b943a8b 100644 --- a/latest/_modules/gcloud/pubsub/subscription.html +++ b/latest/_modules/gcloud/pubsub/subscription.html @@ -5,7 +5,7 @@ - gcloud.pubsub.subscription — gcloud 0.7.0 documentation + gcloud.pubsub.subscription — gcloud 777c6ac documentation @@ -15,7 +15,7 @@ - + @@ -59,7 +59,7 @@

    - + Report an Issue @@ -73,7 +73,7 @@

    Python

    @@ -372,8 +372,8 @@

    Source code for gcloud.pubsub.subscription

     
  • ACL
  • Pub/Sub
  • Using the API
  • -
  • Subscriptions
  • Topics
  • +
  • Subscriptions
  • BigQuery
  • diff --git a/latest/_modules/gcloud/pubsub/topic.html b/latest/_modules/gcloud/pubsub/topic.html index 985b8a3b0cab..06bcf1a05169 100644 --- a/latest/_modules/gcloud/pubsub/topic.html +++ b/latest/_modules/gcloud/pubsub/topic.html @@ -5,7 +5,7 @@ - gcloud.pubsub.topic — gcloud 0.7.0 documentation + gcloud.pubsub.topic — gcloud 777c6ac documentation @@ -15,7 +15,7 @@ - + @@ -59,7 +59,7 @@

    - + Report an Issue @@ -73,7 +73,7 @@

    Python

    @@ -379,8 +379,8 @@

    Source code for gcloud.pubsub.topic

     
  • ACL
  • Pub/Sub
  • Using the API
  • -
  • Subscriptions
  • Topics
  • +
  • Subscriptions
  • BigQuery
  • diff --git a/latest/_modules/gcloud/storage/acl.html b/latest/_modules/gcloud/storage/acl.html index 26013d719c67..debc9c75933c 100644 --- a/latest/_modules/gcloud/storage/acl.html +++ b/latest/_modules/gcloud/storage/acl.html @@ -5,7 +5,7 @@ - gcloud.storage.acl — gcloud 0.7.0 documentation + gcloud.storage.acl — gcloud 777c6ac documentation @@ -15,7 +15,7 @@ - + @@ -59,7 +59,7 @@

    - + Report an Issue @@ -73,7 +73,7 @@

    Python

    @@ -597,8 +597,8 @@

    Source code for gcloud.storage.acl

     
  • ACL
  • Pub/Sub
  • Using the API
  • -
  • Subscriptions
  • Topics
  • +
  • Subscriptions
  • BigQuery
  • diff --git a/latest/_modules/gcloud/storage/blob.html b/latest/_modules/gcloud/storage/blob.html index a03012a1916f..a7964339b1ce 100644 --- a/latest/_modules/gcloud/storage/blob.html +++ b/latest/_modules/gcloud/storage/blob.html @@ -5,7 +5,7 @@ - gcloud.storage.blob — gcloud 0.7.0 documentation + gcloud.storage.blob — gcloud 777c6ac documentation @@ -15,7 +15,7 @@ - + @@ -59,7 +59,7 @@

    - + Report an Issue @@ -73,7 +73,7 @@

    Python

    @@ -928,8 +928,8 @@

    Source code for gcloud.storage.blob

     
  • ACL
  • Pub/Sub
  • Using the API
  • -
  • Subscriptions
  • Topics
  • +
  • Subscriptions
  • BigQuery
  • diff --git a/latest/_modules/gcloud/storage/bucket.html b/latest/_modules/gcloud/storage/bucket.html index 91549ae9a258..6003360b858d 100644 --- a/latest/_modules/gcloud/storage/bucket.html +++ b/latest/_modules/gcloud/storage/bucket.html @@ -5,7 +5,7 @@ - gcloud.storage.bucket — gcloud 0.7.0 documentation + gcloud.storage.bucket — gcloud 777c6ac documentation @@ -15,7 +15,7 @@ - + @@ -59,7 +59,7 @@

    - + Report an Issue @@ -73,7 +73,7 @@

    Python

    @@ -105,7 +105,6 @@

    Source code for gcloud.storage.bucket

     
     import datetime
     import copy
    -import os
     
     import pytz
     import six
    @@ -188,6 +187,31 @@ 

    Source code for gcloud.storage.bucket

         def __repr__(self):
             return '<Bucket: %s>' % self.name
     
    +    @property
    +    def client(self):
    +        """The client bound to this bucket."""
    +        return self._client
    +
    +
    [docs] def blob(self, blob_name, chunk_size=None): + """Factory constructor for blob object. + + .. note:: + This will not make an HTTP request; it simply instantiates + a blob object owned by this bucket. + + :type blob_name: string + :param blob_name: The name of the blob to be instantiated. + + :type chunk_size: integer + :param chunk_size: The size of a chunk of data whenever iterating + (1 MB). This must be a multiple of 256 KB per the + API specification. + + :rtype: :class:`gcloud.storage.blob.Blob` + :returns: The blob object created. + """ + return Blob(name=blob_name, bucket=self, chunk_size=chunk_size) +
    [docs] def exists(self, client=None): """Determines whether or not this bucket exists. @@ -267,11 +291,6 @@

    Source code for gcloud.storage.bucket

     
             return self.path_helper(self.name)
     
    -    @property
    -    def client(self):
    -        """The client bound to this bucket."""
    -        return self._client
    -
     
    [docs] def get_blob(self, blob_name, client=None): """Get a blob object by name. @@ -530,98 +549,6 @@

    Source code for gcloud.storage.bucket

                 method='POST', path=api_path, _target_object=new_blob)
             new_blob._set_properties(copy_result)
             return new_blob
    -
    -
    [docs] def upload_file(self, filename, blob_name=None, client=None): - """Shortcut method to upload a file into this bucket. - - Use this method to quickly put a local file in Cloud Storage. - - For example:: - - >>> from gcloud import storage - >>> client = storage.Client() - >>> bucket = client.get_bucket('my-bucket') - >>> bucket.upload_file('~/my-file.txt', 'remote-text-file.txt') - >>> print bucket.list_blobs() - [<Blob: my-bucket, remote-text-file.txt>] - - If you don't provide a blob name, we will try to upload the file - using the local filename (**not** the complete path):: - - >>> from gcloud import storage - >>> client = storage.Client() - >>> bucket = client.get_bucket('my-bucket') - >>> bucket.upload_file('~/my-file.txt') - >>> print bucket.list_blobs() - [<Blob: my-bucket, my-file.txt>] - - :type filename: string - :param filename: Local path to the file you want to upload. - - :type blob_name: string - :param blob_name: The name of the blob to upload the file to. If this - is blank, we will try to upload the file to the root - of the bucket with the same name as on your local - file system. - - :type client: :class:`gcloud.storage.client.Client` or ``NoneType`` - :param client: Optional. The client to use. If not passed, falls back - to the ``client`` stored on the current bucket. - - :rtype: :class:`Blob` - :returns: The updated Blob object. - """ - if blob_name is None: - blob_name = os.path.basename(filename) - blob = Blob(bucket=self, name=blob_name) - blob.upload_from_filename(filename, client=client) - return blob -
    -
    [docs] def upload_file_object(self, file_obj, blob_name=None, client=None): - """Shortcut method to upload a file object into this bucket. - - Use this method to quickly put a local file in Cloud Storage. - - For example:: - - >>> from gcloud import storage - >>> client = storage.Client() - >>> bucket = client.get_bucket('my-bucket') - >>> bucket.upload_file(open('~/my-file.txt'), 'remote-text-file.txt') - >>> print bucket.list_blobs() - [<Blob: my-bucket, remote-text-file.txt>] - - If you don't provide a blob name, we will try to upload the file - using the local filename (**not** the complete path):: - - >>> from gcloud import storage - >>> client = storage.Client() - >>> bucket = client.get_bucket('my-bucket') - >>> bucket.upload_file(open('~/my-file.txt')) - >>> print bucket.list_blobs() - [<Blob: my-bucket, my-file.txt>] - - :type file_obj: file - :param file_obj: A file handle open for reading. - - :type blob_name: string - :param blob_name: The name of the blob to upload the file to. If this - is blank, we will try to upload the file to the root - of the bucket with the same name as on your local - file system. - - :type client: :class:`gcloud.storage.client.Client` or ``NoneType`` - :param client: Optional. The client to use. If not passed, falls back - to the ``client`` stored on the current bucket. - - :rtype: :class:`Blob` - :returns: The updated Blob object. - """ - if blob_name is None: - blob_name = os.path.basename(file_obj.name) - blob = Blob(bucket=self, name=blob_name) - blob.upload_from_file(file_obj, client=client) - return blob
    @property def cors(self): @@ -962,8 +889,8 @@

    Source code for gcloud.storage.bucket

     
  • ACL
  • Pub/Sub
  • Using the API
  • -
  • Subscriptions
  • Topics
  • +
  • Subscriptions
  • BigQuery
  • diff --git a/latest/_modules/gcloud/storage/connection.html b/latest/_modules/gcloud/storage/connection.html index b460f0f87574..0a203a78b1e6 100644 --- a/latest/_modules/gcloud/storage/connection.html +++ b/latest/_modules/gcloud/storage/connection.html @@ -5,7 +5,7 @@ - gcloud.storage.connection — gcloud 0.7.0 documentation + gcloud.storage.connection — gcloud 777c6ac documentation @@ -15,7 +15,7 @@ - + @@ -59,7 +59,7 @@

    - + Report an Issue @@ -73,7 +73,7 @@

    Python

    @@ -147,8 +147,8 @@

    Source code for gcloud.storage.connection

     
  • ACL
  • Pub/Sub
  • Using the API
  • -
  • Subscriptions
  • Topics
  • +
  • Subscriptions
  • BigQuery
  • diff --git a/latest/_modules/index.html b/latest/_modules/index.html index eb44902102ce..3b594d7c4c39 100644 --- a/latest/_modules/index.html +++ b/latest/_modules/index.html @@ -5,7 +5,7 @@ - Overview: module code — gcloud 0.7.0 documentation + Overview: module code — gcloud 777c6ac documentation @@ -15,7 +15,7 @@ - +