Beethoven.Az.Lib (Beethoven v0.2.3)

Library for Az Genserver

Summary

Functions

Calls IMDS to get metadata about this VM. A response of {:error, :timeout} indicates that you are not in Azure. IMDS should never go down or be unreachable outside of a live-site outage.

Gets the VM's Azure region from cached IMDS data.

Gets the VM's networking config from cached IMDS data.

Functions

call_IMDS()

@spec call_IMDS() :: {:ok, map()} | {:error, :timeout}

Calls IMDS to get metadata about this VM. A response of {:error, :timeout} indicates that you are not in Azure. IMDS should never go down or be unreachable outside of a live-site outage.

get_AzRegion(metadata)

@spec get_AzRegion(map()) :: atom()

Gets the VM's Azure region from cached IMDS data.

get_AzSubnet(metadata)

@spec get_AzSubnet(map()) :: {{integer(), integer(), integer(), integer()}, integer()}

Gets the VM's networking config from cached IMDS data.