Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Client *http.Client Token token SubscriptionID string Host string Credentials Credentials }
Client represents an API client to the Azure Resource Manager It handles wrapping the requests with the required authentication headers
func NewClient ¶
func NewClient(c Credentials) (*Client, error)
NewClient creates a new Azure API client based on a set of credentials represented by the azure.Credentials data type
func (*Client) FindVPNConnection ¶
func (c *Client) FindVPNConnection(group, name string) (VPNConnection, error)
FindVPNConnection gets the given VPN connection by namd and resource group if found
func (*Client) FindVPNConnections ¶
func (c *Client) FindVPNConnections() ([]VPNConnection, error)
FindVPNConnections returns a slice of all VPN connection objects for the current subscription
type Credentials ¶
type Credentials struct { SubscriptionID string ClientID string ClientSecret string TenantID string }
Credentials represents a set of Azure credentials for a service principal All fields are required
func NewCredentialsFromFile ¶
func NewCredentialsFromFile(path string) Credentials
NewCredentialsFromFile will create a new instance of an azure.Credentials object from a JSON formatted file
func (Credentials) String ¶
func (c Credentials) String() string
type VPNConnection ¶
type VPNConnection struct { ID string `json:"id"` Location string `json:"location"` Name string `json:"name"` ResourceGroup string `json:"name,omitempty"` Properties struct { Status string `json:"connectionStatus"` EgressBytesTransferred float64 `json:"egressBytesTransferred"` IngressBytesTransferred float64 `json:"ingressBytesTransferred"` } }
VPNConnection represents an Azure VPN connection object
type VPNConnectionsListResult ¶
type VPNConnectionsListResult struct {
Connections []VPNConnection `json:"value"`
}
VPNConnectionsListResult is used to unmarshal the data from Azure when getting a list of VPN connections