Struct podman_rest_client::models::TopologyRequirement

source ·
pub struct TopologyRequirement {
    pub preferred: Option<Vec<Topology>>,
    pub requisite: Option<Vec<Topology>>,
}
Expand description

TopologyRequirement : TopologyRequirement expresses the user’s requirements for a volume’s accessible topology.

Fields§

§preferred: Option<Vec<Topology>>

Preferred is a list of Topologies that the volume should attempt to be provisioned in. Taken from the CSI spec: Specifies the list of topologies the CO would prefer the volume to be provisioned in. This field is OPTIONAL. If TopologyRequirement is specified either requisite or preferred or both MUST be specified. An SP MUST attempt to make the provisioned volume available using the preferred topologies in order from first to last. If requisite is specified, all topologies in preferred list MUST also be present in the list of requisite topologies. If the SP is unable to make the provisioned volume available from any of the preferred topologies, the SP MAY choose a topology from the list of requisite topologies. If the list of requisite topologies is not specified, then the SP MAY choose from the list of all possible topologies. If the list of requisite topologies is specified and the SP is unable to make the provisioned volume available from any of the requisite topologies it MUST fail the CreateVolume call. Example 1: Given a volume should be accessible from a single zone, and requisite = {"region": "R1", "zone": "Z2"}, {"region": "R1", "zone": "Z3"} preferred = {"region": "R1", "zone": "Z3"} then the SP SHOULD first attempt to make the provisioned volume available from "zone" "Z3" in the "region" "R1" and fall back to "zone" "Z2" in the "region" "R1" if that is not possible. Example 2: Given a volume should be accessible from a single zone, and requisite = {"region": "R1", "zone": "Z2"}, {"region": "R1", "zone": "Z3"}, {"region": "R1", "zone": "Z4"}, {"region": "R1", "zone": "Z5"} preferred = {"region": "R1", "zone": "Z4"}, {"region": "R1", "zone": "Z2"} then the SP SHOULD first attempt to make the provisioned volume accessible from "zone" "Z4" in the "region" "R1" and fall back to "zone" "Z2" in the "region" "R1" if that is not possible. If that is not possible, the SP may choose between either the "zone" "Z3" or "Z5" in the "region" "R1". Example 3: Given a volume should be accessible from TWO zones (because an opaque parameter in CreateVolumeRequest, for example, specifies the volume is accessible from two zones, aka synchronously replicated), and requisite = {"region": "R1", "zone": "Z2"}, {"region": "R1", "zone": "Z3"}, {"region": "R1", "zone": "Z4"}, {"region": "R1", "zone": "Z5"} preferred = {"region": "R1", "zone": "Z5"}, {"region": "R1", "zone": "Z3"} then the SP SHOULD first attempt to make the provisioned volume accessible from the combination of the two "zones" "Z5" and "Z3" in the "region" "R1". If that’s not possible, it should fall back to a combination of "Z5" and other possibilities from the list of requisite. If that’s not possible, it should fall back to a combination of "Z3" and other possibilities from the list of requisite. If that’s not possible, it should fall back to a combination of other possibilities from the list of requisite.

§requisite: Option<Vec<Topology>>

Requisite specifies a list of Topologies, at least one of which the volume must be accessible from. Taken verbatim from the CSI Spec: Specifies the list of topologies the provisioned volume MUST be accessible from. This field is OPTIONAL. If TopologyRequirement is specified either requisite or preferred or both MUST be specified. If requisite is specified, the provisioned volume MUST be accessible from at least one of the requisite topologies. Given x = number of topologies provisioned volume is accessible from n = number of requisite topologies The CO MUST ensure n >= 1. The SP MUST ensure x >= 1 If x==n, then the SP MUST make the provisioned volume available to all topologies from the list of requisite topologies. If it is unable to do so, the SP MUST fail the CreateVolume call. For example, if a volume should be accessible from a single zone, and requisite = {"region": "R1", "zone": "Z2"} then the provisioned volume MUST be accessible from the "region" "R1" and the "zone" "Z2". Similarly, if a volume should be accessible from two zones, and requisite = {"region": "R1", "zone": "Z2"}, {"region": "R1", "zone": "Z3"} then the provisioned volume MUST be accessible from the "region" "R1" and both "zone" "Z2" and "zone" "Z3". If x<n, then the SP SHALL choose x unique topologies from the list of requisite topologies. If it is unable to do so, the SP MUST fail the CreateVolume call. For example, if a volume should be accessible from a single zone, and requisite = {"region": "R1", "zone": "Z2"}, {"region": "R1", "zone": "Z3"} then the SP may choose to make the provisioned volume available in either the "zone" "Z2" or the "zone" "Z3" in the "region" "R1". Similarly, if a volume should be accessible from two zones, and requisite = {"region": "R1", "zone": "Z2"}, {"region": "R1", "zone": "Z3"}, {"region": "R1", "zone": "Z4"} then the provisioned volume MUST be accessible from any combination of two unique topologies: e.g. "R1/Z2" and "R1/Z3", or "R1/Z2" and "R1/Z4", or "R1/Z3" and "R1/Z4". If x>n, then the SP MUST make the provisioned volume available from all topologies from the list of requisite topologies and MAY choose the remaining x-n unique topologies from the list of all possible topologies. If it is unable to do so, the SP MUST fail the CreateVolume call. For example, if a volume should be accessible from two zones, and requisite = {"region": "R1", "zone": "Z2"} then the provisioned volume MUST be accessible from the "region" "R1" and the "zone" "Z2" and the SP may select the second zone independently, e.g. "R1/Z4".

Implementations§

source§

impl TopologyRequirement

source

pub fn new() -> TopologyRequirement

TopologyRequirement expresses the user’s requirements for a volume’s accessible topology.

Trait Implementations§

source§

impl Clone for TopologyRequirement

source§

fn clone(&self) -> TopologyRequirement

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for TopologyRequirement

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for TopologyRequirement

source§

fn default() -> TopologyRequirement

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for TopologyRequirement

source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<TopologyRequirement, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for TopologyRequirement

source§

fn eq(&self, other: &TopologyRequirement) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for TopologyRequirement

source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for TopologyRequirement

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,