[−][src]Struct google_compute1::Compute
Central instance to access all Compute related resource activities
Examples
Instantiate a new hub
extern crate hyper; extern crate hyper_rustls; extern crate yup_oauth2 as oauth2; extern crate google_compute1 as compute1; use compute1::{Result, Error}; use std::default::Default; use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage}; use compute1::Compute; // Get an ApplicationSecret instance by some means. It contains the `client_id` and // `client_secret`, among other things. let secret: ApplicationSecret = Default::default(); // Instantiate the authenticator. It will choose a suitable authentication flow for you, // unless you replace `None` with the desired Flow. // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and // retrieve them from storage. let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate, hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), <MemoryStorage as Default>::default(), None); let mut hub = Compute::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth); // You can configure optional parameters by calling the respective setters at will, and // execute the final call using `doit()`. // Values shown here are possibly random and not representative ! let result = hub.instances().set_disk_auto_delete("project", "zone", "instance", true, "deviceName") .request_id("sadipscing") .doit(); match result { Err(e) => match e { // The Error enum provides details about what exactly happened. // You can also just use its `Debug`, `Display` or `Error` traits Error::HttpError(_) |Error::MissingAPIKey |Error::MissingToken(_) |Error::Cancelled |Error::UploadSizeLimitExceeded(_, _) |Error::Failure(_) |Error::BadRequest(_) |Error::FieldClash(_) |Error::JsonDecodeError(_, _) => println!("{}", e), }, Ok(res) => println!("Success: {:?}", res), }
Methods
impl<'a, C, A> Compute<C, A> where
C: BorrowMut<Client>,
A: GetToken,
[src]
C: BorrowMut<Client>,
A: GetToken,
pub fn new(client: C, authenticator: A) -> Compute<C, A>
[src]
pub fn accelerator_types(&'a self) -> AcceleratorTypeMethods<'a, C, A>
[src]
pub fn addresses(&'a self) -> AddresseMethods<'a, C, A>
[src]
pub fn autoscalers(&'a self) -> AutoscalerMethods<'a, C, A>
[src]
pub fn backend_buckets(&'a self) -> BackendBucketMethods<'a, C, A>
[src]
pub fn backend_services(&'a self) -> BackendServiceMethods<'a, C, A>
[src]
pub fn disk_types(&'a self) -> DiskTypeMethods<'a, C, A>
[src]
pub fn disks(&'a self) -> DiskMethods<'a, C, A>
[src]
pub fn firewalls(&'a self) -> FirewallMethods<'a, C, A>
[src]
pub fn forwarding_rules(&'a self) -> ForwardingRuleMethods<'a, C, A>
[src]
pub fn global_addresses(&'a self) -> GlobalAddresseMethods<'a, C, A>
[src]
pub fn global_forwarding_rules(
&'a self
) -> GlobalForwardingRuleMethods<'a, C, A>
[src]
&'a self
) -> GlobalForwardingRuleMethods<'a, C, A>
pub fn global_operations(&'a self) -> GlobalOperationMethods<'a, C, A>
[src]
pub fn health_checks(&'a self) -> HealthCheckMethods<'a, C, A>
[src]
pub fn http_health_checks(&'a self) -> HttpHealthCheckMethods<'a, C, A>
[src]
pub fn https_health_checks(&'a self) -> HttpsHealthCheckMethods<'a, C, A>
[src]
pub fn images(&'a self) -> ImageMethods<'a, C, A>
[src]
pub fn instance_group_managers(
&'a self
) -> InstanceGroupManagerMethods<'a, C, A>
[src]
&'a self
) -> InstanceGroupManagerMethods<'a, C, A>
pub fn instance_groups(&'a self) -> InstanceGroupMethods<'a, C, A>
[src]
pub fn instance_templates(&'a self) -> InstanceTemplateMethods<'a, C, A>
[src]
pub fn instances(&'a self) -> InstanceMethods<'a, C, A>
[src]
pub fn interconnect_attachments(
&'a self
) -> InterconnectAttachmentMethods<'a, C, A>
[src]
&'a self
) -> InterconnectAttachmentMethods<'a, C, A>
pub fn interconnect_locations(&'a self) -> InterconnectLocationMethods<'a, C, A>
[src]
pub fn interconnects(&'a self) -> InterconnectMethods<'a, C, A>
[src]
pub fn license_codes(&'a self) -> LicenseCodeMethods<'a, C, A>
[src]
pub fn licenses(&'a self) -> LicenseMethods<'a, C, A>
[src]
pub fn machine_types(&'a self) -> MachineTypeMethods<'a, C, A>
[src]
pub fn network_endpoint_groups(
&'a self
) -> NetworkEndpointGroupMethods<'a, C, A>
[src]
&'a self
) -> NetworkEndpointGroupMethods<'a, C, A>
pub fn networks(&'a self) -> NetworkMethods<'a, C, A>
[src]
pub fn node_groups(&'a self) -> NodeGroupMethods<'a, C, A>
[src]
pub fn node_templates(&'a self) -> NodeTemplateMethods<'a, C, A>
[src]
pub fn node_types(&'a self) -> NodeTypeMethods<'a, C, A>
[src]
pub fn projects(&'a self) -> ProjectMethods<'a, C, A>
[src]
pub fn region_autoscalers(&'a self) -> RegionAutoscalerMethods<'a, C, A>
[src]
pub fn region_backend_services(
&'a self
) -> RegionBackendServiceMethods<'a, C, A>
[src]
&'a self
) -> RegionBackendServiceMethods<'a, C, A>
pub fn region_commitments(&'a self) -> RegionCommitmentMethods<'a, C, A>
[src]
pub fn region_disk_types(&'a self) -> RegionDiskTypeMethods<'a, C, A>
[src]
pub fn region_disks(&'a self) -> RegionDiskMethods<'a, C, A>
[src]
pub fn region_instance_group_managers(
&'a self
) -> RegionInstanceGroupManagerMethods<'a, C, A>
[src]
&'a self
) -> RegionInstanceGroupManagerMethods<'a, C, A>
pub fn region_instance_groups(&'a self) -> RegionInstanceGroupMethods<'a, C, A>
[src]
pub fn region_operations(&'a self) -> RegionOperationMethods<'a, C, A>
[src]
pub fn regions(&'a self) -> RegionMethods<'a, C, A>
[src]
pub fn reservations(&'a self) -> ReservationMethods<'a, C, A>
[src]
pub fn resource_policies(&'a self) -> ResourcePolicyMethods<'a, C, A>
[src]
pub fn routers(&'a self) -> RouterMethods<'a, C, A>
[src]
pub fn routes(&'a self) -> RouteMethods<'a, C, A>
[src]
pub fn security_policies(&'a self) -> SecurityPolicyMethods<'a, C, A>
[src]
pub fn snapshots(&'a self) -> SnapshotMethods<'a, C, A>
[src]
pub fn ssl_certificates(&'a self) -> SslCertificateMethods<'a, C, A>
[src]
pub fn ssl_policies(&'a self) -> SslPolicyMethods<'a, C, A>
[src]
pub fn subnetworks(&'a self) -> SubnetworkMethods<'a, C, A>
[src]
pub fn target_http_proxies(&'a self) -> TargetHttpProxyMethods<'a, C, A>
[src]
pub fn target_https_proxies(&'a self) -> TargetHttpsProxyMethods<'a, C, A>
[src]
pub fn target_instances(&'a self) -> TargetInstanceMethods<'a, C, A>
[src]
pub fn target_pools(&'a self) -> TargetPoolMethods<'a, C, A>
[src]
pub fn target_ssl_proxies(&'a self) -> TargetSslProxyMethods<'a, C, A>
[src]
pub fn target_tcp_proxies(&'a self) -> TargetTcpProxyMethods<'a, C, A>
[src]
pub fn target_vpn_gateways(&'a self) -> TargetVpnGatewayMethods<'a, C, A>
[src]
pub fn url_maps(&'a self) -> UrlMapMethods<'a, C, A>
[src]
pub fn vpn_tunnels(&'a self) -> VpnTunnelMethods<'a, C, A>
[src]
pub fn zone_operations(&'a self) -> ZoneOperationMethods<'a, C, A>
[src]
pub fn zones(&'a self) -> ZoneMethods<'a, C, A>
[src]
pub fn user_agent(&mut self, agent_name: String) -> String
[src]
Set the user-agent header field to use in all requests to the server.
It defaults to google-api-rust-client/1.0.10
.
Returns the previously set user-agent.
pub fn base_url(&mut self, new_base_url: String) -> String
[src]
Set the base url to use in all requests to the server.
It defaults to https://www.googleapis.com/compute/v1/projects/
.
Returns the previously set base url.
pub fn root_url(&mut self, new_root_url: String) -> String
[src]
Set the root url to use in all requests to the server.
It defaults to https://www.googleapis.com/
.
Returns the previously set root url.
Trait Implementations
Auto Trait Implementations
impl<C, A> Send for Compute<C, A> where
A: Send,
C: Send,
A: Send,
C: Send,
impl<C, A> Unpin for Compute<C, A> where
A: Unpin,
C: Unpin,
A: Unpin,
C: Unpin,
impl<C, A> !Sync for Compute<C, A>
impl<C, A> UnwindSafe for Compute<C, A> where
A: UnwindSafe,
C: UnwindSafe,
A: UnwindSafe,
C: UnwindSafe,
impl<C, A> !RefUnwindSafe for Compute<C, A>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Typeable for T where
T: Any,
T: Any,