gcloudex_storage v0.9.0 GCloudex.CloudStorage.Client

Link to this section Summary

Functions

Copies the specified ‘source_object’ into the given ‘new_bucket’ as ‘new_object’

Creates a bucket with the specified ‘bucket’ name if available. This function will create the bucket in the default region ‘US’ and with the default class ‘STANDARD’

Creates a bucket with the specified ‘bucket’ name if available and in the specified ‘region’. This function will create the bucket with the default class ‘STANDARD’

Creates a bucket with the specified ‘bucket’ name if available and in the specified ‘region’ and with the specified ‘class’

Deletes and empty bucket

Deletes the ‘object’ in the specified ‘bucket’

Deletes the ‘object’ in the specified ‘bucket’ using the given ‘query_params’. The query parameters must be passed as a list of tuples [{param_1, value_1}, {param_2, value_2}]

Indicates if the specified ‘bucket’ exists or whether the request has READ access to it

Lists the specified ‘bucket’ ACL

Lists the specified ‘bucket’ class

Lists the specified ‘bucket’ CORS configuration

Lists the specified ‘bucket’ lifecycle configuration

Lists the specified ‘bucket’ logging configuration

Lists the specified ‘bucket’ location

Lists the specified ‘bucket’ versioning configuration

Lists the specified ‘bucket’ website configuration

Downloads the ‘object’ from the specified ‘bucket’. The requester must have READ permission

Downloads the ‘object’ from the specified ‘bucket’ using the given ‘query_params’. The query parameters must be passed as a list of tuples [{param_1, value_1}, {param_2, value_2}]. The requester must have READ permission

Lists the ‘object’ ACL from the specified ‘bucket’. The requester must have FULL_CONTROL permission

Lists metadata for the given ‘object’ from the specified ‘bucket’

Lists metadata for the given ‘object’ from the specified ‘bucket’ using the given ‘query_params’. The query parameters must be passed as a list of tuples [{param_1, value_1}, {param_2, value_2}]

Lists all the buckets in the specified project

Lists all the objects in the specified ‘bucket’

Lists all the objects in the specified ‘bucket’ using the given ‘query_params’. The query parameters must be passed as a list of tuples [{param_1, value_1}, {param_2, value_2}]

Uploads the file in the given ‘filepath’ to the specified ‘bucket’. If a ‘bucket_path’ is specified then the filename must be included at the end

Sends an HTTP request without any query parameters

Sends an HTTP request with the specified query parameters

Sends an HTTP request according to the Service resource in the Google Cloud Storage documentation

Sets or modifies the existing ACL in the specified ‘bucket’ with the given ‘acl_config’ in XML format

Sets or modifies the existing CORS configuration in the specified ‘bucket’ with the given ‘cors_config’ in XML format

Sets or modifies the existing lifecyle configuration in the specified ‘bucket’ with the given ‘lifecycle_config’ in XML format

Sets or modifies the existing logging configuration in the specified ‘bucket’ with the given ‘logging_config’ in XML format

Sets or modifies the existing versioning configuration in the specified ‘bucket’ with the given ‘versioning_config’ in XML format

Sets or modifies the existing website configuration in the specified ‘bucket’ with the given ‘website_config’ in XML format

Sets or modifies the ‘object’ from the specified ‘bucket’ with the provided ‘acl_config’ in XML format

Sets or modifies the ‘object’ from the specified ‘bucket’ with the provided ‘acl_config’ in XML format and using the given ‘query_params’. The query parameters must be passed as a list of tuples [{param_1, value_1}, {param_2, value_2}]

Link to this section Functions

Link to this function copy_object(new_bucket, new_object, source_object)
copy_object(new_bucket :: binary(), new_object :: binary(), source_object :: binary()) :: HTTPResponse.t()

Copies the specified ‘source_object’ into the given ‘new_bucket’ as ‘new_object’.

Link to this function create_bucket(bucket)
create_bucket(bucket :: binary()) :: HTTPResponse.t()

Creates a bucket with the specified ‘bucket’ name if available. This function will create the bucket in the default region ‘US’ and with the default class ‘STANDARD’.

Link to this function create_bucket(bucket, region)
create_bucket(bucket :: binary(), region :: binary()) :: HTTPResponse.t()

