Skip to content

Commit

Permalink
Add support for IBMCloud/PowerVS images
Browse files Browse the repository at this point in the history
Adding support for IBMCloud/PowerVS objects to be added to the stream.

similar to coreos/stream-metadata-go#35
  • Loading branch information
Prashanth684 committed Oct 26, 2021
1 parent 13f40d8 commit 4a783f4
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,26 @@ pub struct GcpImage {
pub name: String,
}

/// ReplicatedObject storage images for clouds like IBMCloud/PowerVS
#[derive(Debug, Deserialize)]
#[serde(rename_all = "kebab-case")]
pub struct ReplicatedObject {
/// Mapping from region name to the object.
pub regions: HashMap<String, RegionObject>,
}

/// RegionObject like the ones used for IBMCloud/PowerVS platform containing object, bucket and url .
#[derive(Debug, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "kebab-case")]
pub struct RegionObject {
/// The actual object in the cloud object storage (.ova.gz for PowerVS, .qcow2 for IBMCloud)
pub object: String,
/// The bucket where the object resides.
pub bucket: String,
/// The url of the object.
pub url: String,
}

/// Public cloud images.
#[derive(Debug, Deserialize)]
#[serde(rename_all = "kebab-case")]
Expand All @@ -107,6 +127,10 @@ pub struct Images {
pub aws: Option<AwsImages>,
/// Images for GCP.
pub gcp: Option<GcpImage>,
/// Objects for IBMCloud
pub ibmcloud: Option<ReplicatedObject>,
/// Objects for PowerVS
pub powervs: Option<ReplicatedObject>,
}

impl Stream {
Expand Down

0 comments on commit 4a783f4

Please sign in to comment.