functions.proto 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033
  1. // Copyright 2022 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. syntax = "proto3";
  15. package google.cloud.functions.v2alpha;
  16. import "google/api/annotations.proto";
  17. import "google/api/client.proto";
  18. import "google/api/field_behavior.proto";
  19. import "google/api/resource.proto";
  20. import "google/longrunning/operations.proto";
  21. import "google/protobuf/any.proto";
  22. import "google/protobuf/field_mask.proto";
  23. import "google/protobuf/timestamp.proto";
  24. option go_package = "google.golang.org/genproto/googleapis/cloud/functions/v2alpha;functions";
  25. option java_multiple_files = true;
  26. option java_outer_classname = "FunctionsProto";
  27. option java_package = "com.google.cloud.functions.v2alpha";
  28. option objc_class_prefix = "GCF";
  29. option (google.api.resource_definition) = {
  30. type: "artifactregistry.googleapis.com/Repository"
  31. pattern: "projects/{project}/locations/{location}/repositories/{repository}"
  32. };
  33. option (google.api.resource_definition) = {
  34. type: "cloudbuild.googleapis.com/Build"
  35. pattern: "projects/{project}/locations/{location}/builds/{build}"
  36. };
  37. option (google.api.resource_definition) = {
  38. type: "cloudbuild.googleapis.com/WorkerPool"
  39. pattern: "projects/{project}/locations/{location}/workerPools/{worker_pool}"
  40. };
  41. option (google.api.resource_definition) = {
  42. type: "run.googleapis.com/Service"
  43. pattern: "projects/{project}/locations/{location}/services/{service}"
  44. };
  45. option (google.api.resource_definition) = {
  46. type: "vpcaccess.googleapis.com/Connector"
  47. pattern: "projects/{project}/locations/{location}/connectors/{connector}"
  48. };
  49. option (google.api.resource_definition) = {
  50. type: "eventarc.googleapis.com/Trigger"
  51. pattern: "projects/{project}/locations/{location}/triggers/{trigger}"
  52. };
  53. option (google.api.resource_definition) = {
  54. type: "eventarc.googleapis.com/Channel"
  55. pattern: "projects/{project}/locations/{location}/channels/{channel}"
  56. };
  57. option (google.api.resource_definition) = {
  58. type: "pubsub.googleapis.com/Topic"
  59. pattern: "projects/{project}/topics/{topic}"
  60. };
  61. // Google Cloud Functions is used to deploy functions that are executed by
  62. // Google in response to various events. Data connected with that event is
  63. // passed to a function as the input data.
  64. //
  65. // A **function** is a resource which describes a function that should be
  66. // executed and how it is triggered.
  67. service FunctionService {
  68. option (google.api.default_host) = "cloudfunctions.googleapis.com";
  69. option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";
  70. // Returns a function with the given name from the requested project.
  71. rpc GetFunction(GetFunctionRequest) returns (Function) {
  72. option (google.api.http) = {
  73. get: "/v2alpha/{name=projects/*/locations/*/functions/*}"
  74. };
  75. option (google.api.method_signature) = "name";
  76. }
  77. // Returns a list of functions that belong to the requested project.
  78. rpc ListFunctions(ListFunctionsRequest) returns (ListFunctionsResponse) {
  79. option (google.api.http) = {
  80. get: "/v2alpha/{parent=projects/*/locations/*}/functions"
  81. };
  82. option (google.api.method_signature) = "parent";
  83. }
  84. // Creates a new function. If a function with the given name already exists in
  85. // the specified project, the long running operation will return
  86. // `ALREADY_EXISTS` error.
  87. rpc CreateFunction(CreateFunctionRequest) returns (google.longrunning.Operation) {
  88. option (google.api.http) = {
  89. post: "/v2alpha/{parent=projects/*/locations/*}/functions"
  90. body: "function"
  91. };
  92. option (google.api.method_signature) = "parent,function,function_id";
  93. option (google.longrunning.operation_info) = {
  94. response_type: "google.cloud.functions.v2alpha.Function"
  95. metadata_type: "google.cloud.functions.v2alpha.OperationMetadata"
  96. };
  97. }
  98. // Updates existing function.
  99. rpc UpdateFunction(UpdateFunctionRequest) returns (google.longrunning.Operation) {
  100. option (google.api.http) = {
  101. patch: "/v2alpha/{function.name=projects/*/locations/*/functions/*}"
  102. body: "function"
  103. };
  104. option (google.api.method_signature) = "function,update_mask";
  105. option (google.longrunning.operation_info) = {
  106. response_type: "google.cloud.functions.v2alpha.Function"
  107. metadata_type: "google.cloud.functions.v2alpha.OperationMetadata"
  108. };
  109. }
  110. // Deletes a function with the given name from the specified project. If the
  111. // given function is used by some trigger, the trigger will be updated to
  112. // remove this function.
  113. rpc DeleteFunction(DeleteFunctionRequest) returns (google.longrunning.Operation) {
  114. option (google.api.http) = {
  115. delete: "/v2alpha/{name=projects/*/locations/*/functions/*}"
  116. };
  117. option (google.api.method_signature) = "name";
  118. option (google.longrunning.operation_info) = {
  119. response_type: "google.protobuf.Empty"
  120. metadata_type: "google.cloud.functions.v2alpha.OperationMetadata"
  121. };
  122. }
  123. // Returns a signed URL for uploading a function source code.
  124. // For more information about the signed URL usage see:
  125. // https://cloud.google.com/storage/docs/access-control/signed-urls.
  126. // Once the function source code upload is complete, the used signed
  127. // URL should be provided in CreateFunction or UpdateFunction request
  128. // as a reference to the function source code.
  129. //
  130. // When uploading source code to the generated signed URL, please follow
  131. // these restrictions:
  132. //
  133. // * Source file type should be a zip file.
  134. // * No credentials should be attached - the signed URLs provide access to the
  135. // target bucket using internal service identity; if credentials were
  136. // attached, the identity from the credentials would be used, but that
  137. // identity does not have permissions to upload files to the URL.
  138. //
  139. // When making a HTTP PUT request, these two headers need to be specified:
  140. //
  141. // * `content-type: application/zip`
  142. //
  143. // And this header SHOULD NOT be specified:
  144. //
  145. // * `Authorization: Bearer YOUR_TOKEN`
  146. rpc GenerateUploadUrl(GenerateUploadUrlRequest) returns (GenerateUploadUrlResponse) {
  147. option (google.api.http) = {
  148. post: "/v2alpha/{parent=projects/*/locations/*}/functions:generateUploadUrl"
  149. body: "*"
  150. };
  151. }
  152. // Returns a signed URL for downloading deployed function source code.
  153. // The URL is only valid for a limited period and should be used within
  154. // 30 minutes of generation.
  155. // For more information about the signed URL usage see:
  156. // https://cloud.google.com/storage/docs/access-control/signed-urls
  157. rpc GenerateDownloadUrl(GenerateDownloadUrlRequest) returns (GenerateDownloadUrlResponse) {
  158. option (google.api.http) = {
  159. post: "/v2alpha/{name=projects/*/locations/*/functions/*}:generateDownloadUrl"
  160. body: "*"
  161. };
  162. }
  163. // Returns a list of runtimes that are supported for the requested project.
  164. rpc ListRuntimes(ListRuntimesRequest) returns (ListRuntimesResponse) {
  165. option (google.api.http) = {
  166. get: "/v2alpha/{parent=projects/*/locations/*}/runtimes"
  167. };
  168. option (google.api.method_signature) = "parent";
  169. }
  170. }
  171. // The environment the function is hosted on.
  172. enum Environment {
  173. // Unspecified
  174. ENVIRONMENT_UNSPECIFIED = 0;
  175. // Gen 1
  176. GEN_1 = 1;
  177. // Gen 2
  178. GEN_2 = 2;
  179. }
  180. // Describes a Cloud Function that contains user computation executed in
  181. // response to an event. It encapsulates function and trigger configurations.
  182. message Function {
  183. option (google.api.resource) = {
  184. type: "cloudfunctions.googleapis.com/Function"
  185. pattern: "projects/{project}/locations/{location}/functions/{function}"
  186. plural: "functions"
  187. singular: "function"
  188. };
  189. // Describes the current state of the function.
  190. enum State {
  191. // Not specified. Invalid state.
  192. STATE_UNSPECIFIED = 0;
  193. // Function has been successfully deployed and is serving.
  194. ACTIVE = 1;
  195. // Function deployment failed and the function is not serving.
  196. FAILED = 2;
  197. // Function is being created or updated.
  198. DEPLOYING = 3;
  199. // Function is being deleted.
  200. DELETING = 4;
  201. // Function deployment failed and the function serving state is undefined.
  202. // The function should be updated or deleted to move it out of this state.
  203. UNKNOWN = 5;
  204. }
  205. // A user-defined name of the function. Function names must be unique
  206. // globally and match pattern `projects/*/locations/*/functions/*`
  207. string name = 1;
  208. // Describe whether the function is gen1 or gen2.
  209. Environment environment = 10;
  210. // User-provided description of a function.
  211. string description = 2;
  212. // Describes the Build step of the function that builds a container from the
  213. // given source.
  214. BuildConfig build_config = 3;
  215. // Describes the Service being deployed. Currently deploys services to Cloud
  216. // Run (fully managed).
  217. ServiceConfig service_config = 4;
  218. // An Eventarc trigger managed by Google Cloud Functions that fires events in
  219. // response to a condition in another service.
  220. EventTrigger event_trigger = 5;
  221. // Output only. State of the function.
  222. State state = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
  223. // Output only. The last update timestamp of a Cloud Function.
  224. google.protobuf.Timestamp update_time = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
  225. // Labels associated with this Cloud Function.
  226. map<string, string> labels = 8;
  227. // Output only. State Messages for this Cloud Function.
  228. repeated StateMessage state_messages = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  229. }
  230. // Informational messages about the state of the Cloud Function or Operation.
  231. message StateMessage {
  232. // Severity of the state message.
  233. enum Severity {
  234. // Not specified. Invalid severity.
  235. SEVERITY_UNSPECIFIED = 0;
  236. // ERROR-level severity.
  237. ERROR = 1;
  238. // WARNING-level severity.
  239. WARNING = 2;
  240. // INFO-level severity.
  241. INFO = 3;
  242. }
  243. // Severity of the state message.
  244. Severity severity = 1;
  245. // One-word CamelCase type of the state message.
  246. string type = 2;
  247. // The message.
  248. string message = 3;
  249. }
  250. // Location of the source in an archive file in Google Cloud Storage.
  251. message StorageSource {
  252. // Google Cloud Storage bucket containing the source (see
  253. // [Bucket Name
  254. // Requirements](https://cloud.google.com/storage/docs/bucket-naming#requirements)).
  255. string bucket = 1;
  256. // Google Cloud Storage object containing the source.
  257. //
  258. // This object must be a gzipped archive file (`.tar.gz`) containing source to
  259. // build.
  260. string object = 2;
  261. // Google Cloud Storage generation for the object. If the generation is
  262. // omitted, the latest generation will be used.
  263. int64 generation = 3;
  264. }
  265. // Location of the source in a Google Cloud Source Repository.
  266. message RepoSource {
  267. // A revision within the Cloud Source Repository must be specified in
  268. // one of these ways.
  269. oneof revision {
  270. // Regex matching branches to build.
  271. //
  272. // The syntax of the regular expressions accepted is the syntax accepted by
  273. // RE2 and described at https://github.com/google/re2/wiki/Syntax
  274. string branch_name = 3;
  275. // Regex matching tags to build.
  276. //
  277. // The syntax of the regular expressions accepted is the syntax accepted by
  278. // RE2 and described at https://github.com/google/re2/wiki/Syntax
  279. string tag_name = 4;
  280. // Explicit commit SHA to build.
  281. string commit_sha = 5;
  282. }
  283. // ID of the project that owns the Cloud Source Repository. If omitted, the
  284. // project ID requesting the build is assumed.
  285. string project_id = 1;
  286. // Name of the Cloud Source Repository.
  287. string repo_name = 2;
  288. // Directory, relative to the source root, in which to run the build.
  289. //
  290. // This must be a relative path. If a step's `dir` is specified and is an
  291. // absolute path, this value is ignored for that step's execution.
  292. // eg. helloworld (no leading slash allowed)
  293. string dir = 6;
  294. // Only trigger a build if the revision regex does NOT match the revision
  295. // regex.
  296. bool invert_regex = 7;
  297. }
  298. // The location of the function source code.
  299. message Source {
  300. // Location of the source.
  301. // At least one source needs to be provided for the deployment to succeed.
  302. oneof source {
  303. // If provided, get the source from this location in Google Cloud Storage.
  304. StorageSource storage_source = 1;
  305. // If provided, get the source from this location in a Cloud Source
  306. // Repository.
  307. RepoSource repo_source = 2;
  308. }
  309. }
  310. // Provenance of the source. Ways to find the original source, or verify that
  311. // some source was used for this build.
  312. message SourceProvenance {
  313. // A copy of the build's `source.storage_source`, if exists, with any
  314. // generations resolved.
  315. StorageSource resolved_storage_source = 1;
  316. // A copy of the build's `source.repo_source`, if exists, with any
  317. // revisions resolved.
  318. RepoSource resolved_repo_source = 2;
  319. }
  320. // Describes the Build step of the function that builds a container from the
  321. // given source.
  322. message BuildConfig {
  323. // Output only. The Cloud Build name of the latest successful deployment of the
  324. // function.
  325. string build = 1 [
  326. (google.api.field_behavior) = OUTPUT_ONLY,
  327. (google.api.resource_reference) = {
  328. type: "cloudbuild.googleapis.com/Build"
  329. }
  330. ];
  331. // The runtime in which to run the function. Required when deploying a new
  332. // function, optional when updating an existing function. For a complete
  333. // list of possible choices, see the
  334. // [`gcloud` command
  335. // reference](https://cloud.google.com/sdk/gcloud/reference/functions/deploy#--runtime).
  336. string runtime = 2;
  337. // The name of the function (as defined in source code) that will be
  338. // executed. Defaults to the resource name suffix, if not specified. For
  339. // backward compatibility, if function with given name is not found, then the
  340. // system will try to use function named "function".
  341. // For Node.js this is name of a function exported by the module specified
  342. // in `source_location`.
  343. string entry_point = 3;
  344. // The location of the function source code.
  345. Source source = 4;
  346. // Output only. A permanent fixed identifier for source.
  347. SourceProvenance source_provenance = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
  348. // Name of the Cloud Build Custom Worker Pool that should be used to build the
  349. // function. The format of this field is
  350. // `projects/{project}/locations/{region}/workerPools/{workerPool}` where
  351. // {project} and {region} are the project id and region respectively where the
  352. // worker pool is defined and {workerPool} is the short name of the worker
  353. // pool.
  354. //
  355. // If the project id is not the same as the function, then the Cloud
  356. // Functions Service Agent
  357. // (service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com) must be
  358. // granted the role Cloud Build Custom Workers Builder
  359. // (roles/cloudbuild.customworkers.builder) in the project.
  360. string worker_pool = 5 [(google.api.resource_reference) = {
  361. type: "cloudbuild.googleapis.com/WorkerPool"
  362. }];
  363. // User-provided build-time environment variables for the function
  364. map<string, string> environment_variables = 6;
  365. // Optional. User managed repository created in Artifact Registry optionally with a
  366. // customer managed encryption key. This is the repository to which the
  367. // function docker image will be pushed after it is built by Cloud Build.
  368. // If unspecified, GCF will create and use a repository named 'gcf-artifacts'
  369. // for every deployed region.
  370. //
  371. // It must match the pattern
  372. // `projects/{project}/locations/{location}/repositories/{repository}`.
  373. //
  374. // Cross-project repositories are not supported.
  375. // Cross-location repositories are not supported.
  376. // Repository format must be 'DOCKER'.
  377. string docker_repository = 7 [
  378. (google.api.field_behavior) = OPTIONAL,
  379. (google.api.resource_reference) = {
  380. type: "artifactregistry.googleapis.com/Repository"
  381. }
  382. ];
  383. }
  384. // Describes the Service being deployed.
  385. // Currently Supported : Cloud Run (fully managed).
  386. message ServiceConfig {
  387. // Available egress settings.
  388. //
  389. // This controls what traffic is diverted through the VPC Access Connector
  390. // resource. By default PRIVATE_RANGES_ONLY will be used.
  391. enum VpcConnectorEgressSettings {
  392. // Unspecified.
  393. VPC_CONNECTOR_EGRESS_SETTINGS_UNSPECIFIED = 0;
  394. // Use the VPC Access Connector only for private IP space from RFC1918.
  395. PRIVATE_RANGES_ONLY = 1;
  396. // Force the use of VPC Access Connector for all egress traffic from the
  397. // function.
  398. ALL_TRAFFIC = 2;
  399. }
  400. // Available ingress settings.
  401. //
  402. // This controls what traffic can reach the function.
  403. //
  404. // If unspecified, ALLOW_ALL will be used.
  405. enum IngressSettings {
  406. // Unspecified.
  407. INGRESS_SETTINGS_UNSPECIFIED = 0;
  408. // Allow HTTP traffic from public and private sources.
  409. ALLOW_ALL = 1;
  410. // Allow HTTP traffic from only private VPC sources.
  411. ALLOW_INTERNAL_ONLY = 2;
  412. // Allow HTTP traffic from private VPC sources and through GCLB.
  413. ALLOW_INTERNAL_AND_GCLB = 3;
  414. }
  415. // Output only. Name of the service associated with a Function.
  416. // The format of this field is
  417. // `projects/{project}/locations/{region}/services/{service}`
  418. string service = 1 [
  419. (google.api.field_behavior) = OUTPUT_ONLY,
  420. (google.api.resource_reference) = {
  421. type: "run.googleapis.com/Service"
  422. }
  423. ];
  424. // The function execution timeout. Execution is considered failed and
  425. // can be terminated if the function is not completed at the end of the
  426. // timeout period. Defaults to 60 seconds.
  427. int32 timeout_seconds = 2;
  428. // The amount of memory available for a function.
  429. // Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is
  430. // supplied the value is interpreted as bytes.
  431. // See
  432. // https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go
  433. // a full description.
  434. string available_memory = 13;
  435. // Environment variables that shall be available during function execution.
  436. map<string, string> environment_variables = 4;
  437. // The limit on the maximum number of function instances that may coexist at a
  438. // given time.
  439. //
  440. // In some cases, such as rapid traffic surges, Cloud Functions may, for a
  441. // short period of time, create more instances than the specified max
  442. // instances limit. If your function cannot tolerate this temporary behavior,
  443. // you may want to factor in a safety margin and set a lower max instances
  444. // value than your function can tolerate.
  445. //
  446. // See the [Max
  447. // Instances](https://cloud.google.com/functions/docs/max-instances) Guide for
  448. // more details.
  449. int32 max_instance_count = 5;
  450. // The limit on the minimum number of function instances that may coexist at a
  451. // given time.
  452. //
  453. // Function instances are kept in idle state for a short period after they
  454. // finished executing the request to reduce cold start time for subsequent
  455. // requests. Setting a minimum instance count will ensure that the given
  456. // number of instances are kept running in idle state always. This can help
  457. // with cold start times when jump in incoming request count occurs after the
  458. // idle instance would have been stopped in the default case.
  459. int32 min_instance_count = 12;
  460. // The Serverless VPC Access connector that this cloud function can connect
  461. // to. The format of this field is `projects/*/locations/*/connectors/*`.
  462. string vpc_connector = 6 [(google.api.resource_reference) = {
  463. type: "vpcaccess.googleapis.com/Connector"
  464. }];
  465. // The egress settings for the connector, controlling what traffic is diverted
  466. // through it.
  467. VpcConnectorEgressSettings vpc_connector_egress_settings = 7;
  468. // The ingress settings for the function, controlling what traffic can reach
  469. // it.
  470. IngressSettings ingress_settings = 8;
  471. // Output only. URI of the Service deployed.
  472. string uri = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
  473. // The email of the service's service account. If empty, defaults to
  474. // `{project_number}-compute@developer.gserviceaccount.com`.
  475. string service_account_email = 10;
  476. // Whether 100% of traffic is routed to the latest revision.
  477. // On CreateFunction and UpdateFunction, when set to true, the revision being
  478. // deployed will serve 100% of traffic, ignoring any traffic split settings,
  479. // if any. On GetFunction, true will be returned if the latest revision is
  480. // serving 100% of traffic.
  481. bool all_traffic_on_latest_revision = 16;
  482. // Secret environment variables configuration.
  483. repeated SecretEnvVar secret_environment_variables = 17;
  484. // Secret volumes configuration.
  485. repeated SecretVolume secret_volumes = 19;
  486. // Output only. The name of service revision.
  487. string revision = 18 [(google.api.field_behavior) = OUTPUT_ONLY];
  488. }
  489. // Configuration for a secret environment variable. It has the information
  490. // necessary to fetch the secret value from secret manager and expose it as an
  491. // environment variable.
  492. message SecretEnvVar {
  493. // Name of the environment variable.
  494. string key = 1;
  495. // Project identifier (preferably project number but can also be the
  496. // project ID) of the project that contains the secret. If not set, it is
  497. // assumed that the secret is in the same project as the function.
  498. string project_id = 2;
  499. // Name of the secret in secret manager (not the full resource name).
  500. string secret = 3;
  501. // Version of the secret (version number or the string 'latest'). It is
  502. // recommended to use a numeric version for secret environment variables as
  503. // any updates to the secret value is not reflected until new instances
  504. // start.
  505. string version = 4;
  506. }
  507. // Configuration for a secret volume. It has the information necessary to fetch
  508. // the secret value from secret manager and make it available as files mounted
  509. // at the requested paths within the application container.
  510. message SecretVolume {
  511. // Configuration for a single version.
  512. message SecretVersion {
  513. // Version of the secret (version number or the string 'latest'). It is
  514. // preferable to use `latest` version with secret volumes as secret value
  515. // changes are reflected immediately.
  516. string version = 1;
  517. // Relative path of the file under the mount path where the secret value for
  518. // this version will be fetched and made available. For example, setting the
  519. // mount_path as '/etc/secrets' and path as `secret_foo` would mount the
  520. // secret value file at `/etc/secrets/secret_foo`.
  521. string path = 2;
  522. }
  523. // The path within the container to mount the secret volume. For example,
  524. // setting the mount_path as `/etc/secrets` would mount the secret value files
  525. // under the `/etc/secrets` directory. This directory will also be completely
  526. // shadowed and unavailable to mount any other secrets.
  527. // Recommended mount path: /etc/secrets
  528. string mount_path = 1;
  529. // Project identifier (preferably project number but can also be the project
  530. // ID) of the project that contains the secret. If not set, it is
  531. // assumed that the secret is in the same project as the function.
  532. string project_id = 2;
  533. // Name of the secret in secret manager (not the full resource name).
  534. string secret = 3;
  535. // List of secret versions to mount for this secret. If empty, the `latest`
  536. // version of the secret will be made available in a file named after the
  537. // secret under the mount point.
  538. repeated SecretVersion versions = 4;
  539. }
  540. // Describes EventTrigger, used to request events to be sent from another
  541. // service.
  542. message EventTrigger {
  543. // Describes the retry policy in case of function's execution failure.
  544. // Retried execution is charged as any other execution.
  545. enum RetryPolicy {
  546. // Not specified.
  547. RETRY_POLICY_UNSPECIFIED = 0;
  548. // Do not retry.
  549. RETRY_POLICY_DO_NOT_RETRY = 1;
  550. // Retry on any failure, retry up to 7 days with an exponential backoff
  551. // (capped at 10 seconds).
  552. RETRY_POLICY_RETRY = 2;
  553. }
  554. // Output only. The resource name of the Eventarc trigger. The format of this field is
  555. // `projects/{project}/locations/{region}/triggers/{trigger}`.
  556. string trigger = 1 [
  557. (google.api.field_behavior) = OUTPUT_ONLY,
  558. (google.api.resource_reference) = {
  559. type: "eventarc.googleapis.com/Trigger"
  560. }
  561. ];
  562. // The region that the trigger will be in. The trigger will only receive
  563. // events originating in this region. It can be the same
  564. // region as the function, a different region or multi-region, or the global
  565. // region. If not provided, defaults to the same region as the function.
  566. string trigger_region = 2;
  567. // Required. The type of event to observe. For example:
  568. // `google.cloud.audit.log.v1.written` or
  569. // `google.cloud.pubsub.topic.v1.messagePublished`.
  570. string event_type = 3 [(google.api.field_behavior) = REQUIRED];
  571. // Criteria used to filter events.
  572. repeated EventFilter event_filters = 4;
  573. // Optional. The name of a Pub/Sub topic in the same project that will be used
  574. // as the transport topic for the event delivery. Format:
  575. // `projects/{project}/topics/{topic}`.
  576. //
  577. // This is only valid for events of type
  578. // `google.cloud.pubsub.topic.v1.messagePublished`. The topic provided here
  579. // will not be deleted at function deletion.
  580. string pubsub_topic = 5 [
  581. (google.api.field_behavior) = OPTIONAL,
  582. (google.api.resource_reference) = {
  583. type: "pubsub.googleapis.com/Topic"
  584. }
  585. ];
  586. // Optional. The email of the trigger's service account. The service account must have
  587. // permission to invoke Cloud Run services, the permission is
  588. // `run.routes.invoke`.
  589. // If empty, defaults to the Compute Engine default service account:
  590. // `{project_number}-compute@developer.gserviceaccount.com`.
  591. string service_account_email = 6 [(google.api.field_behavior) = OPTIONAL];
  592. // Optional. If unset, then defaults to ignoring failures (i.e. not retrying them).
  593. RetryPolicy retry_policy = 7 [(google.api.field_behavior) = OPTIONAL];
  594. // Optional. The name of the channel associated with the trigger in
  595. // `projects/{project}/locations/{location}/channels/{channel}` format.
  596. // You must provide a channel to receive events from Eventarc SaaS partners.
  597. string channel = 8 [
  598. (google.api.field_behavior) = OPTIONAL,
  599. (google.api.resource_reference) = {
  600. type: "eventarc.googleapis.com/Channel"
  601. }
  602. ];
  603. }
  604. // Filters events based on exact matches on the CloudEvents attributes.
  605. message EventFilter {
  606. // Required. The name of a CloudEvents attribute.
  607. string attribute = 1 [(google.api.field_behavior) = REQUIRED];
  608. // Required. The value for the attribute.
  609. string value = 2 [(google.api.field_behavior) = REQUIRED];
  610. // Optional. The operator used for matching the events with the value of the
  611. // filter. If not specified, only events that have an exact key-value pair
  612. // specified in the filter are matched. The only allowed value is
  613. // `match-path-pattern`.
  614. string operator = 3 [(google.api.field_behavior) = OPTIONAL];
  615. }
  616. // Request for the `GetFunction` method.
  617. message GetFunctionRequest {
  618. // Required. The name of the function which details should be obtained.
  619. string name = 1 [
  620. (google.api.field_behavior) = REQUIRED,
  621. (google.api.resource_reference) = {
  622. type: "cloudfunctions.googleapis.com/Function"
  623. }
  624. ];
  625. }
  626. // Request for the `ListFunctions` method.
  627. message ListFunctionsRequest {
  628. // Required. The project and location from which the function should be listed,
  629. // specified in the format `projects/*/locations/*`
  630. // If you want to list functions in all locations, use "-" in place of a
  631. // location. When listing functions in all locations, if one or more
  632. // location(s) are unreachable, the response will contain functions from all
  633. // reachable locations along with the names of any unreachable locations.
  634. string parent = 1 [
  635. (google.api.field_behavior) = REQUIRED,
  636. (google.api.resource_reference) = {
  637. child_type: "cloudfunctions.googleapis.com/Function"
  638. }
  639. ];
  640. // Maximum number of functions to return per call.
  641. int32 page_size = 2;
  642. // The value returned by the last
  643. // `ListFunctionsResponse`; indicates that
  644. // this is a continuation of a prior `ListFunctions` call, and that the
  645. // system should return the next page of data.
  646. string page_token = 3;
  647. // The filter for Functions that match the filter expression,
  648. // following the syntax outlined in https://google.aip.dev/160.
  649. string filter = 4;
  650. // The sorting order of the resources returned. Value should be a comma
  651. // separated list of fields. The default sorting oder is ascending.
  652. // See https://google.aip.dev/132#ordering.
  653. string order_by = 5;
  654. }
  655. // Response for the `ListFunctions` method.
  656. message ListFunctionsResponse {
  657. // The functions that match the request.
  658. repeated Function functions = 1;
  659. // A token, which can be sent as `page_token` to retrieve the next page.
  660. // If this field is omitted, there are no subsequent pages.
  661. string next_page_token = 2;
  662. // Locations that could not be reached. The response does not include any
  663. // functions from these locations.
  664. repeated string unreachable = 3;
  665. }
  666. // Request for the `CreateFunction` method.
  667. message CreateFunctionRequest {
  668. // Required. The project and location in which the function should be created, specified
  669. // in the format `projects/*/locations/*`
  670. string parent = 1 [
  671. (google.api.field_behavior) = REQUIRED,
  672. (google.api.resource_reference) = {
  673. type: "locations.googleapis.com/Location"
  674. }
  675. ];
  676. // Required. Function to be created.
  677. Function function = 2 [(google.api.field_behavior) = REQUIRED];
  678. // The ID to use for the function, which will become the final component of
  679. // the function's resource name.
  680. //
  681. // This value should be 4-63 characters, and valid characters
  682. // are /[a-z][0-9]-/.
  683. string function_id = 3;
  684. }
  685. // Request for the `UpdateFunction` method.
  686. message UpdateFunctionRequest {
  687. // Required. New version of the function.
  688. Function function = 1 [(google.api.field_behavior) = REQUIRED];
  689. // The list of fields to be updated.
  690. // If no field mask is provided, all provided fields in the request will be
  691. // updated.
  692. google.protobuf.FieldMask update_mask = 2;
  693. }
  694. // Request for the `DeleteFunction` method.
  695. message DeleteFunctionRequest {
  696. // Required. The name of the function which should be deleted.
  697. string name = 1 [
  698. (google.api.field_behavior) = REQUIRED,
  699. (google.api.resource_reference) = {
  700. type: "cloudfunctions.googleapis.com/Function"
  701. }
  702. ];
  703. }
  704. // Request of `GenerateSourceUploadUrl` method.
  705. message GenerateUploadUrlRequest {
  706. // Required. The project and location in which the Google Cloud Storage signed URL
  707. // should be generated, specified in the format `projects/*/locations/*`.
  708. string parent = 1 [
  709. (google.api.field_behavior) = REQUIRED,
  710. (google.api.resource_reference) = {
  711. type: "locations.googleapis.com/Location"
  712. }
  713. ];
  714. }
  715. // Response of `GenerateSourceUploadUrl` method.
  716. message GenerateUploadUrlResponse {
  717. // The generated Google Cloud Storage signed URL that should be used for a
  718. // function source code upload. The uploaded file should be a zip archive
  719. // which contains a function.
  720. string upload_url = 1;
  721. // The location of the source code in the upload bucket.
  722. //
  723. // Once the archive is uploaded using the `upload_url` use this field to
  724. // set the `function.build_config.source.storage_source`
  725. // during CreateFunction and UpdateFunction.
  726. //
  727. // Generation defaults to 0, as Cloud Storage provides a new generation only
  728. // upon uploading a new object or version of an object.
  729. StorageSource storage_source = 2;
  730. }
  731. // Request of `GenerateDownloadUrl` method.
  732. message GenerateDownloadUrlRequest {
  733. // Required. The name of function for which source code Google Cloud Storage signed
  734. // URL should be generated.
  735. string name = 1 [
  736. (google.api.field_behavior) = REQUIRED,
  737. (google.api.resource_reference) = {
  738. type: "cloudfunctions.googleapis.com/Function"
  739. }
  740. ];
  741. }
  742. // Response of `GenerateDownloadUrl` method.
  743. message GenerateDownloadUrlResponse {
  744. // The generated Google Cloud Storage signed URL that should be used for
  745. // function source code download.
  746. string download_url = 1;
  747. }
  748. // Request for the `ListRuntimes` method.
  749. message ListRuntimesRequest {
  750. // Required. The project and location from which the runtimes should be listed,
  751. // specified in the format `projects/*/locations/*`
  752. string parent = 1 [
  753. (google.api.field_behavior) = REQUIRED,
  754. (google.api.resource_reference) = {
  755. type: "locations.googleapis.com/Location"
  756. }
  757. ];
  758. // The filter for Runtimes that match the filter expression,
  759. // following the syntax outlined in https://google.aip.dev/160.
  760. string filter = 2;
  761. }
  762. // Response for the `ListRuntimes` method.
  763. message ListRuntimesResponse {
  764. // Describes a runtime and any special information (e.g., deprecation status)
  765. // related to it.
  766. message Runtime {
  767. // The name of the runtime, e.g., 'go113', 'nodejs12', etc.
  768. string name = 1;
  769. // The user facing name, eg 'Go 1.13', 'Node.js 12', etc.
  770. string display_name = 5;
  771. // The stage of life this runtime is in, e.g., BETA, GA, etc.
  772. RuntimeStage stage = 2;
  773. // Warning messages, e.g., a deprecation warning.
  774. repeated string warnings = 3;
  775. // The environment for the runtime.
  776. Environment environment = 4;
  777. }
  778. // The various stages that a runtime can be in.
  779. enum RuntimeStage {
  780. // Not specified.
  781. RUNTIME_STAGE_UNSPECIFIED = 0;
  782. // The runtime is in development.
  783. DEVELOPMENT = 1;
  784. // The runtime is in the Alpha stage.
  785. ALPHA = 2;
  786. // The runtime is in the Beta stage.
  787. BETA = 3;
  788. // The runtime is generally available.
  789. GA = 4;
  790. // The runtime is deprecated.
  791. DEPRECATED = 5;
  792. // The runtime is no longer supported.
  793. DECOMMISSIONED = 6;
  794. }
  795. // The runtimes that match the request.
  796. repeated Runtime runtimes = 1;
  797. }
  798. // Represents the metadata of the long-running operation.
  799. message OperationMetadata {
  800. // The time the operation was created.
  801. google.protobuf.Timestamp create_time = 1;
  802. // The time the operation finished running.
  803. google.protobuf.Timestamp end_time = 2;
  804. // Server-defined resource path for the target of the operation.
  805. string target = 3;
  806. // Name of the verb executed by the operation.
  807. string verb = 4;
  808. // Human-readable status of the operation, if any.
  809. string status_detail = 5;
  810. // Identifies whether the user has requested cancellation
  811. // of the operation. Operations that have successfully been cancelled
  812. // have [Operation.error][] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1,
  813. // corresponding to `Code.CANCELLED`.
  814. bool cancel_requested = 6;
  815. // API version used to start the operation.
  816. string api_version = 7;
  817. // The original request that started the operation.
  818. google.protobuf.Any request_resource = 8;
  819. // Mechanism for reporting in-progress stages
  820. repeated Stage stages = 9;
  821. }
  822. // Each Stage of the deployment process
  823. message Stage {
  824. // Possible names for a Stage
  825. enum Name {
  826. // Not specified. Invalid name.
  827. NAME_UNSPECIFIED = 0;
  828. // Artifact Regsitry Stage
  829. ARTIFACT_REGISTRY = 1;
  830. // Build Stage
  831. BUILD = 2;
  832. // Service Stage
  833. SERVICE = 3;
  834. // Trigger Stage
  835. TRIGGER = 4;
  836. // Service Rollback Stage
  837. SERVICE_ROLLBACK = 5;
  838. // Trigger Rollback Stage
  839. TRIGGER_ROLLBACK = 6;
  840. }
  841. // Possible states for a Stage
  842. enum State {
  843. // Not specified. Invalid state.
  844. STATE_UNSPECIFIED = 0;
  845. // Stage has not started.
  846. NOT_STARTED = 1;
  847. // Stage is in progress.
  848. IN_PROGRESS = 2;
  849. // Stage has completed.
  850. COMPLETE = 3;
  851. }
  852. // Name of the Stage. This will be unique for each Stage.
  853. Name name = 1;
  854. // Message describing the Stage
  855. string message = 2;
  856. // Current state of the Stage
  857. State state = 3;
  858. // Resource of the Stage
  859. string resource = 4;
  860. // Link to the current Stage resource
  861. string resource_uri = 5;
  862. // State messages from the current Stage.
  863. repeated StateMessage state_messages = 6;
  864. }