Skip to main content

anywhere_caches

Creates, updates, deletes, gets or lists an anywhere_caches resource.

Overview

Nameanywhere_caches
TypeResource
Idgoogle.storage.anywhere_caches

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
idstringThe ID of the resource, including the project number, bucket name and anywhere cache ID.
admissionPolicystringThe cache-level entry admission policy.
anywhereCacheIdstringThe ID of the Anywhere cache instance.
bucketstringThe name of the bucket containing this cache instance.
createTimestring (date-time)The creation time of the cache instance in RFC 3339 format.
kindstringThe kind of item this is. For Anywhere Cache, this is always storage#anywhereCache. (default: storage#anywhereCache)
pendingUpdatebooleanTrue if the cache instance has an active Update long-running operation.
selfLinkstringThe link to this cache instance.
statestringThe current state of the cache instance.
ttlstring (google-duration)The TTL of all cache entries in whole seconds. e.g., "7200s".
updateTimestring (date-time)The modification time of the cache instance metadata in RFC 3339 format.
zonestringThe zone in which the cache instance is running. For example, us-central1-a.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectbucket, anywhereCacheIdReturns the metadata of an Anywhere Cache instance.
listselectbucketpageSize, pageTokenReturns a list of Anywhere Cache instances of the bucket matching the criteria.
insertinsertbucketCreates an Anywhere Cache instance.
updateupdatebucket, anywhereCacheIdUpdates the config(ttl and admissionPolicy) of an Anywhere Cache instance.
pauseexecbucket, anywhereCacheIdPauses an Anywhere Cache instance.
resumeexecbucket, anywhereCacheIdResumes a paused or disabled Anywhere Cache instance.
disableexecbucket, anywhereCacheIdDisables an Anywhere Cache instance.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
anywhereCacheIdstring
bucketstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Returns the metadata of an Anywhere Cache instance.

SELECT
id,
admissionPolicy,
anywhereCacheId,
bucket,
createTime,
kind,
pendingUpdate,
selfLink,
state,
ttl,
updateTime,
zone
FROM google.storage.anywhere_caches
WHERE bucket = '{{ bucket }}' -- required
AND anywhereCacheId = '{{ anywhereCacheId }}' -- required;

INSERT examples

Creates an Anywhere Cache instance.

INSERT INTO google.storage.anywhere_caches (
data__kind,
data__id,
data__selfLink,
data__bucket,
data__anywhereCacheId,
data__zone,
data__state,
data__createTime,
data__updateTime,
data__ttl,
data__admissionPolicy,
data__pendingUpdate,
bucket
)
SELECT
'{{ kind }}',
'{{ id }}',
'{{ selfLink }}',
'{{ bucket }}',
'{{ anywhereCacheId }}',
'{{ zone }}',
'{{ state }}',
'{{ createTime }}',
'{{ updateTime }}',
'{{ ttl }}',
'{{ admissionPolicy }}',
{{ pendingUpdate }},
'{{ bucket }}'
RETURNING
name,
done,
error,
kind,
metadata,
response,
selfLink
;

UPDATE examples

Updates the config(ttl and admissionPolicy) of an Anywhere Cache instance.

UPDATE google.storage.anywhere_caches
SET
data__kind = '{{ kind }}',
data__id = '{{ id }}',
data__selfLink = '{{ selfLink }}',
data__bucket = '{{ bucket }}',
data__anywhereCacheId = '{{ anywhereCacheId }}',
data__zone = '{{ zone }}',
data__state = '{{ state }}',
data__createTime = '{{ createTime }}',
data__updateTime = '{{ updateTime }}',
data__ttl = '{{ ttl }}',
data__admissionPolicy = '{{ admissionPolicy }}',
data__pendingUpdate = {{ pendingUpdate }}
WHERE
bucket = '{{ bucket }}' --required
AND anywhereCacheId = '{{ anywhereCacheId }}' --required
RETURNING
name,
done,
error,
kind,
metadata,
response,
selfLink;

Lifecycle Methods

Pauses an Anywhere Cache instance.

EXEC google.storage.anywhere_caches.pause 
@bucket='{{ bucket }}' --required,
@anywhereCacheId='{{ anywhereCacheId }}' --required;