Cloud CDN API, gRPC: CacheService
Written by
Updated at December 13, 2022
A set of methods for managing Cache Service resources.
Call | Description |
---|---|
Purge | Removes specified files from the cache of the specified resource. |
Prefetch | Uploads specified files from origins to cache of the specified resource. |
Calls CacheService
Purge
Removes specified files from the cache of the specified resource. For details about purging, see documentation.
Purging may take up to 15 minutes.
rpc Purge (PurgeCacheRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:PurgeCacheMetadata
Operation.response:google.protobuf.Empty
PurgeCacheRequest
Field | Description |
---|---|
resource_id | string Required. ID of the resource to perform purge operation on. The maximum string length in characters is 50. |
paths[] | string Set of paths: Paths of the files to remove from the cache. You may use asterisk ( * ) as a wildcard character that substitutes any number of characters. If an empty array of paths is specified, the cache is purged entirely. |
Operation
Field | Description |
---|---|
id | string ID of the operation. |
description | string Description of the operation. 0-256 characters long. |
created_at | google.protobuf.Timestamp Creation timestamp. |
created_by | string ID of the user or service account who initiated the operation. |
modified_at | google.protobuf.Timestamp The time when the Operation resource was last modified. |
done | bool If the value is false , it means the operation is still in progress. If true , the operation is completed, and either error or response is available. |
metadata | google.protobuf.Any Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any. |
result | oneof: error or response The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true , exactly one of error or response is set. |
error | google.rpc.Status The error result of the operation in case of failure or cancellation. |
response | google.protobuf.Any if operation finished successfully. |
PurgeCacheMetadata
Field | Description |
---|---|
resource_id | string Required. ID of the resource. The maximum string length in characters is 50. |
Prefetch
Uploads specified files from origins to cache of the specified resource. For defails about prefetching, see documentation.
rpc Prefetch (PrefetchCacheRequest) returns (operation.Operation)
Metadata and response of Operation:
Operation.metadata:PrefetchCacheMetadata
Operation.response:google.protobuf.Empty
PrefetchCacheRequest
Field | Description |
---|---|
resource_id | string Required. ID of the resource to perform prefetch operation on. The maximum string length in characters is 50. |
paths[] | string Set of paths to prefetch. |
Operation
Field | Description |
---|---|
id | string ID of the operation. |
description | string Description of the operation. 0-256 characters long. |
created_at | google.protobuf.Timestamp Creation timestamp. |
created_by | string ID of the user or service account who initiated the operation. |
modified_at | google.protobuf.Timestamp The time when the Operation resource was last modified. |
done | bool If the value is false , it means the operation is still in progress. If true , the operation is completed, and either error or response is available. |
metadata | google.protobuf.Any Service-specific metadata associated with the operation. It typically contains the ID of the target resource that the operation is performed on. Any method that returns a long-running operation should document the metadata type, if any. |
result | oneof: error or response The operation result. If done == false and there was no failure detected, neither error nor response is set. If done == false and there was a failure detected, error is set. If done == true , exactly one of error or response is set. |
error | google.rpc.Status The error result of the operation in case of failure or cancellation. |
response | google.protobuf.Any if operation finished successfully. |
PrefetchCacheMetadata
Field | Description |
---|---|
resource_id | string Required. ID of the resource. The maximum string length in characters is 50. |