def __init__(self, **kwargs):
"""
Initializes object for interacting with Google Cloud Storage API.
| By default, Application Default Credentials are used.
| If gcloud SDK isn't installed, credential files have to be specified using the kwargs *json_credentials_path* and *client_id*.
:keyword max_retries: Argument specified with each API call to natively handle retryable errors.
:type max_retries: integer
:keyword chunksize: Upload/Download chunk size
:type chunksize: integer
:keyword client_secret_path: File path for client secret JSON file. Only required if credentials are invalid or unavailable.
:keyword json_credentials_path: File path for automatically generated credentials.
:keyword client_id: Credentials are stored as a key-value pair per client_id to facilitate multiple clients using the same credentials file. For simplicity, using one's email address is sufficient.
"""
self._service = get_service('storage', **kwargs)
self._max_retries = kwargs.get('max_retries', 3)
# Number of bytes to send/receive in each request.
self._chunksize = kwargs.get('chunksize', 2 * 1024 * 1024)
# Retry transport and file IO errors.
self._RETRYABLE_ERRORS = (HttpLib2Error, IOError)
评论列表
文章目录