pub struct Regions { /* private fields */ }regions only.Expand description
Implements a client for the Google Compute Engine API.
§Example
let client = Regions::builder().build().await?;
// use `client` to make requests to the Google Compute Engine API.§Service Description
Service for the regions resource.
§Configuration
To configure Regions use the with_* methods in the type returned
by builder(). The default configuration should
work for most applications. Common configuration changes include
- with_endpoint(): by default this client uses the global default endpoint
(
https://compute.googleapis.com). Applications using regional endpoints or running in restricted networks (e.g. a network configured override this default. - with_credentials(): by default this client uses Application Default Credentials. Applications using custom authentication may need to override this default.
§Pooling and Cloning
Regions holds a connection pool internally, it is advised to
create one and the reuse it. You do not need to wrap Regions in
an Rc or Arc to reuse it, because it
already uses an Arc internally.
Implementations§
Source§impl Regions
impl Regions
Sourcepub fn builder() -> ClientBuilder
pub fn builder() -> ClientBuilder
Returns a builder for Regions.
let client = Regions::builder().build().await?;Sourcepub fn from_stub<T>(stub: T) -> Selfwhere
T: Regions + 'static,
pub fn from_stub<T>(stub: T) -> Selfwhere
T: Regions + 'static,
Creates a new client from the provided stub.
The most common case for calling this function is in tests mocking the client’s behavior.
Sourcepub fn get(&self) -> Get
pub fn get(&self) -> Get
Returns the specified Region resource.
To decrease latency for this method, you can optionally omit any unneeded
information from the response by using a field mask. This practice is
especially recommended for unused quota information (the quotas field).
To exclude one or more fields, set your request’s fields query parameter
to only include the fields you need. For example, to only include the id
and selfLink fields, add the query parameter ?fields=id,selfLink to
your request.
This method fails if the quota information is unavailable for the region
and if the organization policy constraint
compute.requireBasicQuotaInResponse is enforced. This
constraint, when enforced, disables the fail-open behaviour when quota
information (the items.quotas field) is unavailable for the region.
It is recommended to use the default setting
for the constraint unless your application requires the fail-closed
behaviour for this method.
Sourcepub fn list(&self) -> List
pub fn list(&self) -> List
Retrieves the list of region resources available to the specified project.
To decrease latency for this method, you can optionally omit any unneeded
information from the response by using a field mask. This practice is
especially recommended for unused quota information
(the items.quotas field).
To exclude one or more fields, set your request’s fields query parameter
to only include the fields you need. For example, to only include the id
and selfLink fields, add the query parameter ?fields=id,selfLink to
your request.
This method fails if the quota information is unavailable for the region
and if the organization policy constraint
compute.requireBasicQuotaInResponse is enforced. This
constraint, when enforced, disables the fail-open behaviour when quota
information (the items.quotas field) is unavailable for the region.
It is recommended to use the default setting
for the constraint unless your application requires the fail-closed
behaviour for this method.