google_cloud_baremetalsolution_v2/client.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#![allow(rustdoc::redundant_explicit_links)]
17#![allow(rustdoc::broken_intra_doc_links)]
18
19/// Implements a client for the Bare Metal Solution API.
20///
21/// # Example
22/// ```
23/// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
24/// use google_cloud_gax::paginator::ItemPaginator as _;
25/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
26/// let client = BareMetalSolution::builder().build().await?;
27/// let parent = "parent_value";
28/// let mut list = client.list_instances()
29/// .set_parent(parent)
30/// .by_item();
31/// while let Some(item) = list.next().await.transpose()? {
32/// println!("{:?}", item);
33/// }
34/// # Ok(()) }
35/// ```
36///
37/// # Service Description
38///
39/// Performs management operations on Bare Metal Solution servers.
40///
41/// The `baremetalsolution.googleapis.com` service provides management
42/// capabilities for Bare Metal Solution servers. To access the API methods, you
43/// must assign Bare Metal Solution IAM roles containing the desired permissions
44/// to your staff in your Google Cloud project. You must also enable the Bare
45/// Metal Solution API. Once enabled, the methods act
46/// upon specific servers in your Bare Metal Solution environment.
47///
48/// # Configuration
49///
50/// To configure `BareMetalSolution` use the `with_*` methods in the type returned
51/// by [builder()][BareMetalSolution::builder]. The default configuration should
52/// work for most applications. Common configuration changes include
53///
54/// * [with_endpoint()]: by default this client uses the global default endpoint
55/// (`https://baremetalsolution.googleapis.com`). Applications using regional
56/// endpoints or running in restricted networks (e.g. a network configured
57// with [Private Google Access with VPC Service Controls]) may want to
58/// override this default.
59/// * [with_credentials()]: by default this client uses
60/// [Application Default Credentials]. Applications using custom
61/// authentication may need to override this default.
62///
63/// [with_endpoint()]: super::builder::bare_metal_solution::ClientBuilder::with_endpoint
64/// [with_credentials()]: super::builder::bare_metal_solution::ClientBuilder::with_credentials
65/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
66/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
67///
68/// # Pooling and Cloning
69///
70/// `BareMetalSolution` holds a connection pool internally, it is advised to
71/// create one and reuse it. You do not need to wrap `BareMetalSolution` in
72/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
73/// already uses an `Arc` internally.
74#[derive(Clone, Debug)]
75pub struct BareMetalSolution {
76 inner: std::sync::Arc<dyn super::stub::dynamic::BareMetalSolution>,
77}
78
79impl BareMetalSolution {
80 /// Returns a builder for [BareMetalSolution].
81 ///
82 /// ```
83 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
84 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
85 /// let client = BareMetalSolution::builder().build().await?;
86 /// # Ok(()) }
87 /// ```
88 pub fn builder() -> super::builder::bare_metal_solution::ClientBuilder {
89 crate::new_client_builder(super::builder::bare_metal_solution::client::Factory)
90 }
91
92 /// Creates a new client from the provided stub.
93 ///
94 /// The most common case for calling this function is in tests mocking the
95 /// client's behavior.
96 pub fn from_stub<T>(stub: T) -> Self
97 where
98 T: super::stub::BareMetalSolution + 'static,
99 {
100 Self {
101 inner: std::sync::Arc::new(stub),
102 }
103 }
104
105 pub(crate) async fn new(
106 config: gaxi::options::ClientConfig,
107 ) -> crate::ClientBuilderResult<Self> {
108 let inner = Self::build_inner(config).await?;
109 Ok(Self { inner })
110 }
111
112 async fn build_inner(
113 conf: gaxi::options::ClientConfig,
114 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::BareMetalSolution>>
115 {
116 if gaxi::options::tracing_enabled(&conf) {
117 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
118 }
119 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
120 }
121
122 async fn build_transport(
123 conf: gaxi::options::ClientConfig,
124 ) -> crate::ClientBuilderResult<impl super::stub::BareMetalSolution> {
125 super::transport::BareMetalSolution::new(conf).await
126 }
127
128 async fn build_with_tracing(
129 conf: gaxi::options::ClientConfig,
130 ) -> crate::ClientBuilderResult<impl super::stub::BareMetalSolution> {
131 Self::build_transport(conf)
132 .await
133 .map(super::tracing::BareMetalSolution::new)
134 }
135
136 /// List servers in a given project and location.
137 ///
138 /// # Example
139 /// ```
140 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
141 /// use google_cloud_gax::paginator::ItemPaginator as _;
142 /// use google_cloud_baremetalsolution_v2::Result;
143 /// async fn sample(
144 /// client: &BareMetalSolution, parent: &str
145 /// ) -> Result<()> {
146 /// let mut list = client.list_instances()
147 /// .set_parent(parent)
148 /// .by_item();
149 /// while let Some(item) = list.next().await.transpose()? {
150 /// println!("{:?}", item);
151 /// }
152 /// Ok(())
153 /// }
154 /// ```
155 pub fn list_instances(&self) -> super::builder::bare_metal_solution::ListInstances {
156 super::builder::bare_metal_solution::ListInstances::new(self.inner.clone())
157 }
158
159 /// Get details about a single server.
160 ///
161 /// # Example
162 /// ```
163 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
164 /// use google_cloud_baremetalsolution_v2::Result;
165 /// async fn sample(
166 /// client: &BareMetalSolution, name: &str
167 /// ) -> Result<()> {
168 /// let response = client.get_instance()
169 /// .set_name(name)
170 /// .send().await?;
171 /// println!("response {:?}", response);
172 /// Ok(())
173 /// }
174 /// ```
175 pub fn get_instance(&self) -> super::builder::bare_metal_solution::GetInstance {
176 super::builder::bare_metal_solution::GetInstance::new(self.inner.clone())
177 }
178
179 /// Update details of a single server.
180 ///
181 /// # Long running operations
182 ///
183 /// This method is used to start, and/or poll a [long-running Operation].
184 /// The [Working with long-running operations] chapter in the [user guide]
185 /// covers these operations in detail.
186 ///
187 /// [long-running operation]: https://google.aip.dev/151
188 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
189 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
190 ///
191 /// # Example
192 /// ```
193 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
194 /// use google_cloud_lro::Poller;
195 /// # extern crate wkt as google_cloud_wkt;
196 /// use google_cloud_wkt::FieldMask;
197 /// use google_cloud_baremetalsolution_v2::model::Instance;
198 /// use google_cloud_baremetalsolution_v2::Result;
199 /// async fn sample(
200 /// client: &BareMetalSolution, name: &str
201 /// ) -> Result<()> {
202 /// let response = client.update_instance()
203 /// .set_instance(
204 /// Instance::new().set_name(name)/* set fields */
205 /// )
206 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
207 /// .poller().until_done().await?;
208 /// println!("response {:?}", response);
209 /// Ok(())
210 /// }
211 /// ```
212 pub fn update_instance(&self) -> super::builder::bare_metal_solution::UpdateInstance {
213 super::builder::bare_metal_solution::UpdateInstance::new(self.inner.clone())
214 }
215
216 /// RenameInstance sets a new name for an instance.
217 /// Use with caution, previous names become immediately invalidated.
218 ///
219 /// # Example
220 /// ```
221 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
222 /// use google_cloud_baremetalsolution_v2::Result;
223 /// async fn sample(
224 /// client: &BareMetalSolution
225 /// ) -> Result<()> {
226 /// let response = client.rename_instance()
227 /// /* set fields */
228 /// .send().await?;
229 /// println!("response {:?}", response);
230 /// Ok(())
231 /// }
232 /// ```
233 pub fn rename_instance(&self) -> super::builder::bare_metal_solution::RenameInstance {
234 super::builder::bare_metal_solution::RenameInstance::new(self.inner.clone())
235 }
236
237 /// Perform an ungraceful, hard reset on a server. Equivalent to shutting the
238 /// power off and then turning it back on.
239 ///
240 /// # Long running operations
241 ///
242 /// This method is used to start, and/or poll a [long-running Operation].
243 /// The [Working with long-running operations] chapter in the [user guide]
244 /// covers these operations in detail.
245 ///
246 /// [long-running operation]: https://google.aip.dev/151
247 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
248 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
249 ///
250 /// # Example
251 /// ```
252 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
253 /// use google_cloud_lro::Poller;
254 /// use google_cloud_baremetalsolution_v2::Result;
255 /// async fn sample(
256 /// client: &BareMetalSolution
257 /// ) -> Result<()> {
258 /// let response = client.reset_instance()
259 /// /* set fields */
260 /// .poller().until_done().await?;
261 /// println!("response {:?}", response);
262 /// Ok(())
263 /// }
264 /// ```
265 pub fn reset_instance(&self) -> super::builder::bare_metal_solution::ResetInstance {
266 super::builder::bare_metal_solution::ResetInstance::new(self.inner.clone())
267 }
268
269 /// Starts a server that was shutdown.
270 ///
271 /// # Long running operations
272 ///
273 /// This method is used to start, and/or poll a [long-running Operation].
274 /// The [Working with long-running operations] chapter in the [user guide]
275 /// covers these operations in detail.
276 ///
277 /// [long-running operation]: https://google.aip.dev/151
278 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
279 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
280 ///
281 /// # Example
282 /// ```
283 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
284 /// use google_cloud_lro::Poller;
285 /// use google_cloud_baremetalsolution_v2::Result;
286 /// async fn sample(
287 /// client: &BareMetalSolution
288 /// ) -> Result<()> {
289 /// let response = client.start_instance()
290 /// /* set fields */
291 /// .poller().until_done().await?;
292 /// println!("response {:?}", response);
293 /// Ok(())
294 /// }
295 /// ```
296 pub fn start_instance(&self) -> super::builder::bare_metal_solution::StartInstance {
297 super::builder::bare_metal_solution::StartInstance::new(self.inner.clone())
298 }
299
300 /// Stop a running server.
301 ///
302 /// # Long running operations
303 ///
304 /// This method is used to start, and/or poll a [long-running Operation].
305 /// The [Working with long-running operations] chapter in the [user guide]
306 /// covers these operations in detail.
307 ///
308 /// [long-running operation]: https://google.aip.dev/151
309 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
310 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
311 ///
312 /// # Example
313 /// ```
314 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
315 /// use google_cloud_lro::Poller;
316 /// use google_cloud_baremetalsolution_v2::Result;
317 /// async fn sample(
318 /// client: &BareMetalSolution
319 /// ) -> Result<()> {
320 /// let response = client.stop_instance()
321 /// /* set fields */
322 /// .poller().until_done().await?;
323 /// println!("response {:?}", response);
324 /// Ok(())
325 /// }
326 /// ```
327 pub fn stop_instance(&self) -> super::builder::bare_metal_solution::StopInstance {
328 super::builder::bare_metal_solution::StopInstance::new(self.inner.clone())
329 }
330
331 /// Enable the interactive serial console feature on an instance.
332 ///
333 /// # Long running operations
334 ///
335 /// This method is used to start, and/or poll a [long-running Operation].
336 /// The [Working with long-running operations] chapter in the [user guide]
337 /// covers these operations in detail.
338 ///
339 /// [long-running operation]: https://google.aip.dev/151
340 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
341 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
342 ///
343 /// # Example
344 /// ```
345 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
346 /// use google_cloud_lro::Poller;
347 /// use google_cloud_baremetalsolution_v2::Result;
348 /// async fn sample(
349 /// client: &BareMetalSolution
350 /// ) -> Result<()> {
351 /// let response = client.enable_interactive_serial_console()
352 /// /* set fields */
353 /// .poller().until_done().await?;
354 /// println!("response {:?}", response);
355 /// Ok(())
356 /// }
357 /// ```
358 pub fn enable_interactive_serial_console(
359 &self,
360 ) -> super::builder::bare_metal_solution::EnableInteractiveSerialConsole {
361 super::builder::bare_metal_solution::EnableInteractiveSerialConsole::new(self.inner.clone())
362 }
363
364 /// Disable the interactive serial console feature on an instance.
365 ///
366 /// # Long running operations
367 ///
368 /// This method is used to start, and/or poll a [long-running Operation].
369 /// The [Working with long-running operations] chapter in the [user guide]
370 /// covers these operations in detail.
371 ///
372 /// [long-running operation]: https://google.aip.dev/151
373 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
374 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
375 ///
376 /// # Example
377 /// ```
378 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
379 /// use google_cloud_lro::Poller;
380 /// use google_cloud_baremetalsolution_v2::Result;
381 /// async fn sample(
382 /// client: &BareMetalSolution
383 /// ) -> Result<()> {
384 /// let response = client.disable_interactive_serial_console()
385 /// /* set fields */
386 /// .poller().until_done().await?;
387 /// println!("response {:?}", response);
388 /// Ok(())
389 /// }
390 /// ```
391 pub fn disable_interactive_serial_console(
392 &self,
393 ) -> super::builder::bare_metal_solution::DisableInteractiveSerialConsole {
394 super::builder::bare_metal_solution::DisableInteractiveSerialConsole::new(
395 self.inner.clone(),
396 )
397 }
398
399 /// Detach LUN from Instance.
400 ///
401 /// # Long running operations
402 ///
403 /// This method is used to start, and/or poll a [long-running Operation].
404 /// The [Working with long-running operations] chapter in the [user guide]
405 /// covers these operations in detail.
406 ///
407 /// [long-running operation]: https://google.aip.dev/151
408 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
409 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
410 ///
411 /// # Example
412 /// ```
413 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
414 /// use google_cloud_lro::Poller;
415 /// use google_cloud_baremetalsolution_v2::Result;
416 /// async fn sample(
417 /// client: &BareMetalSolution
418 /// ) -> Result<()> {
419 /// let response = client.detach_lun()
420 /// /* set fields */
421 /// .poller().until_done().await?;
422 /// println!("response {:?}", response);
423 /// Ok(())
424 /// }
425 /// ```
426 pub fn detach_lun(&self) -> super::builder::bare_metal_solution::DetachLun {
427 super::builder::bare_metal_solution::DetachLun::new(self.inner.clone())
428 }
429
430 /// Lists the public SSH keys registered for the specified project.
431 /// These SSH keys are used only for the interactive serial console feature.
432 ///
433 /// # Example
434 /// ```
435 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
436 /// use google_cloud_gax::paginator::ItemPaginator as _;
437 /// use google_cloud_baremetalsolution_v2::Result;
438 /// async fn sample(
439 /// client: &BareMetalSolution, parent: &str
440 /// ) -> Result<()> {
441 /// let mut list = client.list_ssh_keys()
442 /// .set_parent(parent)
443 /// .by_item();
444 /// while let Some(item) = list.next().await.transpose()? {
445 /// println!("{:?}", item);
446 /// }
447 /// Ok(())
448 /// }
449 /// ```
450 pub fn list_ssh_keys(&self) -> super::builder::bare_metal_solution::ListSSHKeys {
451 super::builder::bare_metal_solution::ListSSHKeys::new(self.inner.clone())
452 }
453
454 /// Register a public SSH key in the specified project for use with the
455 /// interactive serial console feature.
456 ///
457 /// # Example
458 /// ```
459 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
460 /// use google_cloud_baremetalsolution_v2::model::SSHKey;
461 /// use google_cloud_baremetalsolution_v2::Result;
462 /// async fn sample(
463 /// client: &BareMetalSolution, parent: &str
464 /// ) -> Result<()> {
465 /// let response = client.create_ssh_key()
466 /// .set_parent(parent)
467 /// .set_ssh_key(
468 /// SSHKey::new()/* set fields */
469 /// )
470 /// .send().await?;
471 /// println!("response {:?}", response);
472 /// Ok(())
473 /// }
474 /// ```
475 pub fn create_ssh_key(&self) -> super::builder::bare_metal_solution::CreateSSHKey {
476 super::builder::bare_metal_solution::CreateSSHKey::new(self.inner.clone())
477 }
478
479 /// Deletes a public SSH key registered in the specified project.
480 ///
481 /// # Example
482 /// ```
483 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
484 /// use google_cloud_baremetalsolution_v2::Result;
485 /// async fn sample(
486 /// client: &BareMetalSolution, name: &str
487 /// ) -> Result<()> {
488 /// client.delete_ssh_key()
489 /// .set_name(name)
490 /// .send().await?;
491 /// Ok(())
492 /// }
493 /// ```
494 pub fn delete_ssh_key(&self) -> super::builder::bare_metal_solution::DeleteSSHKey {
495 super::builder::bare_metal_solution::DeleteSSHKey::new(self.inner.clone())
496 }
497
498 /// List storage volumes in a given project and location.
499 ///
500 /// # Example
501 /// ```
502 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
503 /// use google_cloud_gax::paginator::ItemPaginator as _;
504 /// use google_cloud_baremetalsolution_v2::Result;
505 /// async fn sample(
506 /// client: &BareMetalSolution, parent: &str
507 /// ) -> Result<()> {
508 /// let mut list = client.list_volumes()
509 /// .set_parent(parent)
510 /// .by_item();
511 /// while let Some(item) = list.next().await.transpose()? {
512 /// println!("{:?}", item);
513 /// }
514 /// Ok(())
515 /// }
516 /// ```
517 pub fn list_volumes(&self) -> super::builder::bare_metal_solution::ListVolumes {
518 super::builder::bare_metal_solution::ListVolumes::new(self.inner.clone())
519 }
520
521 /// Get details of a single storage volume.
522 ///
523 /// # Example
524 /// ```
525 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
526 /// use google_cloud_baremetalsolution_v2::Result;
527 /// async fn sample(
528 /// client: &BareMetalSolution, name: &str
529 /// ) -> Result<()> {
530 /// let response = client.get_volume()
531 /// .set_name(name)
532 /// .send().await?;
533 /// println!("response {:?}", response);
534 /// Ok(())
535 /// }
536 /// ```
537 pub fn get_volume(&self) -> super::builder::bare_metal_solution::GetVolume {
538 super::builder::bare_metal_solution::GetVolume::new(self.inner.clone())
539 }
540
541 /// Update details of a single storage volume.
542 ///
543 /// # Long running operations
544 ///
545 /// This method is used to start, and/or poll a [long-running Operation].
546 /// The [Working with long-running operations] chapter in the [user guide]
547 /// covers these operations in detail.
548 ///
549 /// [long-running operation]: https://google.aip.dev/151
550 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
551 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
552 ///
553 /// # Example
554 /// ```
555 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
556 /// use google_cloud_lro::Poller;
557 /// # extern crate wkt as google_cloud_wkt;
558 /// use google_cloud_wkt::FieldMask;
559 /// use google_cloud_baremetalsolution_v2::model::Volume;
560 /// use google_cloud_baremetalsolution_v2::Result;
561 /// async fn sample(
562 /// client: &BareMetalSolution, name: &str
563 /// ) -> Result<()> {
564 /// let response = client.update_volume()
565 /// .set_volume(
566 /// Volume::new().set_name(name)/* set fields */
567 /// )
568 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
569 /// .poller().until_done().await?;
570 /// println!("response {:?}", response);
571 /// Ok(())
572 /// }
573 /// ```
574 pub fn update_volume(&self) -> super::builder::bare_metal_solution::UpdateVolume {
575 super::builder::bare_metal_solution::UpdateVolume::new(self.inner.clone())
576 }
577
578 /// RenameVolume sets a new name for a volume.
579 /// Use with caution, previous names become immediately invalidated.
580 ///
581 /// # Example
582 /// ```
583 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
584 /// use google_cloud_baremetalsolution_v2::Result;
585 /// async fn sample(
586 /// client: &BareMetalSolution
587 /// ) -> Result<()> {
588 /// let response = client.rename_volume()
589 /// /* set fields */
590 /// .send().await?;
591 /// println!("response {:?}", response);
592 /// Ok(())
593 /// }
594 /// ```
595 pub fn rename_volume(&self) -> super::builder::bare_metal_solution::RenameVolume {
596 super::builder::bare_metal_solution::RenameVolume::new(self.inner.clone())
597 }
598
599 /// Skips volume's cooloff and deletes it now.
600 /// Volume must be in cooloff state.
601 ///
602 /// # Long running operations
603 ///
604 /// This method is used to start, and/or poll a [long-running Operation].
605 /// The [Working with long-running operations] chapter in the [user guide]
606 /// covers these operations in detail.
607 ///
608 /// [long-running operation]: https://google.aip.dev/151
609 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
610 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
611 ///
612 /// # Example
613 /// ```
614 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
615 /// use google_cloud_lro::Poller;
616 /// use google_cloud_baremetalsolution_v2::Result;
617 /// async fn sample(
618 /// client: &BareMetalSolution
619 /// ) -> Result<()> {
620 /// client.evict_volume()
621 /// /* set fields */
622 /// .poller().until_done().await?;
623 /// Ok(())
624 /// }
625 /// ```
626 pub fn evict_volume(&self) -> super::builder::bare_metal_solution::EvictVolume {
627 super::builder::bare_metal_solution::EvictVolume::new(self.inner.clone())
628 }
629
630 /// Emergency Volume resize.
631 ///
632 /// # Long running operations
633 ///
634 /// This method is used to start, and/or poll a [long-running Operation].
635 /// The [Working with long-running operations] chapter in the [user guide]
636 /// covers these operations in detail.
637 ///
638 /// [long-running operation]: https://google.aip.dev/151
639 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
640 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
641 ///
642 /// # Example
643 /// ```
644 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
645 /// use google_cloud_lro::Poller;
646 /// use google_cloud_baremetalsolution_v2::Result;
647 /// async fn sample(
648 /// client: &BareMetalSolution
649 /// ) -> Result<()> {
650 /// let response = client.resize_volume()
651 /// /* set fields */
652 /// .poller().until_done().await?;
653 /// println!("response {:?}", response);
654 /// Ok(())
655 /// }
656 /// ```
657 pub fn resize_volume(&self) -> super::builder::bare_metal_solution::ResizeVolume {
658 super::builder::bare_metal_solution::ResizeVolume::new(self.inner.clone())
659 }
660
661 /// List network in a given project and location.
662 ///
663 /// # Example
664 /// ```
665 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
666 /// use google_cloud_gax::paginator::ItemPaginator as _;
667 /// use google_cloud_baremetalsolution_v2::Result;
668 /// async fn sample(
669 /// client: &BareMetalSolution, parent: &str
670 /// ) -> Result<()> {
671 /// let mut list = client.list_networks()
672 /// .set_parent(parent)
673 /// .by_item();
674 /// while let Some(item) = list.next().await.transpose()? {
675 /// println!("{:?}", item);
676 /// }
677 /// Ok(())
678 /// }
679 /// ```
680 pub fn list_networks(&self) -> super::builder::bare_metal_solution::ListNetworks {
681 super::builder::bare_metal_solution::ListNetworks::new(self.inner.clone())
682 }
683
684 /// List all Networks (and used IPs for each Network) in the vendor account
685 /// associated with the specified project.
686 ///
687 /// # Example
688 /// ```
689 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
690 /// use google_cloud_baremetalsolution_v2::Result;
691 /// async fn sample(
692 /// client: &BareMetalSolution
693 /// ) -> Result<()> {
694 /// let response = client.list_network_usage()
695 /// /* set fields */
696 /// .send().await?;
697 /// println!("response {:?}", response);
698 /// Ok(())
699 /// }
700 /// ```
701 pub fn list_network_usage(&self) -> super::builder::bare_metal_solution::ListNetworkUsage {
702 super::builder::bare_metal_solution::ListNetworkUsage::new(self.inner.clone())
703 }
704
705 /// Get details of a single network.
706 ///
707 /// # Example
708 /// ```
709 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
710 /// use google_cloud_baremetalsolution_v2::Result;
711 /// async fn sample(
712 /// client: &BareMetalSolution, name: &str
713 /// ) -> Result<()> {
714 /// let response = client.get_network()
715 /// .set_name(name)
716 /// .send().await?;
717 /// println!("response {:?}", response);
718 /// Ok(())
719 /// }
720 /// ```
721 pub fn get_network(&self) -> super::builder::bare_metal_solution::GetNetwork {
722 super::builder::bare_metal_solution::GetNetwork::new(self.inner.clone())
723 }
724
725 /// Update details of a single network.
726 ///
727 /// # Long running operations
728 ///
729 /// This method is used to start, and/or poll a [long-running Operation].
730 /// The [Working with long-running operations] chapter in the [user guide]
731 /// covers these operations in detail.
732 ///
733 /// [long-running operation]: https://google.aip.dev/151
734 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
735 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
736 ///
737 /// # Example
738 /// ```
739 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
740 /// use google_cloud_lro::Poller;
741 /// # extern crate wkt as google_cloud_wkt;
742 /// use google_cloud_wkt::FieldMask;
743 /// use google_cloud_baremetalsolution_v2::model::Network;
744 /// use google_cloud_baremetalsolution_v2::Result;
745 /// async fn sample(
746 /// client: &BareMetalSolution, name: &str
747 /// ) -> Result<()> {
748 /// let response = client.update_network()
749 /// .set_network(
750 /// Network::new().set_name(name)/* set fields */
751 /// )
752 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
753 /// .poller().until_done().await?;
754 /// println!("response {:?}", response);
755 /// Ok(())
756 /// }
757 /// ```
758 pub fn update_network(&self) -> super::builder::bare_metal_solution::UpdateNetwork {
759 super::builder::bare_metal_solution::UpdateNetwork::new(self.inner.clone())
760 }
761
762 /// Takes a snapshot of a boot volume.
763 /// Returns INVALID_ARGUMENT if called for a non-boot volume.
764 ///
765 /// # Example
766 /// ```
767 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
768 /// use google_cloud_baremetalsolution_v2::model::VolumeSnapshot;
769 /// use google_cloud_baremetalsolution_v2::Result;
770 /// async fn sample(
771 /// client: &BareMetalSolution, parent: &str
772 /// ) -> Result<()> {
773 /// let response = client.create_volume_snapshot()
774 /// .set_parent(parent)
775 /// .set_volume_snapshot(
776 /// VolumeSnapshot::new()/* set fields */
777 /// )
778 /// .send().await?;
779 /// println!("response {:?}", response);
780 /// Ok(())
781 /// }
782 /// ```
783 pub fn create_volume_snapshot(
784 &self,
785 ) -> super::builder::bare_metal_solution::CreateVolumeSnapshot {
786 super::builder::bare_metal_solution::CreateVolumeSnapshot::new(self.inner.clone())
787 }
788
789 /// Uses the specified snapshot to restore its parent volume.
790 /// Returns INVALID_ARGUMENT if called for a non-boot volume.
791 ///
792 /// # Long running operations
793 ///
794 /// This method is used to start, and/or poll a [long-running Operation].
795 /// The [Working with long-running operations] chapter in the [user guide]
796 /// covers these operations in detail.
797 ///
798 /// [long-running operation]: https://google.aip.dev/151
799 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
800 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
801 ///
802 /// # Example
803 /// ```
804 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
805 /// use google_cloud_lro::Poller;
806 /// use google_cloud_baremetalsolution_v2::Result;
807 /// async fn sample(
808 /// client: &BareMetalSolution
809 /// ) -> Result<()> {
810 /// let response = client.restore_volume_snapshot()
811 /// /* set fields */
812 /// .poller().until_done().await?;
813 /// println!("response {:?}", response);
814 /// Ok(())
815 /// }
816 /// ```
817 pub fn restore_volume_snapshot(
818 &self,
819 ) -> super::builder::bare_metal_solution::RestoreVolumeSnapshot {
820 super::builder::bare_metal_solution::RestoreVolumeSnapshot::new(self.inner.clone())
821 }
822
823 /// Deletes a volume snapshot.
824 /// Returns INVALID_ARGUMENT if called for a non-boot volume.
825 ///
826 /// # Example
827 /// ```
828 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
829 /// use google_cloud_baremetalsolution_v2::Result;
830 /// async fn sample(
831 /// client: &BareMetalSolution, name: &str
832 /// ) -> Result<()> {
833 /// client.delete_volume_snapshot()
834 /// .set_name(name)
835 /// .send().await?;
836 /// Ok(())
837 /// }
838 /// ```
839 pub fn delete_volume_snapshot(
840 &self,
841 ) -> super::builder::bare_metal_solution::DeleteVolumeSnapshot {
842 super::builder::bare_metal_solution::DeleteVolumeSnapshot::new(self.inner.clone())
843 }
844
845 /// Returns the specified snapshot resource.
846 /// Returns INVALID_ARGUMENT if called for a non-boot volume.
847 ///
848 /// # Example
849 /// ```
850 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
851 /// use google_cloud_baremetalsolution_v2::Result;
852 /// async fn sample(
853 /// client: &BareMetalSolution, name: &str
854 /// ) -> Result<()> {
855 /// let response = client.get_volume_snapshot()
856 /// .set_name(name)
857 /// .send().await?;
858 /// println!("response {:?}", response);
859 /// Ok(())
860 /// }
861 /// ```
862 pub fn get_volume_snapshot(&self) -> super::builder::bare_metal_solution::GetVolumeSnapshot {
863 super::builder::bare_metal_solution::GetVolumeSnapshot::new(self.inner.clone())
864 }
865
866 /// Retrieves the list of snapshots for the specified volume.
867 /// Returns a response with an empty list of snapshots if called
868 /// for a non-boot volume.
869 ///
870 /// # Example
871 /// ```
872 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
873 /// use google_cloud_gax::paginator::ItemPaginator as _;
874 /// use google_cloud_baremetalsolution_v2::Result;
875 /// async fn sample(
876 /// client: &BareMetalSolution, parent: &str
877 /// ) -> Result<()> {
878 /// let mut list = client.list_volume_snapshots()
879 /// .set_parent(parent)
880 /// .by_item();
881 /// while let Some(item) = list.next().await.transpose()? {
882 /// println!("{:?}", item);
883 /// }
884 /// Ok(())
885 /// }
886 /// ```
887 pub fn list_volume_snapshots(
888 &self,
889 ) -> super::builder::bare_metal_solution::ListVolumeSnapshots {
890 super::builder::bare_metal_solution::ListVolumeSnapshots::new(self.inner.clone())
891 }
892
893 /// Get details of a single storage logical unit number(LUN).
894 ///
895 /// # Example
896 /// ```
897 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
898 /// use google_cloud_baremetalsolution_v2::Result;
899 /// async fn sample(
900 /// client: &BareMetalSolution, name: &str
901 /// ) -> Result<()> {
902 /// let response = client.get_lun()
903 /// .set_name(name)
904 /// .send().await?;
905 /// println!("response {:?}", response);
906 /// Ok(())
907 /// }
908 /// ```
909 pub fn get_lun(&self) -> super::builder::bare_metal_solution::GetLun {
910 super::builder::bare_metal_solution::GetLun::new(self.inner.clone())
911 }
912
913 /// List storage volume luns for given storage volume.
914 ///
915 /// # Example
916 /// ```
917 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
918 /// use google_cloud_gax::paginator::ItemPaginator as _;
919 /// use google_cloud_baremetalsolution_v2::Result;
920 /// async fn sample(
921 /// client: &BareMetalSolution, parent: &str
922 /// ) -> Result<()> {
923 /// let mut list = client.list_luns()
924 /// .set_parent(parent)
925 /// .by_item();
926 /// while let Some(item) = list.next().await.transpose()? {
927 /// println!("{:?}", item);
928 /// }
929 /// Ok(())
930 /// }
931 /// ```
932 pub fn list_luns(&self) -> super::builder::bare_metal_solution::ListLuns {
933 super::builder::bare_metal_solution::ListLuns::new(self.inner.clone())
934 }
935
936 /// Skips lun's cooloff and deletes it now.
937 /// Lun must be in cooloff state.
938 ///
939 /// # Long running operations
940 ///
941 /// This method is used to start, and/or poll a [long-running Operation].
942 /// The [Working with long-running operations] chapter in the [user guide]
943 /// covers these operations in detail.
944 ///
945 /// [long-running operation]: https://google.aip.dev/151
946 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
947 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
948 ///
949 /// # Example
950 /// ```
951 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
952 /// use google_cloud_lro::Poller;
953 /// use google_cloud_baremetalsolution_v2::Result;
954 /// async fn sample(
955 /// client: &BareMetalSolution
956 /// ) -> Result<()> {
957 /// client.evict_lun()
958 /// /* set fields */
959 /// .poller().until_done().await?;
960 /// Ok(())
961 /// }
962 /// ```
963 pub fn evict_lun(&self) -> super::builder::bare_metal_solution::EvictLun {
964 super::builder::bare_metal_solution::EvictLun::new(self.inner.clone())
965 }
966
967 /// Get details of a single NFS share.
968 ///
969 /// # Example
970 /// ```
971 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
972 /// use google_cloud_baremetalsolution_v2::Result;
973 /// async fn sample(
974 /// client: &BareMetalSolution, name: &str
975 /// ) -> Result<()> {
976 /// let response = client.get_nfs_share()
977 /// .set_name(name)
978 /// .send().await?;
979 /// println!("response {:?}", response);
980 /// Ok(())
981 /// }
982 /// ```
983 pub fn get_nfs_share(&self) -> super::builder::bare_metal_solution::GetNfsShare {
984 super::builder::bare_metal_solution::GetNfsShare::new(self.inner.clone())
985 }
986
987 /// List NFS shares.
988 ///
989 /// # Example
990 /// ```
991 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
992 /// use google_cloud_gax::paginator::ItemPaginator as _;
993 /// use google_cloud_baremetalsolution_v2::Result;
994 /// async fn sample(
995 /// client: &BareMetalSolution, parent: &str
996 /// ) -> Result<()> {
997 /// let mut list = client.list_nfs_shares()
998 /// .set_parent(parent)
999 /// .by_item();
1000 /// while let Some(item) = list.next().await.transpose()? {
1001 /// println!("{:?}", item);
1002 /// }
1003 /// Ok(())
1004 /// }
1005 /// ```
1006 pub fn list_nfs_shares(&self) -> super::builder::bare_metal_solution::ListNfsShares {
1007 super::builder::bare_metal_solution::ListNfsShares::new(self.inner.clone())
1008 }
1009
1010 /// Update details of a single NFS share.
1011 ///
1012 /// # Long running operations
1013 ///
1014 /// This method is used to start, and/or poll a [long-running Operation].
1015 /// The [Working with long-running operations] chapter in the [user guide]
1016 /// covers these operations in detail.
1017 ///
1018 /// [long-running operation]: https://google.aip.dev/151
1019 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1020 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1021 ///
1022 /// # Example
1023 /// ```
1024 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1025 /// use google_cloud_lro::Poller;
1026 /// # extern crate wkt as google_cloud_wkt;
1027 /// use google_cloud_wkt::FieldMask;
1028 /// use google_cloud_baremetalsolution_v2::model::NfsShare;
1029 /// use google_cloud_baremetalsolution_v2::Result;
1030 /// async fn sample(
1031 /// client: &BareMetalSolution, name: &str
1032 /// ) -> Result<()> {
1033 /// let response = client.update_nfs_share()
1034 /// .set_nfs_share(
1035 /// NfsShare::new().set_name(name)/* set fields */
1036 /// )
1037 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1038 /// .poller().until_done().await?;
1039 /// println!("response {:?}", response);
1040 /// Ok(())
1041 /// }
1042 /// ```
1043 pub fn update_nfs_share(&self) -> super::builder::bare_metal_solution::UpdateNfsShare {
1044 super::builder::bare_metal_solution::UpdateNfsShare::new(self.inner.clone())
1045 }
1046
1047 /// Create an NFS share.
1048 ///
1049 /// # Long running operations
1050 ///
1051 /// This method is used to start, and/or poll a [long-running Operation].
1052 /// The [Working with long-running operations] chapter in the [user guide]
1053 /// covers these operations in detail.
1054 ///
1055 /// [long-running operation]: https://google.aip.dev/151
1056 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1057 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1058 ///
1059 /// # Example
1060 /// ```
1061 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1062 /// use google_cloud_lro::Poller;
1063 /// use google_cloud_baremetalsolution_v2::model::NfsShare;
1064 /// use google_cloud_baremetalsolution_v2::Result;
1065 /// async fn sample(
1066 /// client: &BareMetalSolution, parent: &str
1067 /// ) -> Result<()> {
1068 /// let response = client.create_nfs_share()
1069 /// .set_parent(parent)
1070 /// .set_nfs_share(
1071 /// NfsShare::new()/* set fields */
1072 /// )
1073 /// .poller().until_done().await?;
1074 /// println!("response {:?}", response);
1075 /// Ok(())
1076 /// }
1077 /// ```
1078 pub fn create_nfs_share(&self) -> super::builder::bare_metal_solution::CreateNfsShare {
1079 super::builder::bare_metal_solution::CreateNfsShare::new(self.inner.clone())
1080 }
1081
1082 /// RenameNfsShare sets a new name for an nfsshare.
1083 /// Use with caution, previous names become immediately invalidated.
1084 ///
1085 /// # Example
1086 /// ```
1087 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1088 /// use google_cloud_baremetalsolution_v2::Result;
1089 /// async fn sample(
1090 /// client: &BareMetalSolution
1091 /// ) -> Result<()> {
1092 /// let response = client.rename_nfs_share()
1093 /// /* set fields */
1094 /// .send().await?;
1095 /// println!("response {:?}", response);
1096 /// Ok(())
1097 /// }
1098 /// ```
1099 pub fn rename_nfs_share(&self) -> super::builder::bare_metal_solution::RenameNfsShare {
1100 super::builder::bare_metal_solution::RenameNfsShare::new(self.inner.clone())
1101 }
1102
1103 /// Delete an NFS share. The underlying volume is automatically deleted.
1104 ///
1105 /// # Long running operations
1106 ///
1107 /// This method is used to start, and/or poll a [long-running Operation].
1108 /// The [Working with long-running operations] chapter in the [user guide]
1109 /// covers these operations in detail.
1110 ///
1111 /// [long-running operation]: https://google.aip.dev/151
1112 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1113 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1114 ///
1115 /// # Example
1116 /// ```
1117 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1118 /// use google_cloud_lro::Poller;
1119 /// use google_cloud_baremetalsolution_v2::Result;
1120 /// async fn sample(
1121 /// client: &BareMetalSolution, name: &str
1122 /// ) -> Result<()> {
1123 /// client.delete_nfs_share()
1124 /// .set_name(name)
1125 /// .poller().until_done().await?;
1126 /// Ok(())
1127 /// }
1128 /// ```
1129 pub fn delete_nfs_share(&self) -> super::builder::bare_metal_solution::DeleteNfsShare {
1130 super::builder::bare_metal_solution::DeleteNfsShare::new(self.inner.clone())
1131 }
1132
1133 /// List the budget details to provision resources on a given project.
1134 ///
1135 /// # Example
1136 /// ```
1137 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1138 /// use google_cloud_gax::paginator::ItemPaginator as _;
1139 /// use google_cloud_baremetalsolution_v2::Result;
1140 /// async fn sample(
1141 /// client: &BareMetalSolution, parent: &str
1142 /// ) -> Result<()> {
1143 /// let mut list = client.list_provisioning_quotas()
1144 /// .set_parent(parent)
1145 /// .by_item();
1146 /// while let Some(item) = list.next().await.transpose()? {
1147 /// println!("{:?}", item);
1148 /// }
1149 /// Ok(())
1150 /// }
1151 /// ```
1152 pub fn list_provisioning_quotas(
1153 &self,
1154 ) -> super::builder::bare_metal_solution::ListProvisioningQuotas {
1155 super::builder::bare_metal_solution::ListProvisioningQuotas::new(self.inner.clone())
1156 }
1157
1158 /// Submit a provisiong configuration for a given project.
1159 ///
1160 /// # Example
1161 /// ```
1162 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1163 /// use google_cloud_baremetalsolution_v2::Result;
1164 /// async fn sample(
1165 /// client: &BareMetalSolution
1166 /// ) -> Result<()> {
1167 /// let response = client.submit_provisioning_config()
1168 /// /* set fields */
1169 /// .send().await?;
1170 /// println!("response {:?}", response);
1171 /// Ok(())
1172 /// }
1173 /// ```
1174 pub fn submit_provisioning_config(
1175 &self,
1176 ) -> super::builder::bare_metal_solution::SubmitProvisioningConfig {
1177 super::builder::bare_metal_solution::SubmitProvisioningConfig::new(self.inner.clone())
1178 }
1179
1180 /// Get ProvisioningConfig by name.
1181 ///
1182 /// # Example
1183 /// ```
1184 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1185 /// use google_cloud_baremetalsolution_v2::Result;
1186 /// async fn sample(
1187 /// client: &BareMetalSolution, name: &str
1188 /// ) -> Result<()> {
1189 /// let response = client.get_provisioning_config()
1190 /// .set_name(name)
1191 /// .send().await?;
1192 /// println!("response {:?}", response);
1193 /// Ok(())
1194 /// }
1195 /// ```
1196 pub fn get_provisioning_config(
1197 &self,
1198 ) -> super::builder::bare_metal_solution::GetProvisioningConfig {
1199 super::builder::bare_metal_solution::GetProvisioningConfig::new(self.inner.clone())
1200 }
1201
1202 /// Create new ProvisioningConfig.
1203 ///
1204 /// # Example
1205 /// ```
1206 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1207 /// use google_cloud_baremetalsolution_v2::model::ProvisioningConfig;
1208 /// use google_cloud_baremetalsolution_v2::Result;
1209 /// async fn sample(
1210 /// client: &BareMetalSolution, parent: &str
1211 /// ) -> Result<()> {
1212 /// let response = client.create_provisioning_config()
1213 /// .set_parent(parent)
1214 /// .set_provisioning_config(
1215 /// ProvisioningConfig::new()/* set fields */
1216 /// )
1217 /// .send().await?;
1218 /// println!("response {:?}", response);
1219 /// Ok(())
1220 /// }
1221 /// ```
1222 pub fn create_provisioning_config(
1223 &self,
1224 ) -> super::builder::bare_metal_solution::CreateProvisioningConfig {
1225 super::builder::bare_metal_solution::CreateProvisioningConfig::new(self.inner.clone())
1226 }
1227
1228 /// Update existing ProvisioningConfig.
1229 ///
1230 /// # Example
1231 /// ```
1232 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1233 /// # extern crate wkt as google_cloud_wkt;
1234 /// use google_cloud_wkt::FieldMask;
1235 /// use google_cloud_baremetalsolution_v2::model::ProvisioningConfig;
1236 /// use google_cloud_baremetalsolution_v2::Result;
1237 /// async fn sample(
1238 /// client: &BareMetalSolution, name: &str
1239 /// ) -> Result<()> {
1240 /// let response = client.update_provisioning_config()
1241 /// .set_provisioning_config(
1242 /// ProvisioningConfig::new().set_name(name)/* set fields */
1243 /// )
1244 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1245 /// .send().await?;
1246 /// println!("response {:?}", response);
1247 /// Ok(())
1248 /// }
1249 /// ```
1250 pub fn update_provisioning_config(
1251 &self,
1252 ) -> super::builder::bare_metal_solution::UpdateProvisioningConfig {
1253 super::builder::bare_metal_solution::UpdateProvisioningConfig::new(self.inner.clone())
1254 }
1255
1256 /// RenameNetwork sets a new name for a network.
1257 /// Use with caution, previous names become immediately invalidated.
1258 ///
1259 /// # Example
1260 /// ```
1261 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1262 /// use google_cloud_baremetalsolution_v2::Result;
1263 /// async fn sample(
1264 /// client: &BareMetalSolution
1265 /// ) -> Result<()> {
1266 /// let response = client.rename_network()
1267 /// /* set fields */
1268 /// .send().await?;
1269 /// println!("response {:?}", response);
1270 /// Ok(())
1271 /// }
1272 /// ```
1273 pub fn rename_network(&self) -> super::builder::bare_metal_solution::RenameNetwork {
1274 super::builder::bare_metal_solution::RenameNetwork::new(self.inner.clone())
1275 }
1276
1277 /// Retrieves the list of OS images which are currently approved.
1278 ///
1279 /// # Example
1280 /// ```
1281 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1282 /// use google_cloud_gax::paginator::ItemPaginator as _;
1283 /// use google_cloud_baremetalsolution_v2::Result;
1284 /// async fn sample(
1285 /// client: &BareMetalSolution, parent: &str
1286 /// ) -> Result<()> {
1287 /// let mut list = client.list_os_images()
1288 /// .set_parent(parent)
1289 /// .by_item();
1290 /// while let Some(item) = list.next().await.transpose()? {
1291 /// println!("{:?}", item);
1292 /// }
1293 /// Ok(())
1294 /// }
1295 /// ```
1296 pub fn list_os_images(&self) -> super::builder::bare_metal_solution::ListOSImages {
1297 super::builder::bare_metal_solution::ListOSImages::new(self.inner.clone())
1298 }
1299
1300 /// Lists information about the supported locations for this service.
1301 ///
1302 /// # Example
1303 /// ```
1304 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1305 /// use google_cloud_gax::paginator::ItemPaginator as _;
1306 /// use google_cloud_baremetalsolution_v2::Result;
1307 /// async fn sample(
1308 /// client: &BareMetalSolution
1309 /// ) -> Result<()> {
1310 /// let mut list = client.list_locations()
1311 /// /* set fields */
1312 /// .by_item();
1313 /// while let Some(item) = list.next().await.transpose()? {
1314 /// println!("{:?}", item);
1315 /// }
1316 /// Ok(())
1317 /// }
1318 /// ```
1319 pub fn list_locations(&self) -> super::builder::bare_metal_solution::ListLocations {
1320 super::builder::bare_metal_solution::ListLocations::new(self.inner.clone())
1321 }
1322
1323 /// Gets information about a location.
1324 ///
1325 /// # Example
1326 /// ```
1327 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1328 /// use google_cloud_baremetalsolution_v2::Result;
1329 /// async fn sample(
1330 /// client: &BareMetalSolution
1331 /// ) -> Result<()> {
1332 /// let response = client.get_location()
1333 /// /* set fields */
1334 /// .send().await?;
1335 /// println!("response {:?}", response);
1336 /// Ok(())
1337 /// }
1338 /// ```
1339 pub fn get_location(&self) -> super::builder::bare_metal_solution::GetLocation {
1340 super::builder::bare_metal_solution::GetLocation::new(self.inner.clone())
1341 }
1342
1343 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1344 ///
1345 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1346 ///
1347 /// # Example
1348 /// ```
1349 /// # use google_cloud_baremetalsolution_v2::client::BareMetalSolution;
1350 /// use google_cloud_baremetalsolution_v2::Result;
1351 /// async fn sample(
1352 /// client: &BareMetalSolution
1353 /// ) -> Result<()> {
1354 /// let response = client.get_operation()
1355 /// /* set fields */
1356 /// .send().await?;
1357 /// println!("response {:?}", response);
1358 /// Ok(())
1359 /// }
1360 /// ```
1361 pub fn get_operation(&self) -> super::builder::bare_metal_solution::GetOperation {
1362 super::builder::bare_metal_solution::GetOperation::new(self.inner.clone())
1363 }
1364}