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