Creates a bucket with the specified ‘bucket’ name if available and in the specified ‘region’. This function will create the bucket with the default class ‘STANDARD’.

Link to this function create_bucket(bucket, region, class)
create_bucket(bucket :: binary(), region :: binary(), class :: binary()) :: HTTPResponse.t()

Creates a bucket with the specified ‘bucket’ name if available and in the specified ‘region’ and with the specified ‘class’.

Link to this function delete_bucket(bucket)
delete_bucket(bucket :: binary()) :: HTTPResponse.t()

Deletes and empty bucket.

Link to this function delete_object(bucket, object)
delete_object(bucket :: binary(), object :: binary()) :: HTTPResponse.t()

Deletes the ‘object’ in the specified ‘bucket’.

Link to this function delete_object(bucket, object, query_params)
delete_object(bucket :: binary(), object :: binary(), query_params :: [{binary(), binary()}]) :: HTTPResponse.t()

Deletes the ‘object’ in the specified ‘bucket’ using the given ‘query_params’. The query parameters must be passed as a list of tuples [{param_1, value_1}, {param_2, value_2}].

Link to this function exists_bucket(bucket)
exists_bucket(bucket :: binary()) :: HTTPResponse.t()

Indicates if the specified ‘bucket’ exists or whether the request has READ access to it.

Link to this function get_bucket_acl(bucket)
get_bucket_acl(bucket :: binary()) :: HTTPResponse.t()

Lists the specified ‘bucket’ ACL.

Link to this function get_bucket_class(bucket)
get_bucket_class(bucket :: binary()) :: HTTPResponse.t()

Lists the specified ‘bucket’ class.

Link to this function get_bucket_cors(bucket)
get_bucket_cors(bucket :: binary()) :: HTTPResponse.t()

Lists the specified ‘bucket’ CORS configuration.

Link to this function get_bucket_lifecycle(bucket)
get_bucket_lifecycle(bucket :: binary()) :: HTTPResponse.t()

Lists the specified ‘bucket’ lifecycle configuration.

Link to this function get_bucket_logging(bucket)
get_bucket_logging(bucket :: binary()) :: HTTPResponse.t()

Lists the specified ‘bucket’ logging configuration.

Link to this function get_bucket_region(bucket)
get_bucket_region(bucket :: binary()) :: HTTPResponse.t()

Lists the specified ‘bucket’ location.

Link to this function get_bucket_versioning(bucket)
get_bucket_versioning(bucket :: binary()) :: HTTPResponse.t()

Lists the specified ‘bucket’ versioning configuration.

Link to this function get_bucket_website(bucket)
get_bucket_website(bucket :: binary()) :: HTTPResponse.t()

Lists the specified ‘bucket’ website configuration.

Link to this function get_object(bucket, object)
get_object(bucket :: binary(), object :: binary()) :: HTTPResponse.t()

Downloads the ‘object’ from the specified ‘bucket’. The requester must have READ permission.

Link to this function get_object(bucket, object, query_params)
get_object(bucket :: binary(), object :: binary(), query_params :: [{binary(), binary()}]) :: HTTPResponse.t()

Downloads the ‘object’ from the specified ‘bucket’ using the given ‘query_params’. The query parameters must be passed as a list of tuples [{param_1, value_1}, {param_2, value_2}]. The requester must have READ permission.

Link to this function get_object_acl(bucket, object)
get_object_acl(bucket :: binary(), object :: binary()) :: HTTPResponse.t()

Lists the ‘object’ ACL from the specified ‘bucket’. The requester must have FULL_CONTROL permission.

Link to this function get_object_metadata(bucket, object)
get_object_metadata(bucket :: binary(), object :: binary()) :: HTTPResponse.t()

Lists metadata for the given ‘object’ from the specified ‘bucket’.

Link to this function get_object_metadata(bucket, object, query_params)
get_object_metadata(bucket :: binary(), object :: binary(), [{binary(), binary()}]) :: HTTPResponse.t()

Lists metadata for the given ‘object’ from the specified ‘bucket’ using the given ‘query_params’. The query parameters must be passed as a list of tuples [{param_1, value_1}, {param_2, value_2}].

