Struct ProjectMethods

Source
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>

Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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.
Source

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§

Source§

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> 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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
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<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> ErasedDestructor for T
where T: 'static,