|
| 1 | +// Copyright 2024 Google LLC |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +syntax = "proto3"; |
| 16 | + |
| 17 | +package google.cloud.aiplatform.v1; |
| 18 | + |
| 19 | +import "google/api/annotations.proto"; |
| 20 | +import "google/api/client.proto"; |
| 21 | +import "google/api/field_behavior.proto"; |
| 22 | +import "google/api/resource.proto"; |
| 23 | +import "google/cloud/aiplatform/v1/cached_content.proto"; |
| 24 | +import "google/protobuf/empty.proto"; |
| 25 | +import "google/protobuf/field_mask.proto"; |
| 26 | + |
| 27 | +option csharp_namespace = "Google.Cloud.AIPlatform.V1"; |
| 28 | +option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb"; |
| 29 | +option java_multiple_files = true; |
| 30 | +option java_outer_classname = "GenAiCacheServiceProto"; |
| 31 | +option java_package = "com.google.cloud.aiplatform.v1"; |
| 32 | +option php_namespace = "Google\\Cloud\\AIPlatform\\V1"; |
| 33 | +option ruby_package = "Google::Cloud::AIPlatform::V1"; |
| 34 | + |
| 35 | +// Service for managing Vertex AI's CachedContent resource. |
| 36 | +service GenAiCacheService { |
| 37 | + option (google.api.default_host) = "aiplatform.googleapis.com"; |
| 38 | + option (google.api.oauth_scopes) = |
| 39 | + "https://www.googleapis.com/auth/cloud-platform"; |
| 40 | + |
| 41 | + // Creates cached content, this call will initialize the cached content in the |
| 42 | + // data storage, and users need to pay for the cache data storage. |
| 43 | + rpc CreateCachedContent(CreateCachedContentRequest) returns (CachedContent) { |
| 44 | + option (google.api.http) = { |
| 45 | + post: "/v1/{parent=projects/*/locations/*}/cachedContents" |
| 46 | + body: "cached_content" |
| 47 | + }; |
| 48 | + option (google.api.method_signature) = "parent,cached_content"; |
| 49 | + } |
| 50 | + |
| 51 | + // Gets cached content configurations |
| 52 | + rpc GetCachedContent(GetCachedContentRequest) returns (CachedContent) { |
| 53 | + option (google.api.http) = { |
| 54 | + get: "/v1/{name=projects/*/locations/*/cachedContents/*}" |
| 55 | + }; |
| 56 | + option (google.api.method_signature) = "name"; |
| 57 | + } |
| 58 | + |
| 59 | + // Updates cached content configurations |
| 60 | + rpc UpdateCachedContent(UpdateCachedContentRequest) returns (CachedContent) { |
| 61 | + option (google.api.http) = { |
| 62 | + patch: "/v1/{cached_content.name=projects/*/locations/*/cachedContents/*}" |
| 63 | + body: "cached_content" |
| 64 | + }; |
| 65 | + option (google.api.method_signature) = "cached_content,update_mask"; |
| 66 | + } |
| 67 | + |
| 68 | + // Deletes cached content |
| 69 | + rpc DeleteCachedContent(DeleteCachedContentRequest) |
| 70 | + returns (google.protobuf.Empty) { |
| 71 | + option (google.api.http) = { |
| 72 | + delete: "/v1/{name=projects/*/locations/*/cachedContents/*}" |
| 73 | + }; |
| 74 | + option (google.api.method_signature) = "name"; |
| 75 | + } |
| 76 | + |
| 77 | + // Lists cached contents in a project |
| 78 | + rpc ListCachedContents(ListCachedContentsRequest) |
| 79 | + returns (ListCachedContentsResponse) { |
| 80 | + option (google.api.http) = { |
| 81 | + get: "/v1/{parent=projects/*/locations/*}/cachedContents" |
| 82 | + }; |
| 83 | + option (google.api.method_signature) = "parent"; |
| 84 | + } |
| 85 | +} |
| 86 | + |
| 87 | +// Request message for |
| 88 | +// [GenAiCacheService.CreateCachedContent][google.cloud.aiplatform.v1.GenAiCacheService.CreateCachedContent]. |
| 89 | +message CreateCachedContentRequest { |
| 90 | + // Required. The parent resource where the cached content will be created |
| 91 | + string parent = 1 [ |
| 92 | + (google.api.field_behavior) = REQUIRED, |
| 93 | + (google.api.resource_reference) = { |
| 94 | + child_type: "aiplatform.googleapis.com/CachedContent" |
| 95 | + } |
| 96 | + ]; |
| 97 | + |
| 98 | + // Required. The cached content to create |
| 99 | + CachedContent cached_content = 2 [(google.api.field_behavior) = REQUIRED]; |
| 100 | +} |
| 101 | + |
| 102 | +// Request message for |
| 103 | +// [GenAiCacheService.GetCachedContent][google.cloud.aiplatform.v1.GenAiCacheService.GetCachedContent]. |
| 104 | +message GetCachedContentRequest { |
| 105 | + // Required. The resource name referring to the cached content |
| 106 | + string name = 1 [ |
| 107 | + (google.api.field_behavior) = REQUIRED, |
| 108 | + (google.api.resource_reference) = { |
| 109 | + type: "aiplatform.googleapis.com/CachedContent" |
| 110 | + } |
| 111 | + ]; |
| 112 | +} |
| 113 | + |
| 114 | +// Request message for |
| 115 | +// [GenAiCacheService.UpdateCachedContent][google.cloud.aiplatform.v1.GenAiCacheService.UpdateCachedContent]. |
| 116 | +// Only expire_time or ttl can be updated. |
| 117 | +message UpdateCachedContentRequest { |
| 118 | + // Required. The cached content to update |
| 119 | + CachedContent cached_content = 1 [(google.api.field_behavior) = REQUIRED]; |
| 120 | + |
| 121 | + // Required. The list of fields to update. |
| 122 | + google.protobuf.FieldMask update_mask = 2 |
| 123 | + [(google.api.field_behavior) = REQUIRED]; |
| 124 | +} |
| 125 | + |
| 126 | +// Request message for |
| 127 | +// [GenAiCacheService.DeleteCachedContent][google.cloud.aiplatform.v1.GenAiCacheService.DeleteCachedContent]. |
| 128 | +message DeleteCachedContentRequest { |
| 129 | + // Required. The resource name referring to the cached content |
| 130 | + string name = 1 [ |
| 131 | + (google.api.field_behavior) = REQUIRED, |
| 132 | + (google.api.resource_reference) = { |
| 133 | + type: "aiplatform.googleapis.com/CachedContent" |
| 134 | + } |
| 135 | + ]; |
| 136 | +} |
| 137 | + |
| 138 | +// Request to list CachedContents. |
| 139 | +message ListCachedContentsRequest { |
| 140 | + // Required. The parent, which owns this collection of cached contents. |
| 141 | + string parent = 1 [ |
| 142 | + (google.api.field_behavior) = REQUIRED, |
| 143 | + (google.api.resource_reference) = { |
| 144 | + child_type: "aiplatform.googleapis.com/CachedContent" |
| 145 | + } |
| 146 | + ]; |
| 147 | + |
| 148 | + // Optional. The maximum number of cached contents to return. The service may |
| 149 | + // return fewer than this value. If unspecified, some default (under maximum) |
| 150 | + // number of items will be returned. The maximum value is 1000; values above |
| 151 | + // 1000 will be coerced to 1000. |
| 152 | + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; |
| 153 | + |
| 154 | + // Optional. A page token, received from a previous `ListCachedContents` call. |
| 155 | + // Provide this to retrieve the subsequent page. |
| 156 | + // |
| 157 | + // When paginating, all other parameters provided to `ListCachedContents` must |
| 158 | + // match the call that provided the page token. |
| 159 | + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; |
| 160 | +} |
| 161 | + |
| 162 | +// Response with a list of CachedContents. |
| 163 | +message ListCachedContentsResponse { |
| 164 | + // List of cached contents. |
| 165 | + repeated CachedContent cached_contents = 1; |
| 166 | + |
| 167 | + // A token, which can be sent as `page_token` to retrieve the next page. |
| 168 | + // If this field is omitted, there are no subsequent pages. |
| 169 | + string next_page_token = 2; |
| 170 | +} |
0 commit comments