#[non_exhaustive]pub struct ResourcePolicy {Show 14 fields
pub creation_timestamp: Option<String>,
pub description: Option<String>,
pub disk_consistency_group_policy: Option<ResourcePolicyDiskConsistencyGroupPolicy>,
pub group_placement_policy: Option<ResourcePolicyGroupPlacementPolicy>,
pub id: Option<u64>,
pub instance_schedule_policy: Option<ResourcePolicyInstanceSchedulePolicy>,
pub kind: Option<String>,
pub name: Option<String>,
pub region: Option<String>,
pub resource_status: Option<ResourcePolicyResourceStatus>,
pub self_link: Option<String>,
pub snapshot_schedule_policy: Option<ResourcePolicySnapshotSchedulePolicy>,
pub status: Option<Status>,
pub workload_policy: Option<ResourcePolicyWorkloadPolicy>,
/* private fields */
}resource-policies only.Expand description
Represents a Resource Policy resource. You can use resource policies to schedule actions for some Compute Engine resources. For example, you can use them toschedule persistent disk snapshots.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.creation_timestamp: Option<String>Output only. [Output Only] Creation timestamp inRFC3339 text format.
description: Option<String>§disk_consistency_group_policy: Option<ResourcePolicyDiskConsistencyGroupPolicy>Resource policy for disk consistency groups.
group_placement_policy: Option<ResourcePolicyGroupPlacementPolicy>Resource policy for instances for placement configuration.
id: Option<u64>Output only. [Output Only] The unique identifier for the resource. This identifier is defined by the server.
instance_schedule_policy: Option<ResourcePolicyInstanceSchedulePolicy>Resource policy for scheduling instance operations.
kind: Option<String>Output only. [Output Only] Type of the resource. Alwayscompute#resource_policies for resource policies.
name: Option<String>The name of the resource, provided by the client when initially creating
the resource. The resource name must be 1-63 characters long, and comply
withRFC1035.
Specifically, the name must be 1-63 characters long and match the regular
expression [a-z]([-a-z0-9]*[a-z0-9])? which means the first
character must be a lowercase letter, and all following characters must be
a dash, lowercase letter, or digit, except the last character, which cannot
be a dash.
region: Option<String>§resource_status: Option<ResourcePolicyResourceStatus>Output only. [Output Only] The system status of the resource policy.
self_link: Option<String>Output only. [Output Only] Server-defined fully-qualified URL for this resource.
snapshot_schedule_policy: Option<ResourcePolicySnapshotSchedulePolicy>Resource policy for persistent disks for creating snapshots.
status: Option<Status>Output only. [Output Only] The status of resource policy creation.
workload_policy: Option<ResourcePolicyWorkloadPolicy>Resource policy for defining instance placement for MIGs.
Implementations§
Source§impl ResourcePolicy
impl ResourcePolicy
Sourcepub fn set_creation_timestamp<T>(self, v: T) -> Self
pub fn set_creation_timestamp<T>(self, v: T) -> Self
Sets the value of creation_timestamp.
§Example
let x = ResourcePolicy::new().set_creation_timestamp("example");Sourcepub fn set_or_clear_creation_timestamp<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_creation_timestamp<T>(self, v: Option<T>) -> Self
Sets or clears the value of creation_timestamp.
§Example
let x = ResourcePolicy::new().set_or_clear_creation_timestamp(Some("example"));
let x = ResourcePolicy::new().set_or_clear_creation_timestamp(None::<String>);Sourcepub fn set_description<T>(self, v: T) -> Self
pub fn set_description<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_description<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_description<T>(self, v: Option<T>) -> Self
Sets or clears the value of description.
§Example
let x = ResourcePolicy::new().set_or_clear_description(Some("example"));
let x = ResourcePolicy::new().set_or_clear_description(None::<String>);Sourcepub fn set_disk_consistency_group_policy<T>(self, v: T) -> Selfwhere
T: Into<ResourcePolicyDiskConsistencyGroupPolicy>,
pub fn set_disk_consistency_group_policy<T>(self, v: T) -> Selfwhere
T: Into<ResourcePolicyDiskConsistencyGroupPolicy>,
Sets the value of disk_consistency_group_policy.
§Example
use google_cloud_compute_v1::model::ResourcePolicyDiskConsistencyGroupPolicy;
let x = ResourcePolicy::new().set_disk_consistency_group_policy(ResourcePolicyDiskConsistencyGroupPolicy::default()/* use setters */);Sourcepub fn set_or_clear_disk_consistency_group_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<ResourcePolicyDiskConsistencyGroupPolicy>,
pub fn set_or_clear_disk_consistency_group_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<ResourcePolicyDiskConsistencyGroupPolicy>,
Sets or clears the value of disk_consistency_group_policy.
§Example
use google_cloud_compute_v1::model::ResourcePolicyDiskConsistencyGroupPolicy;
let x = ResourcePolicy::new().set_or_clear_disk_consistency_group_policy(Some(ResourcePolicyDiskConsistencyGroupPolicy::default()/* use setters */));
let x = ResourcePolicy::new().set_or_clear_disk_consistency_group_policy(None::<ResourcePolicyDiskConsistencyGroupPolicy>);Sourcepub fn set_group_placement_policy<T>(self, v: T) -> Selfwhere
T: Into<ResourcePolicyGroupPlacementPolicy>,
pub fn set_group_placement_policy<T>(self, v: T) -> Selfwhere
T: Into<ResourcePolicyGroupPlacementPolicy>,
Sets the value of group_placement_policy.
§Example
use google_cloud_compute_v1::model::ResourcePolicyGroupPlacementPolicy;
let x = ResourcePolicy::new().set_group_placement_policy(ResourcePolicyGroupPlacementPolicy::default()/* use setters */);Sourcepub fn set_or_clear_group_placement_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<ResourcePolicyGroupPlacementPolicy>,
pub fn set_or_clear_group_placement_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<ResourcePolicyGroupPlacementPolicy>,
Sets or clears the value of group_placement_policy.
§Example
use google_cloud_compute_v1::model::ResourcePolicyGroupPlacementPolicy;
let x = ResourcePolicy::new().set_or_clear_group_placement_policy(Some(ResourcePolicyGroupPlacementPolicy::default()/* use setters */));
let x = ResourcePolicy::new().set_or_clear_group_placement_policy(None::<ResourcePolicyGroupPlacementPolicy>);Sourcepub fn set_or_clear_id<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_id<T>(self, v: Option<T>) -> Self
Sourcepub fn set_instance_schedule_policy<T>(self, v: T) -> Selfwhere
T: Into<ResourcePolicyInstanceSchedulePolicy>,
pub fn set_instance_schedule_policy<T>(self, v: T) -> Selfwhere
T: Into<ResourcePolicyInstanceSchedulePolicy>,
Sets the value of instance_schedule_policy.
§Example
use google_cloud_compute_v1::model::ResourcePolicyInstanceSchedulePolicy;
let x = ResourcePolicy::new().set_instance_schedule_policy(ResourcePolicyInstanceSchedulePolicy::default()/* use setters */);Sourcepub fn set_or_clear_instance_schedule_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<ResourcePolicyInstanceSchedulePolicy>,
pub fn set_or_clear_instance_schedule_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<ResourcePolicyInstanceSchedulePolicy>,
Sets or clears the value of instance_schedule_policy.
§Example
use google_cloud_compute_v1::model::ResourcePolicyInstanceSchedulePolicy;
let x = ResourcePolicy::new().set_or_clear_instance_schedule_policy(Some(ResourcePolicyInstanceSchedulePolicy::default()/* use setters */));
let x = ResourcePolicy::new().set_or_clear_instance_schedule_policy(None::<ResourcePolicyInstanceSchedulePolicy>);Sourcepub fn set_or_clear_kind<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_kind<T>(self, v: Option<T>) -> Self
Sourcepub fn set_or_clear_name<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_name<T>(self, v: Option<T>) -> Self
Sourcepub fn set_region<T>(self, v: T) -> Self
pub fn set_region<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_region<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_region<T>(self, v: Option<T>) -> Self
Sourcepub fn set_resource_status<T>(self, v: T) -> Selfwhere
T: Into<ResourcePolicyResourceStatus>,
pub fn set_resource_status<T>(self, v: T) -> Selfwhere
T: Into<ResourcePolicyResourceStatus>,
Sets the value of resource_status.
§Example
use google_cloud_compute_v1::model::ResourcePolicyResourceStatus;
let x = ResourcePolicy::new().set_resource_status(ResourcePolicyResourceStatus::default()/* use setters */);Sourcepub fn set_or_clear_resource_status<T>(self, v: Option<T>) -> Selfwhere
T: Into<ResourcePolicyResourceStatus>,
pub fn set_or_clear_resource_status<T>(self, v: Option<T>) -> Selfwhere
T: Into<ResourcePolicyResourceStatus>,
Sets or clears the value of resource_status.
§Example
use google_cloud_compute_v1::model::ResourcePolicyResourceStatus;
let x = ResourcePolicy::new().set_or_clear_resource_status(Some(ResourcePolicyResourceStatus::default()/* use setters */));
let x = ResourcePolicy::new().set_or_clear_resource_status(None::<ResourcePolicyResourceStatus>);Sourcepub fn set_self_link<T>(self, v: T) -> Self
pub fn set_self_link<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_self_link<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_self_link<T>(self, v: Option<T>) -> Self
Sourcepub fn set_snapshot_schedule_policy<T>(self, v: T) -> Selfwhere
T: Into<ResourcePolicySnapshotSchedulePolicy>,
pub fn set_snapshot_schedule_policy<T>(self, v: T) -> Selfwhere
T: Into<ResourcePolicySnapshotSchedulePolicy>,
Sets the value of snapshot_schedule_policy.
§Example
use google_cloud_compute_v1::model::ResourcePolicySnapshotSchedulePolicy;
let x = ResourcePolicy::new().set_snapshot_schedule_policy(ResourcePolicySnapshotSchedulePolicy::default()/* use setters */);Sourcepub fn set_or_clear_snapshot_schedule_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<ResourcePolicySnapshotSchedulePolicy>,
pub fn set_or_clear_snapshot_schedule_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<ResourcePolicySnapshotSchedulePolicy>,
Sets or clears the value of snapshot_schedule_policy.
§Example
use google_cloud_compute_v1::model::ResourcePolicySnapshotSchedulePolicy;
let x = ResourcePolicy::new().set_or_clear_snapshot_schedule_policy(Some(ResourcePolicySnapshotSchedulePolicy::default()/* use setters */));
let x = ResourcePolicy::new().set_or_clear_snapshot_schedule_policy(None::<ResourcePolicySnapshotSchedulePolicy>);Sourcepub fn set_status<T>(self, v: T) -> Self
pub fn set_status<T>(self, v: T) -> Self
Sourcepub fn set_or_clear_status<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_status<T>(self, v: Option<T>) -> Self
Sets or clears the value of status.
§Example
use google_cloud_compute_v1::model::resource_policy::Status;
let x0 = ResourcePolicy::new().set_or_clear_status(Some(Status::Deleting));
let x1 = ResourcePolicy::new().set_or_clear_status(Some(Status::Expired));
let x2 = ResourcePolicy::new().set_or_clear_status(Some(Status::Invalid));
let x_none = ResourcePolicy::new().set_or_clear_status(None::<Status>);Sourcepub fn set_workload_policy<T>(self, v: T) -> Selfwhere
T: Into<ResourcePolicyWorkloadPolicy>,
pub fn set_workload_policy<T>(self, v: T) -> Selfwhere
T: Into<ResourcePolicyWorkloadPolicy>,
Sets the value of workload_policy.
§Example
use google_cloud_compute_v1::model::ResourcePolicyWorkloadPolicy;
let x = ResourcePolicy::new().set_workload_policy(ResourcePolicyWorkloadPolicy::default()/* use setters */);Sourcepub fn set_or_clear_workload_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<ResourcePolicyWorkloadPolicy>,
pub fn set_or_clear_workload_policy<T>(self, v: Option<T>) -> Selfwhere
T: Into<ResourcePolicyWorkloadPolicy>,
Sets or clears the value of workload_policy.
§Example
use google_cloud_compute_v1::model::ResourcePolicyWorkloadPolicy;
let x = ResourcePolicy::new().set_or_clear_workload_policy(Some(ResourcePolicyWorkloadPolicy::default()/* use setters */));
let x = ResourcePolicy::new().set_or_clear_workload_policy(None::<ResourcePolicyWorkloadPolicy>);Trait Implementations§
Source§impl Clone for ResourcePolicy
impl Clone for ResourcePolicy
Source§fn clone(&self) -> ResourcePolicy
fn clone(&self) -> ResourcePolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResourcePolicy
impl Debug for ResourcePolicy
Source§impl Default for ResourcePolicy
impl Default for ResourcePolicy
Source§fn default() -> ResourcePolicy
fn default() -> ResourcePolicy
Source§impl Message for ResourcePolicy
impl Message for ResourcePolicy
Source§impl PartialEq for ResourcePolicy
impl PartialEq for ResourcePolicy
impl StructuralPartialEq for ResourcePolicy
Auto Trait Implementations§
impl Freeze for ResourcePolicy
impl RefUnwindSafe for ResourcePolicy
impl Send for ResourcePolicy
impl Sync for ResourcePolicy
impl Unpin for ResourcePolicy
impl UnsafeUnpin for ResourcePolicy
impl UnwindSafe for ResourcePolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request