pub struct Snapshot {
pub name: String,
pub urn: String,
pub source_volume: String,
pub source_size_gib: i32,
pub state: i32,
pub state_reason: String,
pub protection_state: i32,
pub protection_reason: String,
pub creator: String,
pub tags: BTreeMap<String, String>,
}Expand description
A point-in-time copy of a volume.
Fields§
§name: StringThe snapshot’s resource name.
urn: StringThe snapshot’s URN, the identifier access policies and the audit log use.
source_volume: StringThe volume copied, in the same project and zone.
source_size_gib: i32The source volume’s size in GiB when it was copied: the least a volume created from the snapshot holds.
state: i32Where the copy is.
state_reason: StringWhy the snapshot is in snapshot::State::Error; empty otherwise.
protection_state: i32Whether it is protected.
protection_reason: StringWhy the last protection change failed, when protection_state is
snapshot::ProtectionState::ProtectionFailed.
creator: StringThe principal that took the snapshot, such as user:<id> or
service_account:<id>.
Labels of your own, at most 50. The origin:name tag is the name the
console shows.
Implementations§
Source§impl Snapshot
impl Snapshot
Sourcepub fn state(&self) -> State
pub fn state(&self) -> State
Returns the enum value of state, or the default if the field is set to an invalid enum value.
Sourcepub fn protection_state(&self) -> ProtectionState
pub fn protection_state(&self) -> ProtectionState
Returns the enum value of protection_state, or the default if the field is set to an invalid enum value.
Sourcepub fn set_protection_state(&mut self, value: ProtectionState)
pub fn set_protection_state(&mut self, value: ProtectionState)
Sets protection_state to the provided enum value.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Snapshot
impl<'de> Deserialize<'de> for Snapshot
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl Message for Snapshot
impl Message for Snapshot
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.