Skip to main content

google_cloud_compute_v1/
lib.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17//! Google Cloud Client Libraries for Rust - Compute Engine API
18//!
19//! This client library was generated from the "20260908" revision of the API.
20//!
21//! This crate contains traits, types, and functions to interact with Compute Engine API
22//! Most applications will use the structs defined in the [client] module.
23//!
24//! The client library types and functions are stable and not expected to change.
25//! Please note that Google Cloud services do change from time to time. The client
26//! libraries are designed to preserve backwards compatibility when the service
27//! changes in compatible ways. For example, adding RPCs, or fields to messages
28//! should not introduce breaking changes to the client libraries.
29//!
30//! # Available Clients
31//!
32//! * [AcceleratorTypes](client/struct.AcceleratorTypes.html)
33//! * [Addresses](client/struct.Addresses.html)
34//! * [Advice](client/struct.Advice.html)
35//! * [Autoscalers](client/struct.Autoscalers.html)
36//! * [BackendBuckets](client/struct.BackendBuckets.html)
37//! * [BackendServices](client/struct.BackendServices.html)
38//! * [CrossSiteNetworks](client/struct.CrossSiteNetworks.html)
39//! * [DiskTypes](client/struct.DiskTypes.html)
40//! * [Disks](client/struct.Disks.html)
41//! * [ExternalVpnGateways](client/struct.ExternalVpnGateways.html)
42//! * [FirewallPolicies](client/struct.FirewallPolicies.html)
43//! * [Firewalls](client/struct.Firewalls.html)
44//! * [ForwardingRules](client/struct.ForwardingRules.html)
45//! * [FutureReservations](client/struct.FutureReservations.html)
46//! * [GlobalAddresses](client/struct.GlobalAddresses.html)
47//! * [GlobalForwardingRules](client/struct.GlobalForwardingRules.html)
48//! * [GlobalNetworkEndpointGroups](client/struct.GlobalNetworkEndpointGroups.html)
49//! * [GlobalOperations](client/struct.GlobalOperations.html)
50//! * [GlobalOrganizationOperations](client/struct.GlobalOrganizationOperations.html)
51//! * [GlobalPublicDelegatedPrefixes](client/struct.GlobalPublicDelegatedPrefixes.html)
52//! * [GlobalVmExtensionPolicies](client/struct.GlobalVmExtensionPolicies.html)
53//! * [HealthChecks](client/struct.HealthChecks.html)
54//! * [Hosts](client/struct.Hosts.html)
55//! * [HttpHealthChecks](client/struct.HttpHealthChecks.html)
56//! * [HttpsHealthChecks](client/struct.HttpsHealthChecks.html)
57//! * [ImageFamilyViews](client/struct.ImageFamilyViews.html)
58//! * [Images](client/struct.Images.html)
59//! * [InstanceGroupManagerResizeRequests](client/struct.InstanceGroupManagerResizeRequests.html)
60//! * [InstanceGroupManagers](client/struct.InstanceGroupManagers.html)
61//! * [InstanceGroups](client/struct.InstanceGroups.html)
62//! * [InstanceSettings](client/struct.InstanceSettings.html)
63//! * [InstanceTemplates](client/struct.InstanceTemplates.html)
64//! * [Instances](client/struct.Instances.html)
65//! * [InstantSnapshotGroups](client/struct.InstantSnapshotGroups.html)
66//! * [InstantSnapshots](client/struct.InstantSnapshots.html)
67//! * [InterconnectAttachmentGroups](client/struct.InterconnectAttachmentGroups.html)
68//! * [InterconnectAttachments](client/struct.InterconnectAttachments.html)
69//! * [InterconnectGroups](client/struct.InterconnectGroups.html)
70//! * [InterconnectLocations](client/struct.InterconnectLocations.html)
71//! * [InterconnectRemoteLocations](client/struct.InterconnectRemoteLocations.html)
72//! * [Interconnects](client/struct.Interconnects.html)
73//! * [LicenseCodes](client/struct.LicenseCodes.html)
74//! * [Licenses](client/struct.Licenses.html)
75//! * [MachineImages](client/struct.MachineImages.html)
76//! * [MachineTypes](client/struct.MachineTypes.html)
77//! * [NetworkAttachments](client/struct.NetworkAttachments.html)
78//! * [NetworkEdgeSecurityServices](client/struct.NetworkEdgeSecurityServices.html)
79//! * [NetworkEndpointGroups](client/struct.NetworkEndpointGroups.html)
80//! * [NetworkFirewallPolicies](client/struct.NetworkFirewallPolicies.html)
81//! * [NetworkProfiles](client/struct.NetworkProfiles.html)
82//! * [Networks](client/struct.Networks.html)
83//! * [NodeGroups](client/struct.NodeGroups.html)
84//! * [NodeTemplates](client/struct.NodeTemplates.html)
85//! * [NodeTypes](client/struct.NodeTypes.html)
86//! * [OrganizationSecurityPolicies](client/struct.OrganizationSecurityPolicies.html)
87//! * [PacketMirrorings](client/struct.PacketMirrorings.html)
88//! * [PreviewFeatures](client/struct.PreviewFeatures.html)
89//! * [ProjectViews](client/struct.ProjectViews.html)
90//! * [Projects](client/struct.Projects.html)
91//! * [PublicAdvertisedPrefixes](client/struct.PublicAdvertisedPrefixes.html)
92//! * [PublicDelegatedPrefixes](client/struct.PublicDelegatedPrefixes.html)
93//! * [RegionAutoscalers](client/struct.RegionAutoscalers.html)
94//! * [RegionBackendBuckets](client/struct.RegionBackendBuckets.html)
95//! * [RegionBackendServices](client/struct.RegionBackendServices.html)
96//! * [RegionCommitments](client/struct.RegionCommitments.html)
97//! * [RegionCompositeHealthChecks](client/struct.RegionCompositeHealthChecks.html)
98//! * [RegionDiskTypes](client/struct.RegionDiskTypes.html)
99//! * [RegionDisks](client/struct.RegionDisks.html)
100//! * [RegionHealthAggregationPolicies](client/struct.RegionHealthAggregationPolicies.html)
101//! * [RegionHealthCheckServices](client/struct.RegionHealthCheckServices.html)
102//! * [RegionHealthChecks](client/struct.RegionHealthChecks.html)
103//! * [RegionHealthSources](client/struct.RegionHealthSources.html)
104//! * [RegionInstanceGroupManagerResizeRequests](client/struct.RegionInstanceGroupManagerResizeRequests.html)
105//! * [RegionInstanceGroupManagers](client/struct.RegionInstanceGroupManagers.html)
106//! * [RegionInstanceGroups](client/struct.RegionInstanceGroups.html)
107//! * [RegionInstanceTemplates](client/struct.RegionInstanceTemplates.html)
108//! * [RegionInstances](client/struct.RegionInstances.html)
109//! * [RegionInstantSnapshotGroups](client/struct.RegionInstantSnapshotGroups.html)
110//! * [RegionInstantSnapshots](client/struct.RegionInstantSnapshots.html)
111//! * [RegionNetworkEndpointGroups](client/struct.RegionNetworkEndpointGroups.html)
112//! * [RegionNetworkFirewallPolicies](client/struct.RegionNetworkFirewallPolicies.html)
113//! * [RegionNotificationEndpoints](client/struct.RegionNotificationEndpoints.html)
114//! * [RegionOperations](client/struct.RegionOperations.html)
115//! * [RegionSecurityPolicies](client/struct.RegionSecurityPolicies.html)
116//! * [RegionSnapshotSettings](client/struct.RegionSnapshotSettings.html)
117//! * [RegionSnapshots](client/struct.RegionSnapshots.html)
118//! * [RegionSslCertificates](client/struct.RegionSslCertificates.html)
119//! * [RegionSslPolicies](client/struct.RegionSslPolicies.html)
120//! * [RegionTargetHttpProxies](client/struct.RegionTargetHttpProxies.html)
121//! * [RegionTargetHttpsProxies](client/struct.RegionTargetHttpsProxies.html)
122//! * [RegionTargetTcpProxies](client/struct.RegionTargetTcpProxies.html)
123//! * [RegionUrlMaps](client/struct.RegionUrlMaps.html)
124//! * [RegionZones](client/struct.RegionZones.html)
125//! * [Regions](client/struct.Regions.html)
126//! * [ReliabilityRisks](client/struct.ReliabilityRisks.html)
127//! * [ReservationBlocks](client/struct.ReservationBlocks.html)
128//! * [ReservationSlots](client/struct.ReservationSlots.html)
129//! * [ReservationSubBlocks](client/struct.ReservationSubBlocks.html)
130//! * [Reservations](client/struct.Reservations.html)
131//! * [ResourcePolicies](client/struct.ResourcePolicies.html)
132//! * [RolloutPlans](client/struct.RolloutPlans.html)
133//! * [Rollouts](client/struct.Rollouts.html)
134//! * [Routers](client/struct.Routers.html)
135//! * [Routes](client/struct.Routes.html)
136//! * [SecurityPolicies](client/struct.SecurityPolicies.html)
137//! * [ServiceAttachments](client/struct.ServiceAttachments.html)
138//! * [SnapshotSettings](client/struct.SnapshotSettings.html)
139//! * [Snapshots](client/struct.Snapshots.html)
140//! * [SslCertificates](client/struct.SslCertificates.html)
141//! * [SslPolicies](client/struct.SslPolicies.html)
142//! * [StoragePoolTypes](client/struct.StoragePoolTypes.html)
143//! * [StoragePools](client/struct.StoragePools.html)
144//! * [Subnetworks](client/struct.Subnetworks.html)
145//! * [TargetGrpcProxies](client/struct.TargetGrpcProxies.html)
146//! * [TargetHttpProxies](client/struct.TargetHttpProxies.html)
147//! * [TargetHttpsProxies](client/struct.TargetHttpsProxies.html)
148//! * [TargetInstances](client/struct.TargetInstances.html)
149//! * [TargetPools](client/struct.TargetPools.html)
150//! * [TargetSslProxies](client/struct.TargetSslProxies.html)
151//! * [TargetTcpProxies](client/struct.TargetTcpProxies.html)
152//! * [TargetVpnGateways](client/struct.TargetVpnGateways.html)
153//! * [UrlMaps](client/struct.UrlMaps.html)
154//! * [VpnGateways](client/struct.VpnGateways.html)
155//! * [VpnTunnels](client/struct.VpnTunnels.html)
156//! * [WireGroups](client/struct.WireGroups.html)
157//! * [ZoneOperations](client/struct.ZoneOperations.html)
158//! * [ZoneVmExtensionPolicies](client/struct.ZoneVmExtensionPolicies.html)
159//! * [Zones](client/struct.Zones.html)
160//!
161//! # Features
162//!
163//! - `default-rustls-provider`: enabled by default. Use the default rustls
164//!   crypto provider ([aws-lc-rs]) for TLS and authentication. Applications
165//!   with specific requirements for cryptography (such as exclusively using the
166//!   [ring] crate) should disable this default and call
167//!   `rustls::crypto::CryptoProvider::install_default()`.
168//! - Each client can be enabled using its own feature. Use the client's name
169//!   in `kebab-case` to enable the client.
170//!
171//! [aws-lc-rs]: https://crates.io/crates/aws-lc-rs
172//! [ring]: https://crates.io/crates/ring
173
174#![cfg_attr(docsrs, feature(doc_cfg))]
175#![allow(deprecated)]
176
177/// The messages and enums that are part of this client library.
178#[allow(clippy::module_inception)]
179pub mod model;
180
181pub use google_cloud_gax::Result;
182pub use google_cloud_gax::error::Error;
183
184#[allow(rustdoc::invalid_html_tags)]
185#[allow(rustdoc::redundant_explicit_links)]
186pub mod stub;
187
188/// Concrete implementations of client library traits.
189///
190/// # Example
191/// ```
192/// # use google_cloud_compute_v1::client::Instances;
193/// async fn sample(
194/// ) -> anyhow::Result<()> {
195///     let client = Instances::builder().build().await?;
196///     // use `client` to make requests to the Compute Engine API.
197///     Ok(())
198/// }
199/// ```
200pub mod client;
201
202/// Request builders.
203pub mod builder;
204
205#[doc(hidden)]
206pub(crate) mod tracing;
207
208#[doc(hidden)]
209pub(crate) mod transport;
210
211/// The default host used by the service.
212#[cfg(any(
213    feature = "accelerator-types",
214    feature = "addresses",
215    feature = "advice",
216    feature = "autoscalers",
217    feature = "backend-buckets",
218    feature = "backend-services",
219    feature = "cross-site-networks",
220    feature = "disk-types",
221    feature = "disks",
222    feature = "external-vpn-gateways",
223    feature = "firewall-policies",
224    feature = "firewalls",
225    feature = "forwarding-rules",
226    feature = "future-reservations",
227    feature = "global-addresses",
228    feature = "global-forwarding-rules",
229    feature = "global-network-endpoint-groups",
230    feature = "global-operations",
231    feature = "global-organization-operations",
232    feature = "global-public-delegated-prefixes",
233    feature = "global-vm-extension-policies",
234    feature = "health-checks",
235    feature = "hosts",
236    feature = "http-health-checks",
237    feature = "https-health-checks",
238    feature = "image-family-views",
239    feature = "images",
240    feature = "instance-group-manager-resize-requests",
241    feature = "instance-group-managers",
242    feature = "instance-groups",
243    feature = "instance-settings",
244    feature = "instance-templates",
245    feature = "instances",
246    feature = "instant-snapshot-groups",
247    feature = "instant-snapshots",
248    feature = "interconnect-attachment-groups",
249    feature = "interconnect-attachments",
250    feature = "interconnect-groups",
251    feature = "interconnect-locations",
252    feature = "interconnect-remote-locations",
253    feature = "interconnects",
254    feature = "license-codes",
255    feature = "licenses",
256    feature = "machine-images",
257    feature = "machine-types",
258    feature = "network-attachments",
259    feature = "network-edge-security-services",
260    feature = "network-endpoint-groups",
261    feature = "network-firewall-policies",
262    feature = "network-profiles",
263    feature = "networks",
264    feature = "node-groups",
265    feature = "node-templates",
266    feature = "node-types",
267    feature = "organization-security-policies",
268    feature = "packet-mirrorings",
269    feature = "preview-features",
270    feature = "project-views",
271    feature = "projects",
272    feature = "public-advertised-prefixes",
273    feature = "public-delegated-prefixes",
274    feature = "region-autoscalers",
275    feature = "region-backend-buckets",
276    feature = "region-backend-services",
277    feature = "region-commitments",
278    feature = "region-composite-health-checks",
279    feature = "region-disk-types",
280    feature = "region-disks",
281    feature = "region-health-aggregation-policies",
282    feature = "region-health-check-services",
283    feature = "region-health-checks",
284    feature = "region-health-sources",
285    feature = "region-instance-group-manager-resize-requests",
286    feature = "region-instance-group-managers",
287    feature = "region-instance-groups",
288    feature = "region-instance-templates",
289    feature = "region-instances",
290    feature = "region-instant-snapshot-groups",
291    feature = "region-instant-snapshots",
292    feature = "region-network-endpoint-groups",
293    feature = "region-network-firewall-policies",
294    feature = "region-notification-endpoints",
295    feature = "region-operations",
296    feature = "region-security-policies",
297    feature = "region-snapshot-settings",
298    feature = "region-snapshots",
299    feature = "region-ssl-certificates",
300    feature = "region-ssl-policies",
301    feature = "region-target-http-proxies",
302    feature = "region-target-https-proxies",
303    feature = "region-target-tcp-proxies",
304    feature = "region-url-maps",
305    feature = "region-zones",
306    feature = "regions",
307    feature = "reliability-risks",
308    feature = "reservation-blocks",
309    feature = "reservation-slots",
310    feature = "reservation-sub-blocks",
311    feature = "reservations",
312    feature = "resource-policies",
313    feature = "rollout-plans",
314    feature = "rollouts",
315    feature = "routers",
316    feature = "routes",
317    feature = "security-policies",
318    feature = "service-attachments",
319    feature = "snapshot-settings",
320    feature = "snapshots",
321    feature = "ssl-certificates",
322    feature = "ssl-policies",
323    feature = "storage-pool-types",
324    feature = "storage-pools",
325    feature = "subnetworks",
326    feature = "target-grpc-proxies",
327    feature = "target-http-proxies",
328    feature = "target-https-proxies",
329    feature = "target-instances",
330    feature = "target-pools",
331    feature = "target-ssl-proxies",
332    feature = "target-tcp-proxies",
333    feature = "target-vpn-gateways",
334    feature = "url-maps",
335    feature = "vpn-gateways",
336    feature = "vpn-tunnels",
337    feature = "wire-groups",
338    feature = "zone-operations",
339    feature = "zone-vm-extension-policies",
340    feature = "zones",
341))]
342const DEFAULT_HOST: &str = "https://compute.googleapis.com/";
343
344#[cfg(any(
345    feature = "accelerator-types",
346    feature = "addresses",
347    feature = "advice",
348    feature = "autoscalers",
349    feature = "backend-buckets",
350    feature = "backend-services",
351    feature = "cross-site-networks",
352    feature = "disk-types",
353    feature = "disks",
354    feature = "external-vpn-gateways",
355    feature = "firewall-policies",
356    feature = "firewalls",
357    feature = "forwarding-rules",
358    feature = "future-reservations",
359    feature = "global-addresses",
360    feature = "global-forwarding-rules",
361    feature = "global-network-endpoint-groups",
362    feature = "global-operations",
363    feature = "global-organization-operations",
364    feature = "global-public-delegated-prefixes",
365    feature = "global-vm-extension-policies",
366    feature = "health-checks",
367    feature = "hosts",
368    feature = "http-health-checks",
369    feature = "https-health-checks",
370    feature = "image-family-views",
371    feature = "images",
372    feature = "instance-group-manager-resize-requests",
373    feature = "instance-group-managers",
374    feature = "instance-groups",
375    feature = "instance-settings",
376    feature = "instance-templates",
377    feature = "instances",
378    feature = "instant-snapshot-groups",
379    feature = "instant-snapshots",
380    feature = "interconnect-attachment-groups",
381    feature = "interconnect-attachments",
382    feature = "interconnect-groups",
383    feature = "interconnect-locations",
384    feature = "interconnect-remote-locations",
385    feature = "interconnects",
386    feature = "license-codes",
387    feature = "licenses",
388    feature = "machine-images",
389    feature = "machine-types",
390    feature = "network-attachments",
391    feature = "network-edge-security-services",
392    feature = "network-endpoint-groups",
393    feature = "network-firewall-policies",
394    feature = "network-profiles",
395    feature = "networks",
396    feature = "node-groups",
397    feature = "node-templates",
398    feature = "node-types",
399    feature = "organization-security-policies",
400    feature = "packet-mirrorings",
401    feature = "preview-features",
402    feature = "project-views",
403    feature = "projects",
404    feature = "public-advertised-prefixes",
405    feature = "public-delegated-prefixes",
406    feature = "region-autoscalers",
407    feature = "region-backend-buckets",
408    feature = "region-backend-services",
409    feature = "region-commitments",
410    feature = "region-composite-health-checks",
411    feature = "region-disk-types",
412    feature = "region-disks",
413    feature = "region-health-aggregation-policies",
414    feature = "region-health-check-services",
415    feature = "region-health-checks",
416    feature = "region-health-sources",
417    feature = "region-instance-group-manager-resize-requests",
418    feature = "region-instance-group-managers",
419    feature = "region-instance-groups",
420    feature = "region-instance-templates",
421    feature = "region-instances",
422    feature = "region-instant-snapshot-groups",
423    feature = "region-instant-snapshots",
424    feature = "region-network-endpoint-groups",
425    feature = "region-network-firewall-policies",
426    feature = "region-notification-endpoints",
427    feature = "region-operations",
428    feature = "region-security-policies",
429    feature = "region-snapshot-settings",
430    feature = "region-snapshots",
431    feature = "region-ssl-certificates",
432    feature = "region-ssl-policies",
433    feature = "region-target-http-proxies",
434    feature = "region-target-https-proxies",
435    feature = "region-target-tcp-proxies",
436    feature = "region-url-maps",
437    feature = "region-zones",
438    feature = "regions",
439    feature = "reliability-risks",
440    feature = "reservation-blocks",
441    feature = "reservation-slots",
442    feature = "reservation-sub-blocks",
443    feature = "reservations",
444    feature = "resource-policies",
445    feature = "rollout-plans",
446    feature = "rollouts",
447    feature = "routers",
448    feature = "routes",
449    feature = "security-policies",
450    feature = "service-attachments",
451    feature = "snapshot-settings",
452    feature = "snapshots",
453    feature = "ssl-certificates",
454    feature = "ssl-policies",
455    feature = "storage-pool-types",
456    feature = "storage-pools",
457    feature = "subnetworks",
458    feature = "target-grpc-proxies",
459    feature = "target-http-proxies",
460    feature = "target-https-proxies",
461    feature = "target-instances",
462    feature = "target-pools",
463    feature = "target-ssl-proxies",
464    feature = "target-tcp-proxies",
465    feature = "target-vpn-gateways",
466    feature = "url-maps",
467    feature = "vpn-gateways",
468    feature = "vpn-tunnels",
469    feature = "wire-groups",
470    feature = "zone-operations",
471    feature = "zone-vm-extension-policies",
472    feature = "zones",
473))]
474pub(crate) mod info {
475    const NAME: &str = env!("CARGO_PKG_NAME");
476    const VERSION: &str = env!("CARGO_PKG_VERSION");
477    pub(crate) static X_GOOG_API_CLIENT_HEADER: std::sync::LazyLock<String> =
478        std::sync::LazyLock::new(|| {
479            let ac = gaxi::api_header::XGoogApiClient {
480                name: NAME,
481                version: VERSION,
482                library_type: gaxi::api_header::GAPIC,
483            };
484            ac.rest_header_value()
485        });
486}
487
488// Define some shortcuts for imported crates.
489pub(crate) use google_cloud_gax::client_builder::ClientBuilder;
490pub(crate) use google_cloud_gax::client_builder::Result as ClientBuilderResult;
491pub(crate) use google_cloud_gax::client_builder::internal::ClientFactory;
492pub(crate) use google_cloud_gax::client_builder::internal::new_builder as new_client_builder;
493pub(crate) use google_cloud_gax::options::RequestOptions;
494pub(crate) use google_cloud_gax::options::internal::RequestBuilder;
495pub(crate) use google_cloud_gax::response::Response;
496
497pub mod errors;
498
499pub mod operation;