Skip to content

Commit

Permalink
Merge pull request #2224 from jpculp/fetch-partition
Browse files Browse the repository at this point in the history
imdsclient: add fetch_partition function
  • Loading branch information
jpculp authored Jun 20, 2022
2 parents 2eaef13 + 43b764f commit f81dfac
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sources/imdsclient/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ impl ImdsClient {
Ok(region)
}

/// Returns the partition that the instance is in.
pub async fn fetch_partition(&mut self) -> Result<Option<String>> {
let partition_target = "meta-data/services/partition";
self.fetch_string(&partition_target).await
}

/// Returns the list of network interface mac addresses.
pub async fn fetch_mac_addresses(&mut self) -> Result<Option<Vec<String>>> {
let macs_target = "meta-data/network/interfaces/macs";
Expand Down

0 comments on commit f81dfac

Please sign in to comment.