pub struct ProjectMethods<'a, C>where
C: 'a,{ /* private fields */ }
Expand description
A builder providing access to all methods supported on project resources.
It is not used directly, but through the Compute
hub.
§Example
Instantiate a resource builder
extern crate hyper;
extern crate hyper_rustls;
extern crate google_compute1 as compute1;
use compute1::{Compute, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
let secret: yup_oauth2::ApplicationSecret = Default::default();
let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
secret,
yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
).build().await.unwrap();
let client = hyper_util::client::legacy::Client::builder(
hyper_util::rt::TokioExecutor::new()
)
.build(
hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.unwrap()
.https_or_http()
.enable_http1()
.build()
);
let mut hub = Compute::new(client, auth);
// Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
// like `disable_xpn_host(...)`, `disable_xpn_resource(...)`, `enable_xpn_host(...)`, `enable_xpn_resource(...)`, `get(...)`, `get_xpn_host(...)`, `get_xpn_resources(...)`, `list_xpn_hosts(...)`, `move_disk(...)`, `move_instance(...)`, `set_cloud_armor_tier(...)`, `set_common_instance_metadata(...)`, `set_default_network_tier(...)` and `set_usage_export_bucket(...)`
// to build up your call.
let rb = hub.projects();
Implementations§
Source§impl<'a, C> ProjectMethods<'a, C>
impl<'a, C> ProjectMethods<'a, C>
Sourcepub fn disable_xpn_host(
&self,
project: &str,
) -> ProjectDisableXpnHostCall<'a, C>
pub fn disable_xpn_host( &self, project: &str, ) -> ProjectDisableXpnHostCall<'a, C>
Create a builder to help you perform the following task:
Disable this project as a shared VPC host project.
§Arguments
project
- Project ID for this request.
Sourcepub fn disable_xpn_resource(
&self,
request: ProjectsDisableXpnResourceRequest,
project: &str,
) -> ProjectDisableXpnResourceCall<'a, C>
pub fn disable_xpn_resource( &self, request: ProjectsDisableXpnResourceRequest, project: &str, ) -> ProjectDisableXpnResourceCall<'a, C>
Create a builder to help you perform the following task:
Disable a service resource (also known as service project) associated with this host project.
§Arguments
request
- No description provided.project
- Project ID for this request.
Sourcepub fn enable_xpn_host(&self, project: &str) -> ProjectEnableXpnHostCall<'a, C>
pub fn enable_xpn_host(&self, project: &str) -> ProjectEnableXpnHostCall<'a, C>
Create a builder to help you perform the following task:
Enable this project as a shared VPC host project.
§Arguments
project
- Project ID for this request.
Sourcepub fn enable_xpn_resource(
&self,
request: ProjectsEnableXpnResourceRequest,
project: &str,
) -> ProjectEnableXpnResourceCall<'a, C>
pub fn enable_xpn_resource( &self, request: ProjectsEnableXpnResourceRequest, project: &str, ) -> ProjectEnableXpnResourceCall<'a, C>
Create a builder to help you perform the following task:
Enable service resource (a.k.a service project) for a host project, so that subnets in the host project can be used by instances in the service project.
§Arguments
request
- No description provided.project
- Project ID for this request.
Sourcepub fn get(&self, project: &str) -> ProjectGetCall<'a, C>
pub fn get(&self, project: &str) -> ProjectGetCall<'a, C>
Create a builder to help you perform the following task:
Returns the specified Project 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.
§Arguments
project
- Project ID for this request.
Sourcepub fn get_xpn_host(&self, project: &str) -> ProjectGetXpnHostCall<'a, C>
pub fn get_xpn_host(&self, project: &str) -> ProjectGetXpnHostCall<'a, C>
Create a builder to help you perform the following task:
Gets the shared VPC host project that this project links to. May be empty if no link exists.
§Arguments
project
- Project ID for this request.
Sourcepub fn get_xpn_resources(
&self,
project: &str,
) -> ProjectGetXpnResourceCall<'a, C>
pub fn get_xpn_resources( &self, project: &str, ) -> ProjectGetXpnResourceCall<'a, C>
Create a builder to help you perform the following task:
Gets service resources (a.k.a service project) associated with this host project.
§Arguments
project
- Project ID for this request.
Sourcepub fn list_xpn_hosts(
&self,
request: ProjectsListXpnHostsRequest,
project: &str,
) -> ProjectListXpnHostCall<'a, C>
pub fn list_xpn_hosts( &self, request: ProjectsListXpnHostsRequest, project: &str, ) -> ProjectListXpnHostCall<'a, C>
Create a builder to help you perform the following task:
Lists all shared VPC host projects visible to the user in an organization.
§Arguments
request
- No description provided.project
- Project ID for this request.
Sourcepub fn move_disk(
&self,
request: DiskMoveRequest,
project: &str,
) -> ProjectMoveDiskCall<'a, C>
pub fn move_disk( &self, request: DiskMoveRequest, project: &str, ) -> ProjectMoveDiskCall<'a, C>
Create a builder to help you perform the following task:
Moves a persistent disk from one zone to another.
§Arguments
request
- No description provided.project
- Project ID for this request.
Sourcepub fn move_instance(
&self,
request: InstanceMoveRequest,
project: &str,
) -> ProjectMoveInstanceCall<'a, C>
pub fn move_instance( &self, request: InstanceMoveRequest, project: &str, ) -> ProjectMoveInstanceCall<'a, C>
Create a builder to help you perform the following task:
Moves an instance and its attached persistent disks from one zone to another. Note: Moving VMs or disks by using this method might cause unexpected behavior. For more information, see the known issue. [Deprecated] This method is deprecated. See moving instance across zones instead.
§Arguments
request
- No description provided.project
- Project ID for this request.
Sourcepub fn set_cloud_armor_tier(
&self,
request: ProjectsSetCloudArmorTierRequest,
project: &str,
) -> ProjectSetCloudArmorTierCall<'a, C>
pub fn set_cloud_armor_tier( &self, request: ProjectsSetCloudArmorTierRequest, project: &str, ) -> ProjectSetCloudArmorTierCall<'a, C>
Create a builder to help you perform the following task:
Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the billing account of the project must be subscribed to Cloud Armor Enterprise. See Subscribing to Cloud Armor Enterprise for more information.
§Arguments
request
- No description provided.project
- Project ID for this request.
Sourcepub fn set_common_instance_metadata(
&self,
request: Metadata,
project: &str,
) -> ProjectSetCommonInstanceMetadataCall<'a, C>
pub fn set_common_instance_metadata( &self, request: Metadata, project: &str, ) -> ProjectSetCommonInstanceMetadataCall<'a, C>
Create a builder to help you perform the following task:
Sets metadata common to all instances within the specified project using the data included in the request.
§Arguments
request
- No description provided.project
- Project ID for this request.
Sourcepub fn set_default_network_tier(
&self,
request: ProjectsSetDefaultNetworkTierRequest,
project: &str,
) -> ProjectSetDefaultNetworkTierCall<'a, C>
pub fn set_default_network_tier( &self, request: ProjectsSetDefaultNetworkTierRequest, project: &str, ) -> ProjectSetDefaultNetworkTierCall<'a, C>
Create a builder to help you perform the following task:
Sets the default network tier of the project. The default network tier is used when an address/forwardingRule/instance is created without specifying the network tier field.
§Arguments
request
- No description provided.project
- Project ID for this request.
Sourcepub fn set_usage_export_bucket(
&self,
request: UsageExportLocation,
project: &str,
) -> ProjectSetUsageExportBucketCall<'a, C>
pub fn set_usage_export_bucket( &self, request: UsageExportLocation, project: &str, ) -> ProjectSetUsageExportBucketCall<'a, C>
Create a builder to help you perform the following task:
Enables the usage export feature and sets the usage export bucket where reports are stored. If you provide an empty request body using this method, the usage export feature will be disabled.
§Arguments
request
- No description provided.project
- Project ID for this request.
Trait Implementations§
impl<'a, C> MethodsBuilder for ProjectMethods<'a, C>
Auto Trait Implementations§
impl<'a, C> Freeze for ProjectMethods<'a, C>
impl<'a, C> !RefUnwindSafe for ProjectMethods<'a, C>
impl<'a, C> Send for ProjectMethods<'a, C>where
C: Sync,
impl<'a, C> Sync for ProjectMethods<'a, C>where
C: Sync,
impl<'a, C> Unpin for ProjectMethods<'a, C>
impl<'a, C> !UnwindSafe for ProjectMethods<'a, C>
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> 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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more