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