azure

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsConflictError added in v0.3.0

func IsConflictError(err error) bool

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func New

func New(opts *Options) (*API, error)

New creates a new Azure client. If no publish settings file is provided or can't be parsed, an anonymous client is created.

func (*API) BlobExists added in v0.3.0

func (a *API) BlobExists(storageaccount, storagekey, container, blob string) (bool, error)

func (*API) GetStorageServiceKeys

func (a *API) GetStorageServiceKeys(account string) (storageservice.GetStorageServiceKeysResponse, error)

func (*API) Locations

func (a *API) Locations() ([]string, error)

Locations returns a slice of Azure Locations, useful for replicating to all Locations.

func (*API) OSImageExists added in v0.2.1

func (a *API) OSImageExists(name string) (bool, error)

func (*API) ReplicateImage

func (a *API) ReplicateImage(image, offer, sku, version string, regions ...string) error

func (*API) ShareImage

func (a *API) ShareImage(image, permission string) error

func (*API) UnreplicateImage

func (a *API) UnreplicateImage(image string) error

func (*API) UploadBlob

func (a *API) UploadBlob(storageaccount, storagekey, vhd, container, blob string, overwrite bool) error

UploadBlob uploads vhd to the given storage account, container, and blob name.

It returns BlobExistsError if the blob exists and overwrite is not true.

func (*API) UrlOfBlob added in v0.3.0

func (a *API) UrlOfBlob(account, container, blob string) *url.URL

type BlobExistsError added in v0.2.1

type BlobExistsError string

func (BlobExistsError) Error added in v0.2.1

func (be BlobExistsError) Error() string

type OSImage

type OSImage struct {
	XMLName           xml.Name `xml:"http://schemas.microsoft.com/windowsazure OSImage"`
	Category          string   `xml:",omitempty"` // Public || Private || MSDN
	Label             string   `xml:",omitempty"` // Specifies an identifier for the image.
	MediaLink         string   `xml:",omitempty"` // Specifies the location of the vhd file for the image. The storage account where the vhd is located must be associated with the specified subscription.
	Name              string   // Specifies the name of the operating system image. This is the name that is used when creating one or more virtual machines using the image.
	OS                string   // Linux || Windows
	Eula              string   `xml:",omitempty"` // Specifies the End User License Agreement that is associated with the image. The value for this element is a string, but it is recommended that the value be a URL that points to a EULA.
	Description       string   `xml:",omitempty"` // Specifies the description of the image.
	ImageFamily       string   `xml:",omitempty"` // Specifies a value that can be used to group images.
	PublishedDate     string   `xml:",omitempty"` // Specifies the date when the image was added to the image repository.
	ShowInGui         bool     // Specifies whether the image should appear in the image gallery.
	PrivacyURI        string   `xml:"PrivacyUri,omitempty"`   // Specifies the URI that points to a document that contains the privacy policy related to the image.
	IconURI           string   `xml:"IconUri,omitempty"`      // Specifies the Uri to the icon that is displayed for the image in the Management Portal.
	RecommendedVMSize string   `xml:",omitempty"`             // Specifies the size to use for the virtual machine that is created from the image.
	SmallIconURI      string   `xml:"SmallIconUri,omitempty"` // Specifies the URI to the small icon that is displayed when the image is presented in the Microsoft Azure Management Portal.
	Language          string   `xml:",omitempty"`             // Specifies the language of the image.

	LogicalSizeInGB   float64 `xml:",omitempty"` //Specifies the size, in GB, of the image.
	Location          string  `xml:",omitempty"` // The geo-location in which this media is located. The Location value is derived from storage account that contains the blob in which the media is located. If the storage account belongs to an affinity group the value is NULL.
	AffinityGroup     string  `xml:",omitempty"` // Specifies the affinity in which the media is located. The AffinityGroup value is derived from storage account that contains the blob in which the media is located. If the storage account does not belong to an affinity group the value is NULL and the element is not displayed in the response. This value is NULL for platform images.
	IsPremium         string  `xml:",omitempty"` // Indicates whether the image contains software or associated services that will incur charges above the core price for the virtual machine. For additional details, see the PricingDetailLink element.
	PublisherName     string  `xml:",omitempty"` // The name of the publisher of the image. All user images have a publisher name of User.
	PricingDetailLink string  `xml:",omitempty"` // Specifies a URL for an image with IsPremium set to true, which contains the pricing details for a virtual machine that is created from the image.
}

OSImage struct for https://msdn.microsoft.com/en-us/library/azure/jj157192.aspx call.

XXX: the field ordering is important!

type Options

type Options struct {
	*platform.Options

	SubscriptionName string
	SubscriptionID   string

	// Azure API endpoint. If unset, the Azure SDK default will be used.
	ManagementURL         string
	ManagementCertificate []byte

	// Azure Storage API endpoint suffix. If unset, the Azure SDK default will be used.
	StorageEndpointSuffix string
}

type ReplicationInput

type ReplicationInput struct {
	XMLName         xml.Name `xml:"http://schemas.microsoft.com/windowsazure ReplicationInput"`
	TargetLocations []string `xml:"TargetLocations>Region"`
	Offer           string   `xml:"ComputeImageAttributes>Offer"`
	Sku             string   `xml:"ComputeImageAttributes>Sku"`
	Version         string   `xml:"ComputeImageAttributes>Version"`
}

Jump to

Keyboard shortcuts

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