class Buckets extends Resource (View source)

The "buckets" collection of methods.

Typical usage is:

 $storageService = new Google\Service\Storage(...);
 $buckets = $storageService->buckets;

Methods

delete(string $bucket, array $optParams = [])

Deletes an empty bucket. Deletions are permanent unless soft delete is enabled on the bucket. (buckets.delete)

get(string $bucket, array $optParams = [])

Returns metadata for the specified bucket. (buckets.get)

getIamPolicy(string $bucket, array $optParams = [])

Returns an IAM policy for the specified bucket. (buckets.getIamPolicy)

getStorageLayout(string $bucket, array $optParams = [])

Returns the storage layout configuration for the specified bucket. Note that this operation requires storage.objects.list permission.

insert(string $project, Bucket $postBody, array $optParams = [])

Creates a new bucket. (buckets.insert)

listBuckets(string $project, array $optParams = [])

Retrieves a list of buckets for a given project. (buckets.listBuckets)

lockRetentionPolicy(string $bucket, string $ifMetagenerationMatch, array $optParams = [])

Locks retention policy on a bucket. (buckets.lockRetentionPolicy)

patch(string $bucket, Bucket $postBody, array $optParams = [])

Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.

restore(string $bucket, string $generation, array $optParams = [])

Restores a soft-deleted bucket. (buckets.restore)

setIamPolicy(string $bucket, Policy $postBody, array $optParams = [])

Updates an IAM policy for the specified bucket. (buckets.setIamPolicy)

testIamPermissions(string $bucket, string|array $permissions, array $optParams = [])

Tests a set of permissions on the given bucket to see which, if any, are held by the caller. (buckets.testIamPermissions)

update(string $bucket, Bucket $postBody, array $optParams = [])

Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.

Details

delete(string $bucket, array $optParams = [])

Deletes an empty bucket. Deletions are permanent unless soft delete is enabled on the bucket. (buckets.delete)

Parameters

string $bucket

Name of a bucket.

array $optParams

Optional parameters.

Exceptions

Exception

Bucket get(string $bucket, array $optParams = [])

Returns metadata for the specified bucket. (buckets.get)

Parameters

string $bucket

Name of a bucket.

array $optParams

Optional parameters.

Return Value

Bucket

Exceptions

Exception

Policy getIamPolicy(string $bucket, array $optParams = [])

Returns an IAM policy for the specified bucket. (buckets.getIamPolicy)

Parameters

string $bucket

Name of a bucket.

array $optParams

Optional parameters.

Return Value

Policy

Exceptions

Exception

BucketStorageLayout getStorageLayout(string $bucket, array $optParams = [])

Returns the storage layout configuration for the specified bucket. Note that this operation requires storage.objects.list permission.

(buckets.getStorageLayout)

Parameters

string $bucket

Name of a bucket.

array $optParams

Optional parameters.

Return Value

BucketStorageLayout

Exceptions

Exception

Bucket insert(string $project, Bucket $postBody, array $optParams = [])

Creates a new bucket. (buckets.insert)

Parameters

string $project

A valid API project identifier.

Bucket $postBody
array $optParams

Optional parameters.

Return Value

Bucket

Exceptions

Exception

Buckets listBuckets(string $project, array $optParams = [])

Retrieves a list of buckets for a given project. (buckets.listBuckets)

Parameters

string $project

A valid API project identifier.

array $optParams

Optional parameters.

Return Value

Buckets

Exceptions

Exception

Bucket lockRetentionPolicy(string $bucket, string $ifMetagenerationMatch, array $optParams = [])

Locks retention policy on a bucket. (buckets.lockRetentionPolicy)

Parameters

string $bucket

Name of a bucket.

string $ifMetagenerationMatch

Makes the operation conditional on whether bucket's current metageneration matches the given value.

array $optParams

Optional parameters.

Return Value

Bucket

Exceptions

Exception

Bucket patch(string $bucket, Bucket $postBody, array $optParams = [])

Patches a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.

(buckets.patch)

Parameters

string $bucket

Name of a bucket.

Bucket $postBody
array $optParams

Optional parameters.

Return Value

Bucket

Exceptions

Exception

restore(string $bucket, string $generation, array $optParams = [])

Restores a soft-deleted bucket. (buckets.restore)

Parameters

string $bucket

Name of a bucket.

string $generation

Generation of a bucket.

array $optParams

Optional parameters.

Exceptions

Exception

Policy setIamPolicy(string $bucket, Policy $postBody, array $optParams = [])

Updates an IAM policy for the specified bucket. (buckets.setIamPolicy)

Parameters

string $bucket

Name of a bucket.

Policy $postBody
array $optParams

Optional parameters.

Return Value

Policy

Exceptions

Exception

TestIamPermissionsResponse testIamPermissions(string $bucket, string|array $permissions, array $optParams = [])

Tests a set of permissions on the given bucket to see which, if any, are held by the caller. (buckets.testIamPermissions)

Parameters

string $bucket

Name of a bucket.

string|array $permissions

Permissions to test.

array $optParams

Optional parameters.

Return Value

TestIamPermissionsResponse

Exceptions

Exception

Bucket update(string $bucket, Bucket $postBody, array $optParams = [])

Updates a bucket. Changes to the bucket will be readable immediately after writing, but configuration changes may take time to propagate.

(buckets.update)

Parameters

string $bucket

Name of a bucket.

Bucket $postBody
array $optParams

Optional parameters.

Return Value

Bucket

Exceptions

Exception