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