Link to this function list_buckets()
list_buckets() :: HTTPResponse.t()

Lists all the buckets in the specified project.

Link to this function list_objects(bucket)
list_objects(bucket :: binary()) :: HTTPResponse.t()

Lists all the objects in the specified ‘bucket’.

Link to this function list_objects(bucket, query_params)
list_objects(bucket :: binary(), query_params :: [{binary(), binary()}]) :: HTTPResponse.t()

Lists all the objects in the specified ‘bucket’ using the given ‘query_params’. The query parameters must be passed as a list of tuples [{param_1, value_1}, {param_2, value_2}].

Link to this function put_object(bucket, filepath, bucket_path \\ :empty)
put_object(bucket :: binary(), filepath :: binary(), bucket_path :: binary()) :: HTTPResponse.t()

Uploads the file in the given ‘filepath’ to the specified ‘bucket’. If a ‘bucket_path’ is specified then the filename must be included at the end:

put_object “somebucket”,

         "/home/user/Documents/this_file",
         "new_folder/some_other_folder/this_file"

=> # This will upload the file to the directory in ‘bucket_path’ and

   will create the directories if they do not exist.
Link to this function request(verb, bucket, headers \\ [], body \\ "")
request(atom(), binary(), [tuple()], binary()) :: HTTPoison.HTTPResponse.t()

Sends an HTTP request without any query parameters.

Link to this function request_query(verb, bucket, headers \\ [], body \\ "", parameters)
request_query(atom(), binary(), [tuple()], binary(), binary()) :: HTTPoison.HTTPResponse.t()

Sends an HTTP request with the specified query parameters.

Link to this function request_service()
request_service() :: HTTPoison.HTTPResponse.t()

Sends an HTTP request according to the Service resource in the Google Cloud Storage documentation.

Link to this function set_bucket_acl(bucket, acl_config)
set_bucket_acl(bucket :: binary(), acl_config :: binary()) :: HTTPResponse.t()

Sets or modifies the existing ACL in the specified ‘bucket’ with the given ‘acl_config’ in XML format.

Link to this function set_bucket_cors(bucket, cors_config)
set_bucket_cors(bucket :: binary(), cors_config :: binary()) :: HTTPResponse.t()

Sets or modifies the existing CORS configuration in the specified ‘bucket’ with the given ‘cors_config’ in XML format.

Link to this function set_bucket_lifecycle(bucket, lifecycle_config)
set_bucket_lifecycle(bucket :: binary(), lifecycle_config :: binary()) :: HTTPResponse.t()

Sets or modifies the existing lifecyle configuration in the specified ‘bucket’ with the given ‘lifecycle_config’ in XML format.

Link to this function set_bucket_logging(bucket, logging_config)
set_bucket_logging(bucket :: binary(), logging_config :: binary()) :: HTTPResponse.t()

Sets or modifies the existing logging configuration in the specified ‘bucket’ with the given ‘logging_config’ in XML format.

Link to this function set_bucket_versioning(bucket, versioning_config)
set_bucket_versioning(bucket :: binary(), versioning_config :: binary()) :: HTTPResponse.t()

Sets or modifies the existing versioning configuration in the specified ‘bucket’ with the given ‘versioning_config’ in XML format.

Link to this function set_bucket_website(bucket, website_config)
set_bucket_website(bucket :: binary(), website_config :: binary()) :: HTTPResponse.t()

Sets or modifies the existing website configuration in the specified ‘bucket’ with the given ‘website_config’ in XML format.

Link to this function set_object_acl(bucket, object, acl_config)
set_object_acl(bucket :: binary(), object :: binary(), acl_config :: binary()) :: HTTPResponse.t()

Sets or modifies the ‘object’ from the specified ‘bucket’ with the provided ‘acl_config’ in XML format.

Link to this function set_object_acl(bucket, object, acl_config, query_params)
set_object_acl(bucket :: binary(), object :: binary(), acl_config :: binary(), [{binary(), binary()}]) :: HTTPResponse.t()

Sets or modifies the ‘object’ from the specified ‘bucket’ with the provided ‘acl_config’ in XML format and using the given ‘query_params’. The query parameters must be passed as a list of tuples [{param_1, value_1}, {param_2, value_2}].