pub struct CloudFunction {Show 17 fields
pub name: String,
pub status: i32,
pub latest_operation: String,
pub entry_point: String,
pub runtime: String,
pub timeout: Option<Duration>,
pub available_memory_mb: i32,
pub service_account: String,
pub update_time: Option<Timestamp>,
pub version_id: i64,
pub labels: HashMap<String, String>,
pub environment_variables: HashMap<String, String>,
pub max_instances: i32,
pub network: String,
pub vpc_connector: String,
pub source_code: Option<SourceCode>,
pub trigger: Option<Trigger>,
}
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/*
status: i32
Output only. Status of the function deployment.
latest_operation: String
Output only. Name of the most recent operation modifying the function. If
the function status is DEPLOYING
or DELETING
, then it points to the
active operation.
entry_point: String
The name of the function (as defined in source code) that will be
executed. Defaults to the resource name suffix, if not specified. For
backward compatibility, if function with given name is not found, then the
system will try to use function named “function”.
For Node.js this is name of a function exported by the module specified
in source_location
.
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: 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: HashMap<String, String>
Labels associated with this Cloud Function.
environment_variables: HashMap<String, String>
Environment variables that shall be available during function execution.
max_instances: i32
The limit on the maximum number of function instances that may coexist at a given time.
network: String
The VPC Network that this cloud function can connect to. It can be
either the fully-qualified URI, or the short name of the network resource.
If the short network name is used, the network must belong to the same
project. Otherwise, it must belong to a project within the same
organization. The format of this field is either
projects/{project}/global/networks/{network}
or {network}
, where
{project} is a project id where the network is defined, and {network} is
the short name of the network.
This field is mutually exclusive with vpc_connector
and will be replaced
by it.
See the VPC documentation for more information on connecting Cloud projects.
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.
source_code: Option<SourceCode>
The location of the function source code.
trigger: Option<Trigger>
An event that triggers the function.
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.
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§fn default() -> CloudFunction
fn default() -> CloudFunction
Source§impl Message for CloudFunction
impl Message for CloudFunction
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.Source§impl PartialEq for CloudFunction
impl PartialEq for CloudFunction
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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