diff --git a/profiles/2019-03-01/compute/mgmt/compute/computeapi/models.go b/profiles/2019-03-01/compute/mgmt/compute/computeapi/models.go
index 94e4a0da5a24..7172e8f97b35 100644
--- a/profiles/2019-03-01/compute/mgmt/compute/computeapi/models.go
+++ b/profiles/2019-03-01/compute/mgmt/compute/computeapi/models.go
@@ -22,9 +22,12 @@ package computeapi
import original "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute/computeapi"
type AvailabilitySetsClientAPI = original.AvailabilitySetsClientAPI
+type DisksClientAPI = original.DisksClientAPI
type ImagesClientAPI = original.ImagesClientAPI
type LogAnalyticsClientAPI = original.LogAnalyticsClientAPI
type OperationsClientAPI = original.OperationsClientAPI
+type ResourceSkusClientAPI = original.ResourceSkusClientAPI
+type SnapshotsClientAPI = original.SnapshotsClientAPI
type UsageClientAPI = original.UsageClientAPI
type VirtualMachineExtensionImagesClientAPI = original.VirtualMachineExtensionImagesClientAPI
type VirtualMachineExtensionsClientAPI = original.VirtualMachineExtensionsClientAPI
diff --git a/profiles/2019-03-01/compute/mgmt/compute/models.go b/profiles/2019-03-01/compute/mgmt/compute/models.go
index e7834619804f..fed2780c1b54 100644
--- a/profiles/2019-03-01/compute/mgmt/compute/models.go
+++ b/profiles/2019-03-01/compute/mgmt/compute/models.go
@@ -29,12 +29,19 @@ const (
DefaultBaseURI = original.DefaultBaseURI
)
+type AccessLevel = original.AccessLevel
+
+const (
+ None AccessLevel = original.None
+ Read AccessLevel = original.Read
+)
+
type CachingTypes = original.CachingTypes
const (
- None CachingTypes = original.None
- ReadOnly CachingTypes = original.ReadOnly
- ReadWrite CachingTypes = original.ReadWrite
+ CachingTypesNone CachingTypes = original.CachingTypesNone
+ CachingTypesReadOnly CachingTypes = original.CachingTypesReadOnly
+ CachingTypesReadWrite CachingTypes = original.CachingTypesReadWrite
)
type ComponentNames = original.ComponentNames
@@ -43,12 +50,22 @@ const (
MicrosoftWindowsShellSetup ComponentNames = original.MicrosoftWindowsShellSetup
)
+type DiskCreateOption = original.DiskCreateOption
+
+const (
+ Attach DiskCreateOption = original.Attach
+ Copy DiskCreateOption = original.Copy
+ Empty DiskCreateOption = original.Empty
+ FromImage DiskCreateOption = original.FromImage
+ Import DiskCreateOption = original.Import
+)
+
type DiskCreateOptionTypes = original.DiskCreateOptionTypes
const (
- Attach DiskCreateOptionTypes = original.Attach
- Empty DiskCreateOptionTypes = original.Empty
- FromImage DiskCreateOptionTypes = original.FromImage
+ DiskCreateOptionTypesAttach DiskCreateOptionTypes = original.DiskCreateOptionTypesAttach
+ DiskCreateOptionTypesEmpty DiskCreateOptionTypes = original.DiskCreateOptionTypesEmpty
+ DiskCreateOptionTypesFromImage DiskCreateOptionTypes = original.DiskCreateOptionTypesFromImage
)
type IPVersion = original.IPVersion
@@ -118,6 +135,28 @@ const (
ResourceIdentityTypeUserAssigned ResourceIdentityType = original.ResourceIdentityTypeUserAssigned
)
+type ResourceSkuCapacityScaleType = original.ResourceSkuCapacityScaleType
+
+const (
+ ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = original.ResourceSkuCapacityScaleTypeAutomatic
+ ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = original.ResourceSkuCapacityScaleTypeManual
+ ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = original.ResourceSkuCapacityScaleTypeNone
+)
+
+type ResourceSkuRestrictionsReasonCode = original.ResourceSkuRestrictionsReasonCode
+
+const (
+ NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = original.NotAvailableForSubscription
+ QuotaID ResourceSkuRestrictionsReasonCode = original.QuotaID
+)
+
+type ResourceSkuRestrictionsType = original.ResourceSkuRestrictionsType
+
+const (
+ Location ResourceSkuRestrictionsType = original.Location
+ Zone ResourceSkuRestrictionsType = original.Zone
+)
+
type RollingUpgradeActionType = original.RollingUpgradeActionType
const (
@@ -376,6 +415,9 @@ const (
type APIEntityReference = original.APIEntityReference
type APIError = original.APIError
type APIErrorBase = original.APIErrorBase
+type AccessURI = original.AccessURI
+type AccessURIOutput = original.AccessURIOutput
+type AccessURIRaw = original.AccessURIRaw
type AdditionalUnattendContent = original.AdditionalUnattendContent
type AutoOSUpgradePolicy = original.AutoOSUpgradePolicy
type AvailabilitySet = original.AvailabilitySet
@@ -388,14 +430,32 @@ type AvailabilitySetsClient = original.AvailabilitySetsClient
type BaseClient = original.BaseClient
type BootDiagnostics = original.BootDiagnostics
type BootDiagnosticsInstanceView = original.BootDiagnosticsInstanceView
+type CreationData = original.CreationData
type DataDisk = original.DataDisk
type DataDiskImage = original.DataDiskImage
type DiagnosticsProfile = original.DiagnosticsProfile
+type Disk = original.Disk
type DiskEncryptionSettings = original.DiskEncryptionSettings
type DiskInstanceView = original.DiskInstanceView
+type DiskList = original.DiskList
+type DiskListIterator = original.DiskListIterator
+type DiskListPage = original.DiskListPage
+type DiskProperties = original.DiskProperties
+type DiskSku = original.DiskSku
+type DiskUpdate = original.DiskUpdate
+type DiskUpdateProperties = original.DiskUpdateProperties
+type DisksClient = original.DisksClient
+type DisksCreateOrUpdateFuture = original.DisksCreateOrUpdateFuture
+type DisksDeleteFuture = original.DisksDeleteFuture
+type DisksGrantAccessFuture = original.DisksGrantAccessFuture
+type DisksRevokeAccessFuture = original.DisksRevokeAccessFuture
+type DisksUpdateFuture = original.DisksUpdateFuture
+type EncryptionSettings = original.EncryptionSettings
+type GrantAccessData = original.GrantAccessData
type HardwareProfile = original.HardwareProfile
type Image = original.Image
type ImageDataDisk = original.ImageDataDisk
+type ImageDiskReference = original.ImageDiskReference
type ImageListResult = original.ImageListResult
type ImageListResultIterator = original.ImageListResultIterator
type ImageListResultPage = original.ImageListResultPage
@@ -410,6 +470,8 @@ type ImagesDeleteFuture = original.ImagesDeleteFuture
type ImagesUpdateFuture = original.ImagesUpdateFuture
type InnerError = original.InnerError
type InstanceViewStatus = original.InstanceViewStatus
+type KeyVaultAndKeyReference = original.KeyVaultAndKeyReference
+type KeyVaultAndSecretReference = original.KeyVaultAndSecretReference
type KeyVaultKeyReference = original.KeyVaultKeyReference
type KeyVaultSecretReference = original.KeyVaultSecretReference
type LinuxConfiguration = original.LinuxConfiguration
@@ -443,6 +505,18 @@ type PurchasePlan = original.PurchasePlan
type RecoveryWalkResponse = original.RecoveryWalkResponse
type RequestRateByIntervalInput = original.RequestRateByIntervalInput
type Resource = original.Resource
+type ResourceSku = original.ResourceSku
+type ResourceSkuCapabilities = original.ResourceSkuCapabilities
+type ResourceSkuCapacity = original.ResourceSkuCapacity
+type ResourceSkuCosts = original.ResourceSkuCosts
+type ResourceSkuLocationInfo = original.ResourceSkuLocationInfo
+type ResourceSkuRestrictionInfo = original.ResourceSkuRestrictionInfo
+type ResourceSkuRestrictions = original.ResourceSkuRestrictions
+type ResourceSkusClient = original.ResourceSkusClient
+type ResourceSkusResult = original.ResourceSkusResult
+type ResourceSkusResultIterator = original.ResourceSkusResultIterator
+type ResourceSkusResultPage = original.ResourceSkusResultPage
+type ResourceUpdate = original.ResourceUpdate
type RollbackStatusInfo = original.RollbackStatusInfo
type RollingUpgradePolicy = original.RollingUpgradePolicy
type RollingUpgradeProgressInfo = original.RollingUpgradeProgressInfo
@@ -462,6 +536,18 @@ type RunCommandResultProperties = original.RunCommandResultProperties
type SSHConfiguration = original.SSHConfiguration
type SSHPublicKey = original.SSHPublicKey
type Sku = original.Sku
+type Snapshot = original.Snapshot
+type SnapshotList = original.SnapshotList
+type SnapshotListIterator = original.SnapshotListIterator
+type SnapshotListPage = original.SnapshotListPage
+type SnapshotUpdate = original.SnapshotUpdate
+type SnapshotsClient = original.SnapshotsClient
+type SnapshotsCreateOrUpdateFuture = original.SnapshotsCreateOrUpdateFuture
+type SnapshotsDeleteFuture = original.SnapshotsDeleteFuture
+type SnapshotsGrantAccessFuture = original.SnapshotsGrantAccessFuture
+type SnapshotsRevokeAccessFuture = original.SnapshotsRevokeAccessFuture
+type SnapshotsUpdateFuture = original.SnapshotsUpdateFuture
+type SourceVault = original.SourceVault
type StorageProfile = original.StorageProfile
type SubResource = original.SubResource
type SubResourceReadOnly = original.SubResourceReadOnly
@@ -638,6 +724,18 @@ func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient {
func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string) AvailabilitySetsClient {
return original.NewAvailabilitySetsClientWithBaseURI(baseURI, subscriptionID)
}
+func NewDiskListIterator(page DiskListPage) DiskListIterator {
+ return original.NewDiskListIterator(page)
+}
+func NewDiskListPage(getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage {
+ return original.NewDiskListPage(getNextPage)
+}
+func NewDisksClient(subscriptionID string) DisksClient {
+ return original.NewDisksClient(subscriptionID)
+}
+func NewDisksClientWithBaseURI(baseURI string, subscriptionID string) DisksClient {
+ return original.NewDisksClientWithBaseURI(baseURI, subscriptionID)
+}
func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator {
return original.NewImageListResultIterator(page)
}
@@ -668,12 +766,36 @@ func NewOperationsClient(subscriptionID string) OperationsClient {
func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID)
}
+func NewResourceSkusClient(subscriptionID string) ResourceSkusClient {
+ return original.NewResourceSkusClient(subscriptionID)
+}
+func NewResourceSkusClientWithBaseURI(baseURI string, subscriptionID string) ResourceSkusClient {
+ return original.NewResourceSkusClientWithBaseURI(baseURI, subscriptionID)
+}
+func NewResourceSkusResultIterator(page ResourceSkusResultPage) ResourceSkusResultIterator {
+ return original.NewResourceSkusResultIterator(page)
+}
+func NewResourceSkusResultPage(getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage {
+ return original.NewResourceSkusResultPage(getNextPage)
+}
func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator {
return original.NewRunCommandListResultIterator(page)
}
func NewRunCommandListResultPage(getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage {
return original.NewRunCommandListResultPage(getNextPage)
}
+func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator {
+ return original.NewSnapshotListIterator(page)
+}
+func NewSnapshotListPage(getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage {
+ return original.NewSnapshotListPage(getNextPage)
+}
+func NewSnapshotsClient(subscriptionID string) SnapshotsClient {
+ return original.NewSnapshotsClient(subscriptionID)
+}
+func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient {
+ return original.NewSnapshotsClientWithBaseURI(baseURI, subscriptionID)
+}
func NewUsageClient(subscriptionID string) UsageClient {
return original.NewUsageClient(subscriptionID)
}
@@ -785,6 +907,9 @@ func NewVirtualMachinesClientWithBaseURI(baseURI string, subscriptionID string)
func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
return original.NewWithBaseURI(baseURI, subscriptionID)
}
+func PossibleAccessLevelValues() []AccessLevel {
+ return original.PossibleAccessLevelValues()
+}
func PossibleCachingTypesValues() []CachingTypes {
return original.PossibleCachingTypesValues()
}
@@ -794,6 +919,9 @@ func PossibleComponentNamesValues() []ComponentNames {
func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes {
return original.PossibleDiskCreateOptionTypesValues()
}
+func PossibleDiskCreateOptionValues() []DiskCreateOption {
+ return original.PossibleDiskCreateOptionValues()
+}
func PossibleIPVersionValues() []IPVersion {
return original.PossibleIPVersionValues()
}
@@ -821,6 +949,15 @@ func PossibleProtocolTypesValues() []ProtocolTypes {
func PossibleResourceIdentityTypeValues() []ResourceIdentityType {
return original.PossibleResourceIdentityTypeValues()
}
+func PossibleResourceSkuCapacityScaleTypeValues() []ResourceSkuCapacityScaleType {
+ return original.PossibleResourceSkuCapacityScaleTypeValues()
+}
+func PossibleResourceSkuRestrictionsReasonCodeValues() []ResourceSkuRestrictionsReasonCode {
+ return original.PossibleResourceSkuRestrictionsReasonCodeValues()
+}
+func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType {
+ return original.PossibleResourceSkuRestrictionsTypeValues()
+}
func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType {
return original.PossibleRollingUpgradeActionTypeValues()
}
diff --git a/services/compute/mgmt/2017-12-01/compute/client.go b/services/compute/mgmt/2017-12-01/compute/client.go
index e0edcfb124de..b23c9ca74268 100644
--- a/services/compute/mgmt/2017-12-01/compute/client.go
+++ b/services/compute/mgmt/2017-12-01/compute/client.go
@@ -1,4 +1,4 @@
-// Package compute implements the Azure ARM Compute service API version 2017-12-01.
+// Package compute implements the Azure ARM Compute service API version .
//
// Compute Client
package compute
diff --git a/services/compute/mgmt/2017-12-01/compute/computeapi/interfaces.go b/services/compute/mgmt/2017-12-01/compute/computeapi/interfaces.go
index 3e93b4c6867e..1c71e948ee6a 100644
--- a/services/compute/mgmt/2017-12-01/compute/computeapi/interfaces.go
+++ b/services/compute/mgmt/2017-12-01/compute/computeapi/interfaces.go
@@ -203,3 +203,38 @@ type VirtualMachineRunCommandsClientAPI interface {
}
var _ VirtualMachineRunCommandsClientAPI = (*compute.VirtualMachineRunCommandsClient)(nil)
+
+// ResourceSkusClientAPI contains the set of methods on the ResourceSkusClient type.
+type ResourceSkusClientAPI interface {
+ List(ctx context.Context) (result compute.ResourceSkusResultPage, err error)
+}
+
+var _ ResourceSkusClientAPI = (*compute.ResourceSkusClient)(nil)
+
+// DisksClientAPI contains the set of methods on the DisksClient type.
+type DisksClientAPI interface {
+ CreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk compute.Disk) (result compute.DisksCreateOrUpdateFuture, err error)
+ Delete(ctx context.Context, resourceGroupName string, diskName string) (result compute.DisksDeleteFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, diskName string) (result compute.Disk, err error)
+ GrantAccess(ctx context.Context, resourceGroupName string, diskName string, grantAccessData compute.GrantAccessData) (result compute.DisksGrantAccessFuture, err error)
+ List(ctx context.Context) (result compute.DiskListPage, err error)
+ ListByResourceGroup(ctx context.Context, resourceGroupName string) (result compute.DiskListPage, err error)
+ RevokeAccess(ctx context.Context, resourceGroupName string, diskName string) (result compute.DisksRevokeAccessFuture, err error)
+ Update(ctx context.Context, resourceGroupName string, diskName string, disk compute.DiskUpdate) (result compute.DisksUpdateFuture, err error)
+}
+
+var _ DisksClientAPI = (*compute.DisksClient)(nil)
+
+// SnapshotsClientAPI contains the set of methods on the SnapshotsClient type.
+type SnapshotsClientAPI interface {
+ CreateOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot compute.Snapshot) (result compute.SnapshotsCreateOrUpdateFuture, err error)
+ Delete(ctx context.Context, resourceGroupName string, snapshotName string) (result compute.SnapshotsDeleteFuture, err error)
+ Get(ctx context.Context, resourceGroupName string, snapshotName string) (result compute.Snapshot, err error)
+ GrantAccess(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData compute.GrantAccessData) (result compute.SnapshotsGrantAccessFuture, err error)
+ List(ctx context.Context) (result compute.SnapshotListPage, err error)
+ ListByResourceGroup(ctx context.Context, resourceGroupName string) (result compute.SnapshotListPage, err error)
+ RevokeAccess(ctx context.Context, resourceGroupName string, snapshotName string) (result compute.SnapshotsRevokeAccessFuture, err error)
+ Update(ctx context.Context, resourceGroupName string, snapshotName string, snapshot compute.SnapshotUpdate) (result compute.SnapshotsUpdateFuture, err error)
+}
+
+var _ SnapshotsClientAPI = (*compute.SnapshotsClient)(nil)
diff --git a/services/compute/mgmt/2017-12-01/compute/disks.go b/services/compute/mgmt/2017-12-01/compute/disks.go
new file mode 100644
index 000000000000..7ecc51adf228
--- /dev/null
+++ b/services/compute/mgmt/2017-12-01/compute/disks.go
@@ -0,0 +1,776 @@
+package compute
+
+// Copyright (c) Microsoft and contributors. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is regenerated.
+
+import (
+ "context"
+ "github.com/Azure/go-autorest/autorest"
+ "github.com/Azure/go-autorest/autorest/azure"
+ "github.com/Azure/go-autorest/autorest/validation"
+ "github.com/Azure/go-autorest/tracing"
+ "net/http"
+)
+
+// DisksClient is the compute Client
+type DisksClient struct {
+ BaseClient
+}
+
+// NewDisksClient creates an instance of the DisksClient client.
+func NewDisksClient(subscriptionID string) DisksClient {
+ return NewDisksClientWithBaseURI(DefaultBaseURI, subscriptionID)
+}
+
+// NewDisksClientWithBaseURI creates an instance of the DisksClient client.
+func NewDisksClientWithBaseURI(baseURI string, subscriptionID string) DisksClient {
+ return DisksClient{NewWithBaseURI(baseURI, subscriptionID)}
+}
+
+// CreateOrUpdate creates or updates a disk.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
+// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
+// characters.
+// disk - disk object supplied in the body of the Put disk operation.
+func (client DisksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk Disk) (result DisksCreateOrUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.CreateOrUpdate")
+ defer func() {
+ sc := -1
+ if result.Response() != nil {
+ sc = result.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: disk,
+ Constraints: []validation.Constraint{{Target: "disk.DiskProperties", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData", Name: validation.Null, Rule: true,
+ Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData.ImageReference", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}},
+ }},
+ {Target: "disk.DiskProperties.EncryptionSettings", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "disk.DiskProperties.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "disk.DiskProperties.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "disk.DiskProperties.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil},
+ }},
+ {Target: "disk.DiskProperties.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false,
+ Chain: []validation.Constraint{{Target: "disk.DiskProperties.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
+ {Target: "disk.DiskProperties.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil},
+ }},
+ }},
+ }}}}}); err != nil {
+ return result, validation.NewError("compute.DisksClient", "CreateOrUpdate", err.Error())
+ }
+
+ req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, diskName, disk)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.CreateOrUpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
+func (client DisksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, diskName string, disk Disk) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "diskName": autorest.Encode("path", diskName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2017-03-30"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ disk.ManagedBy = nil
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPut(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters),
+ autorest.WithJSON(disk),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
+// http.Response Body if it receives an error.
+func (client DisksClient) CreateOrUpdateSender(req *http.Request) (future DisksCreateOrUpdateFuture, err error) {
+ var resp *http.Response
+ resp, err = autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ future.Future, err = azure.NewFutureFromResponse(resp)
+ return
+}
+
+// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
+// closes the http.Response Body.
+func (client DisksClient) CreateOrUpdateResponder(resp *http.Response) (result Disk, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Delete deletes a disk.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
+// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
+// characters.
+func (client DisksClient) Delete(ctx context.Context, resourceGroupName string, diskName string) (result DisksDeleteFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Delete")
+ defer func() {
+ sc := -1
+ if result.Response() != nil {
+ sc = result.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.DeletePreparer(ctx, resourceGroupName, diskName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.DeleteSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// DeletePreparer prepares the Delete request.
+func (client DisksClient) DeletePreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "diskName": autorest.Encode("path", diskName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2017-03-30"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsDelete(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// DeleteSender sends the Delete request. The method will close the
+// http.Response Body if it receives an error.
+func (client DisksClient) DeleteSender(req *http.Request) (future DisksDeleteFuture, err error) {
+ var resp *http.Response
+ resp, err = autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ future.Future, err = azure.NewFutureFromResponse(resp)
+ return
+}
+
+// DeleteResponder handles the response to the Delete request. The method always
+// closes the http.Response Body.
+func (client DisksClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Get gets information about a disk.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
+// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
+// characters.
+func (client DisksClient) Get(ctx context.Context, resourceGroupName string, diskName string) (result Disk, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Get")
+ defer func() {
+ sc := -1
+ if result.Response.Response != nil {
+ sc = result.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.GetPreparer(ctx, resourceGroupName, diskName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.GetSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", resp, "Failure sending request")
+ return
+ }
+
+ result, err = client.GetResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// GetPreparer prepares the Get request.
+func (client DisksClient) GetPreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "diskName": autorest.Encode("path", diskName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2017-03-30"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GetSender sends the Get request. The method will close the
+// http.Response Body if it receives an error.
+func (client DisksClient) GetSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// GetResponder handles the response to the Get request. The method always
+// closes the http.Response Body.
+func (client DisksClient) GetResponder(resp *http.Response) (result Disk, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// GrantAccess grants access to a disk.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
+// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
+// characters.
+// grantAccessData - access data object supplied in the body of the get disk access operation.
+func (client DisksClient) GrantAccess(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData) (result DisksGrantAccessFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.GrantAccess")
+ defer func() {
+ sc := -1
+ if result.Response() != nil {
+ sc = result.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ if err := validation.Validate([]validation.Validation{
+ {TargetValue: grantAccessData,
+ Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
+ return result, validation.NewError("compute.DisksClient", "GrantAccess", err.Error())
+ }
+
+ req, err := client.GrantAccessPreparer(ctx, resourceGroupName, diskName, grantAccessData)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.GrantAccessSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// GrantAccessPreparer prepares the GrantAccess request.
+func (client DisksClient) GrantAccessPreparer(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "diskName": autorest.Encode("path", diskName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2017-03-30"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess", pathParameters),
+ autorest.WithJSON(grantAccessData),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// GrantAccessSender sends the GrantAccess request. The method will close the
+// http.Response Body if it receives an error.
+func (client DisksClient) GrantAccessSender(req *http.Request) (future DisksGrantAccessFuture, err error) {
+ var resp *http.Response
+ resp, err = autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ future.Future, err = azure.NewFutureFromResponse(resp)
+ return
+}
+
+// GrantAccessResponder handles the response to the GrantAccess request. The method always
+// closes the http.Response Body.
+func (client DisksClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// List lists all the disks under a subscription.
+func (client DisksClient) List(ctx context.Context) (result DiskListPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.List")
+ defer func() {
+ sc := -1
+ if result.dl.Response.Response != nil {
+ sc = result.dl.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.fn = client.listNextResults
+ req, err := client.ListPreparer(ctx)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.dl.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure sending request")
+ return
+ }
+
+ result.dl, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListPreparer prepares the List request.
+func (client DisksClient) ListPreparer(ctx context.Context) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2017-03-30"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListSender sends the List request. The method will close the
+// http.Response Body if it receives an error.
+func (client DisksClient) ListSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListResponder handles the response to the List request. The method always
+// closes the http.Response Body.
+func (client DisksClient) ListResponder(resp *http.Response) (result DiskList, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// listNextResults retrieves the next set of results, if any.
+func (client DisksClient) listNextResults(ctx context.Context, lastResults DiskList) (result DiskList, err error) {
+ req, err := lastResults.diskListPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "listNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListComplete enumerates all values, automatically crossing page boundaries as required.
+func (client DisksClient) ListComplete(ctx context.Context) (result DiskListIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.List")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.page, err = client.List(ctx)
+ return
+}
+
+// ListByResourceGroup lists all the disks under a resource group.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+func (client DisksClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskListPage, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.ListByResourceGroup")
+ defer func() {
+ sc := -1
+ if result.dl.Response.Response != nil {
+ sc = result.dl.Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.fn = client.listByResourceGroupNextResults
+ req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", nil, "Failure preparing request")
+ return
+ }
+
+ resp, err := client.ListByResourceGroupSender(req)
+ if err != nil {
+ result.dl.Response = autorest.Response{Response: resp}
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure sending request")
+ return
+ }
+
+ result.dl, err = client.ListByResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure responding to request")
+ }
+
+ return
+}
+
+// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
+func (client DisksClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2017-03-30"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsGet(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
+// http.Response Body if it receives an error.
+func (client DisksClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
+ return autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+}
+
+// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
+// closes the http.Response Body.
+func (client DisksClient) ListByResourceGroupResponder(resp *http.Response) (result DiskList, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// listByResourceGroupNextResults retrieves the next set of results, if any.
+func (client DisksClient) listByResourceGroupNextResults(ctx context.Context, lastResults DiskList) (result DiskList, err error) {
+ req, err := lastResults.diskListPreparer(ctx)
+ if err != nil {
+ return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request")
+ }
+ if req == nil {
+ return
+ }
+ resp, err := client.ListByResourceGroupSender(req)
+ if err != nil {
+ result.Response = autorest.Response{Response: resp}
+ return result, autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
+ }
+ result, err = client.ListByResourceGroupResponder(resp)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
+ }
+ return
+}
+
+// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
+func (client DisksClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DiskListIterator, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.ListByResourceGroup")
+ defer func() {
+ sc := -1
+ if result.Response().Response.Response != nil {
+ sc = result.page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ result.page, err = client.ListByResourceGroup(ctx, resourceGroupName)
+ return
+}
+
+// RevokeAccess revokes access to a disk.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
+// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
+// characters.
+func (client DisksClient) RevokeAccess(ctx context.Context, resourceGroupName string, diskName string) (result DisksRevokeAccessFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.RevokeAccess")
+ defer func() {
+ sc := -1
+ if result.Response() != nil {
+ sc = result.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, diskName)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.RevokeAccessSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// RevokeAccessPreparer prepares the RevokeAccess request.
+func (client DisksClient) RevokeAccessPreparer(ctx context.Context, resourceGroupName string, diskName string) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "diskName": autorest.Encode("path", diskName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2017-03-30"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsPost(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess", pathParameters),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// RevokeAccessSender sends the RevokeAccess request. The method will close the
+// http.Response Body if it receives an error.
+func (client DisksClient) RevokeAccessSender(req *http.Request) (future DisksRevokeAccessFuture, err error) {
+ var resp *http.Response
+ resp, err = autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ future.Future, err = azure.NewFutureFromResponse(resp)
+ return
+}
+
+// RevokeAccessResponder handles the response to the RevokeAccess request. The method always
+// closes the http.Response Body.
+func (client DisksClient) RevokeAccessResponder(resp *http.Response) (result OperationStatusResponse, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
+
+// Update updates (patches) a disk.
+// Parameters:
+// resourceGroupName - the name of the resource group.
+// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
+// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
+// characters.
+// disk - disk object supplied in the body of the Patch disk operation.
+func (client DisksClient) Update(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate) (result DisksUpdateFuture, err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/DisksClient.Update")
+ defer func() {
+ sc := -1
+ if result.Response() != nil {
+ sc = result.Response().StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ req, err := client.UpdatePreparer(ctx, resourceGroupName, diskName, disk)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", nil, "Failure preparing request")
+ return
+ }
+
+ result, err = client.UpdateSender(req)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", result.Response(), "Failure sending request")
+ return
+ }
+
+ return
+}
+
+// UpdatePreparer prepares the Update request.
+func (client DisksClient) UpdatePreparer(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate) (*http.Request, error) {
+ pathParameters := map[string]interface{}{
+ "diskName": autorest.Encode("path", diskName),
+ "resourceGroupName": autorest.Encode("path", resourceGroupName),
+ "subscriptionId": autorest.Encode("path", client.SubscriptionID),
+ }
+
+ const APIVersion = "2017-03-30"
+ queryParameters := map[string]interface{}{
+ "api-version": APIVersion,
+ }
+
+ preparer := autorest.CreatePreparer(
+ autorest.AsContentType("application/json; charset=utf-8"),
+ autorest.AsPatch(),
+ autorest.WithBaseURL(client.BaseURI),
+ autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters),
+ autorest.WithJSON(disk),
+ autorest.WithQueryParameters(queryParameters))
+ return preparer.Prepare((&http.Request{}).WithContext(ctx))
+}
+
+// UpdateSender sends the Update request. The method will close the
+// http.Response Body if it receives an error.
+func (client DisksClient) UpdateSender(req *http.Request) (future DisksUpdateFuture, err error) {
+ var resp *http.Response
+ resp, err = autorest.SendWithSender(client, req,
+ azure.DoRetryWithRegistration(client.Client))
+ if err != nil {
+ return
+ }
+ future.Future, err = azure.NewFutureFromResponse(resp)
+ return
+}
+
+// UpdateResponder handles the response to the Update request. The method always
+// closes the http.Response Body.
+func (client DisksClient) UpdateResponder(resp *http.Response) (result Disk, err error) {
+ err = autorest.Respond(
+ resp,
+ client.ByInspecting(),
+ azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
+ autorest.ByUnmarshallingJSON(&result),
+ autorest.ByClosing())
+ result.Response = autorest.Response{Response: resp}
+ return
+}
diff --git a/services/compute/mgmt/2017-12-01/compute/models.go b/services/compute/mgmt/2017-12-01/compute/models.go
index 6aac0e3dc0be..4a3b482bf285 100644
--- a/services/compute/mgmt/2017-12-01/compute/models.go
+++ b/services/compute/mgmt/2017-12-01/compute/models.go
@@ -31,21 +31,36 @@ import (
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute"
+// AccessLevel enumerates the values for access level.
+type AccessLevel string
+
+const (
+ // None ...
+ None AccessLevel = "None"
+ // Read ...
+ Read AccessLevel = "Read"
+)
+
+// PossibleAccessLevelValues returns an array of possible values for the AccessLevel const type.
+func PossibleAccessLevelValues() []AccessLevel {
+ return []AccessLevel{None, Read}
+}
+
// CachingTypes enumerates the values for caching types.
type CachingTypes string
const (
- // None ...
- None CachingTypes = "None"
- // ReadOnly ...
- ReadOnly CachingTypes = "ReadOnly"
- // ReadWrite ...
- ReadWrite CachingTypes = "ReadWrite"
+ // CachingTypesNone ...
+ CachingTypesNone CachingTypes = "None"
+ // CachingTypesReadOnly ...
+ CachingTypesReadOnly CachingTypes = "ReadOnly"
+ // CachingTypesReadWrite ...
+ CachingTypesReadWrite CachingTypes = "ReadWrite"
)
// PossibleCachingTypesValues returns an array of possible values for the CachingTypes const type.
func PossibleCachingTypesValues() []CachingTypes {
- return []CachingTypes{None, ReadOnly, ReadWrite}
+ return []CachingTypes{CachingTypesNone, CachingTypesReadOnly, CachingTypesReadWrite}
}
// ComponentNames enumerates the values for component names.
@@ -61,21 +76,42 @@ func PossibleComponentNamesValues() []ComponentNames {
return []ComponentNames{MicrosoftWindowsShellSetup}
}
-// DiskCreateOptionTypes enumerates the values for disk create option types.
-type DiskCreateOptionTypes string
+// DiskCreateOption enumerates the values for disk create option.
+type DiskCreateOption string
const (
// Attach ...
- Attach DiskCreateOptionTypes = "Attach"
+ Attach DiskCreateOption = "Attach"
+ // Copy ...
+ Copy DiskCreateOption = "Copy"
// Empty ...
- Empty DiskCreateOptionTypes = "Empty"
+ Empty DiskCreateOption = "Empty"
// FromImage ...
- FromImage DiskCreateOptionTypes = "FromImage"
+ FromImage DiskCreateOption = "FromImage"
+ // Import ...
+ Import DiskCreateOption = "Import"
+)
+
+// PossibleDiskCreateOptionValues returns an array of possible values for the DiskCreateOption const type.
+func PossibleDiskCreateOptionValues() []DiskCreateOption {
+ return []DiskCreateOption{Attach, Copy, Empty, FromImage, Import}
+}
+
+// DiskCreateOptionTypes enumerates the values for disk create option types.
+type DiskCreateOptionTypes string
+
+const (
+ // DiskCreateOptionTypesAttach ...
+ DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach"
+ // DiskCreateOptionTypesEmpty ...
+ DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty"
+ // DiskCreateOptionTypesFromImage ...
+ DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage"
)
// PossibleDiskCreateOptionTypesValues returns an array of possible values for the DiskCreateOptionTypes const type.
func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes {
- return []DiskCreateOptionTypes{Attach, Empty, FromImage}
+ return []DiskCreateOptionTypes{DiskCreateOptionTypesAttach, DiskCreateOptionTypesEmpty, DiskCreateOptionTypesFromImage}
}
// InstanceViewTypes enumerates the values for instance view types.
@@ -221,6 +257,53 @@ func PossibleResourceIdentityTypeValues() []ResourceIdentityType {
return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned}
}
+// ResourceSkuCapacityScaleType enumerates the values for resource sku capacity scale type.
+type ResourceSkuCapacityScaleType string
+
+const (
+ // ResourceSkuCapacityScaleTypeAutomatic ...
+ ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "Automatic"
+ // ResourceSkuCapacityScaleTypeManual ...
+ ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "Manual"
+ // ResourceSkuCapacityScaleTypeNone ...
+ ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "None"
+)
+
+// PossibleResourceSkuCapacityScaleTypeValues returns an array of possible values for the ResourceSkuCapacityScaleType const type.
+func PossibleResourceSkuCapacityScaleTypeValues() []ResourceSkuCapacityScaleType {
+ return []ResourceSkuCapacityScaleType{ResourceSkuCapacityScaleTypeAutomatic, ResourceSkuCapacityScaleTypeManual, ResourceSkuCapacityScaleTypeNone}
+}
+
+// ResourceSkuRestrictionsReasonCode enumerates the values for resource sku restrictions reason code.
+type ResourceSkuRestrictionsReasonCode string
+
+const (
+ // NotAvailableForSubscription ...
+ NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription"
+ // QuotaID ...
+ QuotaID ResourceSkuRestrictionsReasonCode = "QuotaId"
+)
+
+// PossibleResourceSkuRestrictionsReasonCodeValues returns an array of possible values for the ResourceSkuRestrictionsReasonCode const type.
+func PossibleResourceSkuRestrictionsReasonCodeValues() []ResourceSkuRestrictionsReasonCode {
+ return []ResourceSkuRestrictionsReasonCode{NotAvailableForSubscription, QuotaID}
+}
+
+// ResourceSkuRestrictionsType enumerates the values for resource sku restrictions type.
+type ResourceSkuRestrictionsType string
+
+const (
+ // Location ...
+ Location ResourceSkuRestrictionsType = "Location"
+ // Zone ...
+ Zone ResourceSkuRestrictionsType = "Zone"
+)
+
+// PossibleResourceSkuRestrictionsTypeValues returns an array of possible values for the ResourceSkuRestrictionsType const type.
+func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType {
+ return []ResourceSkuRestrictionsType{Location, Zone}
+}
+
// RollingUpgradeActionType enumerates the values for rolling upgrade action type.
type RollingUpgradeActionType string
@@ -743,6 +826,91 @@ func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes {
return []VirtualMachineSizeTypes{BasicA0, BasicA1, BasicA2, BasicA3, BasicA4, StandardA0, StandardA1, StandardA10, StandardA11, StandardA1V2, StandardA2, StandardA2mV2, StandardA2V2, StandardA3, StandardA4, StandardA4mV2, StandardA4V2, StandardA5, StandardA6, StandardA7, StandardA8, StandardA8mV2, StandardA8V2, StandardA9, StandardB1ms, StandardB1s, StandardB2ms, StandardB2s, StandardB4ms, StandardB8ms, StandardD1, StandardD11, StandardD11V2, StandardD12, StandardD12V2, StandardD13, StandardD13V2, StandardD14, StandardD14V2, StandardD15V2, StandardD16sV3, StandardD16V3, StandardD1V2, StandardD2, StandardD2sV3, StandardD2V2, StandardD2V3, StandardD3, StandardD32sV3, StandardD32V3, StandardD3V2, StandardD4, StandardD4sV3, StandardD4V2, StandardD4V3, StandardD5V2, StandardD64sV3, StandardD64V3, StandardD8sV3, StandardD8V3, StandardDS1, StandardDS11, StandardDS11V2, StandardDS12, StandardDS12V2, StandardDS13, StandardDS132V2, StandardDS134V2, StandardDS13V2, StandardDS14, StandardDS144V2, StandardDS148V2, StandardDS14V2, StandardDS15V2, StandardDS1V2, StandardDS2, StandardDS2V2, StandardDS3, StandardDS3V2, StandardDS4, StandardDS4V2, StandardDS5V2, StandardE16sV3, StandardE16V3, StandardE2sV3, StandardE2V3, StandardE3216V3, StandardE328sV3, StandardE32sV3, StandardE32V3, StandardE4sV3, StandardE4V3, StandardE6416sV3, StandardE6432sV3, StandardE64sV3, StandardE64V3, StandardE8sV3, StandardE8V3, StandardF1, StandardF16, StandardF16s, StandardF16sV2, StandardF1s, StandardF2, StandardF2s, StandardF2sV2, StandardF32sV2, StandardF4, StandardF4s, StandardF4sV2, StandardF64sV2, StandardF72sV2, StandardF8, StandardF8s, StandardF8sV2, StandardG1, StandardG2, StandardG3, StandardG4, StandardG5, StandardGS1, StandardGS2, StandardGS3, StandardGS4, StandardGS44, StandardGS48, StandardGS5, StandardGS516, StandardGS58, StandardH16, StandardH16m, StandardH16mr, StandardH16r, StandardH8, StandardH8m, StandardL16s, StandardL32s, StandardL4s, StandardL8s, StandardM12832ms, StandardM12864ms, StandardM128ms, StandardM128s, StandardM6416ms, StandardM6432ms, StandardM64ms, StandardM64s, StandardNC12, StandardNC12sV2, StandardNC12sV3, StandardNC24, StandardNC24r, StandardNC24rsV2, StandardNC24rsV3, StandardNC24sV2, StandardNC24sV3, StandardNC6, StandardNC6sV2, StandardNC6sV3, StandardND12s, StandardND24rs, StandardND24s, StandardND6s, StandardNV12, StandardNV24, StandardNV6}
}
+// AccessURI a disk access SAS uri.
+type AccessURI struct {
+ autorest.Response `json:"-"`
+ // AccessURIOutput - Operation output data (raw JSON)
+ *AccessURIOutput `json:"properties,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for AccessURI.
+func (au AccessURI) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if au.AccessURIOutput != nil {
+ objectMap["properties"] = au.AccessURIOutput
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for AccessURI struct.
+func (au *AccessURI) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "properties":
+ if v != nil {
+ var accessURIOutput AccessURIOutput
+ err = json.Unmarshal(*v, &accessURIOutput)
+ if err != nil {
+ return err
+ }
+ au.AccessURIOutput = &accessURIOutput
+ }
+ }
+ }
+
+ return nil
+}
+
+// AccessURIOutput azure properties, including output.
+type AccessURIOutput struct {
+ // AccessURIRaw - Operation output data (raw JSON)
+ *AccessURIRaw `json:"output,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for AccessURIOutput.
+func (auo AccessURIOutput) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if auo.AccessURIRaw != nil {
+ objectMap["output"] = auo.AccessURIRaw
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for AccessURIOutput struct.
+func (auo *AccessURIOutput) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "output":
+ if v != nil {
+ var accessURIRaw AccessURIRaw
+ err = json.Unmarshal(*v, &accessURIRaw)
+ if err != nil {
+ return err
+ }
+ auo.AccessURIRaw = &accessURIRaw
+ }
+ }
+ }
+
+ return nil
+}
+
+// AccessURIRaw this object gets 'bubbled up' through flattening.
+type AccessURIRaw struct {
+ // AccessSAS - READ-ONLY; A SAS uri for accessing a disk.
+ AccessSAS *string `json:"accessSAS,omitempty"`
+}
+
// AdditionalUnattendContent specifies additional XML formatted information that can be included in the
// Unattend.xml file, which is used by Windows Setup. Contents are defined by setting name, component name,
// and the pass in which the content is applied.
@@ -1159,6 +1327,20 @@ type BootDiagnosticsInstanceView struct {
SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"`
}
+// CreationData data used when creating a disk.
+type CreationData struct {
+ // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy'
+ CreateOption DiskCreateOption `json:"createOption,omitempty"`
+ // StorageAccountID - If createOption is Import, the Azure Resource Manager identifier of the storage account containing the blob to import as a disk. Required only if the blob is in a different subscription
+ StorageAccountID *string `json:"storageAccountId,omitempty"`
+ // ImageReference - Disk source information.
+ ImageReference *ImageDiskReference `json:"imageReference,omitempty"`
+ // SourceURI - If createOption is Import, this is the URI of a blob to be imported into a managed disk.
+ SourceURI *string `json:"sourceUri,omitempty"`
+ // SourceResourceID - If createOption is Copy, this is the ARM id of the source snapshot or disk.
+ SourceResourceID *string `json:"sourceResourceId,omitempty"`
+}
+
// DataDisk describes a data disk.
type DataDisk struct {
// Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
@@ -1169,11 +1351,11 @@ type DataDisk struct {
Vhd *VirtualHardDisk `json:"vhd,omitempty"`
// Image - The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.
Image *VirtualHardDisk `json:"image,omitempty"`
- // Caching - Specifies the caching requirements.
Possible values are:
**None**
**ReadOnly**
**ReadWrite**
Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite'
+ // Caching - Specifies the caching requirements.
Possible values are:
**None**
**ReadOnly**
**ReadWrite**
Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite'
Caching CachingTypes `json:"caching,omitempty"`
// WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk.
WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"`
- // CreateOption - Specifies how the virtual machine should be created.
Possible values are:
**Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.
**FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'FromImage', 'Empty', 'Attach'
+ // CreateOption - Specifies how the virtual machine should be created.
Possible values are:
**Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.
**FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach'
CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"`
// DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.
This value cannot be larger than 1023 GB
DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
@@ -1194,38 +1376,15 @@ type DiagnosticsProfile struct {
BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"`
}
-// DiskEncryptionSettings describes a Encryption Settings for a Disk
-type DiskEncryptionSettings struct {
- // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret.
- DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"`
- // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault.
- KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"`
- // Enabled - Specifies whether disk encryption should be enabled on the virtual machine.
- Enabled *bool `json:"enabled,omitempty"`
-}
-
-// DiskInstanceView the instance view of the disk.
-type DiskInstanceView struct {
- // Name - The disk name.
- Name *string `json:"name,omitempty"`
- // EncryptionSettings - Specifies the encryption settings for the OS Disk.
Minimum api-version: 2015-06-15
- EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"`
- // Statuses - The resource status information.
- Statuses *[]InstanceViewStatus `json:"statuses,omitempty"`
-}
-
-// HardwareProfile specifies the hardware settings for the virtual machine.
-type HardwareProfile struct {
- // VMSize - Specifies the size of the virtual machine. For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
The available VM sizes depend on region and availability set. For a list of available sizes use these APIs:
[List all available virtual machine sizes in an availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes)
[List all available virtual machine sizes in a region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list)
[List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). Possible values include: 'BasicA0', 'BasicA1', 'BasicA2', 'BasicA3', 'BasicA4', 'StandardA0', 'StandardA1', 'StandardA2', 'StandardA3', 'StandardA4', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA9', 'StandardA10', 'StandardA11', 'StandardA1V2', 'StandardA2V2', 'StandardA4V2', 'StandardA8V2', 'StandardA2mV2', 'StandardA4mV2', 'StandardA8mV2', 'StandardB1s', 'StandardB1ms', 'StandardB2s', 'StandardB2ms', 'StandardB4ms', 'StandardB8ms', 'StandardD1', 'StandardD2', 'StandardD3', 'StandardD4', 'StandardD11', 'StandardD12', 'StandardD13', 'StandardD14', 'StandardD1V2', 'StandardD2V2', 'StandardD3V2', 'StandardD4V2', 'StandardD5V2', 'StandardD2V3', 'StandardD4V3', 'StandardD8V3', 'StandardD16V3', 'StandardD32V3', 'StandardD64V3', 'StandardD2sV3', 'StandardD4sV3', 'StandardD8sV3', 'StandardD16sV3', 'StandardD32sV3', 'StandardD64sV3', 'StandardD11V2', 'StandardD12V2', 'StandardD13V2', 'StandardD14V2', 'StandardD15V2', 'StandardDS1', 'StandardDS2', 'StandardDS3', 'StandardDS4', 'StandardDS11', 'StandardDS12', 'StandardDS13', 'StandardDS14', 'StandardDS1V2', 'StandardDS2V2', 'StandardDS3V2', 'StandardDS4V2', 'StandardDS5V2', 'StandardDS11V2', 'StandardDS12V2', 'StandardDS13V2', 'StandardDS14V2', 'StandardDS15V2', 'StandardDS134V2', 'StandardDS132V2', 'StandardDS148V2', 'StandardDS144V2', 'StandardE2V3', 'StandardE4V3', 'StandardE8V3', 'StandardE16V3', 'StandardE32V3', 'StandardE64V3', 'StandardE2sV3', 'StandardE4sV3', 'StandardE8sV3', 'StandardE16sV3', 'StandardE32sV3', 'StandardE64sV3', 'StandardE3216V3', 'StandardE328sV3', 'StandardE6432sV3', 'StandardE6416sV3', 'StandardF1', 'StandardF2', 'StandardF4', 'StandardF8', 'StandardF16', 'StandardF1s', 'StandardF2s', 'StandardF4s', 'StandardF8s', 'StandardF16s', 'StandardF2sV2', 'StandardF4sV2', 'StandardF8sV2', 'StandardF16sV2', 'StandardF32sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5', 'StandardGS48', 'StandardGS44', 'StandardGS516', 'StandardGS58', 'StandardH8', 'StandardH16', 'StandardH8m', 'StandardH16m', 'StandardH16r', 'StandardH16mr', 'StandardL4s', 'StandardL8s', 'StandardL16s', 'StandardL32s', 'StandardM64s', 'StandardM64ms', 'StandardM128s', 'StandardM128ms', 'StandardM6432ms', 'StandardM6416ms', 'StandardM12864ms', 'StandardM12832ms', 'StandardNC6', 'StandardNC12', 'StandardNC24', 'StandardNC24r', 'StandardNC6sV2', 'StandardNC12sV2', 'StandardNC24sV2', 'StandardNC24rsV2', 'StandardNC6sV3', 'StandardNC12sV3', 'StandardNC24sV3', 'StandardNC24rsV3', 'StandardND6s', 'StandardND12s', 'StandardND24s', 'StandardND24rs', 'StandardNV6', 'StandardNV12', 'StandardNV24'
- VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"`
-}
-
-// Image the source user image virtual hard disk. The virtual hard disk will be copied before being
-// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not
-// exist.
-type Image struct {
+// Disk disk resource.
+type Disk struct {
autorest.Response `json:"-"`
- *ImageProperties `json:"properties,omitempty"`
+ // ManagedBy - READ-ONLY; A relative URI containing the ID of the VM that has the disk attached.
+ ManagedBy *string `json:"managedBy,omitempty"`
+ Sku *DiskSku `json:"sku,omitempty"`
+ // Zones - The Logical zone list for Disk.
+ Zones *[]string `json:"zones,omitempty"`
+ *DiskProperties `json:"properties,omitempty"`
// ID - READ-ONLY; Resource Id
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; Resource name
@@ -1238,23 +1397,29 @@ type Image struct {
Tags map[string]*string `json:"tags"`
}
-// MarshalJSON is the custom marshaler for Image.
-func (i Image) MarshalJSON() ([]byte, error) {
+// MarshalJSON is the custom marshaler for Disk.
+func (d Disk) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
- if i.ImageProperties != nil {
- objectMap["properties"] = i.ImageProperties
+ if d.Sku != nil {
+ objectMap["sku"] = d.Sku
}
- if i.Location != nil {
- objectMap["location"] = i.Location
+ if d.Zones != nil {
+ objectMap["zones"] = d.Zones
}
- if i.Tags != nil {
- objectMap["tags"] = i.Tags
+ if d.DiskProperties != nil {
+ objectMap["properties"] = d.DiskProperties
+ }
+ if d.Location != nil {
+ objectMap["location"] = d.Location
+ }
+ if d.Tags != nil {
+ objectMap["tags"] = d.Tags
}
return json.Marshal(objectMap)
}
-// UnmarshalJSON is the custom unmarshaler for Image struct.
-func (i *Image) UnmarshalJSON(body []byte) error {
+// UnmarshalJSON is the custom unmarshaler for Disk struct.
+func (d *Disk) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
@@ -1262,14 +1427,41 @@ func (i *Image) UnmarshalJSON(body []byte) error {
}
for k, v := range m {
switch k {
+ case "managedBy":
+ if v != nil {
+ var managedBy string
+ err = json.Unmarshal(*v, &managedBy)
+ if err != nil {
+ return err
+ }
+ d.ManagedBy = &managedBy
+ }
+ case "sku":
+ if v != nil {
+ var sku DiskSku
+ err = json.Unmarshal(*v, &sku)
+ if err != nil {
+ return err
+ }
+ d.Sku = &sku
+ }
+ case "zones":
+ if v != nil {
+ var zones []string
+ err = json.Unmarshal(*v, &zones)
+ if err != nil {
+ return err
+ }
+ d.Zones = &zones
+ }
case "properties":
if v != nil {
- var imageProperties ImageProperties
- err = json.Unmarshal(*v, &imageProperties)
+ var diskProperties DiskProperties
+ err = json.Unmarshal(*v, &diskProperties)
if err != nil {
return err
}
- i.ImageProperties = &imageProperties
+ d.DiskProperties = &diskProperties
}
case "id":
if v != nil {
@@ -1278,7 +1470,7 @@ func (i *Image) UnmarshalJSON(body []byte) error {
if err != nil {
return err
}
- i.ID = &ID
+ d.ID = &ID
}
case "name":
if v != nil {
@@ -1287,7 +1479,7 @@ func (i *Image) UnmarshalJSON(body []byte) error {
if err != nil {
return err
}
- i.Name = &name
+ d.Name = &name
}
case "type":
if v != nil {
@@ -1296,7 +1488,7 @@ func (i *Image) UnmarshalJSON(body []byte) error {
if err != nil {
return err
}
- i.Type = &typeVar
+ d.Type = &typeVar
}
case "location":
if v != nil {
@@ -1305,7 +1497,7 @@ func (i *Image) UnmarshalJSON(body []byte) error {
if err != nil {
return err
}
- i.Location = &location
+ d.Location = &location
}
case "tags":
if v != nil {
@@ -1314,7 +1506,7 @@ func (i *Image) UnmarshalJSON(body []byte) error {
if err != nil {
return err
}
- i.Tags = tags
+ d.Tags = tags
}
}
}
@@ -1322,44 +1514,46 @@ func (i *Image) UnmarshalJSON(body []byte) error {
return nil
}
-// ImageDataDisk describes a data disk.
-type ImageDataDisk struct {
- // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
- Lun *int32 `json:"lun,omitempty"`
- // Snapshot - The snapshot.
- Snapshot *SubResource `json:"snapshot,omitempty"`
- // ManagedDisk - The managedDisk.
- ManagedDisk *SubResource `json:"managedDisk,omitempty"`
- // BlobURI - The Virtual Hard Disk.
- BlobURI *string `json:"blobUri,omitempty"`
- // Caching - Specifies the caching requirements.
Possible values are:
**None**
**ReadOnly**
**ReadWrite**
Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite'
- Caching CachingTypes `json:"caching,omitempty"`
- // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.
This value cannot be larger than 1023 GB
- DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
- // StorageAccountType - Specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'StandardLRS', 'PremiumLRS'
- StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"`
+// DiskEncryptionSettings describes a Encryption Settings for a Disk
+type DiskEncryptionSettings struct {
+ // DiskEncryptionKey - Specifies the location of the disk encryption key, which is a Key Vault Secret.
+ DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"`
+ // KeyEncryptionKey - Specifies the location of the key encryption key in Key Vault.
+ KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"`
+ // Enabled - Specifies whether disk encryption should be enabled on the virtual machine.
+ Enabled *bool `json:"enabled,omitempty"`
}
-// ImageListResult the List Image operation response.
-type ImageListResult struct {
+// DiskInstanceView the instance view of the disk.
+type DiskInstanceView struct {
+ // Name - The disk name.
+ Name *string `json:"name,omitempty"`
+ // EncryptionSettings - Specifies the encryption settings for the OS Disk.
Minimum api-version: 2015-06-15
+ EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"`
+ // Statuses - The resource status information.
+ Statuses *[]InstanceViewStatus `json:"statuses,omitempty"`
+}
+
+// DiskList the List Disks operation response.
+type DiskList struct {
autorest.Response `json:"-"`
- // Value - The list of Images.
- Value *[]Image `json:"value,omitempty"`
- // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images.
+ // Value - A list of disks.
+ Value *[]Disk `json:"value,omitempty"`
+ // NextLink - The uri to fetch the next page of disks. Call ListNext() with this to fetch the next page of disks.
NextLink *string `json:"nextLink,omitempty"`
}
-// ImageListResultIterator provides access to a complete listing of Image values.
-type ImageListResultIterator struct {
+// DiskListIterator provides access to a complete listing of Disk values.
+type DiskListIterator struct {
i int
- page ImageListResultPage
+ page DiskListPage
}
// NextWithContext advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
-func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) {
+func (iter *DiskListIterator) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext")
+ ctx = tracing.StartSpan(ctx, fqdn+"/DiskListIterator.NextWithContext")
defer func() {
sc := -1
if iter.Response().Response.Response != nil {
@@ -1384,62 +1578,62 @@ func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err e
// Next advances to the next value. If there was an error making
// the request the iterator does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
-func (iter *ImageListResultIterator) Next() error {
+func (iter *DiskListIterator) Next() error {
return iter.NextWithContext(context.Background())
}
// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter ImageListResultIterator) NotDone() bool {
+func (iter DiskListIterator) NotDone() bool {
return iter.page.NotDone() && iter.i < len(iter.page.Values())
}
// Response returns the raw server response from the last page request.
-func (iter ImageListResultIterator) Response() ImageListResult {
+func (iter DiskListIterator) Response() DiskList {
return iter.page.Response()
}
// Value returns the current value or a zero-initialized value if the
// iterator has advanced beyond the end of the collection.
-func (iter ImageListResultIterator) Value() Image {
+func (iter DiskListIterator) Value() Disk {
if !iter.page.NotDone() {
- return Image{}
+ return Disk{}
}
return iter.page.Values()[iter.i]
}
-// Creates a new instance of the ImageListResultIterator type.
-func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator {
- return ImageListResultIterator{page: page}
+// Creates a new instance of the DiskListIterator type.
+func NewDiskListIterator(page DiskListPage) DiskListIterator {
+ return DiskListIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
-func (ilr ImageListResult) IsEmpty() bool {
- return ilr.Value == nil || len(*ilr.Value) == 0
+func (dl DiskList) IsEmpty() bool {
+ return dl.Value == nil || len(*dl.Value) == 0
}
-// imageListResultPreparer prepares a request to retrieve the next set of results.
+// diskListPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
-func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) {
- if ilr.NextLink == nil || len(to.String(ilr.NextLink)) < 1 {
+func (dl DiskList) diskListPreparer(ctx context.Context) (*http.Request, error) {
+ if dl.NextLink == nil || len(to.String(dl.NextLink)) < 1 {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
- autorest.WithBaseURL(to.String(ilr.NextLink)))
+ autorest.WithBaseURL(to.String(dl.NextLink)))
}
-// ImageListResultPage contains a page of Image values.
-type ImageListResultPage struct {
- fn func(context.Context, ImageListResult) (ImageListResult, error)
- ilr ImageListResult
+// DiskListPage contains a page of Disk values.
+type DiskListPage struct {
+ fn func(context.Context, DiskList) (DiskList, error)
+ dl DiskList
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
-func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) {
+func (page *DiskListPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext")
+ ctx = tracing.StartSpan(ctx, fqdn+"/DiskListPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
@@ -1448,207 +1642,236 @@ func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error
tracing.EndSpan(ctx, sc, err)
}()
}
- next, err := page.fn(ctx, page.ilr)
+ next, err := page.fn(ctx, page.dl)
if err != nil {
return err
}
- page.ilr = next
+ page.dl = next
return nil
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
-func (page *ImageListResultPage) Next() error {
+func (page *DiskListPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page ImageListResultPage) NotDone() bool {
- return !page.ilr.IsEmpty()
+func (page DiskListPage) NotDone() bool {
+ return !page.dl.IsEmpty()
}
// Response returns the raw server response from the last page request.
-func (page ImageListResultPage) Response() ImageListResult {
- return page.ilr
+func (page DiskListPage) Response() DiskList {
+ return page.dl
}
// Values returns the slice of values for the current page or nil if there are no values.
-func (page ImageListResultPage) Values() []Image {
- if page.ilr.IsEmpty() {
+func (page DiskListPage) Values() []Disk {
+ if page.dl.IsEmpty() {
return nil
}
- return *page.ilr.Value
+ return *page.dl.Value
}
-// Creates a new instance of the ImageListResultPage type.
-func NewImageListResultPage(getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage {
- return ImageListResultPage{fn: getNextPage}
+// Creates a new instance of the DiskListPage type.
+func NewDiskListPage(getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage {
+ return DiskListPage{fn: getNextPage}
}
-// ImageOSDisk describes an Operating System disk.
-type ImageOSDisk struct {
- // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image.
Possible values are:
**Windows**
**Linux**. Possible values include: 'Windows', 'Linux'
+// DiskProperties disk resource properties.
+type DiskProperties struct {
+ // TimeCreated - READ-ONLY; The time when the disk was created.
+ TimeCreated *date.Time `json:"timeCreated,omitempty"`
+ // OsType - The Operating System type. Possible values include: 'Windows', 'Linux'
OsType OperatingSystemTypes `json:"osType,omitempty"`
- // OsState - The OS State. Possible values include: 'Generalized', 'Specialized'
- OsState OperatingSystemStateTypes `json:"osState,omitempty"`
- // Snapshot - The snapshot.
- Snapshot *SubResource `json:"snapshot,omitempty"`
- // ManagedDisk - The managedDisk.
- ManagedDisk *SubResource `json:"managedDisk,omitempty"`
- // BlobURI - The Virtual Hard Disk.
- BlobURI *string `json:"blobUri,omitempty"`
- // Caching - Specifies the caching requirements.
Possible values are:
**None**
**ReadOnly**
**ReadWrite**
Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'None', 'ReadOnly', 'ReadWrite'
- Caching CachingTypes `json:"caching,omitempty"`
- // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.
This value cannot be larger than 1023 GB
+ // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created.
+ CreationData *CreationData `json:"creationData,omitempty"`
+ // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size.
DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
- // StorageAccountType - Specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'StandardLRS', 'PremiumLRS'
- StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"`
+ // EncryptionSettings - Encryption settings for disk or snapshot
+ EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"`
+ // ProvisioningState - READ-ONLY; The disk provisioning state.
+ ProvisioningState *string `json:"provisioningState,omitempty"`
}
-// ImageProperties describes the properties of an Image.
-type ImageProperties struct {
- // SourceVirtualMachine - The source virtual machine from which Image is created.
- SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"`
- // StorageProfile - Specifies the storage settings for the virtual machine disks.
- StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"`
- // ProvisioningState - READ-ONLY; The provisioning state.
- ProvisioningState *string `json:"provisioningState,omitempty"`
+// DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type DisksCreateOrUpdateFuture struct {
+ azure.Future
}
-// ImageReference specifies information about the image to use. You can specify information about platform
-// images, marketplace images, or virtual machine images. This element is required when you want to use a
-// platform image, marketplace image, or virtual machine image, but is not used in other creation
-// operations.
-type ImageReference struct {
- // Publisher - The image publisher.
- Publisher *string `json:"publisher,omitempty"`
- // Offer - Specifies the offer of the platform image or marketplace image used to create the virtual machine.
- Offer *string `json:"offer,omitempty"`
- // Sku - The image SKU.
- Sku *string `json:"sku,omitempty"`
- // Version - Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available.
- Version *string `json:"version,omitempty"`
- // ID - Resource Id
- ID *string `json:"id,omitempty"`
+// Result returns the result of the asynchronous operation.
+// If the operation has not completed it will return an error.
+func (future *DisksCreateOrUpdateFuture) Result(client DisksClient) (d Disk, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ err = azure.NewAsyncOpIncompleteError("compute.DisksCreateOrUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
+ d, err = client.CreateOrUpdateResponder(d.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request")
+ }
+ }
+ return
}
-// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
-// operation.
-type ImagesCreateOrUpdateFuture struct {
+// DisksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
+type DisksDeleteFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
-func (future *ImagesCreateOrUpdateFuture) Result(client ImagesClient) (i Image, err error) {
+func (future *DisksDeleteFuture) Result(client DisksClient) (osr OperationStatusResponse, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
+ err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
- err = azure.NewAsyncOpIncompleteError("compute.ImagesCreateOrUpdateFuture")
+ err = azure.NewAsyncOpIncompleteError("compute.DisksDeleteFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent {
- i, err = client.CreateOrUpdateResponder(i.Response.Response)
+ if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
+ osr, err = client.DeleteResponder(osr.Response.Response)
if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.DisksDeleteFuture", "Result", osr.Response.Response, "Failure responding to request")
}
}
return
}
-// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
-type ImagesDeleteFuture struct {
+// DisksGrantAccessFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type DisksGrantAccessFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
-func (future *ImagesDeleteFuture) Result(client ImagesClient) (osr OperationStatusResponse, err error) {
+func (future *DisksGrantAccessFuture) Result(client DisksClient) (au AccessURI, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", future.Response(), "Polling failure")
+ err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
- err = azure.NewAsyncOpIncompleteError("compute.ImagesDeleteFuture")
+ err = azure.NewAsyncOpIncompleteError("compute.DisksGrantAccessFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
- osr, err = client.DeleteResponder(osr.Response.Response)
+ if au.Response.Response, err = future.GetResult(sender); err == nil && au.Response.Response.StatusCode != http.StatusNoContent {
+ au, err = client.GrantAccessResponder(au.Response.Response)
if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", osr.Response.Response, "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.DisksGrantAccessFuture", "Result", au.Response.Response, "Failure responding to request")
}
}
return
}
-// ImageStorageProfile describes a storage profile.
-type ImageStorageProfile struct {
- // OsDisk - Specifies information about the operating system disk used by the virtual machine.
For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- OsDisk *ImageOSDisk `json:"osDisk,omitempty"`
- // DataDisks - Specifies the parameters that are used to add a data disk to a virtual machine.
For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
- DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"`
- // ZoneResilient - Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions that provide Zone Redundant Storage (ZRS).
- ZoneResilient *bool `json:"zoneResilient,omitempty"`
+// DiskSku the disks and snapshots sku name. Can be Standard_LRS or Premium_LRS.
+type DiskSku struct {
+ // Name - The sku name. Possible values include: 'StandardLRS', 'PremiumLRS'
+ Name StorageAccountTypes `json:"name,omitempty"`
+ // Tier - READ-ONLY; The sku tier.
+ Tier *string `json:"tier,omitempty"`
}
-// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
-type ImagesUpdateFuture struct {
+// DisksRevokeAccessFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type DisksRevokeAccessFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
-func (future *ImagesUpdateFuture) Result(client ImagesClient) (i Image, err error) {
+func (future *DisksRevokeAccessFuture) Result(client DisksClient) (osr OperationStatusResponse, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", future.Response(), "Polling failure")
+ err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
- err = azure.NewAsyncOpIncompleteError("compute.ImagesUpdateFuture")
+ err = azure.NewAsyncOpIncompleteError("compute.DisksRevokeAccessFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent {
- i, err = client.UpdateResponder(i.Response.Response)
+ if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
+ osr, err = client.RevokeAccessResponder(osr.Response.Response)
if err != nil {
- err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", i.Response.Response, "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.DisksRevokeAccessFuture", "Result", osr.Response.Response, "Failure responding to request")
}
}
return
}
-// ImageUpdate the source user image virtual hard disk. Only tags may be updated.
-type ImageUpdate struct {
- *ImageProperties `json:"properties,omitempty"`
+// DisksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
+type DisksUpdateFuture struct {
+ azure.Future
+}
+
+// Result returns the result of the asynchronous operation.
+// If the operation has not completed it will return an error.
+func (future *DisksUpdateFuture) Result(client DisksClient) (d Disk, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ err = azure.NewAsyncOpIncompleteError("compute.DisksUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent {
+ d, err = client.UpdateResponder(d.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.DisksUpdateFuture", "Result", d.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// DiskUpdate disk update resource.
+type DiskUpdate struct {
+ *DiskUpdateProperties `json:"properties,omitempty"`
// Tags - Resource tags
Tags map[string]*string `json:"tags"`
+ Sku *DiskSku `json:"sku,omitempty"`
}
-// MarshalJSON is the custom marshaler for ImageUpdate.
-func (iu ImageUpdate) MarshalJSON() ([]byte, error) {
+// MarshalJSON is the custom marshaler for DiskUpdate.
+func (du DiskUpdate) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
- if iu.ImageProperties != nil {
- objectMap["properties"] = iu.ImageProperties
+ if du.DiskUpdateProperties != nil {
+ objectMap["properties"] = du.DiskUpdateProperties
}
- if iu.Tags != nil {
- objectMap["tags"] = iu.Tags
+ if du.Tags != nil {
+ objectMap["tags"] = du.Tags
+ }
+ if du.Sku != nil {
+ objectMap["sku"] = du.Sku
}
return json.Marshal(objectMap)
}
-// UnmarshalJSON is the custom unmarshaler for ImageUpdate struct.
-func (iu *ImageUpdate) UnmarshalJSON(body []byte) error {
+// UnmarshalJSON is the custom unmarshaler for DiskUpdate struct.
+func (du *DiskUpdate) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
@@ -1658,12 +1881,12 @@ func (iu *ImageUpdate) UnmarshalJSON(body []byte) error {
switch k {
case "properties":
if v != nil {
- var imageProperties ImageProperties
- err = json.Unmarshal(*v, &imageProperties)
+ var diskUpdateProperties DiskUpdateProperties
+ err = json.Unmarshal(*v, &diskUpdateProperties)
if err != nil {
return err
}
- iu.ImageProperties = &imageProperties
+ du.DiskUpdateProperties = &diskUpdateProperties
}
case "tags":
if v != nil {
@@ -1672,7 +1895,16 @@ func (iu *ImageUpdate) UnmarshalJSON(body []byte) error {
if err != nil {
return err
}
- iu.Tags = tags
+ du.Tags = tags
+ }
+ case "sku":
+ if v != nil {
+ var sku DiskSku
+ err = json.Unmarshal(*v, &sku)
+ if err != nil {
+ return err
+ }
+ du.Sku = &sku
}
}
}
@@ -1680,156 +1912,268 @@ func (iu *ImageUpdate) UnmarshalJSON(body []byte) error {
return nil
}
-// InnerError inner error details.
-type InnerError struct {
- // Exceptiontype - The exception type.
- Exceptiontype *string `json:"exceptiontype,omitempty"`
- // Errordetail - The internal error message or exception dump.
- Errordetail *string `json:"errordetail,omitempty"`
-}
-
-// InstanceViewStatus instance view status.
-type InstanceViewStatus struct {
- // Code - The status code.
- Code *string `json:"code,omitempty"`
- // Level - The level code. Possible values include: 'Info', 'Warning', 'Error'
- Level StatusLevelTypes `json:"level,omitempty"`
- // DisplayStatus - The short localizable label for the status.
- DisplayStatus *string `json:"displayStatus,omitempty"`
- // Message - The detailed status message, including for alerts and error messages.
- Message *string `json:"message,omitempty"`
- // Time - The time of the status.
- Time *date.Time `json:"time,omitempty"`
+// DiskUpdateProperties disk resource update properties.
+type DiskUpdateProperties struct {
+ // OsType - the Operating System type. Possible values include: 'Windows', 'Linux'
+ OsType OperatingSystemTypes `json:"osType,omitempty"`
+ // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size.
+ DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
+ // EncryptionSettings - Encryption settings for disk or snapshot
+ EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"`
}
-// KeyVaultKeyReference describes a reference to Key Vault Key
-type KeyVaultKeyReference struct {
- // KeyURL - The URL referencing a key encryption key in Key Vault.
- KeyURL *string `json:"keyUrl,omitempty"`
- // SourceVault - The relative URL of the Key Vault containing the key.
- SourceVault *SubResource `json:"sourceVault,omitempty"`
+// EncryptionSettings encryption settings for disk or snapshot
+type EncryptionSettings struct {
+ // Enabled - Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged.
+ Enabled *bool `json:"enabled,omitempty"`
+ // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key
+ DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"`
+ // KeyEncryptionKey - Key Vault Key Url and vault id of the key encryption key
+ KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"`
}
-// KeyVaultSecretReference describes a reference to Key Vault Secret
-type KeyVaultSecretReference struct {
- // SecretURL - The URL referencing a secret in a Key Vault.
- SecretURL *string `json:"secretUrl,omitempty"`
- // SourceVault - The relative URL of the Key Vault containing the secret.
- SourceVault *SubResource `json:"sourceVault,omitempty"`
+// GrantAccessData data used for requesting a SAS.
+type GrantAccessData struct {
+ // Access - Possible values include: 'None', 'Read'
+ Access AccessLevel `json:"access,omitempty"`
+ // DurationInSeconds - Time duration in seconds until the SAS access expires.
+ DurationInSeconds *int32 `json:"durationInSeconds,omitempty"`
}
-// LinuxConfiguration specifies the Linux operating system settings on the virtual machine.
For a
-// list of supported Linux distributions, see [Linux on Azure-Endorsed
-// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
-//
For running non-endorsed distributions, see [Information for Non-Endorsed
-// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json).
-type LinuxConfiguration struct {
- // DisablePasswordAuthentication - Specifies whether password authentication should be disabled.
- DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"`
- // SSH - Specifies the ssh key configuration for a Linux OS.
- SSH *SSHConfiguration `json:"ssh,omitempty"`
+// HardwareProfile specifies the hardware settings for the virtual machine.
+type HardwareProfile struct {
+ // VMSize - Specifies the size of the virtual machine. For more information about virtual machine sizes, see [Sizes for virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-sizes?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
The available VM sizes depend on region and availability set. For a list of available sizes use these APIs:
[List all available virtual machine sizes in an availability set](https://docs.microsoft.com/rest/api/compute/availabilitysets/listavailablesizes)
[List all available virtual machine sizes in a region](https://docs.microsoft.com/rest/api/compute/virtualmachinesizes/list)
[List all available virtual machine sizes for resizing](https://docs.microsoft.com/rest/api/compute/virtualmachines/listavailablesizes). Possible values include: 'BasicA0', 'BasicA1', 'BasicA2', 'BasicA3', 'BasicA4', 'StandardA0', 'StandardA1', 'StandardA2', 'StandardA3', 'StandardA4', 'StandardA5', 'StandardA6', 'StandardA7', 'StandardA8', 'StandardA9', 'StandardA10', 'StandardA11', 'StandardA1V2', 'StandardA2V2', 'StandardA4V2', 'StandardA8V2', 'StandardA2mV2', 'StandardA4mV2', 'StandardA8mV2', 'StandardB1s', 'StandardB1ms', 'StandardB2s', 'StandardB2ms', 'StandardB4ms', 'StandardB8ms', 'StandardD1', 'StandardD2', 'StandardD3', 'StandardD4', 'StandardD11', 'StandardD12', 'StandardD13', 'StandardD14', 'StandardD1V2', 'StandardD2V2', 'StandardD3V2', 'StandardD4V2', 'StandardD5V2', 'StandardD2V3', 'StandardD4V3', 'StandardD8V3', 'StandardD16V3', 'StandardD32V3', 'StandardD64V3', 'StandardD2sV3', 'StandardD4sV3', 'StandardD8sV3', 'StandardD16sV3', 'StandardD32sV3', 'StandardD64sV3', 'StandardD11V2', 'StandardD12V2', 'StandardD13V2', 'StandardD14V2', 'StandardD15V2', 'StandardDS1', 'StandardDS2', 'StandardDS3', 'StandardDS4', 'StandardDS11', 'StandardDS12', 'StandardDS13', 'StandardDS14', 'StandardDS1V2', 'StandardDS2V2', 'StandardDS3V2', 'StandardDS4V2', 'StandardDS5V2', 'StandardDS11V2', 'StandardDS12V2', 'StandardDS13V2', 'StandardDS14V2', 'StandardDS15V2', 'StandardDS134V2', 'StandardDS132V2', 'StandardDS148V2', 'StandardDS144V2', 'StandardE2V3', 'StandardE4V3', 'StandardE8V3', 'StandardE16V3', 'StandardE32V3', 'StandardE64V3', 'StandardE2sV3', 'StandardE4sV3', 'StandardE8sV3', 'StandardE16sV3', 'StandardE32sV3', 'StandardE64sV3', 'StandardE3216V3', 'StandardE328sV3', 'StandardE6432sV3', 'StandardE6416sV3', 'StandardF1', 'StandardF2', 'StandardF4', 'StandardF8', 'StandardF16', 'StandardF1s', 'StandardF2s', 'StandardF4s', 'StandardF8s', 'StandardF16s', 'StandardF2sV2', 'StandardF4sV2', 'StandardF8sV2', 'StandardF16sV2', 'StandardF32sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardG1', 'StandardG2', 'StandardG3', 'StandardG4', 'StandardG5', 'StandardGS1', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5', 'StandardGS48', 'StandardGS44', 'StandardGS516', 'StandardGS58', 'StandardH8', 'StandardH16', 'StandardH8m', 'StandardH16m', 'StandardH16r', 'StandardH16mr', 'StandardL4s', 'StandardL8s', 'StandardL16s', 'StandardL32s', 'StandardM64s', 'StandardM64ms', 'StandardM128s', 'StandardM128ms', 'StandardM6432ms', 'StandardM6416ms', 'StandardM12864ms', 'StandardM12832ms', 'StandardNC6', 'StandardNC12', 'StandardNC24', 'StandardNC24r', 'StandardNC6sV2', 'StandardNC12sV2', 'StandardNC24sV2', 'StandardNC24rsV2', 'StandardNC6sV3', 'StandardNC12sV3', 'StandardNC24sV3', 'StandardNC24rsV3', 'StandardND6s', 'StandardND12s', 'StandardND24s', 'StandardND24rs', 'StandardNV6', 'StandardNV12', 'StandardNV24'
+ VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"`
}
-// ListUsagesResult the List Usages operation response.
-type ListUsagesResult struct {
+// Image the source user image virtual hard disk. The virtual hard disk will be copied before being
+// attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not
+// exist.
+type Image struct {
autorest.Response `json:"-"`
- // Value - The list of compute resource usages.
- Value *[]Usage `json:"value,omitempty"`
- // NextLink - The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the next page of compute resource usage information.
- NextLink *string `json:"nextLink,omitempty"`
-}
-
-// ListUsagesResultIterator provides access to a complete listing of Usage values.
-type ListUsagesResultIterator struct {
- i int
- page ListUsagesResultPage
+ *ImageProperties `json:"properties,omitempty"`
+ // ID - READ-ONLY; Resource Id
+ ID *string `json:"id,omitempty"`
+ // Name - READ-ONLY; Resource name
+ Name *string `json:"name,omitempty"`
+ // Type - READ-ONLY; Resource type
+ Type *string `json:"type,omitempty"`
+ // Location - Resource location
+ Location *string `json:"location,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
}
-// NextWithContext advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) {
- if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext")
- defer func() {
- sc := -1
- if iter.Response().Response.Response != nil {
- sc = iter.Response().Response.Response.StatusCode
- }
- tracing.EndSpan(ctx, sc, err)
- }()
- }
- iter.i++
- if iter.i < len(iter.page.Values()) {
- return nil
+// MarshalJSON is the custom marshaler for Image.
+func (i Image) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if i.ImageProperties != nil {
+ objectMap["properties"] = i.ImageProperties
}
- err = iter.page.NextWithContext(ctx)
- if err != nil {
- iter.i--
- return err
+ if i.Location != nil {
+ objectMap["location"] = i.Location
}
- iter.i = 0
- return nil
-}
-
-// Next advances to the next value. If there was an error making
-// the request the iterator does not advance and the error is returned.
-// Deprecated: Use NextWithContext() instead.
-func (iter *ListUsagesResultIterator) Next() error {
- return iter.NextWithContext(context.Background())
-}
-
-// NotDone returns true if the enumeration should be started or is not yet complete.
-func (iter ListUsagesResultIterator) NotDone() bool {
- return iter.page.NotDone() && iter.i < len(iter.page.Values())
-}
-
-// Response returns the raw server response from the last page request.
-func (iter ListUsagesResultIterator) Response() ListUsagesResult {
- return iter.page.Response()
-}
-
-// Value returns the current value or a zero-initialized value if the
-// iterator has advanced beyond the end of the collection.
-func (iter ListUsagesResultIterator) Value() Usage {
- if !iter.page.NotDone() {
- return Usage{}
+ if i.Tags != nil {
+ objectMap["tags"] = i.Tags
}
- return iter.page.Values()[iter.i]
+ return json.Marshal(objectMap)
}
-// Creates a new instance of the ListUsagesResultIterator type.
-func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator {
- return ListUsagesResultIterator{page: page}
+// UnmarshalJSON is the custom unmarshaler for Image struct.
+func (i *Image) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "properties":
+ if v != nil {
+ var imageProperties ImageProperties
+ err = json.Unmarshal(*v, &imageProperties)
+ if err != nil {
+ return err
+ }
+ i.ImageProperties = &imageProperties
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ i.ID = &ID
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ i.Name = &name
+ }
+ case "type":
+ if v != nil {
+ var typeVar string
+ err = json.Unmarshal(*v, &typeVar)
+ if err != nil {
+ return err
+ }
+ i.Type = &typeVar
+ }
+ case "location":
+ if v != nil {
+ var location string
+ err = json.Unmarshal(*v, &location)
+ if err != nil {
+ return err
+ }
+ i.Location = &location
+ }
+ case "tags":
+ if v != nil {
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
+ if err != nil {
+ return err
+ }
+ i.Tags = tags
+ }
+ }
+ }
+
+ return nil
+}
+
+// ImageDataDisk describes a data disk.
+type ImageDataDisk struct {
+ // Lun - Specifies the logical unit number of the data disk. This value is used to identify data disks within the VM and therefore must be unique for each data disk attached to a VM.
+ Lun *int32 `json:"lun,omitempty"`
+ // Snapshot - The snapshot.
+ Snapshot *SubResource `json:"snapshot,omitempty"`
+ // ManagedDisk - The managedDisk.
+ ManagedDisk *SubResource `json:"managedDisk,omitempty"`
+ // BlobURI - The Virtual Hard Disk.
+ BlobURI *string `json:"blobUri,omitempty"`
+ // Caching - Specifies the caching requirements.
Possible values are:
**None**
**ReadOnly**
**ReadWrite**
Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite'
+ Caching CachingTypes `json:"caching,omitempty"`
+ // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.
This value cannot be larger than 1023 GB
+ DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
+ // StorageAccountType - Specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'StandardLRS', 'PremiumLRS'
+ StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"`
+}
+
+// ImageDiskReference the source image used for creating the disk.
+type ImageDiskReference struct {
+ // ID - A relative uri containing either a Platform Image Repository or user image reference.
+ ID *string `json:"id,omitempty"`
+ // Lun - If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null.
+ Lun *int32 `json:"lun,omitempty"`
+}
+
+// ImageListResult the List Image operation response.
+type ImageListResult struct {
+ autorest.Response `json:"-"`
+ // Value - The list of Images.
+ Value *[]Image `json:"value,omitempty"`
+ // NextLink - The uri to fetch the next page of Images. Call ListNext() with this to fetch the next page of Images.
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ImageListResultIterator provides access to a complete listing of Image values.
+type ImageListResultIterator struct {
+ i int
+ page ImageListResultPage
+}
+
+// NextWithContext advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+func (iter *ImageListResultIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ iter.i++
+ if iter.i < len(iter.page.Values()) {
+ return nil
+ }
+ err = iter.page.NextWithContext(ctx)
+ if err != nil {
+ iter.i--
+ return err
+ }
+ iter.i = 0
+ return nil
+}
+
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *ImageListResultIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the enumeration should be started or is not yet complete.
+func (iter ImageListResultIterator) NotDone() bool {
+ return iter.page.NotDone() && iter.i < len(iter.page.Values())
+}
+
+// Response returns the raw server response from the last page request.
+func (iter ImageListResultIterator) Response() ImageListResult {
+ return iter.page.Response()
+}
+
+// Value returns the current value or a zero-initialized value if the
+// iterator has advanced beyond the end of the collection.
+func (iter ImageListResultIterator) Value() Image {
+ if !iter.page.NotDone() {
+ return Image{}
+ }
+ return iter.page.Values()[iter.i]
+}
+
+// Creates a new instance of the ImageListResultIterator type.
+func NewImageListResultIterator(page ImageListResultPage) ImageListResultIterator {
+ return ImageListResultIterator{page: page}
}
// IsEmpty returns true if the ListResult contains no values.
-func (lur ListUsagesResult) IsEmpty() bool {
- return lur.Value == nil || len(*lur.Value) == 0
+func (ilr ImageListResult) IsEmpty() bool {
+ return ilr.Value == nil || len(*ilr.Value) == 0
}
-// listUsagesResultPreparer prepares a request to retrieve the next set of results.
+// imageListResultPreparer prepares a request to retrieve the next set of results.
// It returns nil if no more results exist.
-func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) {
- if lur.NextLink == nil || len(to.String(lur.NextLink)) < 1 {
+func (ilr ImageListResult) imageListResultPreparer(ctx context.Context) (*http.Request, error) {
+ if ilr.NextLink == nil || len(to.String(ilr.NextLink)) < 1 {
return nil, nil
}
return autorest.Prepare((&http.Request{}).WithContext(ctx),
autorest.AsJSON(),
autorest.AsGet(),
- autorest.WithBaseURL(to.String(lur.NextLink)))
+ autorest.WithBaseURL(to.String(ilr.NextLink)))
}
-// ListUsagesResultPage contains a page of Usage values.
-type ListUsagesResultPage struct {
- fn func(context.Context, ListUsagesResult) (ListUsagesResult, error)
- lur ListUsagesResult
+// ImageListResultPage contains a page of Image values.
+type ImageListResultPage struct {
+ fn func(context.Context, ImageListResult) (ImageListResult, error)
+ ilr ImageListResult
}
// NextWithContext advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
-func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) {
+func (page *ImageListResultPage) NextWithContext(ctx context.Context) (err error) {
if tracing.IsEnabled() {
- ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext")
+ ctx = tracing.StartSpan(ctx, fqdn+"/ImageListResultPage.NextWithContext")
defer func() {
sc := -1
if page.Response().Response.Response != nil {
@@ -1838,206 +2182,207 @@ func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err erro
tracing.EndSpan(ctx, sc, err)
}()
}
- next, err := page.fn(ctx, page.lur)
+ next, err := page.fn(ctx, page.ilr)
if err != nil {
return err
}
- page.lur = next
+ page.ilr = next
return nil
}
// Next advances to the next page of values. If there was an error making
// the request the page does not advance and the error is returned.
// Deprecated: Use NextWithContext() instead.
-func (page *ListUsagesResultPage) Next() error {
+func (page *ImageListResultPage) Next() error {
return page.NextWithContext(context.Background())
}
// NotDone returns true if the page enumeration should be started or is not yet complete.
-func (page ListUsagesResultPage) NotDone() bool {
- return !page.lur.IsEmpty()
+func (page ImageListResultPage) NotDone() bool {
+ return !page.ilr.IsEmpty()
}
// Response returns the raw server response from the last page request.
-func (page ListUsagesResultPage) Response() ListUsagesResult {
- return page.lur
+func (page ImageListResultPage) Response() ImageListResult {
+ return page.ilr
}
// Values returns the slice of values for the current page or nil if there are no values.
-func (page ListUsagesResultPage) Values() []Usage {
- if page.lur.IsEmpty() {
+func (page ImageListResultPage) Values() []Image {
+ if page.ilr.IsEmpty() {
return nil
}
- return *page.lur.Value
-}
-
-// Creates a new instance of the ListUsagesResultPage type.
-func NewListUsagesResultPage(getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage {
- return ListUsagesResultPage{fn: getNextPage}
+ return *page.ilr.Value
}
-// ListVirtualMachineExtensionImage ...
-type ListVirtualMachineExtensionImage struct {
- autorest.Response `json:"-"`
- Value *[]VirtualMachineExtensionImage `json:"value,omitempty"`
+// Creates a new instance of the ImageListResultPage type.
+func NewImageListResultPage(getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage {
+ return ImageListResultPage{fn: getNextPage}
}
-// ListVirtualMachineImageResource ...
-type ListVirtualMachineImageResource struct {
- autorest.Response `json:"-"`
- Value *[]VirtualMachineImageResource `json:"value,omitempty"`
+// ImageOSDisk describes an Operating System disk.
+type ImageOSDisk struct {
+ // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from a custom image.
Possible values are:
**Windows**
**Linux**. Possible values include: 'Windows', 'Linux'
+ OsType OperatingSystemTypes `json:"osType,omitempty"`
+ // OsState - The OS State. Possible values include: 'Generalized', 'Specialized'
+ OsState OperatingSystemStateTypes `json:"osState,omitempty"`
+ // Snapshot - The snapshot.
+ Snapshot *SubResource `json:"snapshot,omitempty"`
+ // ManagedDisk - The managedDisk.
+ ManagedDisk *SubResource `json:"managedDisk,omitempty"`
+ // BlobURI - The Virtual Hard Disk.
+ BlobURI *string `json:"blobUri,omitempty"`
+ // Caching - Specifies the caching requirements.
Possible values are:
**None**
**ReadOnly**
**ReadWrite**
Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite'
+ Caching CachingTypes `json:"caching,omitempty"`
+ // DiskSizeGB - Specifies the size of empty data disks in gigabytes. This element can be used to overwrite the name of the disk in a virtual machine image.
This value cannot be larger than 1023 GB
+ DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
+ // StorageAccountType - Specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'StandardLRS', 'PremiumLRS'
+ StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"`
}
-// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results
-// of a long-running operation.
-type LogAnalyticsExportRequestRateByIntervalFuture struct {
- azure.Future
+// ImageProperties describes the properties of an Image.
+type ImageProperties struct {
+ // SourceVirtualMachine - The source virtual machine from which Image is created.
+ SourceVirtualMachine *SubResource `json:"sourceVirtualMachine,omitempty"`
+ // StorageProfile - Specifies the storage settings for the virtual machine disks.
+ StorageProfile *ImageStorageProfile `json:"storageProfile,omitempty"`
+ // ProvisioningState - READ-ONLY; The provisioning state.
+ ProvisioningState *string `json:"provisioningState,omitempty"`
}
-// Result returns the result of the asynchronous operation.
-// If the operation has not completed it will return an error.
-func (future *LogAnalyticsExportRequestRateByIntervalFuture) Result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) {
- var done bool
- done, err = future.DoneWithContext(context.Background(), client)
+// ImageReference specifies information about the image to use. You can specify information about platform
+// images, marketplace images, or virtual machine images. This element is required when you want to use a
+// platform image, marketplace image, or virtual machine image, but is not used in other creation
+// operations.
+type ImageReference struct {
+ // Publisher - The image publisher.
+ Publisher *string `json:"publisher,omitempty"`
+ // Offer - Specifies the offer of the platform image or marketplace image used to create the virtual machine.
+ Offer *string `json:"offer,omitempty"`
+ // Sku - The image SKU.
+ Sku *string `json:"sku,omitempty"`
+ // Version - Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available.
+ Version *string `json:"version,omitempty"`
+ // ID - Resource Id
+ ID *string `json:"id,omitempty"`
+}
+
+// ImagesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
+// operation.
+type ImagesCreateOrUpdateFuture struct {
+ azure.Future
+}
+
+// Result returns the result of the asynchronous operation.
+// If the operation has not completed it will return an error.
+func (future *ImagesCreateOrUpdateFuture) Result(client ImagesClient) (i Image, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
- err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", future.Response(), "Polling failure")
+ err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
- err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportRequestRateByIntervalFuture")
+ err = azure.NewAsyncOpIncompleteError("compute.ImagesCreateOrUpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent {
- laor, err = client.ExportRequestRateByIntervalResponder(laor.Response.Response)
+ if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent {
+ i, err = client.CreateOrUpdateResponder(i.Response.Response)
if err != nil {
- err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", laor.Response.Response, "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.ImagesCreateOrUpdateFuture", "Result", i.Response.Response, "Failure responding to request")
}
}
return
}
-// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a
-// long-running operation.
-type LogAnalyticsExportThrottledRequestsFuture struct {
+// ImagesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
+type ImagesDeleteFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
-func (future *LogAnalyticsExportThrottledRequestsFuture) Result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) {
+func (future *ImagesDeleteFuture) Result(client ImagesClient) (osr OperationStatusResponse, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
- err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", future.Response(), "Polling failure")
+ err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
- err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportThrottledRequestsFuture")
+ err = azure.NewAsyncOpIncompleteError("compute.ImagesDeleteFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
- if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent {
- laor, err = client.ExportThrottledRequestsResponder(laor.Response.Response)
+ if osr.Response.Response, err = future.GetResult(sender); err == nil && osr.Response.Response.StatusCode != http.StatusNoContent {
+ osr, err = client.DeleteResponder(osr.Response.Response)
if err != nil {
- err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", laor.Response.Response, "Failure responding to request")
+ err = autorest.NewErrorWithError(err, "compute.ImagesDeleteFuture", "Result", osr.Response.Response, "Failure responding to request")
}
}
return
}
-// LogAnalyticsInputBase api input base class for LogAnalytics Api.
-type LogAnalyticsInputBase struct {
- // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to.
- BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"`
- // FromTime - From time of the query
- FromTime *date.Time `json:"fromTime,omitempty"`
- // ToTime - To time of the query
- ToTime *date.Time `json:"toTime,omitempty"`
- // GroupByThrottlePolicy - Group query result by Throttle Policy applied.
- GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"`
- // GroupByOperationName - Group query result by Operation Name.
- GroupByOperationName *bool `json:"groupByOperationName,omitempty"`
- // GroupByResourceName - Group query result by Resource Name.
- GroupByResourceName *bool `json:"groupByResourceName,omitempty"`
-}
-
-// LogAnalyticsOperationResult logAnalytics operation status response
-type LogAnalyticsOperationResult struct {
- autorest.Response `json:"-"`
- // Properties - READ-ONLY; LogAnalyticsOutput
- Properties *LogAnalyticsOutput `json:"properties,omitempty"`
- // Name - READ-ONLY; Operation ID
- Name *string `json:"name,omitempty"`
- // Status - READ-ONLY; Operation status
- Status *string `json:"status,omitempty"`
- // StartTime - READ-ONLY; Start time of the operation
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - READ-ONLY; End time of the operation
- EndTime *date.Time `json:"endTime,omitempty"`
- // Error - READ-ONLY; Api error
- Error *APIError `json:"error,omitempty"`
-}
-
-// LogAnalyticsOutput logAnalytics output properties
-type LogAnalyticsOutput struct {
- // Output - READ-ONLY; Output file Uri path to blob container.
- Output *string `json:"output,omitempty"`
-}
-
-// LongRunningOperationProperties compute-specific operation properties, including output
-type LongRunningOperationProperties struct {
- // Output - Operation output data (raw JSON)
- Output interface{} `json:"output,omitempty"`
+// ImageStorageProfile describes a storage profile.
+type ImageStorageProfile struct {
+ // OsDisk - Specifies information about the operating system disk used by the virtual machine.
For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
+ OsDisk *ImageOSDisk `json:"osDisk,omitempty"`
+ // DataDisks - Specifies the parameters that are used to add a data disk to a virtual machine.
For more information about disks, see [About disks and VHDs for Azure virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
+ DataDisks *[]ImageDataDisk `json:"dataDisks,omitempty"`
+ // ZoneResilient - Specifies whether an image is zone resilient or not. Default is false. Zone resilient images can be created only in regions that provide Zone Redundant Storage (ZRS).
+ ZoneResilient *bool `json:"zoneResilient,omitempty"`
}
-// MaintenanceRedeployStatus maintenance Operation Status.
-type MaintenanceRedeployStatus struct {
- // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance.
- IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"`
- // PreMaintenanceWindowStartTime - Start Time for the Pre Maintenance Window.
- PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"`
- // PreMaintenanceWindowEndTime - End Time for the Pre Maintenance Window.
- PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"`
- // MaintenanceWindowStartTime - Start Time for the Maintenance Window.
- MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"`
- // MaintenanceWindowEndTime - End Time for the Maintenance Window.
- MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"`
- // LastOperationResultCode - The Last Maintenance Operation Result Code. Possible values include: 'MaintenanceOperationResultCodeTypesNone', 'MaintenanceOperationResultCodeTypesRetryLater', 'MaintenanceOperationResultCodeTypesMaintenanceAborted', 'MaintenanceOperationResultCodeTypesMaintenanceCompleted'
- LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"`
- // LastOperationMessage - Message returned for the last Maintenance Operation.
- LastOperationMessage *string `json:"lastOperationMessage,omitempty"`
+// ImagesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
+type ImagesUpdateFuture struct {
+ azure.Future
}
-// ManagedDiskParameters the parameters of a managed disk.
-type ManagedDiskParameters struct {
- // StorageAccountType - Specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'StandardLRS', 'PremiumLRS'
- StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"`
- // ID - Resource Id
- ID *string `json:"id,omitempty"`
+// Result returns the result of the asynchronous operation.
+// If the operation has not completed it will return an error.
+func (future *ImagesUpdateFuture) Result(client ImagesClient) (i Image, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ err = azure.NewAsyncOpIncompleteError("compute.ImagesUpdateFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if i.Response.Response, err = future.GetResult(sender); err == nil && i.Response.Response.StatusCode != http.StatusNoContent {
+ i, err = client.UpdateResponder(i.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.ImagesUpdateFuture", "Result", i.Response.Response, "Failure responding to request")
+ }
+ }
+ return
}
-// NetworkInterfaceReference describes a network interface reference.
-type NetworkInterfaceReference struct {
- *NetworkInterfaceReferenceProperties `json:"properties,omitempty"`
- // ID - Resource Id
- ID *string `json:"id,omitempty"`
+// ImageUpdate the source user image virtual hard disk. Only tags may be updated.
+type ImageUpdate struct {
+ *ImageProperties `json:"properties,omitempty"`
+ // Tags - Resource tags
+ Tags map[string]*string `json:"tags"`
}
-// MarshalJSON is the custom marshaler for NetworkInterfaceReference.
-func (nir NetworkInterfaceReference) MarshalJSON() ([]byte, error) {
+// MarshalJSON is the custom marshaler for ImageUpdate.
+func (iu ImageUpdate) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
- if nir.NetworkInterfaceReferenceProperties != nil {
- objectMap["properties"] = nir.NetworkInterfaceReferenceProperties
+ if iu.ImageProperties != nil {
+ objectMap["properties"] = iu.ImageProperties
}
- if nir.ID != nil {
- objectMap["id"] = nir.ID
+ if iu.Tags != nil {
+ objectMap["tags"] = iu.Tags
}
return json.Marshal(objectMap)
}
-// UnmarshalJSON is the custom unmarshaler for NetworkInterfaceReference struct.
-func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error {
+// UnmarshalJSON is the custom unmarshaler for ImageUpdate struct.
+func (iu *ImageUpdate) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
@@ -2047,21 +2392,21 @@ func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error {
switch k {
case "properties":
if v != nil {
- var networkInterfaceReferenceProperties NetworkInterfaceReferenceProperties
- err = json.Unmarshal(*v, &networkInterfaceReferenceProperties)
+ var imageProperties ImageProperties
+ err = json.Unmarshal(*v, &imageProperties)
if err != nil {
return err
}
- nir.NetworkInterfaceReferenceProperties = &networkInterfaceReferenceProperties
+ iu.ImageProperties = &imageProperties
}
- case "id":
+ case "tags":
if v != nil {
- var ID string
- err = json.Unmarshal(*v, &ID)
+ var tags map[string]*string
+ err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
- nir.ID = &ID
+ iu.Tags = tags
}
}
}
@@ -2069,292 +2414,1385 @@ func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error {
return nil
}
-// NetworkInterfaceReferenceProperties describes a network interface reference properties.
-type NetworkInterfaceReferenceProperties struct {
- // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface.
- Primary *bool `json:"primary,omitempty"`
+// InnerError inner error details.
+type InnerError struct {
+ // Exceptiontype - The exception type.
+ Exceptiontype *string `json:"exceptiontype,omitempty"`
+ // Errordetail - The internal error message or exception dump.
+ Errordetail *string `json:"errordetail,omitempty"`
}
-// NetworkProfile specifies the network interfaces of the virtual machine.
-type NetworkProfile struct {
- // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine.
- NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"`
+// InstanceViewStatus instance view status.
+type InstanceViewStatus struct {
+ // Code - The status code.
+ Code *string `json:"code,omitempty"`
+ // Level - The level code. Possible values include: 'Info', 'Warning', 'Error'
+ Level StatusLevelTypes `json:"level,omitempty"`
+ // DisplayStatus - The short localizable label for the status.
+ DisplayStatus *string `json:"displayStatus,omitempty"`
+ // Message - The detailed status message, including for alerts and error messages.
+ Message *string `json:"message,omitempty"`
+ // Time - The time of the status.
+ Time *date.Time `json:"time,omitempty"`
}
-// OperationListResult the List Compute Operation operation response.
-type OperationListResult struct {
- autorest.Response `json:"-"`
- // Value - READ-ONLY; The list of compute operations
- Value *[]OperationValue `json:"value,omitempty"`
+// KeyVaultAndKeyReference key Vault Key Url and vault id of KeK, KeK is optional and when provided is used
+// to unwrap the encryptionKey
+type KeyVaultAndKeyReference struct {
+ // SourceVault - Resource id of the KeyVault containing the key or secret
+ SourceVault *SourceVault `json:"sourceVault,omitempty"`
+ // KeyURL - Url pointing to a key or secret in KeyVault
+ KeyURL *string `json:"keyUrl,omitempty"`
}
-// OperationStatusResponse operation status response
-type OperationStatusResponse struct {
- autorest.Response `json:"-"`
- // Name - READ-ONLY; Operation ID
- Name *string `json:"name,omitempty"`
- // Status - READ-ONLY; Operation status
- Status *string `json:"status,omitempty"`
- // StartTime - READ-ONLY; Start time of the operation
- StartTime *date.Time `json:"startTime,omitempty"`
- // EndTime - READ-ONLY; End time of the operation
- EndTime *date.Time `json:"endTime,omitempty"`
- // Error - READ-ONLY; Api error
- Error *APIError `json:"error,omitempty"`
+// KeyVaultAndSecretReference key Vault Secret Url and vault id of the encryption key
+type KeyVaultAndSecretReference struct {
+ // SourceVault - Resource id of the KeyVault containing the key or secret
+ SourceVault *SourceVault `json:"sourceVault,omitempty"`
+ // SecretURL - Url pointing to a key or secret in KeyVault
+ SecretURL *string `json:"secretUrl,omitempty"`
}
-// OperationValue describes the properties of a Compute Operation value.
-type OperationValue struct {
- // Origin - READ-ONLY; The origin of the compute operation.
- Origin *string `json:"origin,omitempty"`
- // Name - READ-ONLY; The name of the compute operation.
- Name *string `json:"name,omitempty"`
- *OperationValueDisplay `json:"display,omitempty"`
+// KeyVaultKeyReference describes a reference to Key Vault Key
+type KeyVaultKeyReference struct {
+ // KeyURL - The URL referencing a key encryption key in Key Vault.
+ KeyURL *string `json:"keyUrl,omitempty"`
+ // SourceVault - The relative URL of the Key Vault containing the key.
+ SourceVault *SubResource `json:"sourceVault,omitempty"`
}
-// MarshalJSON is the custom marshaler for OperationValue.
-func (ov OperationValue) MarshalJSON() ([]byte, error) {
- objectMap := make(map[string]interface{})
- if ov.OperationValueDisplay != nil {
- objectMap["display"] = ov.OperationValueDisplay
+// KeyVaultSecretReference describes a reference to Key Vault Secret
+type KeyVaultSecretReference struct {
+ // SecretURL - The URL referencing a secret in a Key Vault.
+ SecretURL *string `json:"secretUrl,omitempty"`
+ // SourceVault - The relative URL of the Key Vault containing the secret.
+ SourceVault *SubResource `json:"sourceVault,omitempty"`
+}
+
+// LinuxConfiguration specifies the Linux operating system settings on the virtual machine.
For a
+// list of supported Linux distributions, see [Linux on Azure-Endorsed
+// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
+//
For running non-endorsed distributions, see [Information for Non-Endorsed
+// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json).
+type LinuxConfiguration struct {
+ // DisablePasswordAuthentication - Specifies whether password authentication should be disabled.
+ DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"`
+ // SSH - Specifies the ssh key configuration for a Linux OS.
+ SSH *SSHConfiguration `json:"ssh,omitempty"`
+}
+
+// ListUsagesResult the List Usages operation response.
+type ListUsagesResult struct {
+ autorest.Response `json:"-"`
+ // Value - The list of compute resource usages.
+ Value *[]Usage `json:"value,omitempty"`
+ // NextLink - The URI to fetch the next page of compute resource usage information. Call ListNext() with this to fetch the next page of compute resource usage information.
+ NextLink *string `json:"nextLink,omitempty"`
+}
+
+// ListUsagesResultIterator provides access to a complete listing of Usage values.
+type ListUsagesResultIterator struct {
+ i int
+ page ListUsagesResultPage
+}
+
+// NextWithContext advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext")
+ defer func() {
+ sc := -1
+ if iter.Response().Response.Response != nil {
+ sc = iter.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ iter.i++
+ if iter.i < len(iter.page.Values()) {
+ return nil
+ }
+ err = iter.page.NextWithContext(ctx)
+ if err != nil {
+ iter.i--
+ return err
+ }
+ iter.i = 0
+ return nil
+}
+
+// Next advances to the next value. If there was an error making
+// the request the iterator does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (iter *ListUsagesResultIterator) Next() error {
+ return iter.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the enumeration should be started or is not yet complete.
+func (iter ListUsagesResultIterator) NotDone() bool {
+ return iter.page.NotDone() && iter.i < len(iter.page.Values())
+}
+
+// Response returns the raw server response from the last page request.
+func (iter ListUsagesResultIterator) Response() ListUsagesResult {
+ return iter.page.Response()
+}
+
+// Value returns the current value or a zero-initialized value if the
+// iterator has advanced beyond the end of the collection.
+func (iter ListUsagesResultIterator) Value() Usage {
+ if !iter.page.NotDone() {
+ return Usage{}
+ }
+ return iter.page.Values()[iter.i]
+}
+
+// Creates a new instance of the ListUsagesResultIterator type.
+func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator {
+ return ListUsagesResultIterator{page: page}
+}
+
+// IsEmpty returns true if the ListResult contains no values.
+func (lur ListUsagesResult) IsEmpty() bool {
+ return lur.Value == nil || len(*lur.Value) == 0
+}
+
+// listUsagesResultPreparer prepares a request to retrieve the next set of results.
+// It returns nil if no more results exist.
+func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) {
+ if lur.NextLink == nil || len(to.String(lur.NextLink)) < 1 {
+ return nil, nil
+ }
+ return autorest.Prepare((&http.Request{}).WithContext(ctx),
+ autorest.AsJSON(),
+ autorest.AsGet(),
+ autorest.WithBaseURL(to.String(lur.NextLink)))
+}
+
+// ListUsagesResultPage contains a page of Usage values.
+type ListUsagesResultPage struct {
+ fn func(context.Context, ListUsagesResult) (ListUsagesResult, error)
+ lur ListUsagesResult
+}
+
+// NextWithContext advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) {
+ if tracing.IsEnabled() {
+ ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext")
+ defer func() {
+ sc := -1
+ if page.Response().Response.Response != nil {
+ sc = page.Response().Response.Response.StatusCode
+ }
+ tracing.EndSpan(ctx, sc, err)
+ }()
+ }
+ next, err := page.fn(ctx, page.lur)
+ if err != nil {
+ return err
+ }
+ page.lur = next
+ return nil
+}
+
+// Next advances to the next page of values. If there was an error making
+// the request the page does not advance and the error is returned.
+// Deprecated: Use NextWithContext() instead.
+func (page *ListUsagesResultPage) Next() error {
+ return page.NextWithContext(context.Background())
+}
+
+// NotDone returns true if the page enumeration should be started or is not yet complete.
+func (page ListUsagesResultPage) NotDone() bool {
+ return !page.lur.IsEmpty()
+}
+
+// Response returns the raw server response from the last page request.
+func (page ListUsagesResultPage) Response() ListUsagesResult {
+ return page.lur
+}
+
+// Values returns the slice of values for the current page or nil if there are no values.
+func (page ListUsagesResultPage) Values() []Usage {
+ if page.lur.IsEmpty() {
+ return nil
+ }
+ return *page.lur.Value
+}
+
+// Creates a new instance of the ListUsagesResultPage type.
+func NewListUsagesResultPage(getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage {
+ return ListUsagesResultPage{fn: getNextPage}
+}
+
+// ListVirtualMachineExtensionImage ...
+type ListVirtualMachineExtensionImage struct {
+ autorest.Response `json:"-"`
+ Value *[]VirtualMachineExtensionImage `json:"value,omitempty"`
+}
+
+// ListVirtualMachineImageResource ...
+type ListVirtualMachineImageResource struct {
+ autorest.Response `json:"-"`
+ Value *[]VirtualMachineImageResource `json:"value,omitempty"`
+}
+
+// LogAnalyticsExportRequestRateByIntervalFuture an abstraction for monitoring and retrieving the results
+// of a long-running operation.
+type LogAnalyticsExportRequestRateByIntervalFuture struct {
+ azure.Future
+}
+
+// Result returns the result of the asynchronous operation.
+// If the operation has not completed it will return an error.
+func (future *LogAnalyticsExportRequestRateByIntervalFuture) Result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportRequestRateByIntervalFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent {
+ laor, err = client.ExportRequestRateByIntervalResponder(laor.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportRequestRateByIntervalFuture", "Result", laor.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// LogAnalyticsExportThrottledRequestsFuture an abstraction for monitoring and retrieving the results of a
+// long-running operation.
+type LogAnalyticsExportThrottledRequestsFuture struct {
+ azure.Future
+}
+
+// Result returns the result of the asynchronous operation.
+// If the operation has not completed it will return an error.
+func (future *LogAnalyticsExportThrottledRequestsFuture) Result(client LogAnalyticsClient) (laor LogAnalyticsOperationResult, err error) {
+ var done bool
+ done, err = future.DoneWithContext(context.Background(), client)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", future.Response(), "Polling failure")
+ return
+ }
+ if !done {
+ err = azure.NewAsyncOpIncompleteError("compute.LogAnalyticsExportThrottledRequestsFuture")
+ return
+ }
+ sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
+ if laor.Response.Response, err = future.GetResult(sender); err == nil && laor.Response.Response.StatusCode != http.StatusNoContent {
+ laor, err = client.ExportThrottledRequestsResponder(laor.Response.Response)
+ if err != nil {
+ err = autorest.NewErrorWithError(err, "compute.LogAnalyticsExportThrottledRequestsFuture", "Result", laor.Response.Response, "Failure responding to request")
+ }
+ }
+ return
+}
+
+// LogAnalyticsInputBase api input base class for LogAnalytics Api.
+type LogAnalyticsInputBase struct {
+ // BlobContainerSasURI - SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to.
+ BlobContainerSasURI *string `json:"blobContainerSasUri,omitempty"`
+ // FromTime - From time of the query
+ FromTime *date.Time `json:"fromTime,omitempty"`
+ // ToTime - To time of the query
+ ToTime *date.Time `json:"toTime,omitempty"`
+ // GroupByThrottlePolicy - Group query result by Throttle Policy applied.
+ GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"`
+ // GroupByOperationName - Group query result by Operation Name.
+ GroupByOperationName *bool `json:"groupByOperationName,omitempty"`
+ // GroupByResourceName - Group query result by Resource Name.
+ GroupByResourceName *bool `json:"groupByResourceName,omitempty"`
+}
+
+// LogAnalyticsOperationResult logAnalytics operation status response
+type LogAnalyticsOperationResult struct {
+ autorest.Response `json:"-"`
+ // Properties - READ-ONLY; LogAnalyticsOutput
+ Properties *LogAnalyticsOutput `json:"properties,omitempty"`
+ // Name - READ-ONLY; Operation ID
+ Name *string `json:"name,omitempty"`
+ // Status - READ-ONLY; Operation status
+ Status *string `json:"status,omitempty"`
+ // StartTime - READ-ONLY; Start time of the operation
+ StartTime *date.Time `json:"startTime,omitempty"`
+ // EndTime - READ-ONLY; End time of the operation
+ EndTime *date.Time `json:"endTime,omitempty"`
+ // Error - READ-ONLY; Api error
+ Error *APIError `json:"error,omitempty"`
+}
+
+// LogAnalyticsOutput logAnalytics output properties
+type LogAnalyticsOutput struct {
+ // Output - READ-ONLY; Output file Uri path to blob container.
+ Output *string `json:"output,omitempty"`
+}
+
+// LongRunningOperationProperties compute-specific operation properties, including output
+type LongRunningOperationProperties struct {
+ // Output - Operation output data (raw JSON)
+ Output interface{} `json:"output,omitempty"`
+}
+
+// MaintenanceRedeployStatus maintenance Operation Status.
+type MaintenanceRedeployStatus struct {
+ // IsCustomerInitiatedMaintenanceAllowed - True, if customer is allowed to perform Maintenance.
+ IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"`
+ // PreMaintenanceWindowStartTime - Start Time for the Pre Maintenance Window.
+ PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"`
+ // PreMaintenanceWindowEndTime - End Time for the Pre Maintenance Window.
+ PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"`
+ // MaintenanceWindowStartTime - Start Time for the Maintenance Window.
+ MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"`
+ // MaintenanceWindowEndTime - End Time for the Maintenance Window.
+ MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"`
+ // LastOperationResultCode - The Last Maintenance Operation Result Code. Possible values include: 'MaintenanceOperationResultCodeTypesNone', 'MaintenanceOperationResultCodeTypesRetryLater', 'MaintenanceOperationResultCodeTypesMaintenanceAborted', 'MaintenanceOperationResultCodeTypesMaintenanceCompleted'
+ LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"`
+ // LastOperationMessage - Message returned for the last Maintenance Operation.
+ LastOperationMessage *string `json:"lastOperationMessage,omitempty"`
+}
+
+// ManagedDiskParameters the parameters of a managed disk.
+type ManagedDiskParameters struct {
+ // StorageAccountType - Specifies the storage account type for the managed disk. Possible values are: Standard_LRS or Premium_LRS. Possible values include: 'StandardLRS', 'PremiumLRS'
+ StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"`
+ // ID - Resource Id
+ ID *string `json:"id,omitempty"`
+}
+
+// NetworkInterfaceReference describes a network interface reference.
+type NetworkInterfaceReference struct {
+ *NetworkInterfaceReferenceProperties `json:"properties,omitempty"`
+ // ID - Resource Id
+ ID *string `json:"id,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for NetworkInterfaceReference.
+func (nir NetworkInterfaceReference) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if nir.NetworkInterfaceReferenceProperties != nil {
+ objectMap["properties"] = nir.NetworkInterfaceReferenceProperties
+ }
+ if nir.ID != nil {
+ objectMap["id"] = nir.ID
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for NetworkInterfaceReference struct.
+func (nir *NetworkInterfaceReference) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "properties":
+ if v != nil {
+ var networkInterfaceReferenceProperties NetworkInterfaceReferenceProperties
+ err = json.Unmarshal(*v, &networkInterfaceReferenceProperties)
+ if err != nil {
+ return err
+ }
+ nir.NetworkInterfaceReferenceProperties = &networkInterfaceReferenceProperties
+ }
+ case "id":
+ if v != nil {
+ var ID string
+ err = json.Unmarshal(*v, &ID)
+ if err != nil {
+ return err
+ }
+ nir.ID = &ID
+ }
+ }
+ }
+
+ return nil
+}
+
+// NetworkInterfaceReferenceProperties describes a network interface reference properties.
+type NetworkInterfaceReferenceProperties struct {
+ // Primary - Specifies the primary network interface in case the virtual machine has more than 1 network interface.
+ Primary *bool `json:"primary,omitempty"`
+}
+
+// NetworkProfile specifies the network interfaces of the virtual machine.
+type NetworkProfile struct {
+ // NetworkInterfaces - Specifies the list of resource Ids for the network interfaces associated with the virtual machine.
+ NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"`
+}
+
+// OperationListResult the List Compute Operation operation response.
+type OperationListResult struct {
+ autorest.Response `json:"-"`
+ // Value - READ-ONLY; The list of compute operations
+ Value *[]OperationValue `json:"value,omitempty"`
+}
+
+// OperationStatusResponse operation status response
+type OperationStatusResponse struct {
+ autorest.Response `json:"-"`
+ // Name - READ-ONLY; Operation ID
+ Name *string `json:"name,omitempty"`
+ // Status - READ-ONLY; Operation status
+ Status *string `json:"status,omitempty"`
+ // StartTime - READ-ONLY; Start time of the operation
+ StartTime *date.Time `json:"startTime,omitempty"`
+ // EndTime - READ-ONLY; End time of the operation
+ EndTime *date.Time `json:"endTime,omitempty"`
+ // Error - READ-ONLY; Api error
+ Error *APIError `json:"error,omitempty"`
+}
+
+// OperationValue describes the properties of a Compute Operation value.
+type OperationValue struct {
+ // Origin - READ-ONLY; The origin of the compute operation.
+ Origin *string `json:"origin,omitempty"`
+ // Name - READ-ONLY; The name of the compute operation.
+ Name *string `json:"name,omitempty"`
+ *OperationValueDisplay `json:"display,omitempty"`
+}
+
+// MarshalJSON is the custom marshaler for OperationValue.
+func (ov OperationValue) MarshalJSON() ([]byte, error) {
+ objectMap := make(map[string]interface{})
+ if ov.OperationValueDisplay != nil {
+ objectMap["display"] = ov.OperationValueDisplay
+ }
+ return json.Marshal(objectMap)
+}
+
+// UnmarshalJSON is the custom unmarshaler for OperationValue struct.
+func (ov *OperationValue) UnmarshalJSON(body []byte) error {
+ var m map[string]*json.RawMessage
+ err := json.Unmarshal(body, &m)
+ if err != nil {
+ return err
+ }
+ for k, v := range m {
+ switch k {
+ case "origin":
+ if v != nil {
+ var origin string
+ err = json.Unmarshal(*v, &origin)
+ if err != nil {
+ return err
+ }
+ ov.Origin = &origin
+ }
+ case "name":
+ if v != nil {
+ var name string
+ err = json.Unmarshal(*v, &name)
+ if err != nil {
+ return err
+ }
+ ov.Name = &name
+ }
+ case "display":
+ if v != nil {
+ var operationValueDisplay OperationValueDisplay
+ err = json.Unmarshal(*v, &operationValueDisplay)
+ if err != nil {
+ return err
+ }
+ ov.OperationValueDisplay = &operationValueDisplay
+ }
+ }
+ }
+
+ return nil
+}
+
+// OperationValueDisplay describes the properties of a Compute Operation Value Display.
+type OperationValueDisplay struct {
+ // Operation - READ-ONLY; The display name of the compute operation.
+ Operation *string `json:"operation,omitempty"`
+ // Resource - READ-ONLY; The display name of the resource the operation applies to.
+ Resource *string `json:"resource,omitempty"`
+ // Description - READ-ONLY; The description of the operation.
+ Description *string `json:"description,omitempty"`
+ // Provider - READ-ONLY; The resource provider for the operation.
+ Provider *string `json:"provider,omitempty"`
+}
+
+// OSDisk specifies information about the operating system disk used by the virtual machine.
For
+// more information about disks, see [About disks and VHDs for Azure virtual
+// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).
+type OSDisk struct {
+ // OsType - This property allows you to specify the type of the OS that is included in the disk if creating a VM from user-image or a specialized VHD.
Possible values are:
**Windows**
**Linux**. Possible values include: 'Windows', 'Linux'
+ OsType OperatingSystemTypes `json:"osType,omitempty"`
+ // EncryptionSettings - Specifies the encryption settings for the OS Disk.
Minimum api-version: 2015-06-15
+ EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"`
+ // Name - The disk name.
+ Name *string `json:"name,omitempty"`
+ // Vhd - The virtual hard disk.
+ Vhd *VirtualHardDisk `json:"vhd,omitempty"`
+ // Image - The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist.
+ Image *VirtualHardDisk `json:"image,omitempty"`
+ // Caching - Specifies the caching requirements.
Possible values are:
**None**
**ReadOnly**
**ReadWrite**
Default: **None for Standard storage. ReadOnly for Premium storage**. Possible values include: 'CachingTypesNone', 'CachingTypesReadOnly', 'CachingTypesReadWrite'
+ Caching CachingTypes `json:"caching,omitempty"`
+ // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk.
+ WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"`
+ // CreateOption - Specifies how the virtual machine should be created.
Possible values are:
**Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.
**FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach'
+ CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"`
+ // DiskSizeGB - Specifies the size of an empty data disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.
This value cannot be larger than 1023 GB
+ DiskSizeGB *int32 `json:"diskSizeGB,omitempty"`
+ // ManagedDisk - The managed disk parameters.
+ ManagedDisk *ManagedDiskParameters `json:"managedDisk,omitempty"`
+}
+
+// OSDiskImage contains the os disk image information.
+type OSDiskImage struct {
+ // OperatingSystem - The operating system of the osDiskImage. Possible values include: 'Windows', 'Linux'
+ OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"`
+}
+
+// OSProfile specifies the operating system settings for the virtual machine.
+type OSProfile struct {
+ // ComputerName - Specifies the host OS name of the virtual machine.
This name cannot be updated after the VM is created.
**Max-length (Windows):** 15 characters
**Max-length (Linux):** 64 characters.
For naming conventions and restrictions see [Azure infrastructure services implementation guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions).
+ ComputerName *string `json:"computerName,omitempty"`
+ // AdminUsername - Specifies the name of the administrator account.
**Windows-only restriction:** Cannot end in "."
**Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".
**Minimum-length (Linux):** 1 character
**Max-length (Linux):** 64 characters
**Max-length (Windows):** 20 characters