Documentation ¶
Index ¶
- func IsConflictError(err error) bool
- type API
- func (a *API) AddOSImage(md *OSImage) error
- func (a *API) BlobExists(storageaccount, storagekey, container, blob string) (bool, error)
- func (a *API) CopyBlob(storageaccount, storagekey, container, targetBlob, sourceBlob string) error
- func (a *API) CreateGalleryImage(name, resourceGroup, storageAccount, blobURI string) (string, error)
- func (a *API) CreateImage(name, resourceGroup, blobURI string) (compute.Image, error)
- func (a *API) CreateInstance(name, userdata, sshkey, resourceGroup, storageAccount string, network Network) (*Machine, error)
- func (a *API) CreateResourceGroup(prefix string) (string, error)
- func (a *API) CreateStorageAccount(resourceGroup string) (string, error)
- func (a *API) DeleteBlob(storageaccount, storagekey, container, blob string) error
- func (a *API) GC(gracePeriod time.Duration) error
- func (a *API) GetBlob(storageaccount, storagekey, container, name string) (io.ReadCloser, error)
- func (a *API) GetConsoleOutput(name, resourceGroup, storageAccount string) ([]byte, error)
- func (a *API) GetIPAddresses(name, publicIPName, resourceGroup string) (string, string, error)
- func (a *API) GetOpts() *Options
- func (a *API) GetPrivateIP(name, resourceGroup string) (string, error)
- func (a *API) GetStorageServiceKeys(account string) (storageservice.GetStorageServiceKeysResponse, error)
- func (a *API) GetStorageServiceKeysARM(account, resourceGroup string) (storage.AccountListKeysResult, error)
- func (a *API) ListBlobs(storageaccount, storagekey, container string, ...) ([]storage.Blob, error)
- func (a *API) ListResourceGroups(filter string) (resources.GroupListResult, error)
- func (a *API) ListStorageContainers(storageaccount, storagekey, prefix string) (*storage.ContainerListResponse, error)
- func (a *API) Locations() ([]string, error)
- func (a *API) OSImageExists(name string) (bool, error)
- func (a *API) PrepareNetworkResources(resourceGroup string) (Network, error)
- func (a *API) ReplicateImage(image, offer, sku, version string, regions ...string) error
- func (a *API) SetupClients() error
- func (a *API) ShareImage(image, permission string) error
- func (a *API) SignBlob(storageaccount, storagekey, container, blob string) (string, error)
- func (a *API) TerminateInstance(machine *Machine, resourceGroup string) error
- func (a *API) TerminateResourceGroup(name string) error
- func (a *API) TerminateStorageContainer(storageaccount, storagekey, name string) error
- func (a *API) UnreplicateImage(image string) error
- func (a *API) UploadBlob(storageaccount, storagekey, vhd, container, blob string, overwrite bool) error
- func (a *API) UrlOfBlob(account, container, blob string) *url.URL
- type BlobExistsError
- type Machine
- type Network
- type OSImage
- type Options
- type ReplicationInput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsConflictError ¶ added in v0.3.0
Types ¶
type API ¶
type API struct { Opts *Options // contains filtered or unexported fields }
func New ¶
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 (*API) CreateGalleryImage ¶ added in v0.20.0
func (a *API) CreateGalleryImage(name, resourceGroup, storageAccount, blobURI string) (string, error)
CreateGalleryImage creates an Azure Compute Gallery with 1 image version referencing the blob as the disk
func (*API) CreateImage ¶ added in v0.20.0
CreateImage creates a managed image referencing the blob as the disk
func (*API) CreateInstance ¶ added in v0.20.0
func (*API) CreateResourceGroup ¶ added in v0.20.0
func (*API) CreateStorageAccount ¶ added in v0.20.0
func (*API) DeleteBlob ¶ added in v0.20.0
func (*API) GetBlob ¶ added in v0.20.0
func (a *API) GetBlob(storageaccount, storagekey, container, name string) (io.ReadCloser, error)
func (*API) GetConsoleOutput ¶ added in v0.20.0
func (*API) GetIPAddresses ¶ added in v0.20.0
returns PublicIP, PrivateIP, error
func (*API) GetPrivateIP ¶ added in v0.20.0
func (*API) GetStorageServiceKeys ¶
func (a *API) GetStorageServiceKeys(account string) (storageservice.GetStorageServiceKeysResponse, error)
func (*API) GetStorageServiceKeysARM ¶ added in v0.20.0
func (a *API) GetStorageServiceKeysARM(account, resourceGroup string) (storage.AccountListKeysResult, error)
func (*API) ListResourceGroups ¶ added in v0.20.0
func (a *API) ListResourceGroups(filter string) (resources.GroupListResult, error)
func (*API) ListStorageContainers ¶ added in v0.20.0
func (a *API) ListStorageContainers(storageaccount, storagekey, prefix string) (*storage.ContainerListResponse, error)
func (*API) Locations ¶
Locations returns a slice of Azure Locations which offer the Compute service, useful for replicating to all Locations.
func (*API) PrepareNetworkResources ¶ added in v0.20.0
func (*API) ReplicateImage ¶
func (*API) SetupClients ¶ added in v0.20.0
func (*API) ShareImage ¶
func (*API) TerminateInstance ¶ added in v0.20.0
TerminateInstance deletes a VM created by CreateInstance. Public IP, NIC and OS disk are deleted automatically together with the VM.
func (*API) TerminateResourceGroup ¶ added in v0.20.0
func (*API) TerminateStorageContainer ¶ added in v0.20.0
func (*API) UnreplicateImage ¶
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 AzureProfile string AzureAuthLocation string AzureSubscription string BlobURL string ImageFile string DiskURI string Publisher string Offer string Sku string Version string Size string Location string HyperVGeneration string VnetSubnetName string UseGallery bool UsePrivateIPs bool 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 // UseUserData can be use to enable custom data only or user-data only. UseUserData bool }
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"` }