ServiceConfig

Struct ServiceConfig 

Source
#[non_exhaustive]
pub struct ServiceConfig {
Show 19 fields pub service: String, pub timeout_seconds: i32, pub available_memory: String, pub available_cpu: String, pub environment_variables: HashMap<String, String>, pub max_instance_count: i32, pub min_instance_count: i32, pub vpc_connector: String, pub vpc_connector_egress_settings: VpcConnectorEgressSettings, pub ingress_settings: IngressSettings, pub uri: String, pub service_account_email: String, pub all_traffic_on_latest_revision: bool, pub secret_environment_variables: Vec<SecretEnvVar>, pub secret_volumes: Vec<SecretVolume>, pub revision: String, pub max_instance_request_concurrency: i32, pub security_level: SecurityLevel, pub binary_authorization_policy: String, /* private fields */
}
Expand description

Describes the Service being deployed. Currently Supported : Cloud Run (fully managed).

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§service: String

Output only. Name of the service associated with a Function. The format of this field is projects/{project}/locations/{region}/services/{service}

§timeout_seconds: i32

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: String

The amount of memory available for a function. Defaults to 256M. Supported units are k, M, G, Mi, Gi. If no unit is supplied the value is interpreted as bytes. See https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/apimachinery/pkg/api/resource/quantity.go a full description.

§available_cpu: String

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 Example: “1” indicates 1 vCPU

§environment_variables: HashMap<String, String>

Environment variables that shall be available during function execution.

§max_instance_count: 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_instance_count: i32

The limit on the minimum number of function instances that may coexist at a given time.

Function instances are kept in idle state for a short period after they finished executing the request to reduce cold start time for subsequent requests. Setting a minimum instance count will ensure that the given number of instances are kept running in idle state always. This can help with cold start times when jump in incoming request count occurs after the idle instance would have been stopped in the default case.

§vpc_connector: String

The Serverless VPC Access connector that this cloud function can connect to. The format of this field is projects/*/locations/*/connectors/*.

§vpc_connector_egress_settings: VpcConnectorEgressSettings

The egress settings for the connector, controlling what traffic is diverted through it.

§ingress_settings: IngressSettings

The ingress settings for the function, controlling what traffic can reach it.

§uri: String

Output only. URI of the Service deployed.

§service_account_email: String

The email of the service’s service account. If empty, defaults to {project_number}-compute@developer.gserviceaccount.com.

§all_traffic_on_latest_revision: bool

Whether 100% of traffic is routed to the latest revision. On CreateFunction and UpdateFunction, when set to true, the revision being deployed will serve 100% of traffic, ignoring any traffic split settings, if any. On GetFunction, true will be returned if the latest revision is serving 100% of traffic.

§secret_environment_variables: Vec<SecretEnvVar>

Secret environment variables configuration.

§secret_volumes: Vec<SecretVolume>

Secret volumes configuration.

§revision: String

Output only. The name of service revision.

§max_instance_request_concurrency: i32

Sets the maximum number of concurrent requests that each instance can receive. Defaults to 1.

§security_level: SecurityLevel

Security level configure whether the function only accepts https. This configuration is only applicable to 1st Gen functions with Http trigger. By default https is optional for 1st Gen functions; 2nd Gen functions are https ONLY.

§binary_authorization_policy: String

Optional. The binary authorization policy to be checked when deploying the Cloud Run service.

Implementations§

Source§

impl ServiceConfig

Source

pub fn new() -> Self

Source

pub fn set_service<T: Into<String>>(self, v: T) -> Self

Sets the value of service.

Source

pub fn set_timeout_seconds<T: Into<i32>>(self, v: T) -> Self

Sets the value of timeout_seconds.

Source

pub fn set_available_memory<T: Into<String>>(self, v: T) -> Self

Sets the value of available_memory.

Source

pub fn set_available_cpu<T: Into<String>>(self, v: T) -> Self

Sets the value of available_cpu.

Source

pub fn set_environment_variables<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Sets the value of environment_variables.

Source

pub fn set_max_instance_count<T: Into<i32>>(self, v: T) -> Self

Sets the value of max_instance_count.

Source

pub fn set_min_instance_count<T: Into<i32>>(self, v: T) -> Self

Sets the value of min_instance_count.

Source

pub fn set_vpc_connector<T: Into<String>>(self, v: T) -> Self

Sets the value of vpc_connector.

Source

pub fn set_vpc_connector_egress_settings<T: Into<VpcConnectorEgressSettings>>( self, v: T, ) -> Self

Sets the value of vpc_connector_egress_settings.

Source

pub fn set_ingress_settings<T: Into<IngressSettings>>(self, v: T) -> Self

Sets the value of ingress_settings.

Source

pub fn set_uri<T: Into<String>>(self, v: T) -> Self

Sets the value of uri.

Source

pub fn set_service_account_email<T: Into<String>>(self, v: T) -> Self

Sets the value of service_account_email.

Source

pub fn set_all_traffic_on_latest_revision<T: Into<bool>>(self, v: T) -> Self

Sets the value of all_traffic_on_latest_revision.

Source

pub fn set_secret_environment_variables<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<SecretEnvVar>,

Sets the value of secret_environment_variables.

Source

pub fn set_secret_volumes<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<SecretVolume>,

Sets the value of secret_volumes.

Source

pub fn set_revision<T: Into<String>>(self, v: T) -> Self

Sets the value of revision.

Source

pub fn set_max_instance_request_concurrency<T: Into<i32>>(self, v: T) -> Self

Source

pub fn set_security_level<T: Into<SecurityLevel>>(self, v: T) -> Self

Sets the value of security_level.

Source

pub fn set_binary_authorization_policy<T: Into<String>>(self, v: T) -> Self

Sets the value of binary_authorization_policy.

Trait Implementations§

Source§

impl Clone for ServiceConfig

Source§

fn clone(&self) -> ServiceConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ServiceConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ServiceConfig

Source§

fn default() -> ServiceConfig

Returns the “default value” for a type. Read more
Source§

impl Message for ServiceConfig

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for ServiceConfig

Source§

fn eq(&self, other: &ServiceConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for ServiceConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,