azure

package
v0.0.0-...-8b9beea Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2016 License: MPL-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Global         = "global"
	CentralUS      = "centralus"
	EastUS         = "eastus"
	EastUS2        = "eastus2"
	USGovIowa      = "usgoviowa"
	USGovVirginia  = "usgovvirginia"
	NorthCentralUS = "northcentralus"
	SouthCentralUS = "southcentralus"
	WestUS         = "westus"
	NorthEurope    = "northeurope"
	WestEurope     = "westeurope"
	EastAsia       = "eastasia"
	SoutheastAsia  = "southeastasia"
	JapanEast      = "japaneast"
	JapanWest      = "japanwest"
	BrazilSouth    = "brazilsouth"
	AustraliaEast  = "australiaeast"
	Australia      = "australia"
	CentralIndia   = "centralindia"
	SouthIndia     = "southindia"
	WestIndia      = "westindia"
	ChinaEast      = "chinaeast"
)

Variables

This section is empty.

Functions

func String

func String(input string) *string

String returns a pointer to the input string. This is useful when initializing structures.

Types

type APICall

type APICall interface {
	APIInfo() APIInfo
}

APICall must be implemented by structures which represent requests to the ARM API in order that the generic request handling layer has sufficient information to execute requests.

type APIInfo

type APIInfo struct {
	APIVersion            string
	Method                string
	URLPathFunc           func() string
	ResponseTypeFunc      func() interface{}
	RequestPropertiesFunc func() interface{}
	HasBodyOverride       bool
}

APIInfo contains information about a request to the ARM API - which API version is required, the HTTP method to use, and a factory function for responses.

func (APIInfo) HasBody

func (apiInfo APIInfo) HasBody() bool

HasBody returns true if the API Request should have a body. This is usually the case for PUT, PATCH or POST operations, but is not the case for GET operations. TODO(jen20): This may need revisiting at some point.

type AzureResourceManagerCredentials

type AzureResourceManagerCredentials struct {
	ClientID       string
	ClientSecret   string
	TenantID       string
	SubscriptionID string
}

type Client

type Client struct {
	BaseURL string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(creds *AzureResourceManagerCredentials) (*Client, error)

func (*Client) NewRequest

func (c *Client) NewRequest() *Request

func (*Client) NewRequestForURI

func (c *Client) NewRequestForURI(resourceURI string) *Request

func (*Client) SetLogger

func (c *Client) SetLogger(newLogger *log.Logger)

type CreateResourceGroup

type CreateResourceGroup struct {
	Name     string             `json:"-"`
	Location string             `json:"-" riviera:"location"`
	Tags     map[string]*string `json:"-" riviera:"tags"`
}

func (CreateResourceGroup) APIInfo

func (command CreateResourceGroup) APIInfo() APIInfo

type CreateResourceGroupResponse

type CreateResourceGroupResponse struct {
	ID                *string `mapstructure:"id"`
	Name              *string `mapstructure:"name"`
	Location          *string `mapstructure:"location"`
	ProvisioningState *string `mapstructure:"provisioningState"`
}

type DeleteResourceGroup

type DeleteResourceGroup struct {
	Name string `json:"-"`
}

func (DeleteResourceGroup) APIInfo

func (s DeleteResourceGroup) APIInfo() APIInfo

type Error

type Error struct {
	StatusCode int
	ErrorCode  string `mapstructure:"code"`
	Message    string `mapstructure:"message"`
}

Error represents the body of an error response which is often returned by the Azure ARM API.

func (Error) Error

func (e Error) Error() string

Error implements interface error on AzureError structures

type GetResourceGroup

type GetResourceGroup struct {
	Name string `json:"-"`
}

func (GetResourceGroup) APIInfo

func (command GetResourceGroup) APIInfo() APIInfo

type GetResourceGroupResponse

type GetResourceGroupResponse struct {
	ID                *string             `mapstructure:"id"`
	Name              *string             `mapstructure:"name"`
	Location          *string             `mapstructure:"location"`
	ProvisioningState *string             `mapstructure:"provisioningState"`
	Tags              *map[string]*string `mapstructure:"tags"`
}

type RegisterResourceProvider

type RegisterResourceProvider struct {
	Namespace string `json:"-"`
}

TODO: Investigate RegistrationState response polling

func (RegisterResourceProvider) APIInfo

func (command RegisterResourceProvider) APIInfo() APIInfo

type RegisterResourceProviderResponse

type RegisterResourceProviderResponse struct {
	ID                *string `mapstructure:"id"`
	Namespace         *string `mapstructure:"namespace"`
	RegistrationState *string `mapstructure:"registrationState"`
	ApplicationID     *string `mapstructure:"applicationId"`
}

type Request

type Request struct {
	URI *string

	Command APICall
	// contains filtered or unexported fields
}

func (*Request) Execute

func (request *Request) Execute() (*Response, error)

type Response

type Response struct {
	// HTTP provides direct access to the http.Response, though use should
	// not be necessary as a matter of course
	HTTP *http.Response

	// Parsed provides access the response structure of the command
	Parsed interface{}

	// Error provides access to the error body if the command was unsuccessful
	Error *Error
}

Response is the type returned by API operations. It provides low level access to the HTTP request from the operation if that is required, and a parsed version of the response as an interface{} which can be type asserted to the correct response type for the request.

func (*Response) IsSuccessful

func (response *Response) IsSuccessful() bool

IsSuccessful returns true if the status code for the underlying HTTP request was a "successful" status code.

type UpdateResourceGroup

type UpdateResourceGroup struct {
	Name string             `json:"-"`
	Tags map[string]*string `json:"-" riviera:"tags"`
}

func (UpdateResourceGroup) APIInfo

func (command UpdateResourceGroup) APIInfo() APIInfo

type UpdateResourceGroupResponse

type UpdateResourceGroupResponse struct {
	ID                *string             `mapstructure:"id"`
	Name              *string             `mapstructure:"name"`
	Location          *string             `mapstructure:"location"`
	ProvisioningState *string             `mapstructure:"provisioningState"`
	Tags              *map[string]*string `mapstructure:"tags"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL