Struct google_api_proto::google::cloud::functions::v1::CloudFunction
source · pub struct CloudFunction {Show 32 fields
pub name: String,
pub description: String,
pub status: i32,
pub entry_point: String,
pub runtime: String,
pub timeout: Option<Duration>,
pub available_memory_mb: i32,
pub service_account_email: String,
pub update_time: Option<Timestamp>,
pub version_id: i64,
pub labels: BTreeMap<String, String>,
pub environment_variables: BTreeMap<String, String>,
pub build_environment_variables: BTreeMap<String, String>,
pub network: String,
pub max_instances: i32,
pub min_instances: i32,
pub vpc_connector: String,
pub vpc_connector_egress_settings: i32,
pub ingress_settings: i32,
pub kms_key_name: String,
pub build_worker_pool: String,
pub build_id: String,
pub build_name: String,
pub secret_environment_variables: Vec<SecretEnvVar>,
pub secret_volumes: Vec<SecretVolume>,
pub source_token: String,
pub docker_repository: String,
pub docker_registry: i32,
pub build_service_account: String,
pub source_code: Option<SourceCode>,
pub trigger: Option<Trigger>,
pub runtime_update_policy: Option<RuntimeUpdatePolicy>,
}
Expand description
Describes a Cloud Function that contains user computation executed in response to an event. It encapsulate function and triggers configurations.
Fields§
§name: String
A user-defined name of the function. Function names must be unique
globally and match pattern projects/*/locations/*/functions/*
description: String
User-provided description of a function.
status: i32
Output only. Status of the function deployment.
entry_point: String
The name of the function (as defined in source code) that will be executed. Defaults to the resource name suffix (ID of the function), if not specified.
runtime: String
The runtime in which to run the function. Required when deploying a new
function, optional when updating an existing function. For a complete
list of possible choices, see the
gcloud
command
reference.
timeout: Option<Duration>
The function execution timeout. Execution is considered failed and can be terminated if the function is not completed at the end of the timeout period. Defaults to 60 seconds.
available_memory_mb: i32
The amount of memory in MB available for a function. Defaults to 256MB.
service_account_email: String
The email of the function’s service account. If empty, defaults to
{project_id}@appspot.gserviceaccount.com
.
update_time: Option<Timestamp>
Output only. The last update timestamp of a Cloud Function.
version_id: i64
Output only. The version identifier of the Cloud Function. Each deployment attempt results in a new version of a function being created.
labels: BTreeMap<String, String>
Labels associated with this Cloud Function.
environment_variables: BTreeMap<String, String>
Environment variables that shall be available during function execution.
build_environment_variables: BTreeMap<String, String>
Build environment variables that shall be available during build time.
network: String
Deprecated: use vpc_connector
max_instances: i32
The limit on the maximum number of function instances that may coexist at a given time.
In some cases, such as rapid traffic surges, Cloud Functions may, for a short period of time, create more instances than the specified max instances limit. If your function cannot tolerate this temporary behavior, you may want to factor in a safety margin and set a lower max instances value than your function can tolerate.
See the Max Instances Guide for more details.
min_instances: i32
A lower bound for the number function instances that may coexist at a given time.
vpc_connector: String
The VPC Network Connector that this cloud function can connect to. It can
be either the fully-qualified URI, or the short name of the network
connector resource. The format of this field is
projects/*/locations/*/connectors/*
This field is mutually exclusive with network
field and will eventually
replace it.
See the VPC documentation for more information on connecting Cloud projects.
vpc_connector_egress_settings: i32
The egress settings for the connector, controlling what traffic is diverted through it.
ingress_settings: i32
The ingress settings for the function, controlling what traffic can reach it.
kms_key_name: String
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}
.
If specified, you must also provide an artifact registry repository using
the docker_repository
field that was created with the same KMS crypto
key.
The following service accounts need to be granted the role ‘Cloud KMS CryptoKey Encrypter/Decrypter (roles/cloudkms.cryptoKeyEncrypterDecrypter)’ on the Key/KeyRing/Project/Organization (least access preferred).
- Google Cloud Functions service account (service-{project_number}@gcf-admin-robot.iam.gserviceaccount.com) - Required to protect the function’s image.
- Google Storage service account (service-{project_number}@gs-project-accounts.iam.gserviceaccount.com) - Required to protect the function’s source code. If this service account does not exist, deploying a function without a KMS key or retrieving the service agent name provisions it. For more information, see https://cloud.google.com/storage/docs/projects#service-agents and https://cloud.google.com/storage/docs/getting-service-agent#gsutil.
Google Cloud Functions delegates access to service agents to protect function resources in internal projects that are not accessible by the end user.
build_worker_pool: String
Name of the Cloud Build Custom Worker Pool that should be used to build the
function. The format of this field is
projects/{project}/locations/{region}/workerPools/{workerPool}
where
{project}
and {region}
are the project id and region respectively where
the worker pool is defined and {workerPool}
is the short name of the
worker pool.
If the project id is not the same as the function, then the Cloud
Functions Service Agent
(service-<project_number>@gcf-admin-robot.iam.gserviceaccount.com
) must
be granted the role Cloud Build Custom Workers Builder
(roles/cloudbuild.customworkers.builder
) in the project.
build_id: String
Output only. The Cloud Build ID of the latest successful deployment of the function.
build_name: String
Output only. The Cloud Build Name of the function deployment.
projects/<project-number>/locations/<region>/builds/<build-id>
.
secret_environment_variables: Vec<SecretEnvVar>
Secret environment variables configuration.
secret_volumes: Vec<SecretVolume>
Secret volumes configuration.
source_token: String
Input only. An identifier for Firebase function sources. Disclaimer: This field is only supported for Firebase function deployments.
docker_repository: String
User-managed repository created in Artifact Registry to which the
function’s Docker image will be pushed after it is built by Cloud Build.
May optionally be encrypted with a customer-managed encryption key (CMEK).
If unspecified and docker_registry
is not explicitly set to
CONTAINER_REGISTRY
, GCF will create and use a default Artifact Registry
repository named ‘gcf-artifacts’ in the region.
It must match the pattern
projects/{project}/locations/{location}/repositories/{repository}
.
Cross-project repositories are not supported. Cross-location repositories are not supported. Repository format must be ‘DOCKER’.
docker_registry: i32
Docker Registry to use for this deployment.
If unspecified, it defaults to ARTIFACT_REGISTRY
.
If docker_repository
field is specified, this field should either be left
unspecified or set to ARTIFACT_REGISTRY
.
build_service_account: String
A service account the user provides for use with Cloud Build. The format of
this field is
projects/{projectId}/serviceAccounts/{serviceAccountEmail}
.
source_code: Option<SourceCode>
The location of the function source code.
trigger: Option<Trigger>
An event that triggers the function.
runtime_update_policy: Option<RuntimeUpdatePolicy>
This controls when security patches are applied to the runtime environment.
Implementations§
source§impl CloudFunction
impl CloudFunction
sourcepub fn status(&self) -> CloudFunctionStatus
pub fn status(&self) -> CloudFunctionStatus
Returns the enum value of status
, or the default if the field is set to an invalid enum value.
sourcepub fn set_status(&mut self, value: CloudFunctionStatus)
pub fn set_status(&mut self, value: CloudFunctionStatus)
Sets status
to the provided enum value.
sourcepub fn vpc_connector_egress_settings(&self) -> VpcConnectorEgressSettings
pub fn vpc_connector_egress_settings(&self) -> VpcConnectorEgressSettings
Returns the enum value of vpc_connector_egress_settings
, or the default if the field is set to an invalid enum value.
sourcepub fn set_vpc_connector_egress_settings(
&mut self,
value: VpcConnectorEgressSettings,
)
pub fn set_vpc_connector_egress_settings( &mut self, value: VpcConnectorEgressSettings, )
Sets vpc_connector_egress_settings
to the provided enum value.
sourcepub fn ingress_settings(&self) -> IngressSettings
pub fn ingress_settings(&self) -> IngressSettings
Returns the enum value of ingress_settings
, or the default if the field is set to an invalid enum value.
sourcepub fn set_ingress_settings(&mut self, value: IngressSettings)
pub fn set_ingress_settings(&mut self, value: IngressSettings)
Sets ingress_settings
to the provided enum value.
sourcepub fn docker_registry(&self) -> DockerRegistry
pub fn docker_registry(&self) -> DockerRegistry
Returns the enum value of docker_registry
, or the default if the field is set to an invalid enum value.
sourcepub fn set_docker_registry(&mut self, value: DockerRegistry)
pub fn set_docker_registry(&mut self, value: DockerRegistry)
Sets docker_registry
to the provided enum value.
Trait Implementations§
source§impl Clone for CloudFunction
impl Clone for CloudFunction
source§fn clone(&self) -> CloudFunction
fn clone(&self) -> CloudFunction
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CloudFunction
impl Debug for CloudFunction
source§impl Default for CloudFunction
impl Default for CloudFunction
source§impl Message for CloudFunction
impl Message for CloudFunction
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for CloudFunction
impl PartialEq for CloudFunction
source§fn eq(&self, other: &CloudFunction) -> bool
fn eq(&self, other: &CloudFunction) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for CloudFunction
Auto Trait Implementations§
impl Freeze for CloudFunction
impl RefUnwindSafe for CloudFunction
impl Send for CloudFunction
impl Sync for CloudFunction
impl Unpin for CloudFunction
impl UnwindSafe for CloudFunction
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request