Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ how to create a bucket.
.. code:: python

from gcloud import storage
bucket = storage.get_bucket('bucket-id-here')
client = storage.Client()
bucket = client.get_bucket('bucket-id-here')
# Then do other things...
blob = bucket.get_blob('/remote/path/to/file.txt')
print blob.download_as_string()
Expand Down
10 changes: 5 additions & 5 deletions docs/_components/storage-getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ bucket.

Let's create a bucket:

>>> bucket = storage.create_bucket('test', project_name, connection=connection)
>>> bucket = client.create_bucket('test')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "gcloud/storage/connection.py", line 340, in create_bucket
Expand Down Expand Up @@ -150,10 +150,10 @@ Accessing a bucket
------------------

If you already have a bucket, use
:func:`get_bucket <gcloud.storage.api.get_bucket>` to retrieve the
:meth:`get_bucket <gcloud.storage.client.Client.get_bucket>` to retrieve the
bucket object::

>>> bucket = storage.get_bucket('my-bucket', connection=connection)
>>> bucket = client.get_bucket('my-bucket')

If you want to get all the blobs in the bucket, you can use
:func:`list_blobs <gcloud.storage.bucket.Bucket.list_blobs>`::
Expand Down Expand Up @@ -184,8 +184,8 @@ If you have a full bucket, you can delete it this way::
Listing available buckets
-------------------------

>>> for bucket in storage.list_buckets(connection):
... print bucket.name
>>> for bucket in client.list_buckets():
... print bucket.name

Managing access control
-----------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/_components/storage-quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ Once you have the connection,
you can create buckets and blobs::

>>> from gcloud import storage
>>> storage.list_buckets(connection)
>>> client.list_buckets()
[<Bucket: ...>, ...]
>>> bucket = storage.create_bucket('my-new-bucket', connection=connection)
>>> bucket = client.create_bucket('my-new-bucket')
>>> print bucket
<Bucket: my-new-bucket>
>>> blob = storage.Blob('my-test-file.txt', bucket=bucket)
Expand Down
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ Cloud Storage
.. code-block:: python

from gcloud import storage
bucket = storage.get_bucket('<your-bucket-name>')
client = storage.Client()
bucket = client.get_bucket('<your-bucket-name>')
blob = storage.Blob('my-test-file.txt', bucket=bucket)
blob = blob.upload_contents_from_string('this is test content!')
8 changes: 3 additions & 5 deletions gcloud/storage/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
You'll typically use these to get started with the API:

>>> from gcloud import storage
>>> bucket = storage.get_bucket('bucket-id-here')
>>> client = storage.Client()
>>> bucket = client.get_bucket('bucket-id-here')
>>> # Then do other things...
>>> blob = bucket.get_blob('/remote/path/to/file.txt')
>>> print blob.download_as_string()
Expand Down Expand Up @@ -47,13 +48,10 @@
from gcloud.storage._implicit_environ import get_default_bucket
from gcloud.storage._implicit_environ import get_default_connection
from gcloud.storage._implicit_environ import set_default_connection
from gcloud.storage.api import create_bucket
from gcloud.storage.api import get_bucket
from gcloud.storage.api import list_buckets
from gcloud.storage.api import lookup_bucket
from gcloud.storage.batch import Batch
from gcloud.storage.blob import Blob
from gcloud.storage.bucket import Bucket
from gcloud.storage.client import Client
from gcloud.storage.connection import SCOPE
from gcloud.storage.connection import Connection

Expand Down
4 changes: 2 additions & 2 deletions gcloud/storage/acl.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
:func:`gcloud.storage.bucket.Bucket.acl`::

>>> from gcloud import storage
>>> connection = storage.get_connection()
>>> bucket = storage.get_bucket(bucket_name, connection=connection)
>>> client = storage.Client()
>>> bucket = client.get_bucket(bucket_name)
>>> acl = bucket.acl

Adding and removing permissions can be done with the following methods
Expand Down
230 changes: 0 additions & 230 deletions gcloud/storage/api.py

This file was deleted.

Loading