Skip to content

Commit

Permalink
feat: ListFunctions now include metadata which indicates whether a fu…
Browse files Browse the repository at this point in the history
…nction is a `GEN_1` or `GEN_2` function

PiperOrigin-RevId: 535193873
  • Loading branch information
Google APIs authored and Copybara-Service committed May 25, 2023
1 parent d0da39a commit d6b7eb5
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 25 deletions.
6 changes: 1 addition & 5 deletions google/cloud/functions/v2/cloudfunctions_v2.yaml
Expand Up @@ -10,6 +10,7 @@ apis:
- name: google.longrunning.Operations

types:
- name: google.cloud.functions.v2.LocationMetadata
- name: google.cloud.functions.v2.OperationMetadata

documentation:
Expand Down Expand Up @@ -43,11 +44,6 @@ events.'
permission-aware UIs and command-line tools, not for authorization
checking. This operation may "fail open" without warning.
- selector: google.longrunning.Operations.ListOperations
description: |-
Lists operations that match the specified filter in the request. If
the server doesn't support this method, it returns `UNIMPLEMENTED`.
backend:
rules:
- selector: 'google.cloud.functions.v2.FunctionService.*'
Expand Down
45 changes: 25 additions & 20 deletions google/cloud/functions/v2/functions.proto
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2023 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -241,9 +241,6 @@ message Function {
// globally and match pattern `projects/*/locations/*/functions/*`
string name = 1;

// Describe whether the function is 1st Gen or 2nd Gen.
Environment environment = 10;

// User-provided description of a function.
string description = 2;

Expand Down Expand Up @@ -273,17 +270,20 @@ message Function {
repeated StateMessage state_messages = 9
[(google.api.field_behavior) = OUTPUT_ONLY];

// Resource name of a KMS crypto key (managed by the user) used to
// Describe whether the function is 1st Gen or 2nd Gen.
Environment environment = 10;

// Output only. The deployed url for the function.
string url = 14 [(google.api.field_behavior) = OUTPUT_ONLY];

// [Preview] Resource name of a KMS crypto key (managed by the user) used to
// encrypt/decrypt function resources.
//
// It must match the pattern
// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
string kms_key_name = 25 [(google.api.resource_reference) = {
type: "cloudkms.googleapis.com/CryptoKey"
}];

// Output only. The deployed url for the function.
string url = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
}

// Informational messages about the state of the Cloud Function or Operation.
Expand Down Expand Up @@ -467,18 +467,18 @@ message BuildConfig {
// User-provided build-time environment variables for the function
map<string, string> environment_variables = 6;

// Optional. Docker Registry to use for this deployment. This configuration is
// only applicable to 1st Gen functions, 2nd Gen functions can only use
// Artifact Registry.
// Docker Registry to use for this deployment. This configuration is only
// applicable to 1st Gen functions, 2nd Gen functions can only use Artifact
// Registry.
//
// If `docker_repository` field is specified, this field will be automatically
// set as `ARTIFACT_REGISTRY`.
// If unspecified, it currently defaults to `CONTAINER_REGISTRY`.
// This field may be overridden by the backend for eligible deployments.
DockerRegistry docker_registry = 10 [(google.api.field_behavior) = OPTIONAL];
DockerRegistry docker_registry = 10;

// User managed repository created in Artifact Registry optionally with a
// customer managed encryption key. This is the repository to which the
// User managed repository created in Artifact Registry optionally
// with a customer managed encryption key. This is the repository to which the
// function docker image will be pushed after it is built by Cloud Build.
// If unspecified, GCF will create and use a repository named 'gcf-artifacts'
// for every deployed region.
Expand All @@ -496,7 +496,6 @@ message BuildConfig {

// Describes the Service being deployed.
// Currently Supported : Cloud Run (fully managed).
// Next tag: 23
message ServiceConfig {
// Available egress settings.
//
Expand Down Expand Up @@ -537,7 +536,7 @@ message ServiceConfig {
//
// This enforces security protocol on function URL.
//
// Security level is only ocnfigurable for 1st Gen functions, If unspecified,
// Security level is only configurable for 1st Gen functions, If unspecified,
// SECURE_OPTIONAL will be used. 2nd Gen functions are SECURE_ALWAYS ONLY.
enum SecurityLevel {
// Unspecified.
Expand Down Expand Up @@ -575,7 +574,7 @@ message ServiceConfig {
// a full description.
string available_memory = 13;

// The number of CPUs used in a single container instance.
// [Preview] The number of CPUs used in a single container instance.
// Default value is calculated from available memory.
// Supports the same values as Cloud Run, see
// https://cloud.google.com/run/docs/reference/rest/v1/Container#resourcerequirements
Expand Down Expand Up @@ -647,8 +646,8 @@ message ServiceConfig {
// Output only. The name of service revision.
string revision = 18 [(google.api.field_behavior) = OUTPUT_ONLY];

// Sets the maximum number of concurrent requests that each instance can
// receive. Defaults to 1.
// [Preview] Sets the maximum number of concurrent requests that each instance
// can receive. Defaults to 1.
int32 max_instance_request_concurrency = 20;

// Security level configure whether the function only accepts https.
Expand Down Expand Up @@ -925,7 +924,7 @@ message GenerateUploadUrlRequest {
}
];

// Resource name of a KMS crypto key (managed by the user) used to
// [Preview] Resource name of a KMS crypto key (managed by the user) used to
// encrypt/decrypt function source code objects in intermediate Cloud Storage
// buckets. When you generate an upload url and upload your source code, it
// gets copied to an intermediate Cloud Storage bucket. The source code is
Expand Down Expand Up @@ -1081,6 +1080,12 @@ message OperationMetadata {
repeated Stage stages = 9;
}

// Extra GCF specific location information.
message LocationMetadata {
// The Cloud Function environments this location supports.
repeated Environment environments = 1;
}

// Each Stage of the deployment process
message Stage {
// Possible names for a Stage
Expand Down

0 comments on commit d6b7eb5

Please sign in to comment.