mirror of
https://github.com/openshift/installer.git
synced 2026-02-05 15:47:14 +01:00
Merge pull request #8134 from patrickdillon/azure-sku-perf
OCPBUGS-31546: azure: use filter when listing SKUs
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
azsku "github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/compute/mgmt/compute"
|
||||
aznetwork "github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/network/mgmt/network"
|
||||
azres "github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/resources/mgmt/resources"
|
||||
azsubs "github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/resources/mgmt/subscriptions"
|
||||
@@ -25,9 +24,9 @@ type API interface {
|
||||
GetControlPlaneSubnet(ctx context.Context, resourceGroupName, virtualNetwork, subnet string) (*aznetwork.Subnet, error)
|
||||
ListLocations(ctx context.Context) (*[]azsubs.Location, error)
|
||||
GetResourcesProvider(ctx context.Context, resourceProviderNamespace string) (*azres.Provider, error)
|
||||
GetVirtualMachineSku(ctx context.Context, name, region string) (*azsku.ResourceSku, error)
|
||||
GetVirtualMachineSku(ctx context.Context, name, region string) (*azenc.ResourceSku, error)
|
||||
GetVirtualMachineFamily(ctx context.Context, name, region string) (string, error)
|
||||
GetDiskSkus(ctx context.Context, region string) ([]azsku.ResourceSku, error)
|
||||
GetDiskSkus(ctx context.Context, region string) ([]azenc.ResourceSku, error)
|
||||
GetGroup(ctx context.Context, groupName string) (*azres.Group, error)
|
||||
ListResourceIDsByGroup(ctx context.Context, groupName string) ([]string, error)
|
||||
GetStorageEndpointSuffix(ctx context.Context) (string, error)
|
||||
@@ -170,20 +169,19 @@ func (c *Client) getProvidersClient(ctx context.Context) (azres.ProvidersClient,
|
||||
}
|
||||
|
||||
// GetDiskSkus returns all the disk SKU pages for a given region.
|
||||
func (c *Client) GetDiskSkus(ctx context.Context, region string) ([]azsku.ResourceSku, error) {
|
||||
client := azsku.NewResourceSkusClientWithBaseURI(c.ssn.Environment.ResourceManagerEndpoint, c.ssn.Credentials.SubscriptionID)
|
||||
func (c *Client) GetDiskSkus(ctx context.Context, region string) ([]azenc.ResourceSku, error) {
|
||||
client := azenc.NewResourceSkusClientWithBaseURI(c.ssn.Environment.ResourceManagerEndpoint, c.ssn.Credentials.SubscriptionID)
|
||||
client.Authorizer = c.ssn.Authorizer
|
||||
|
||||
// See https://issues.redhat.com/browse/OCPBUGS-29469 before changing this timeout
|
||||
ctx, cancel := context.WithTimeout(ctx, 2*time.Minute)
|
||||
defer cancel()
|
||||
|
||||
var sku []azsku.ResourceSku
|
||||
|
||||
var sku []azenc.ResourceSku
|
||||
filter := fmt.Sprintf("location eq '%s'", region)
|
||||
// This has to be initialized outside the `for` because we need access to
|
||||
// `err`. If initialized in the loop and the API call fails right away,
|
||||
// `page.NotDone()` will return `false` and we'll never check for the error
|
||||
skuPage, err := client.List(ctx)
|
||||
skuPage, err := client.List(ctx, filter, "false")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to list SKUs: %w", err)
|
||||
}
|
||||
@@ -245,18 +243,19 @@ func (c *Client) ListResourceIDsByGroup(ctx context.Context, groupName string) (
|
||||
}
|
||||
|
||||
// GetVirtualMachineSku retrieves the resource SKU of a specified virtual machine SKU in the specified region.
|
||||
func (c *Client) GetVirtualMachineSku(ctx context.Context, name, region string) (*azsku.ResourceSku, error) {
|
||||
client := azsku.NewResourceSkusClientWithBaseURI(c.ssn.Environment.ResourceManagerEndpoint, c.ssn.Credentials.SubscriptionID)
|
||||
func (c *Client) GetVirtualMachineSku(ctx context.Context, name, region string) (*azenc.ResourceSku, error) {
|
||||
client := azenc.NewResourceSkusClientWithBaseURI(c.ssn.Environment.ResourceManagerEndpoint, c.ssn.Credentials.SubscriptionID)
|
||||
client.Authorizer = c.ssn.Authorizer
|
||||
|
||||
// See https://issues.redhat.com/browse/OCPBUGS-29469 before chaging this timeout
|
||||
ctx, cancel := context.WithTimeout(ctx, 2*time.Minute)
|
||||
defer cancel()
|
||||
|
||||
filter := fmt.Sprintf("location eq '%s'", region)
|
||||
// This has to be initialized outside the `for` because we need access to
|
||||
// `err`. If initialized in the loop and the API call fails right away,
|
||||
// `page.NotDone()` will return `false` and we'll never check for the error
|
||||
page, err := client.List(ctx)
|
||||
page, err := client.List(ctx, filter, "false")
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to list SKUs: %w", err)
|
||||
}
|
||||
|
||||
@@ -8,11 +8,10 @@ import (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
compute "github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/compute/mgmt/compute"
|
||||
network "github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/network/mgmt/network"
|
||||
resources "github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/resources/mgmt/resources"
|
||||
subscriptions "github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/resources/mgmt/subscriptions"
|
||||
compute0 "github.com/Azure/azure-sdk-for-go/profiles/latest/compute/mgmt/compute"
|
||||
compute "github.com/Azure/azure-sdk-for-go/profiles/latest/compute/mgmt/compute"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
@@ -100,10 +99,10 @@ func (mr *MockAPIMockRecorder) GetControlPlaneSubnet(ctx, resourceGroupName, vir
|
||||
}
|
||||
|
||||
// GetDiskEncryptionSet mocks base method.
|
||||
func (m *MockAPI) GetDiskEncryptionSet(ctx context.Context, subscriptionID, groupName, diskEncryptionSetName string) (*compute0.DiskEncryptionSet, error) {
|
||||
func (m *MockAPI) GetDiskEncryptionSet(ctx context.Context, subscriptionID, groupName, diskEncryptionSetName string) (*compute.DiskEncryptionSet, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetDiskEncryptionSet", ctx, subscriptionID, groupName, diskEncryptionSetName)
|
||||
ret0, _ := ret[0].(*compute0.DiskEncryptionSet)
|
||||
ret0, _ := ret[0].(*compute.DiskEncryptionSet)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@@ -160,10 +159,10 @@ func (mr *MockAPIMockRecorder) GetHyperVGenerationVersion(ctx, instanceType, reg
|
||||
}
|
||||
|
||||
// GetLocationInfo mocks base method.
|
||||
func (m *MockAPI) GetLocationInfo(ctx context.Context, region, instanceType string) (*compute0.ResourceSkuLocationInfo, error) {
|
||||
func (m *MockAPI) GetLocationInfo(ctx context.Context, region, instanceType string) (*compute.ResourceSkuLocationInfo, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetLocationInfo", ctx, region, instanceType)
|
||||
ret0, _ := ret[0].(*compute0.ResourceSkuLocationInfo)
|
||||
ret0, _ := ret[0].(*compute.ResourceSkuLocationInfo)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
@@ -175,10 +174,10 @@ func (mr *MockAPIMockRecorder) GetLocationInfo(ctx, region, instanceType interfa
|
||||
}
|
||||
|
||||
// GetMarketplaceImage mocks base method.
|
||||
func (m *MockAPI) GetMarketplaceImage(ctx context.Context, region, publisher, offer, sku, version string) (compute0.VirtualMachineImage, error) {
|
||||
func (m *MockAPI) GetMarketplaceImage(ctx context.Context, region, publisher, offer, sku, version string) (compute.VirtualMachineImage, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetMarketplaceImage", ctx, region, publisher, offer, sku, version)
|
||||
ret0, _ := ret[0].(compute0.VirtualMachineImage)
|
||||
ret0, _ := ret[0].(compute.VirtualMachineImage)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@ import (
|
||||
"net"
|
||||
"testing"
|
||||
|
||||
azsku "github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/compute/mgmt/compute"
|
||||
aznetwork "github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/network/mgmt/network"
|
||||
azres "github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/resources/mgmt/resources"
|
||||
azsubs "github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/resources/mgmt/subscriptions"
|
||||
@@ -54,16 +53,16 @@ var (
|
||||
"Standard_DC8s_v3": {"vCPUsAvailable": "8", "MemoryGB": "32", "PremiumIO": "True", "HyperVGenerations": "V2", "AcceleratedNetworkingEnabled": "True", "CpuArchitectureType": "x64", "ConfidentialComputingType": "SGX"},
|
||||
}
|
||||
|
||||
instanceTypeSku = func() []*azsku.ResourceSku {
|
||||
instances := make([]*azsku.ResourceSku, 0, len(vmCapabilities))
|
||||
instanceTypeSku = func() []*azenc.ResourceSku {
|
||||
instances := make([]*azenc.ResourceSku, 0, len(vmCapabilities))
|
||||
for typeName, capsMap := range vmCapabilities {
|
||||
capabilities := make([]azsku.ResourceSkuCapabilities, 0, len(capsMap))
|
||||
capabilities := make([]azenc.ResourceSkuCapabilities, 0, len(capsMap))
|
||||
for name, value := range capsMap {
|
||||
capabilities = append(capabilities, azsku.ResourceSkuCapabilities{
|
||||
capabilities = append(capabilities, azenc.ResourceSkuCapabilities{
|
||||
Name: to.StringPtr(name), Value: to.StringPtr(value),
|
||||
})
|
||||
}
|
||||
instances = append(instances, &azsku.ResourceSku{
|
||||
instances = append(instances, &azenc.ResourceSku{
|
||||
Name: to.StringPtr(typeName), Capabilities: &capabilities,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import (
|
||||
reflect "reflect"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
gcp "github.com/openshift/installer/pkg/types/gcp"
|
||||
cloudresourcemanager "google.golang.org/api/cloudresourcemanager/v3"
|
||||
sets "k8s.io/apimachinery/pkg/util/sets"
|
||||
)
|
||||
@@ -66,18 +65,3 @@ func (mr *MockTagManagerMockRecorder) GetProjectTags(ctx, projectID interface{})
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetProjectTags", reflect.TypeOf((*MockTagManager)(nil).GetProjectTags), ctx, projectID)
|
||||
}
|
||||
|
||||
// GetUserTags mocks base method.
|
||||
func (m *MockTagManager) GetUserTags(ctx context.Context, projectID string, userTags []gcp.UserTag) (map[string]string, error) {
|
||||
m.ctrl.T.Helper()
|
||||
ret := m.ctrl.Call(m, "GetUserTags", ctx, projectID, userTags)
|
||||
ret0, _ := ret[0].(map[string]string)
|
||||
ret1, _ := ret[1].(error)
|
||||
return ret0, ret1
|
||||
}
|
||||
|
||||
// GetUserTags indicates an expected call of GetUserTags.
|
||||
func (mr *MockTagManagerMockRecorder) GetUserTags(ctx, projectID, userTags interface{}) *gomock.Call {
|
||||
mr.mock.ctrl.T.Helper()
|
||||
return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUserTags", reflect.TypeOf((*MockTagManager)(nil).GetUserTags), ctx, projectID, userTags)
|
||||
}
|
||||
|
||||
813
vendor/github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/compute/mgmt/compute/models.go
generated
vendored
813
vendor/github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/compute/mgmt/compute/models.go
generated
vendored
@@ -1,813 +0,0 @@
|
||||
//go:build go1.9
|
||||
// +build go1.9
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
// This code was auto-generated by:
|
||||
// github.com/Azure/azure-sdk-for-go/eng/tools/profileBuilder
|
||||
|
||||
package compute
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
original "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-03-30/compute"
|
||||
)
|
||||
|
||||
const (
|
||||
DefaultBaseURI = original.DefaultBaseURI
|
||||
)
|
||||
|
||||
type AccessLevel = original.AccessLevel
|
||||
|
||||
const (
|
||||
None AccessLevel = original.None
|
||||
Read AccessLevel = original.Read
|
||||
)
|
||||
|
||||
type CachingTypes = original.CachingTypes
|
||||
|
||||
const (
|
||||
CachingTypesNone CachingTypes = original.CachingTypesNone
|
||||
CachingTypesReadOnly CachingTypes = original.CachingTypesReadOnly
|
||||
CachingTypesReadWrite CachingTypes = original.CachingTypesReadWrite
|
||||
)
|
||||
|
||||
type ComponentNames = original.ComponentNames
|
||||
|
||||
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 (
|
||||
DiskCreateOptionTypesAttach DiskCreateOptionTypes = original.DiskCreateOptionTypesAttach
|
||||
DiskCreateOptionTypesEmpty DiskCreateOptionTypes = original.DiskCreateOptionTypesEmpty
|
||||
DiskCreateOptionTypesFromImage DiskCreateOptionTypes = original.DiskCreateOptionTypesFromImage
|
||||
)
|
||||
|
||||
type IPVersion = original.IPVersion
|
||||
|
||||
const (
|
||||
IPv4 IPVersion = original.IPv4
|
||||
IPv6 IPVersion = original.IPv6
|
||||
)
|
||||
|
||||
type InstanceViewTypes = original.InstanceViewTypes
|
||||
|
||||
const (
|
||||
InstanceView InstanceViewTypes = original.InstanceView
|
||||
)
|
||||
|
||||
type MaintenanceOperationResultCodeTypes = original.MaintenanceOperationResultCodeTypes
|
||||
|
||||
const (
|
||||
MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = original.MaintenanceOperationResultCodeTypesMaintenanceAborted
|
||||
MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = original.MaintenanceOperationResultCodeTypesMaintenanceCompleted
|
||||
MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = original.MaintenanceOperationResultCodeTypesNone
|
||||
MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = original.MaintenanceOperationResultCodeTypesRetryLater
|
||||
)
|
||||
|
||||
type OperatingSystemStateTypes = original.OperatingSystemStateTypes
|
||||
|
||||
const (
|
||||
Generalized OperatingSystemStateTypes = original.Generalized
|
||||
Specialized OperatingSystemStateTypes = original.Specialized
|
||||
)
|
||||
|
||||
type OperatingSystemTypes = original.OperatingSystemTypes
|
||||
|
||||
const (
|
||||
Linux OperatingSystemTypes = original.Linux
|
||||
Windows OperatingSystemTypes = original.Windows
|
||||
)
|
||||
|
||||
type PassNames = original.PassNames
|
||||
|
||||
const (
|
||||
OobeSystem PassNames = original.OobeSystem
|
||||
)
|
||||
|
||||
type ProtocolTypes = original.ProtocolTypes
|
||||
|
||||
const (
|
||||
HTTP ProtocolTypes = original.HTTP
|
||||
HTTPS ProtocolTypes = original.HTTPS
|
||||
)
|
||||
|
||||
type ResourceIdentityType = original.ResourceIdentityType
|
||||
|
||||
const (
|
||||
SystemAssigned ResourceIdentityType = original.SystemAssigned
|
||||
)
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
type RollingUpgradeActionType = original.RollingUpgradeActionType
|
||||
|
||||
const (
|
||||
Cancel RollingUpgradeActionType = original.Cancel
|
||||
Start RollingUpgradeActionType = original.Start
|
||||
)
|
||||
|
||||
type RollingUpgradeStatusCode = original.RollingUpgradeStatusCode
|
||||
|
||||
const (
|
||||
Cancelled RollingUpgradeStatusCode = original.Cancelled
|
||||
Completed RollingUpgradeStatusCode = original.Completed
|
||||
Faulted RollingUpgradeStatusCode = original.Faulted
|
||||
RollingForward RollingUpgradeStatusCode = original.RollingForward
|
||||
)
|
||||
|
||||
type SettingNames = original.SettingNames
|
||||
|
||||
const (
|
||||
AutoLogon SettingNames = original.AutoLogon
|
||||
FirstLogonCommands SettingNames = original.FirstLogonCommands
|
||||
)
|
||||
|
||||
type StatusLevelTypes = original.StatusLevelTypes
|
||||
|
||||
const (
|
||||
Error StatusLevelTypes = original.Error
|
||||
Info StatusLevelTypes = original.Info
|
||||
Warning StatusLevelTypes = original.Warning
|
||||
)
|
||||
|
||||
type StorageAccountTypes = original.StorageAccountTypes
|
||||
|
||||
const (
|
||||
PremiumLRS StorageAccountTypes = original.PremiumLRS
|
||||
StandardLRS StorageAccountTypes = original.StandardLRS
|
||||
)
|
||||
|
||||
type UpgradeMode = original.UpgradeMode
|
||||
|
||||
const (
|
||||
Automatic UpgradeMode = original.Automatic
|
||||
Manual UpgradeMode = original.Manual
|
||||
Rolling UpgradeMode = original.Rolling
|
||||
)
|
||||
|
||||
type VirtualMachineScaleSetSkuScaleType = original.VirtualMachineScaleSetSkuScaleType
|
||||
|
||||
const (
|
||||
VirtualMachineScaleSetSkuScaleTypeAutomatic VirtualMachineScaleSetSkuScaleType = original.VirtualMachineScaleSetSkuScaleTypeAutomatic
|
||||
VirtualMachineScaleSetSkuScaleTypeNone VirtualMachineScaleSetSkuScaleType = original.VirtualMachineScaleSetSkuScaleTypeNone
|
||||
)
|
||||
|
||||
type VirtualMachineSizeTypes = original.VirtualMachineSizeTypes
|
||||
|
||||
const (
|
||||
BasicA0 VirtualMachineSizeTypes = original.BasicA0
|
||||
BasicA1 VirtualMachineSizeTypes = original.BasicA1
|
||||
BasicA2 VirtualMachineSizeTypes = original.BasicA2
|
||||
BasicA3 VirtualMachineSizeTypes = original.BasicA3
|
||||
BasicA4 VirtualMachineSizeTypes = original.BasicA4
|
||||
StandardA0 VirtualMachineSizeTypes = original.StandardA0
|
||||
StandardA1 VirtualMachineSizeTypes = original.StandardA1
|
||||
StandardA10 VirtualMachineSizeTypes = original.StandardA10
|
||||
StandardA11 VirtualMachineSizeTypes = original.StandardA11
|
||||
StandardA1V2 VirtualMachineSizeTypes = original.StandardA1V2
|
||||
StandardA2 VirtualMachineSizeTypes = original.StandardA2
|
||||
StandardA2mV2 VirtualMachineSizeTypes = original.StandardA2mV2
|
||||
StandardA2V2 VirtualMachineSizeTypes = original.StandardA2V2
|
||||
StandardA3 VirtualMachineSizeTypes = original.StandardA3
|
||||
StandardA4 VirtualMachineSizeTypes = original.StandardA4
|
||||
StandardA4mV2 VirtualMachineSizeTypes = original.StandardA4mV2
|
||||
StandardA4V2 VirtualMachineSizeTypes = original.StandardA4V2
|
||||
StandardA5 VirtualMachineSizeTypes = original.StandardA5
|
||||
StandardA6 VirtualMachineSizeTypes = original.StandardA6
|
||||
StandardA7 VirtualMachineSizeTypes = original.StandardA7
|
||||
StandardA8 VirtualMachineSizeTypes = original.StandardA8
|
||||
StandardA8mV2 VirtualMachineSizeTypes = original.StandardA8mV2
|
||||
StandardA8V2 VirtualMachineSizeTypes = original.StandardA8V2
|
||||
StandardA9 VirtualMachineSizeTypes = original.StandardA9
|
||||
StandardD1 VirtualMachineSizeTypes = original.StandardD1
|
||||
StandardD11 VirtualMachineSizeTypes = original.StandardD11
|
||||
StandardD11V2 VirtualMachineSizeTypes = original.StandardD11V2
|
||||
StandardD12 VirtualMachineSizeTypes = original.StandardD12
|
||||
StandardD12V2 VirtualMachineSizeTypes = original.StandardD12V2
|
||||
StandardD13 VirtualMachineSizeTypes = original.StandardD13
|
||||
StandardD13V2 VirtualMachineSizeTypes = original.StandardD13V2
|
||||
StandardD14 VirtualMachineSizeTypes = original.StandardD14
|
||||
StandardD14V2 VirtualMachineSizeTypes = original.StandardD14V2
|
||||
StandardD15V2 VirtualMachineSizeTypes = original.StandardD15V2
|
||||
StandardD1V2 VirtualMachineSizeTypes = original.StandardD1V2
|
||||
StandardD2 VirtualMachineSizeTypes = original.StandardD2
|
||||
StandardD2V2 VirtualMachineSizeTypes = original.StandardD2V2
|
||||
StandardD3 VirtualMachineSizeTypes = original.StandardD3
|
||||
StandardD3V2 VirtualMachineSizeTypes = original.StandardD3V2
|
||||
StandardD4 VirtualMachineSizeTypes = original.StandardD4
|
||||
StandardD4V2 VirtualMachineSizeTypes = original.StandardD4V2
|
||||
StandardD5V2 VirtualMachineSizeTypes = original.StandardD5V2
|
||||
StandardDS1 VirtualMachineSizeTypes = original.StandardDS1
|
||||
StandardDS11 VirtualMachineSizeTypes = original.StandardDS11
|
||||
StandardDS11V2 VirtualMachineSizeTypes = original.StandardDS11V2
|
||||
StandardDS12 VirtualMachineSizeTypes = original.StandardDS12
|
||||
StandardDS12V2 VirtualMachineSizeTypes = original.StandardDS12V2
|
||||
StandardDS13 VirtualMachineSizeTypes = original.StandardDS13
|
||||
StandardDS13V2 VirtualMachineSizeTypes = original.StandardDS13V2
|
||||
StandardDS14 VirtualMachineSizeTypes = original.StandardDS14
|
||||
StandardDS14V2 VirtualMachineSizeTypes = original.StandardDS14V2
|
||||
StandardDS15V2 VirtualMachineSizeTypes = original.StandardDS15V2
|
||||
StandardDS1V2 VirtualMachineSizeTypes = original.StandardDS1V2
|
||||
StandardDS2 VirtualMachineSizeTypes = original.StandardDS2
|
||||
StandardDS2V2 VirtualMachineSizeTypes = original.StandardDS2V2
|
||||
StandardDS3 VirtualMachineSizeTypes = original.StandardDS3
|
||||
StandardDS3V2 VirtualMachineSizeTypes = original.StandardDS3V2
|
||||
StandardDS4 VirtualMachineSizeTypes = original.StandardDS4
|
||||
StandardDS4V2 VirtualMachineSizeTypes = original.StandardDS4V2
|
||||
StandardDS5V2 VirtualMachineSizeTypes = original.StandardDS5V2
|
||||
StandardF1 VirtualMachineSizeTypes = original.StandardF1
|
||||
StandardF16 VirtualMachineSizeTypes = original.StandardF16
|
||||
StandardF16s VirtualMachineSizeTypes = original.StandardF16s
|
||||
StandardF1s VirtualMachineSizeTypes = original.StandardF1s
|
||||
StandardF2 VirtualMachineSizeTypes = original.StandardF2
|
||||
StandardF2s VirtualMachineSizeTypes = original.StandardF2s
|
||||
StandardF4 VirtualMachineSizeTypes = original.StandardF4
|
||||
StandardF4s VirtualMachineSizeTypes = original.StandardF4s
|
||||
StandardF8 VirtualMachineSizeTypes = original.StandardF8
|
||||
StandardF8s VirtualMachineSizeTypes = original.StandardF8s
|
||||
StandardG1 VirtualMachineSizeTypes = original.StandardG1
|
||||
StandardG2 VirtualMachineSizeTypes = original.StandardG2
|
||||
StandardG3 VirtualMachineSizeTypes = original.StandardG3
|
||||
StandardG4 VirtualMachineSizeTypes = original.StandardG4
|
||||
StandardG5 VirtualMachineSizeTypes = original.StandardG5
|
||||
StandardGS1 VirtualMachineSizeTypes = original.StandardGS1
|
||||
StandardGS2 VirtualMachineSizeTypes = original.StandardGS2
|
||||
StandardGS3 VirtualMachineSizeTypes = original.StandardGS3
|
||||
StandardGS4 VirtualMachineSizeTypes = original.StandardGS4
|
||||
StandardGS5 VirtualMachineSizeTypes = original.StandardGS5
|
||||
StandardH16 VirtualMachineSizeTypes = original.StandardH16
|
||||
StandardH16m VirtualMachineSizeTypes = original.StandardH16m
|
||||
StandardH16mr VirtualMachineSizeTypes = original.StandardH16mr
|
||||
StandardH16r VirtualMachineSizeTypes = original.StandardH16r
|
||||
StandardH8 VirtualMachineSizeTypes = original.StandardH8
|
||||
StandardH8m VirtualMachineSizeTypes = original.StandardH8m
|
||||
StandardL16s VirtualMachineSizeTypes = original.StandardL16s
|
||||
StandardL32s VirtualMachineSizeTypes = original.StandardL32s
|
||||
StandardL4s VirtualMachineSizeTypes = original.StandardL4s
|
||||
StandardL8s VirtualMachineSizeTypes = original.StandardL8s
|
||||
StandardNC12 VirtualMachineSizeTypes = original.StandardNC12
|
||||
StandardNC24 VirtualMachineSizeTypes = original.StandardNC24
|
||||
StandardNC24r VirtualMachineSizeTypes = original.StandardNC24r
|
||||
StandardNC6 VirtualMachineSizeTypes = original.StandardNC6
|
||||
StandardNV12 VirtualMachineSizeTypes = original.StandardNV12
|
||||
StandardNV24 VirtualMachineSizeTypes = original.StandardNV24
|
||||
StandardNV6 VirtualMachineSizeTypes = original.StandardNV6
|
||||
)
|
||||
|
||||
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 AvailabilitySet = original.AvailabilitySet
|
||||
type AvailabilitySetListResult = original.AvailabilitySetListResult
|
||||
type AvailabilitySetListResultIterator = original.AvailabilitySetListResultIterator
|
||||
type AvailabilitySetListResultPage = original.AvailabilitySetListResultPage
|
||||
type AvailabilitySetProperties = original.AvailabilitySetProperties
|
||||
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
|
||||
type ImageOSDisk = original.ImageOSDisk
|
||||
type ImageProperties = original.ImageProperties
|
||||
type ImageReference = original.ImageReference
|
||||
type ImageStorageProfile = original.ImageStorageProfile
|
||||
type ImagesClient = original.ImagesClient
|
||||
type ImagesCreateOrUpdateFuture = original.ImagesCreateOrUpdateFuture
|
||||
type ImagesDeleteFuture = original.ImagesDeleteFuture
|
||||
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
|
||||
type ListUsagesResult = original.ListUsagesResult
|
||||
type ListUsagesResultIterator = original.ListUsagesResultIterator
|
||||
type ListUsagesResultPage = original.ListUsagesResultPage
|
||||
type ListVirtualMachineExtensionImage = original.ListVirtualMachineExtensionImage
|
||||
type ListVirtualMachineImageResource = original.ListVirtualMachineImageResource
|
||||
type LongRunningOperationProperties = original.LongRunningOperationProperties
|
||||
type MaintenanceRedeployStatus = original.MaintenanceRedeployStatus
|
||||
type ManagedDiskParameters = original.ManagedDiskParameters
|
||||
type NetworkInterfaceReference = original.NetworkInterfaceReference
|
||||
type NetworkInterfaceReferenceProperties = original.NetworkInterfaceReferenceProperties
|
||||
type NetworkProfile = original.NetworkProfile
|
||||
type OSDisk = original.OSDisk
|
||||
type OSDiskImage = original.OSDiskImage
|
||||
type OSProfile = original.OSProfile
|
||||
type OperationStatusResponse = original.OperationStatusResponse
|
||||
type Plan = original.Plan
|
||||
type PurchasePlan = original.PurchasePlan
|
||||
type Resource = original.Resource
|
||||
type ResourceSku = original.ResourceSku
|
||||
type ResourceSkuCapabilities = original.ResourceSkuCapabilities
|
||||
type ResourceSkuCapacity = original.ResourceSkuCapacity
|
||||
type ResourceSkuCosts = original.ResourceSkuCosts
|
||||
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 RollingUpgradePolicy = original.RollingUpgradePolicy
|
||||
type RollingUpgradeProgressInfo = original.RollingUpgradeProgressInfo
|
||||
type RollingUpgradeRunningStatus = original.RollingUpgradeRunningStatus
|
||||
type RollingUpgradeStatusInfo = original.RollingUpgradeStatusInfo
|
||||
type RollingUpgradeStatusInfoProperties = original.RollingUpgradeStatusInfoProperties
|
||||
type RunCommandDocument = original.RunCommandDocument
|
||||
type RunCommandDocumentBase = original.RunCommandDocumentBase
|
||||
type RunCommandInput = original.RunCommandInput
|
||||
type RunCommandInputParameter = original.RunCommandInputParameter
|
||||
type RunCommandListResult = original.RunCommandListResult
|
||||
type RunCommandListResultIterator = original.RunCommandListResultIterator
|
||||
type RunCommandListResultPage = original.RunCommandListResultPage
|
||||
type RunCommandParameterDefinition = original.RunCommandParameterDefinition
|
||||
type RunCommandResult = original.RunCommandResult
|
||||
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
|
||||
type UpdateResource = original.UpdateResource
|
||||
type UpgradePolicy = original.UpgradePolicy
|
||||
type Usage = original.Usage
|
||||
type UsageClient = original.UsageClient
|
||||
type UsageName = original.UsageName
|
||||
type VaultCertificate = original.VaultCertificate
|
||||
type VaultSecretGroup = original.VaultSecretGroup
|
||||
type VirtualHardDisk = original.VirtualHardDisk
|
||||
type VirtualMachine = original.VirtualMachine
|
||||
type VirtualMachineAgentInstanceView = original.VirtualMachineAgentInstanceView
|
||||
type VirtualMachineCaptureParameters = original.VirtualMachineCaptureParameters
|
||||
type VirtualMachineCaptureResult = original.VirtualMachineCaptureResult
|
||||
type VirtualMachineCaptureResultProperties = original.VirtualMachineCaptureResultProperties
|
||||
type VirtualMachineExtension = original.VirtualMachineExtension
|
||||
type VirtualMachineExtensionHandlerInstanceView = original.VirtualMachineExtensionHandlerInstanceView
|
||||
type VirtualMachineExtensionImage = original.VirtualMachineExtensionImage
|
||||
type VirtualMachineExtensionImageProperties = original.VirtualMachineExtensionImageProperties
|
||||
type VirtualMachineExtensionImagesClient = original.VirtualMachineExtensionImagesClient
|
||||
type VirtualMachineExtensionInstanceView = original.VirtualMachineExtensionInstanceView
|
||||
type VirtualMachineExtensionProperties = original.VirtualMachineExtensionProperties
|
||||
type VirtualMachineExtensionUpdate = original.VirtualMachineExtensionUpdate
|
||||
type VirtualMachineExtensionUpdateProperties = original.VirtualMachineExtensionUpdateProperties
|
||||
type VirtualMachineExtensionsClient = original.VirtualMachineExtensionsClient
|
||||
type VirtualMachineExtensionsCreateOrUpdateFuture = original.VirtualMachineExtensionsCreateOrUpdateFuture
|
||||
type VirtualMachineExtensionsDeleteFuture = original.VirtualMachineExtensionsDeleteFuture
|
||||
type VirtualMachineExtensionsListResult = original.VirtualMachineExtensionsListResult
|
||||
type VirtualMachineExtensionsUpdateFuture = original.VirtualMachineExtensionsUpdateFuture
|
||||
type VirtualMachineHealthStatus = original.VirtualMachineHealthStatus
|
||||
type VirtualMachineIdentity = original.VirtualMachineIdentity
|
||||
type VirtualMachineImage = original.VirtualMachineImage
|
||||
type VirtualMachineImageProperties = original.VirtualMachineImageProperties
|
||||
type VirtualMachineImageResource = original.VirtualMachineImageResource
|
||||
type VirtualMachineImagesClient = original.VirtualMachineImagesClient
|
||||
type VirtualMachineInstanceView = original.VirtualMachineInstanceView
|
||||
type VirtualMachineListResult = original.VirtualMachineListResult
|
||||
type VirtualMachineListResultIterator = original.VirtualMachineListResultIterator
|
||||
type VirtualMachineListResultPage = original.VirtualMachineListResultPage
|
||||
type VirtualMachineProperties = original.VirtualMachineProperties
|
||||
type VirtualMachineRunCommandsClient = original.VirtualMachineRunCommandsClient
|
||||
type VirtualMachineScaleSet = original.VirtualMachineScaleSet
|
||||
type VirtualMachineScaleSetDataDisk = original.VirtualMachineScaleSetDataDisk
|
||||
type VirtualMachineScaleSetExtension = original.VirtualMachineScaleSetExtension
|
||||
type VirtualMachineScaleSetExtensionListResult = original.VirtualMachineScaleSetExtensionListResult
|
||||
type VirtualMachineScaleSetExtensionListResultIterator = original.VirtualMachineScaleSetExtensionListResultIterator
|
||||
type VirtualMachineScaleSetExtensionListResultPage = original.VirtualMachineScaleSetExtensionListResultPage
|
||||
type VirtualMachineScaleSetExtensionProfile = original.VirtualMachineScaleSetExtensionProfile
|
||||
type VirtualMachineScaleSetExtensionProperties = original.VirtualMachineScaleSetExtensionProperties
|
||||
type VirtualMachineScaleSetExtensionsClient = original.VirtualMachineScaleSetExtensionsClient
|
||||
type VirtualMachineScaleSetExtensionsCreateOrUpdateFuture = original.VirtualMachineScaleSetExtensionsCreateOrUpdateFuture
|
||||
type VirtualMachineScaleSetExtensionsDeleteFuture = original.VirtualMachineScaleSetExtensionsDeleteFuture
|
||||
type VirtualMachineScaleSetIPConfiguration = original.VirtualMachineScaleSetIPConfiguration
|
||||
type VirtualMachineScaleSetIPConfigurationProperties = original.VirtualMachineScaleSetIPConfigurationProperties
|
||||
type VirtualMachineScaleSetIdentity = original.VirtualMachineScaleSetIdentity
|
||||
type VirtualMachineScaleSetInstanceView = original.VirtualMachineScaleSetInstanceView
|
||||
type VirtualMachineScaleSetInstanceViewStatusesSummary = original.VirtualMachineScaleSetInstanceViewStatusesSummary
|
||||
type VirtualMachineScaleSetListResult = original.VirtualMachineScaleSetListResult
|
||||
type VirtualMachineScaleSetListResultIterator = original.VirtualMachineScaleSetListResultIterator
|
||||
type VirtualMachineScaleSetListResultPage = original.VirtualMachineScaleSetListResultPage
|
||||
type VirtualMachineScaleSetListSkusResult = original.VirtualMachineScaleSetListSkusResult
|
||||
type VirtualMachineScaleSetListSkusResultIterator = original.VirtualMachineScaleSetListSkusResultIterator
|
||||
type VirtualMachineScaleSetListSkusResultPage = original.VirtualMachineScaleSetListSkusResultPage
|
||||
type VirtualMachineScaleSetListWithLinkResult = original.VirtualMachineScaleSetListWithLinkResult
|
||||
type VirtualMachineScaleSetListWithLinkResultIterator = original.VirtualMachineScaleSetListWithLinkResultIterator
|
||||
type VirtualMachineScaleSetListWithLinkResultPage = original.VirtualMachineScaleSetListWithLinkResultPage
|
||||
type VirtualMachineScaleSetManagedDiskParameters = original.VirtualMachineScaleSetManagedDiskParameters
|
||||
type VirtualMachineScaleSetNetworkConfiguration = original.VirtualMachineScaleSetNetworkConfiguration
|
||||
type VirtualMachineScaleSetNetworkConfigurationDNSSettings = original.VirtualMachineScaleSetNetworkConfigurationDNSSettings
|
||||
type VirtualMachineScaleSetNetworkConfigurationProperties = original.VirtualMachineScaleSetNetworkConfigurationProperties
|
||||
type VirtualMachineScaleSetNetworkProfile = original.VirtualMachineScaleSetNetworkProfile
|
||||
type VirtualMachineScaleSetOSDisk = original.VirtualMachineScaleSetOSDisk
|
||||
type VirtualMachineScaleSetOSProfile = original.VirtualMachineScaleSetOSProfile
|
||||
type VirtualMachineScaleSetProperties = original.VirtualMachineScaleSetProperties
|
||||
type VirtualMachineScaleSetPublicIPAddressConfiguration = original.VirtualMachineScaleSetPublicIPAddressConfiguration
|
||||
type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings = original.VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings
|
||||
type VirtualMachineScaleSetPublicIPAddressConfigurationProperties = original.VirtualMachineScaleSetPublicIPAddressConfigurationProperties
|
||||
type VirtualMachineScaleSetRollingUpgradesCancelFuture = original.VirtualMachineScaleSetRollingUpgradesCancelFuture
|
||||
type VirtualMachineScaleSetRollingUpgradesClient = original.VirtualMachineScaleSetRollingUpgradesClient
|
||||
type VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture = original.VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture
|
||||
type VirtualMachineScaleSetSku = original.VirtualMachineScaleSetSku
|
||||
type VirtualMachineScaleSetSkuCapacity = original.VirtualMachineScaleSetSkuCapacity
|
||||
type VirtualMachineScaleSetStorageProfile = original.VirtualMachineScaleSetStorageProfile
|
||||
type VirtualMachineScaleSetUpdate = original.VirtualMachineScaleSetUpdate
|
||||
type VirtualMachineScaleSetUpdateIPConfiguration = original.VirtualMachineScaleSetUpdateIPConfiguration
|
||||
type VirtualMachineScaleSetUpdateIPConfigurationProperties = original.VirtualMachineScaleSetUpdateIPConfigurationProperties
|
||||
type VirtualMachineScaleSetUpdateNetworkConfiguration = original.VirtualMachineScaleSetUpdateNetworkConfiguration
|
||||
type VirtualMachineScaleSetUpdateNetworkConfigurationProperties = original.VirtualMachineScaleSetUpdateNetworkConfigurationProperties
|
||||
type VirtualMachineScaleSetUpdateNetworkProfile = original.VirtualMachineScaleSetUpdateNetworkProfile
|
||||
type VirtualMachineScaleSetUpdateOSDisk = original.VirtualMachineScaleSetUpdateOSDisk
|
||||
type VirtualMachineScaleSetUpdateOSProfile = original.VirtualMachineScaleSetUpdateOSProfile
|
||||
type VirtualMachineScaleSetUpdateProperties = original.VirtualMachineScaleSetUpdateProperties
|
||||
type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration = original.VirtualMachineScaleSetUpdatePublicIPAddressConfiguration
|
||||
type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties = original.VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties
|
||||
type VirtualMachineScaleSetUpdateStorageProfile = original.VirtualMachineScaleSetUpdateStorageProfile
|
||||
type VirtualMachineScaleSetUpdateVMProfile = original.VirtualMachineScaleSetUpdateVMProfile
|
||||
type VirtualMachineScaleSetVM = original.VirtualMachineScaleSetVM
|
||||
type VirtualMachineScaleSetVMExtensionsSummary = original.VirtualMachineScaleSetVMExtensionsSummary
|
||||
type VirtualMachineScaleSetVMInstanceIDs = original.VirtualMachineScaleSetVMInstanceIDs
|
||||
type VirtualMachineScaleSetVMInstanceRequiredIDs = original.VirtualMachineScaleSetVMInstanceRequiredIDs
|
||||
type VirtualMachineScaleSetVMInstanceView = original.VirtualMachineScaleSetVMInstanceView
|
||||
type VirtualMachineScaleSetVMListResult = original.VirtualMachineScaleSetVMListResult
|
||||
type VirtualMachineScaleSetVMListResultIterator = original.VirtualMachineScaleSetVMListResultIterator
|
||||
type VirtualMachineScaleSetVMListResultPage = original.VirtualMachineScaleSetVMListResultPage
|
||||
type VirtualMachineScaleSetVMProfile = original.VirtualMachineScaleSetVMProfile
|
||||
type VirtualMachineScaleSetVMProperties = original.VirtualMachineScaleSetVMProperties
|
||||
type VirtualMachineScaleSetVMsClient = original.VirtualMachineScaleSetVMsClient
|
||||
type VirtualMachineScaleSetVMsDeallocateFuture = original.VirtualMachineScaleSetVMsDeallocateFuture
|
||||
type VirtualMachineScaleSetVMsDeleteFuture = original.VirtualMachineScaleSetVMsDeleteFuture
|
||||
type VirtualMachineScaleSetVMsPowerOffFuture = original.VirtualMachineScaleSetVMsPowerOffFuture
|
||||
type VirtualMachineScaleSetVMsReimageAllFuture = original.VirtualMachineScaleSetVMsReimageAllFuture
|
||||
type VirtualMachineScaleSetVMsReimageFuture = original.VirtualMachineScaleSetVMsReimageFuture
|
||||
type VirtualMachineScaleSetVMsRestartFuture = original.VirtualMachineScaleSetVMsRestartFuture
|
||||
type VirtualMachineScaleSetVMsStartFuture = original.VirtualMachineScaleSetVMsStartFuture
|
||||
type VirtualMachineScaleSetsClient = original.VirtualMachineScaleSetsClient
|
||||
type VirtualMachineScaleSetsCreateOrUpdateFuture = original.VirtualMachineScaleSetsCreateOrUpdateFuture
|
||||
type VirtualMachineScaleSetsDeallocateFuture = original.VirtualMachineScaleSetsDeallocateFuture
|
||||
type VirtualMachineScaleSetsDeleteFuture = original.VirtualMachineScaleSetsDeleteFuture
|
||||
type VirtualMachineScaleSetsDeleteInstancesFuture = original.VirtualMachineScaleSetsDeleteInstancesFuture
|
||||
type VirtualMachineScaleSetsPowerOffFuture = original.VirtualMachineScaleSetsPowerOffFuture
|
||||
type VirtualMachineScaleSetsReimageAllFuture = original.VirtualMachineScaleSetsReimageAllFuture
|
||||
type VirtualMachineScaleSetsReimageFuture = original.VirtualMachineScaleSetsReimageFuture
|
||||
type VirtualMachineScaleSetsRestartFuture = original.VirtualMachineScaleSetsRestartFuture
|
||||
type VirtualMachineScaleSetsStartFuture = original.VirtualMachineScaleSetsStartFuture
|
||||
type VirtualMachineScaleSetsUpdateFuture = original.VirtualMachineScaleSetsUpdateFuture
|
||||
type VirtualMachineScaleSetsUpdateInstancesFuture = original.VirtualMachineScaleSetsUpdateInstancesFuture
|
||||
type VirtualMachineSize = original.VirtualMachineSize
|
||||
type VirtualMachineSizeListResult = original.VirtualMachineSizeListResult
|
||||
type VirtualMachineSizesClient = original.VirtualMachineSizesClient
|
||||
type VirtualMachineStatusCodeCount = original.VirtualMachineStatusCodeCount
|
||||
type VirtualMachinesCaptureFuture = original.VirtualMachinesCaptureFuture
|
||||
type VirtualMachinesClient = original.VirtualMachinesClient
|
||||
type VirtualMachinesConvertToManagedDisksFuture = original.VirtualMachinesConvertToManagedDisksFuture
|
||||
type VirtualMachinesCreateOrUpdateFuture = original.VirtualMachinesCreateOrUpdateFuture
|
||||
type VirtualMachinesDeallocateFuture = original.VirtualMachinesDeallocateFuture
|
||||
type VirtualMachinesDeleteFuture = original.VirtualMachinesDeleteFuture
|
||||
type VirtualMachinesPerformMaintenanceFuture = original.VirtualMachinesPerformMaintenanceFuture
|
||||
type VirtualMachinesPowerOffFuture = original.VirtualMachinesPowerOffFuture
|
||||
type VirtualMachinesRedeployFuture = original.VirtualMachinesRedeployFuture
|
||||
type VirtualMachinesRestartFuture = original.VirtualMachinesRestartFuture
|
||||
type VirtualMachinesRunCommandFuture = original.VirtualMachinesRunCommandFuture
|
||||
type VirtualMachinesStartFuture = original.VirtualMachinesStartFuture
|
||||
type WinRMConfiguration = original.WinRMConfiguration
|
||||
type WinRMListener = original.WinRMListener
|
||||
type WindowsConfiguration = original.WindowsConfiguration
|
||||
|
||||
func New(subscriptionID string) BaseClient {
|
||||
return original.New(subscriptionID)
|
||||
}
|
||||
func NewAvailabilitySetListResultIterator(page AvailabilitySetListResultPage) AvailabilitySetListResultIterator {
|
||||
return original.NewAvailabilitySetListResultIterator(page)
|
||||
}
|
||||
func NewAvailabilitySetListResultPage(cur AvailabilitySetListResult, getNextPage func(context.Context, AvailabilitySetListResult) (AvailabilitySetListResult, error)) AvailabilitySetListResultPage {
|
||||
return original.NewAvailabilitySetListResultPage(cur, getNextPage)
|
||||
}
|
||||
func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient {
|
||||
return original.NewAvailabilitySetsClient(subscriptionID)
|
||||
}
|
||||
func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string) AvailabilitySetsClient {
|
||||
return original.NewAvailabilitySetsClientWithBaseURI(baseURI, subscriptionID)
|
||||
}
|
||||
func NewDiskListIterator(page DiskListPage) DiskListIterator {
|
||||
return original.NewDiskListIterator(page)
|
||||
}
|
||||
func NewDiskListPage(cur DiskList, getNextPage func(context.Context, DiskList) (DiskList, error)) DiskListPage {
|
||||
return original.NewDiskListPage(cur, 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)
|
||||
}
|
||||
func NewImageListResultPage(cur ImageListResult, getNextPage func(context.Context, ImageListResult) (ImageListResult, error)) ImageListResultPage {
|
||||
return original.NewImageListResultPage(cur, getNextPage)
|
||||
}
|
||||
func NewImagesClient(subscriptionID string) ImagesClient {
|
||||
return original.NewImagesClient(subscriptionID)
|
||||
}
|
||||
func NewImagesClientWithBaseURI(baseURI string, subscriptionID string) ImagesClient {
|
||||
return original.NewImagesClientWithBaseURI(baseURI, subscriptionID)
|
||||
}
|
||||
func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator {
|
||||
return original.NewListUsagesResultIterator(page)
|
||||
}
|
||||
func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage {
|
||||
return original.NewListUsagesResultPage(cur, getNextPage)
|
||||
}
|
||||
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(cur ResourceSkusResult, getNextPage func(context.Context, ResourceSkusResult) (ResourceSkusResult, error)) ResourceSkusResultPage {
|
||||
return original.NewResourceSkusResultPage(cur, getNextPage)
|
||||
}
|
||||
func NewRunCommandListResultIterator(page RunCommandListResultPage) RunCommandListResultIterator {
|
||||
return original.NewRunCommandListResultIterator(page)
|
||||
}
|
||||
func NewRunCommandListResultPage(cur RunCommandListResult, getNextPage func(context.Context, RunCommandListResult) (RunCommandListResult, error)) RunCommandListResultPage {
|
||||
return original.NewRunCommandListResultPage(cur, getNextPage)
|
||||
}
|
||||
func NewSnapshotListIterator(page SnapshotListPage) SnapshotListIterator {
|
||||
return original.NewSnapshotListIterator(page)
|
||||
}
|
||||
func NewSnapshotListPage(cur SnapshotList, getNextPage func(context.Context, SnapshotList) (SnapshotList, error)) SnapshotListPage {
|
||||
return original.NewSnapshotListPage(cur, 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)
|
||||
}
|
||||
func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClient {
|
||||
return original.NewUsageClientWithBaseURI(baseURI, subscriptionID)
|
||||
}
|
||||
func NewVirtualMachineExtensionImagesClient(subscriptionID string) VirtualMachineExtensionImagesClient {
|
||||
return original.NewVirtualMachineExtensionImagesClient(subscriptionID)
|
||||
}
|
||||
func NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionImagesClient {
|
||||
return original.NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI, subscriptionID)
|
||||
}
|
||||
func NewVirtualMachineExtensionsClient(subscriptionID string) VirtualMachineExtensionsClient {
|
||||
return original.NewVirtualMachineExtensionsClient(subscriptionID)
|
||||
}
|
||||
func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionsClient {
|
||||
return original.NewVirtualMachineExtensionsClientWithBaseURI(baseURI, subscriptionID)
|
||||
}
|
||||
func NewVirtualMachineImagesClient(subscriptionID string) VirtualMachineImagesClient {
|
||||
return original.NewVirtualMachineImagesClient(subscriptionID)
|
||||
}
|
||||
func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineImagesClient {
|
||||
return original.NewVirtualMachineImagesClientWithBaseURI(baseURI, subscriptionID)
|
||||
}
|
||||
func NewVirtualMachineListResultIterator(page VirtualMachineListResultPage) VirtualMachineListResultIterator {
|
||||
return original.NewVirtualMachineListResultIterator(page)
|
||||
}
|
||||
func NewVirtualMachineListResultPage(cur VirtualMachineListResult, getNextPage func(context.Context, VirtualMachineListResult) (VirtualMachineListResult, error)) VirtualMachineListResultPage {
|
||||
return original.NewVirtualMachineListResultPage(cur, getNextPage)
|
||||
}
|
||||
func NewVirtualMachineRunCommandsClient(subscriptionID string) VirtualMachineRunCommandsClient {
|
||||
return original.NewVirtualMachineRunCommandsClient(subscriptionID)
|
||||
}
|
||||
func NewVirtualMachineRunCommandsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineRunCommandsClient {
|
||||
return original.NewVirtualMachineRunCommandsClientWithBaseURI(baseURI, subscriptionID)
|
||||
}
|
||||
func NewVirtualMachineScaleSetExtensionListResultIterator(page VirtualMachineScaleSetExtensionListResultPage) VirtualMachineScaleSetExtensionListResultIterator {
|
||||
return original.NewVirtualMachineScaleSetExtensionListResultIterator(page)
|
||||
}
|
||||
func NewVirtualMachineScaleSetExtensionListResultPage(cur VirtualMachineScaleSetExtensionListResult, getNextPage func(context.Context, VirtualMachineScaleSetExtensionListResult) (VirtualMachineScaleSetExtensionListResult, error)) VirtualMachineScaleSetExtensionListResultPage {
|
||||
return original.NewVirtualMachineScaleSetExtensionListResultPage(cur, getNextPage)
|
||||
}
|
||||
func NewVirtualMachineScaleSetExtensionsClient(subscriptionID string) VirtualMachineScaleSetExtensionsClient {
|
||||
return original.NewVirtualMachineScaleSetExtensionsClient(subscriptionID)
|
||||
}
|
||||
func NewVirtualMachineScaleSetExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetExtensionsClient {
|
||||
return original.NewVirtualMachineScaleSetExtensionsClientWithBaseURI(baseURI, subscriptionID)
|
||||
}
|
||||
func NewVirtualMachineScaleSetListResultIterator(page VirtualMachineScaleSetListResultPage) VirtualMachineScaleSetListResultIterator {
|
||||
return original.NewVirtualMachineScaleSetListResultIterator(page)
|
||||
}
|
||||
func NewVirtualMachineScaleSetListResultPage(cur VirtualMachineScaleSetListResult, getNextPage func(context.Context, VirtualMachineScaleSetListResult) (VirtualMachineScaleSetListResult, error)) VirtualMachineScaleSetListResultPage {
|
||||
return original.NewVirtualMachineScaleSetListResultPage(cur, getNextPage)
|
||||
}
|
||||
func NewVirtualMachineScaleSetListSkusResultIterator(page VirtualMachineScaleSetListSkusResultPage) VirtualMachineScaleSetListSkusResultIterator {
|
||||
return original.NewVirtualMachineScaleSetListSkusResultIterator(page)
|
||||
}
|
||||
func NewVirtualMachineScaleSetListSkusResultPage(cur VirtualMachineScaleSetListSkusResult, getNextPage func(context.Context, VirtualMachineScaleSetListSkusResult) (VirtualMachineScaleSetListSkusResult, error)) VirtualMachineScaleSetListSkusResultPage {
|
||||
return original.NewVirtualMachineScaleSetListSkusResultPage(cur, getNextPage)
|
||||
}
|
||||
func NewVirtualMachineScaleSetListWithLinkResultIterator(page VirtualMachineScaleSetListWithLinkResultPage) VirtualMachineScaleSetListWithLinkResultIterator {
|
||||
return original.NewVirtualMachineScaleSetListWithLinkResultIterator(page)
|
||||
}
|
||||
func NewVirtualMachineScaleSetListWithLinkResultPage(cur VirtualMachineScaleSetListWithLinkResult, getNextPage func(context.Context, VirtualMachineScaleSetListWithLinkResult) (VirtualMachineScaleSetListWithLinkResult, error)) VirtualMachineScaleSetListWithLinkResultPage {
|
||||
return original.NewVirtualMachineScaleSetListWithLinkResultPage(cur, getNextPage)
|
||||
}
|
||||
func NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient {
|
||||
return original.NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID)
|
||||
}
|
||||
func NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient {
|
||||
return original.NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI, subscriptionID)
|
||||
}
|
||||
func NewVirtualMachineScaleSetVMListResultIterator(page VirtualMachineScaleSetVMListResultPage) VirtualMachineScaleSetVMListResultIterator {
|
||||
return original.NewVirtualMachineScaleSetVMListResultIterator(page)
|
||||
}
|
||||
func NewVirtualMachineScaleSetVMListResultPage(cur VirtualMachineScaleSetVMListResult, getNextPage func(context.Context, VirtualMachineScaleSetVMListResult) (VirtualMachineScaleSetVMListResult, error)) VirtualMachineScaleSetVMListResultPage {
|
||||
return original.NewVirtualMachineScaleSetVMListResultPage(cur, getNextPage)
|
||||
}
|
||||
func NewVirtualMachineScaleSetVMsClient(subscriptionID string) VirtualMachineScaleSetVMsClient {
|
||||
return original.NewVirtualMachineScaleSetVMsClient(subscriptionID)
|
||||
}
|
||||
func NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMsClient {
|
||||
return original.NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI, subscriptionID)
|
||||
}
|
||||
func NewVirtualMachineScaleSetsClient(subscriptionID string) VirtualMachineScaleSetsClient {
|
||||
return original.NewVirtualMachineScaleSetsClient(subscriptionID)
|
||||
}
|
||||
func NewVirtualMachineScaleSetsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetsClient {
|
||||
return original.NewVirtualMachineScaleSetsClientWithBaseURI(baseURI, subscriptionID)
|
||||
}
|
||||
func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient {
|
||||
return original.NewVirtualMachineSizesClient(subscriptionID)
|
||||
}
|
||||
func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineSizesClient {
|
||||
return original.NewVirtualMachineSizesClientWithBaseURI(baseURI, subscriptionID)
|
||||
}
|
||||
func NewVirtualMachinesClient(subscriptionID string) VirtualMachinesClient {
|
||||
return original.NewVirtualMachinesClient(subscriptionID)
|
||||
}
|
||||
func NewVirtualMachinesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachinesClient {
|
||||
return original.NewVirtualMachinesClientWithBaseURI(baseURI, subscriptionID)
|
||||
}
|
||||
func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
|
||||
return original.NewWithBaseURI(baseURI, subscriptionID)
|
||||
}
|
||||
func PossibleAccessLevelValues() []AccessLevel {
|
||||
return original.PossibleAccessLevelValues()
|
||||
}
|
||||
func PossibleCachingTypesValues() []CachingTypes {
|
||||
return original.PossibleCachingTypesValues()
|
||||
}
|
||||
func PossibleComponentNamesValues() []ComponentNames {
|
||||
return original.PossibleComponentNamesValues()
|
||||
}
|
||||
func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes {
|
||||
return original.PossibleDiskCreateOptionTypesValues()
|
||||
}
|
||||
func PossibleDiskCreateOptionValues() []DiskCreateOption {
|
||||
return original.PossibleDiskCreateOptionValues()
|
||||
}
|
||||
func PossibleIPVersionValues() []IPVersion {
|
||||
return original.PossibleIPVersionValues()
|
||||
}
|
||||
func PossibleInstanceViewTypesValues() []InstanceViewTypes {
|
||||
return original.PossibleInstanceViewTypesValues()
|
||||
}
|
||||
func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes {
|
||||
return original.PossibleMaintenanceOperationResultCodeTypesValues()
|
||||
}
|
||||
func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes {
|
||||
return original.PossibleOperatingSystemStateTypesValues()
|
||||
}
|
||||
func PossibleOperatingSystemTypesValues() []OperatingSystemTypes {
|
||||
return original.PossibleOperatingSystemTypesValues()
|
||||
}
|
||||
func PossiblePassNamesValues() []PassNames {
|
||||
return original.PossiblePassNamesValues()
|
||||
}
|
||||
func PossibleProtocolTypesValues() []ProtocolTypes {
|
||||
return original.PossibleProtocolTypesValues()
|
||||
}
|
||||
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()
|
||||
}
|
||||
func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode {
|
||||
return original.PossibleRollingUpgradeStatusCodeValues()
|
||||
}
|
||||
func PossibleSettingNamesValues() []SettingNames {
|
||||
return original.PossibleSettingNamesValues()
|
||||
}
|
||||
func PossibleStatusLevelTypesValues() []StatusLevelTypes {
|
||||
return original.PossibleStatusLevelTypesValues()
|
||||
}
|
||||
func PossibleStorageAccountTypesValues() []StorageAccountTypes {
|
||||
return original.PossibleStorageAccountTypesValues()
|
||||
}
|
||||
func PossibleUpgradeModeValues() []UpgradeMode {
|
||||
return original.PossibleUpgradeModeValues()
|
||||
}
|
||||
func PossibleVirtualMachineScaleSetSkuScaleTypeValues() []VirtualMachineScaleSetSkuScaleType {
|
||||
return original.PossibleVirtualMachineScaleSetSkuScaleTypeValues()
|
||||
}
|
||||
func PossibleVirtualMachineSizeTypesValues() []VirtualMachineSizeTypes {
|
||||
return original.PossibleVirtualMachineSizeTypesValues()
|
||||
}
|
||||
func UserAgent() string {
|
||||
return original.UserAgent() + " profiles/2018-03-01"
|
||||
}
|
||||
func Version() string {
|
||||
return original.Version()
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
# Change History
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
{
|
||||
"commit": "3c764635e7d442b3e74caf593029fcd440b3ef82",
|
||||
"readme": "/_/azure-rest-api-specs/specification/compute/resource-manager/readme.md",
|
||||
"tag": "package-compute-2017-03",
|
||||
"use": "@microsoft.azure/autorest.go@2.1.187",
|
||||
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
|
||||
"autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-compute-2017-03 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION /_/azure-rest-api-specs/specification/compute/resource-manager/readme.md",
|
||||
"additional_properties": {
|
||||
"additional_options": "--go --verbose --use-onever --version=2.0.4421 --go.license-header=MICROSOFT_MIT_NO_VERSION"
|
||||
}
|
||||
}
|
||||
@@ -1,574 +0,0 @@
|
||||
package compute
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// 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/tracing"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// AvailabilitySetsClient is the compute Client
|
||||
type AvailabilitySetsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewAvailabilitySetsClient creates an instance of the AvailabilitySetsClient client.
|
||||
func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient {
|
||||
return NewAvailabilitySetsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewAvailabilitySetsClientWithBaseURI creates an instance of the AvailabilitySetsClient client using a custom
|
||||
// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure
|
||||
// stack).
|
||||
func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string) AvailabilitySetsClient {
|
||||
return AvailabilitySetsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate create or update an availability set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// availabilitySetName - the name of the availability set.
|
||||
// parameters - parameters supplied to the Create Availability Set operation.
|
||||
func (client AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (result AvailabilitySet, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.CreateOrUpdate")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response.Response != nil {
|
||||
sc = result.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, availabilitySetName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.CreateOrUpdateSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateOrUpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client AvailabilitySetsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"availabilitySetName": autorest.Encode("path", availabilitySetName),
|
||||
"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.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
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 AvailabilitySetsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AvailabilitySetsClient) CreateOrUpdateResponder(resp *http.Response) (result AvailabilitySet, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Delete delete an availability set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// availabilitySetName - the name of the availability set.
|
||||
func (client AvailabilitySetsClient) Delete(ctx context.Context, resourceGroupName string, availabilitySetName string) (result OperationStatusResponse, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.Delete")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response.Response != nil {
|
||||
sc = result.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, availabilitySetName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.DeleteSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Delete", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client AvailabilitySetsClient) DeletePreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"availabilitySetName": autorest.Encode("path", availabilitySetName),
|
||||
"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/availabilitySets/{availabilitySetName}", 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 AvailabilitySetsClient) DeleteSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// DeleteResponder handles the response to the Delete request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AvailabilitySetsClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Get retrieves information about an availability set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// availabilitySetName - the name of the availability set.
|
||||
func (client AvailabilitySetsClient) Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result AvailabilitySet, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.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, availabilitySetName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "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.AvailabilitySetsClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "Get", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client AvailabilitySetsClient) GetPreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"availabilitySetName": autorest.Encode("path", availabilitySetName),
|
||||
"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/availabilitySets/{availabilitySetName}", 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 AvailabilitySetsClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AvailabilitySetsClient) GetResponder(resp *http.Response) (result AvailabilitySet, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List lists all availability sets in a resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
func (client AvailabilitySetsClient) List(ctx context.Context, resourceGroupName string) (result AvailabilitySetListResultPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.List")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.aslr.Response.Response != nil {
|
||||
sc = result.aslr.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.aslr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.aslr, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.aslr.hasNextLink() && result.aslr.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client AvailabilitySetsClient) ListPreparer(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/availabilitySets", 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 AvailabilitySetsClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AvailabilitySetsClient) ListResponder(resp *http.Response) (result AvailabilitySetListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
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 AvailabilitySetsClient) listNextResults(ctx context.Context, lastResults AvailabilitySetListResult) (result AvailabilitySetListResult, err error) {
|
||||
req, err := lastResults.availabilitySetListResultPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "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.AvailabilitySetsClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client AvailabilitySetsClient) ListComplete(ctx context.Context, resourceGroupName string) (result AvailabilitySetListResultIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.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, resourceGroupName)
|
||||
return
|
||||
}
|
||||
|
||||
// ListAvailableSizes lists all available virtual machine sizes that can be used to create a new virtual machine in an
|
||||
// existing availability set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// availabilitySetName - the name of the availability set.
|
||||
func (client AvailabilitySetsClient) ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result VirtualMachineSizeListResult, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListAvailableSizes")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response.Response != nil {
|
||||
sc = result.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.ListAvailableSizesPreparer(ctx, resourceGroupName, availabilitySetName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListAvailableSizesSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListAvailableSizesResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListAvailableSizesPreparer prepares the ListAvailableSizes request.
|
||||
func (client AvailabilitySetsClient) ListAvailableSizesPreparer(ctx context.Context, resourceGroupName string, availabilitySetName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"availabilitySetName": autorest.Encode("path", availabilitySetName),
|
||||
"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/availabilitySets/{availabilitySetName}/vmSizes", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListAvailableSizesSender sends the ListAvailableSizes request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AvailabilitySetsClient) ListAvailableSizesSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListAvailableSizesResponder handles the response to the ListAvailableSizes request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscription lists all availability sets in a subscription.
|
||||
// Parameters:
|
||||
// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'.
|
||||
func (client AvailabilitySetsClient) ListBySubscription(ctx context.Context, expand string) (result AvailabilitySetListResultPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.aslr.Response.Response != nil {
|
||||
sc = result.aslr.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
result.fn = client.listBySubscriptionNextResults
|
||||
req, err := client.ListBySubscriptionPreparer(ctx, expand)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListBySubscriptionSender(req)
|
||||
if err != nil {
|
||||
result.aslr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.aslr, err = client.ListBySubscriptionResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListBySubscription", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.aslr.hasNextLink() && result.aslr.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscriptionPreparer prepares the ListBySubscription request.
|
||||
func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Context, expand string) (*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,
|
||||
}
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/availabilitySets", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListBySubscriptionSender sends the ListBySubscription request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AvailabilitySetsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client AvailabilitySetsClient) ListBySubscriptionResponder(resp *http.Response) (result AvailabilitySetListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// listBySubscriptionNextResults retrieves the next set of results, if any.
|
||||
func (client AvailabilitySetsClient) listBySubscriptionNextResults(ctx context.Context, lastResults AvailabilitySetListResult) (result AvailabilitySetListResult, err error) {
|
||||
req, err := lastResults.availabilitySetListResultPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.ListBySubscriptionSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListBySubscriptionResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client AvailabilitySetsClient) ListBySubscriptionComplete(ctx context.Context, expand string) (result AvailabilitySetListResultIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/AvailabilitySetsClient.ListBySubscription")
|
||||
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.ListBySubscription(ctx, expand)
|
||||
return
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
// Deprecated: Please note, this package has been deprecated. A replacement package is available [github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute). We strongly encourage you to upgrade to continue receiving updates. See [Migration Guide](https://aka.ms/azsdk/golang/t2/migration) for guidance on upgrading. Refer to our [deprecation policy](https://azure.github.io/azure-sdk/policies_support.html) for more details.
|
||||
//
|
||||
// Package compute implements the Azure ARM Compute service API version 2017-03-30.
|
||||
//
|
||||
// Compute Client
|
||||
package compute
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
import (
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
)
|
||||
|
||||
const (
|
||||
// DefaultBaseURI is the default URI used for the service Compute
|
||||
DefaultBaseURI = "https://management.azure.com"
|
||||
)
|
||||
|
||||
// BaseClient is the base client for Compute.
|
||||
type BaseClient struct {
|
||||
autorest.Client
|
||||
BaseURI string
|
||||
SubscriptionID string
|
||||
}
|
||||
|
||||
// New creates an instance of the BaseClient client.
|
||||
func New(subscriptionID string) BaseClient {
|
||||
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with
|
||||
// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
|
||||
func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
|
||||
return BaseClient{
|
||||
Client: autorest.NewClientWithUserAgent(UserAgent()),
|
||||
BaseURI: baseURI,
|
||||
SubscriptionID: subscriptionID,
|
||||
}
|
||||
}
|
||||
781
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-03-30/compute/disks.go
generated
vendored
781
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-03-30/compute/disks.go
generated
vendored
@@ -1,781 +0,0 @@
|
||||
package compute
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// 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 using a custom endpoint. Use this when
|
||||
// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
|
||||
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.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.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
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
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,
|
||||
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.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.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
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
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,
|
||||
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
|
||||
}
|
||||
|
||||
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 client.Send(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,
|
||||
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.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.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
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
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,
|
||||
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
|
||||
}
|
||||
if result.dl.hasNextLink() && result.dl.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
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 client.Send(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,
|
||||
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
|
||||
}
|
||||
if result.dl.hasNextLink() && result.dl.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
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 client.Send(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,
|
||||
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.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.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
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
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,
|
||||
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.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.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
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
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,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
571
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-03-30/compute/enums.go
generated
vendored
571
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-03-30/compute/enums.go
generated
vendored
@@ -1,571 +0,0 @@
|
||||
package compute
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
// 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 (
|
||||
// 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{CachingTypesNone, CachingTypesReadOnly, CachingTypesReadWrite}
|
||||
}
|
||||
|
||||
// ComponentNames enumerates the values for component names.
|
||||
type ComponentNames string
|
||||
|
||||
const (
|
||||
// MicrosoftWindowsShellSetup ...
|
||||
MicrosoftWindowsShellSetup ComponentNames = "Microsoft-Windows-Shell-Setup"
|
||||
)
|
||||
|
||||
// PossibleComponentNamesValues returns an array of possible values for the ComponentNames const type.
|
||||
func PossibleComponentNamesValues() []ComponentNames {
|
||||
return []ComponentNames{MicrosoftWindowsShellSetup}
|
||||
}
|
||||
|
||||
// DiskCreateOption enumerates the values for disk create option.
|
||||
type DiskCreateOption string
|
||||
|
||||
const (
|
||||
// Attach ...
|
||||
Attach DiskCreateOption = "Attach"
|
||||
// Copy ...
|
||||
Copy DiskCreateOption = "Copy"
|
||||
// Empty ...
|
||||
Empty DiskCreateOption = "Empty"
|
||||
// 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{DiskCreateOptionTypesAttach, DiskCreateOptionTypesEmpty, DiskCreateOptionTypesFromImage}
|
||||
}
|
||||
|
||||
// InstanceViewTypes enumerates the values for instance view types.
|
||||
type InstanceViewTypes string
|
||||
|
||||
const (
|
||||
// InstanceView ...
|
||||
InstanceView InstanceViewTypes = "instanceView"
|
||||
)
|
||||
|
||||
// PossibleInstanceViewTypesValues returns an array of possible values for the InstanceViewTypes const type.
|
||||
func PossibleInstanceViewTypesValues() []InstanceViewTypes {
|
||||
return []InstanceViewTypes{InstanceView}
|
||||
}
|
||||
|
||||
// IPVersion enumerates the values for ip version.
|
||||
type IPVersion string
|
||||
|
||||
const (
|
||||
// IPv4 ...
|
||||
IPv4 IPVersion = "IPv4"
|
||||
// IPv6 ...
|
||||
IPv6 IPVersion = "IPv6"
|
||||
)
|
||||
|
||||
// PossibleIPVersionValues returns an array of possible values for the IPVersion const type.
|
||||
func PossibleIPVersionValues() []IPVersion {
|
||||
return []IPVersion{IPv4, IPv6}
|
||||
}
|
||||
|
||||
// MaintenanceOperationResultCodeTypes enumerates the values for maintenance operation result code types.
|
||||
type MaintenanceOperationResultCodeTypes string
|
||||
|
||||
const (
|
||||
// MaintenanceOperationResultCodeTypesMaintenanceAborted ...
|
||||
MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted"
|
||||
// MaintenanceOperationResultCodeTypesMaintenanceCompleted ...
|
||||
MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted"
|
||||
// MaintenanceOperationResultCodeTypesNone ...
|
||||
MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None"
|
||||
// MaintenanceOperationResultCodeTypesRetryLater ...
|
||||
MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater"
|
||||
)
|
||||
|
||||
// PossibleMaintenanceOperationResultCodeTypesValues returns an array of possible values for the MaintenanceOperationResultCodeTypes const type.
|
||||
func PossibleMaintenanceOperationResultCodeTypesValues() []MaintenanceOperationResultCodeTypes {
|
||||
return []MaintenanceOperationResultCodeTypes{MaintenanceOperationResultCodeTypesMaintenanceAborted, MaintenanceOperationResultCodeTypesMaintenanceCompleted, MaintenanceOperationResultCodeTypesNone, MaintenanceOperationResultCodeTypesRetryLater}
|
||||
}
|
||||
|
||||
// OperatingSystemStateTypes enumerates the values for operating system state types.
|
||||
type OperatingSystemStateTypes string
|
||||
|
||||
const (
|
||||
// Generalized ...
|
||||
Generalized OperatingSystemStateTypes = "Generalized"
|
||||
// Specialized ...
|
||||
Specialized OperatingSystemStateTypes = "Specialized"
|
||||
)
|
||||
|
||||
// PossibleOperatingSystemStateTypesValues returns an array of possible values for the OperatingSystemStateTypes const type.
|
||||
func PossibleOperatingSystemStateTypesValues() []OperatingSystemStateTypes {
|
||||
return []OperatingSystemStateTypes{Generalized, Specialized}
|
||||
}
|
||||
|
||||
// OperatingSystemTypes enumerates the values for operating system types.
|
||||
type OperatingSystemTypes string
|
||||
|
||||
const (
|
||||
// Linux ...
|
||||
Linux OperatingSystemTypes = "Linux"
|
||||
// Windows ...
|
||||
Windows OperatingSystemTypes = "Windows"
|
||||
)
|
||||
|
||||
// PossibleOperatingSystemTypesValues returns an array of possible values for the OperatingSystemTypes const type.
|
||||
func PossibleOperatingSystemTypesValues() []OperatingSystemTypes {
|
||||
return []OperatingSystemTypes{Linux, Windows}
|
||||
}
|
||||
|
||||
// PassNames enumerates the values for pass names.
|
||||
type PassNames string
|
||||
|
||||
const (
|
||||
// OobeSystem ...
|
||||
OobeSystem PassNames = "OobeSystem"
|
||||
)
|
||||
|
||||
// PossiblePassNamesValues returns an array of possible values for the PassNames const type.
|
||||
func PossiblePassNamesValues() []PassNames {
|
||||
return []PassNames{OobeSystem}
|
||||
}
|
||||
|
||||
// ProtocolTypes enumerates the values for protocol types.
|
||||
type ProtocolTypes string
|
||||
|
||||
const (
|
||||
// HTTP ...
|
||||
HTTP ProtocolTypes = "Http"
|
||||
// HTTPS ...
|
||||
HTTPS ProtocolTypes = "Https"
|
||||
)
|
||||
|
||||
// PossibleProtocolTypesValues returns an array of possible values for the ProtocolTypes const type.
|
||||
func PossibleProtocolTypesValues() []ProtocolTypes {
|
||||
return []ProtocolTypes{HTTP, HTTPS}
|
||||
}
|
||||
|
||||
// ResourceIdentityType enumerates the values for resource identity type.
|
||||
type ResourceIdentityType string
|
||||
|
||||
const (
|
||||
// SystemAssigned ...
|
||||
SystemAssigned ResourceIdentityType = "SystemAssigned"
|
||||
)
|
||||
|
||||
// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type.
|
||||
func PossibleResourceIdentityTypeValues() []ResourceIdentityType {
|
||||
return []ResourceIdentityType{SystemAssigned}
|
||||
}
|
||||
|
||||
// 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"
|
||||
)
|
||||
|
||||
// PossibleResourceSkuRestrictionsTypeValues returns an array of possible values for the ResourceSkuRestrictionsType const type.
|
||||
func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType {
|
||||
return []ResourceSkuRestrictionsType{Location}
|
||||
}
|
||||
|
||||
// RollingUpgradeActionType enumerates the values for rolling upgrade action type.
|
||||
type RollingUpgradeActionType string
|
||||
|
||||
const (
|
||||
// Cancel ...
|
||||
Cancel RollingUpgradeActionType = "Cancel"
|
||||
// Start ...
|
||||
Start RollingUpgradeActionType = "Start"
|
||||
)
|
||||
|
||||
// PossibleRollingUpgradeActionTypeValues returns an array of possible values for the RollingUpgradeActionType const type.
|
||||
func PossibleRollingUpgradeActionTypeValues() []RollingUpgradeActionType {
|
||||
return []RollingUpgradeActionType{Cancel, Start}
|
||||
}
|
||||
|
||||
// RollingUpgradeStatusCode enumerates the values for rolling upgrade status code.
|
||||
type RollingUpgradeStatusCode string
|
||||
|
||||
const (
|
||||
// Cancelled ...
|
||||
Cancelled RollingUpgradeStatusCode = "Cancelled"
|
||||
// Completed ...
|
||||
Completed RollingUpgradeStatusCode = "Completed"
|
||||
// Faulted ...
|
||||
Faulted RollingUpgradeStatusCode = "Faulted"
|
||||
// RollingForward ...
|
||||
RollingForward RollingUpgradeStatusCode = "RollingForward"
|
||||
)
|
||||
|
||||
// PossibleRollingUpgradeStatusCodeValues returns an array of possible values for the RollingUpgradeStatusCode const type.
|
||||
func PossibleRollingUpgradeStatusCodeValues() []RollingUpgradeStatusCode {
|
||||
return []RollingUpgradeStatusCode{Cancelled, Completed, Faulted, RollingForward}
|
||||
}
|
||||
|
||||
// SettingNames enumerates the values for setting names.
|
||||
type SettingNames string
|
||||
|
||||
const (
|
||||
// AutoLogon ...
|
||||
AutoLogon SettingNames = "AutoLogon"
|
||||
// FirstLogonCommands ...
|
||||
FirstLogonCommands SettingNames = "FirstLogonCommands"
|
||||
)
|
||||
|
||||
// PossibleSettingNamesValues returns an array of possible values for the SettingNames const type.
|
||||
func PossibleSettingNamesValues() []SettingNames {
|
||||
return []SettingNames{AutoLogon, FirstLogonCommands}
|
||||
}
|
||||
|
||||
// StatusLevelTypes enumerates the values for status level types.
|
||||
type StatusLevelTypes string
|
||||
|
||||
const (
|
||||
// Error ...
|
||||
Error StatusLevelTypes = "Error"
|
||||
// Info ...
|
||||
Info StatusLevelTypes = "Info"
|
||||
// Warning ...
|
||||
Warning StatusLevelTypes = "Warning"
|
||||
)
|
||||
|
||||
// PossibleStatusLevelTypesValues returns an array of possible values for the StatusLevelTypes const type.
|
||||
func PossibleStatusLevelTypesValues() []StatusLevelTypes {
|
||||
return []StatusLevelTypes{Error, Info, Warning}
|
||||
}
|
||||
|
||||
// StorageAccountTypes enumerates the values for storage account types.
|
||||
type StorageAccountTypes string
|
||||
|
||||
const (
|
||||
// PremiumLRS ...
|
||||
PremiumLRS StorageAccountTypes = "Premium_LRS"
|
||||
// StandardLRS ...
|
||||
StandardLRS StorageAccountTypes = "Standard_LRS"
|
||||
)
|
||||
|
||||
// PossibleStorageAccountTypesValues returns an array of possible values for the StorageAccountTypes const type.
|
||||
func PossibleStorageAccountTypesValues() []StorageAccountTypes {
|
||||
return []StorageAccountTypes{PremiumLRS, StandardLRS}
|
||||
}
|
||||
|
||||
// UpgradeMode enumerates the values for upgrade mode.
|
||||
type UpgradeMode string
|
||||
|
||||
const (
|
||||
// Automatic ...
|
||||
Automatic UpgradeMode = "Automatic"
|
||||
// Manual ...
|
||||
Manual UpgradeMode = "Manual"
|
||||
// Rolling ...
|
||||
Rolling UpgradeMode = "Rolling"
|
||||
)
|
||||
|
||||
// PossibleUpgradeModeValues returns an array of possible values for the UpgradeMode const type.
|
||||
func PossibleUpgradeModeValues() []UpgradeMode {
|
||||
return []UpgradeMode{Automatic, Manual, Rolling}
|
||||
}
|
||||
|
||||
// VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine scale set sku scale type.
|
||||
type VirtualMachineScaleSetSkuScaleType string
|
||||
|
||||
const (
|
||||
// VirtualMachineScaleSetSkuScaleTypeAutomatic ...
|
||||
VirtualMachineScaleSetSkuScaleTypeAutomatic VirtualMachineScaleSetSkuScaleType = "Automatic"
|
||||
// VirtualMachineScaleSetSkuScaleTypeNone ...
|
||||
VirtualMachineScaleSetSkuScaleTypeNone VirtualMachineScaleSetSkuScaleType = "None"
|
||||
)
|
||||
|
||||
// PossibleVirtualMachineScaleSetSkuScaleTypeValues returns an array of possible values for the VirtualMachineScaleSetSkuScaleType const type.
|
||||
func PossibleVirtualMachineScaleSetSkuScaleTypeValues() []VirtualMachineScaleSetSkuScaleType {
|
||||
return []VirtualMachineScaleSetSkuScaleType{VirtualMachineScaleSetSkuScaleTypeAutomatic, VirtualMachineScaleSetSkuScaleTypeNone}
|
||||
}
|
||||
|
||||
// VirtualMachineSizeTypes enumerates the values for virtual machine size types.
|
||||
type VirtualMachineSizeTypes string
|
||||
|
||||
const (
|
||||
// BasicA0 ...
|
||||
BasicA0 VirtualMachineSizeTypes = "Basic_A0"
|
||||
// BasicA1 ...
|
||||
BasicA1 VirtualMachineSizeTypes = "Basic_A1"
|
||||
// BasicA2 ...
|
||||
BasicA2 VirtualMachineSizeTypes = "Basic_A2"
|
||||
// BasicA3 ...
|
||||
BasicA3 VirtualMachineSizeTypes = "Basic_A3"
|
||||
// BasicA4 ...
|
||||
BasicA4 VirtualMachineSizeTypes = "Basic_A4"
|
||||
// StandardA0 ...
|
||||
StandardA0 VirtualMachineSizeTypes = "Standard_A0"
|
||||
// StandardA1 ...
|
||||
StandardA1 VirtualMachineSizeTypes = "Standard_A1"
|
||||
// StandardA10 ...
|
||||
StandardA10 VirtualMachineSizeTypes = "Standard_A10"
|
||||
// StandardA11 ...
|
||||
StandardA11 VirtualMachineSizeTypes = "Standard_A11"
|
||||
// StandardA1V2 ...
|
||||
StandardA1V2 VirtualMachineSizeTypes = "Standard_A1_v2"
|
||||
// StandardA2 ...
|
||||
StandardA2 VirtualMachineSizeTypes = "Standard_A2"
|
||||
// StandardA2mV2 ...
|
||||
StandardA2mV2 VirtualMachineSizeTypes = "Standard_A2m_v2"
|
||||
// StandardA2V2 ...
|
||||
StandardA2V2 VirtualMachineSizeTypes = "Standard_A2_v2"
|
||||
// StandardA3 ...
|
||||
StandardA3 VirtualMachineSizeTypes = "Standard_A3"
|
||||
// StandardA4 ...
|
||||
StandardA4 VirtualMachineSizeTypes = "Standard_A4"
|
||||
// StandardA4mV2 ...
|
||||
StandardA4mV2 VirtualMachineSizeTypes = "Standard_A4m_v2"
|
||||
// StandardA4V2 ...
|
||||
StandardA4V2 VirtualMachineSizeTypes = "Standard_A4_v2"
|
||||
// StandardA5 ...
|
||||
StandardA5 VirtualMachineSizeTypes = "Standard_A5"
|
||||
// StandardA6 ...
|
||||
StandardA6 VirtualMachineSizeTypes = "Standard_A6"
|
||||
// StandardA7 ...
|
||||
StandardA7 VirtualMachineSizeTypes = "Standard_A7"
|
||||
// StandardA8 ...
|
||||
StandardA8 VirtualMachineSizeTypes = "Standard_A8"
|
||||
// StandardA8mV2 ...
|
||||
StandardA8mV2 VirtualMachineSizeTypes = "Standard_A8m_v2"
|
||||
// StandardA8V2 ...
|
||||
StandardA8V2 VirtualMachineSizeTypes = "Standard_A8_v2"
|
||||
// StandardA9 ...
|
||||
StandardA9 VirtualMachineSizeTypes = "Standard_A9"
|
||||
// StandardD1 ...
|
||||
StandardD1 VirtualMachineSizeTypes = "Standard_D1"
|
||||
// StandardD11 ...
|
||||
StandardD11 VirtualMachineSizeTypes = "Standard_D11"
|
||||
// StandardD11V2 ...
|
||||
StandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2"
|
||||
// StandardD12 ...
|
||||
StandardD12 VirtualMachineSizeTypes = "Standard_D12"
|
||||
// StandardD12V2 ...
|
||||
StandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2"
|
||||
// StandardD13 ...
|
||||
StandardD13 VirtualMachineSizeTypes = "Standard_D13"
|
||||
// StandardD13V2 ...
|
||||
StandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2"
|
||||
// StandardD14 ...
|
||||
StandardD14 VirtualMachineSizeTypes = "Standard_D14"
|
||||
// StandardD14V2 ...
|
||||
StandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2"
|
||||
// StandardD15V2 ...
|
||||
StandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2"
|
||||
// StandardD1V2 ...
|
||||
StandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2"
|
||||
// StandardD2 ...
|
||||
StandardD2 VirtualMachineSizeTypes = "Standard_D2"
|
||||
// StandardD2V2 ...
|
||||
StandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2"
|
||||
// StandardD3 ...
|
||||
StandardD3 VirtualMachineSizeTypes = "Standard_D3"
|
||||
// StandardD3V2 ...
|
||||
StandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2"
|
||||
// StandardD4 ...
|
||||
StandardD4 VirtualMachineSizeTypes = "Standard_D4"
|
||||
// StandardD4V2 ...
|
||||
StandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2"
|
||||
// StandardD5V2 ...
|
||||
StandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2"
|
||||
// StandardDS1 ...
|
||||
StandardDS1 VirtualMachineSizeTypes = "Standard_DS1"
|
||||
// StandardDS11 ...
|
||||
StandardDS11 VirtualMachineSizeTypes = "Standard_DS11"
|
||||
// StandardDS11V2 ...
|
||||
StandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2"
|
||||
// StandardDS12 ...
|
||||
StandardDS12 VirtualMachineSizeTypes = "Standard_DS12"
|
||||
// StandardDS12V2 ...
|
||||
StandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2"
|
||||
// StandardDS13 ...
|
||||
StandardDS13 VirtualMachineSizeTypes = "Standard_DS13"
|
||||
// StandardDS13V2 ...
|
||||
StandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2"
|
||||
// StandardDS14 ...
|
||||
StandardDS14 VirtualMachineSizeTypes = "Standard_DS14"
|
||||
// StandardDS14V2 ...
|
||||
StandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2"
|
||||
// StandardDS15V2 ...
|
||||
StandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2"
|
||||
// StandardDS1V2 ...
|
||||
StandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2"
|
||||
// StandardDS2 ...
|
||||
StandardDS2 VirtualMachineSizeTypes = "Standard_DS2"
|
||||
// StandardDS2V2 ...
|
||||
StandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2"
|
||||
// StandardDS3 ...
|
||||
StandardDS3 VirtualMachineSizeTypes = "Standard_DS3"
|
||||
// StandardDS3V2 ...
|
||||
StandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2"
|
||||
// StandardDS4 ...
|
||||
StandardDS4 VirtualMachineSizeTypes = "Standard_DS4"
|
||||
// StandardDS4V2 ...
|
||||
StandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2"
|
||||
// StandardDS5V2 ...
|
||||
StandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2"
|
||||
// StandardF1 ...
|
||||
StandardF1 VirtualMachineSizeTypes = "Standard_F1"
|
||||
// StandardF16 ...
|
||||
StandardF16 VirtualMachineSizeTypes = "Standard_F16"
|
||||
// StandardF16s ...
|
||||
StandardF16s VirtualMachineSizeTypes = "Standard_F16s"
|
||||
// StandardF1s ...
|
||||
StandardF1s VirtualMachineSizeTypes = "Standard_F1s"
|
||||
// StandardF2 ...
|
||||
StandardF2 VirtualMachineSizeTypes = "Standard_F2"
|
||||
// StandardF2s ...
|
||||
StandardF2s VirtualMachineSizeTypes = "Standard_F2s"
|
||||
// StandardF4 ...
|
||||
StandardF4 VirtualMachineSizeTypes = "Standard_F4"
|
||||
// StandardF4s ...
|
||||
StandardF4s VirtualMachineSizeTypes = "Standard_F4s"
|
||||
// StandardF8 ...
|
||||
StandardF8 VirtualMachineSizeTypes = "Standard_F8"
|
||||
// StandardF8s ...
|
||||
StandardF8s VirtualMachineSizeTypes = "Standard_F8s"
|
||||
// StandardG1 ...
|
||||
StandardG1 VirtualMachineSizeTypes = "Standard_G1"
|
||||
// StandardG2 ...
|
||||
StandardG2 VirtualMachineSizeTypes = "Standard_G2"
|
||||
// StandardG3 ...
|
||||
StandardG3 VirtualMachineSizeTypes = "Standard_G3"
|
||||
// StandardG4 ...
|
||||
StandardG4 VirtualMachineSizeTypes = "Standard_G4"
|
||||
// StandardG5 ...
|
||||
StandardG5 VirtualMachineSizeTypes = "Standard_G5"
|
||||
// StandardGS1 ...
|
||||
StandardGS1 VirtualMachineSizeTypes = "Standard_GS1"
|
||||
// StandardGS2 ...
|
||||
StandardGS2 VirtualMachineSizeTypes = "Standard_GS2"
|
||||
// StandardGS3 ...
|
||||
StandardGS3 VirtualMachineSizeTypes = "Standard_GS3"
|
||||
// StandardGS4 ...
|
||||
StandardGS4 VirtualMachineSizeTypes = "Standard_GS4"
|
||||
// StandardGS5 ...
|
||||
StandardGS5 VirtualMachineSizeTypes = "Standard_GS5"
|
||||
// StandardH16 ...
|
||||
StandardH16 VirtualMachineSizeTypes = "Standard_H16"
|
||||
// StandardH16m ...
|
||||
StandardH16m VirtualMachineSizeTypes = "Standard_H16m"
|
||||
// StandardH16mr ...
|
||||
StandardH16mr VirtualMachineSizeTypes = "Standard_H16mr"
|
||||
// StandardH16r ...
|
||||
StandardH16r VirtualMachineSizeTypes = "Standard_H16r"
|
||||
// StandardH8 ...
|
||||
StandardH8 VirtualMachineSizeTypes = "Standard_H8"
|
||||
// StandardH8m ...
|
||||
StandardH8m VirtualMachineSizeTypes = "Standard_H8m"
|
||||
// StandardL16s ...
|
||||
StandardL16s VirtualMachineSizeTypes = "Standard_L16s"
|
||||
// StandardL32s ...
|
||||
StandardL32s VirtualMachineSizeTypes = "Standard_L32s"
|
||||
// StandardL4s ...
|
||||
StandardL4s VirtualMachineSizeTypes = "Standard_L4s"
|
||||
// StandardL8s ...
|
||||
StandardL8s VirtualMachineSizeTypes = "Standard_L8s"
|
||||
// StandardNC12 ...
|
||||
StandardNC12 VirtualMachineSizeTypes = "Standard_NC12"
|
||||
// StandardNC24 ...
|
||||
StandardNC24 VirtualMachineSizeTypes = "Standard_NC24"
|
||||
// StandardNC24r ...
|
||||
StandardNC24r VirtualMachineSizeTypes = "Standard_NC24r"
|
||||
// StandardNC6 ...
|
||||
StandardNC6 VirtualMachineSizeTypes = "Standard_NC6"
|
||||
// StandardNV12 ...
|
||||
StandardNV12 VirtualMachineSizeTypes = "Standard_NV12"
|
||||
// StandardNV24 ...
|
||||
StandardNV24 VirtualMachineSizeTypes = "Standard_NV24"
|
||||
// StandardNV6 ...
|
||||
StandardNV6 VirtualMachineSizeTypes = "Standard_NV6"
|
||||
)
|
||||
|
||||
// PossibleVirtualMachineSizeTypesValues returns an array of possible values for the VirtualMachineSizeTypes const type.
|
||||
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, StandardD1, StandardD11, StandardD11V2, StandardD12, StandardD12V2, StandardD13, StandardD13V2, StandardD14, StandardD14V2, StandardD15V2, StandardD1V2, StandardD2, StandardD2V2, StandardD3, StandardD3V2, StandardD4, StandardD4V2, StandardD5V2, StandardDS1, StandardDS11, StandardDS11V2, StandardDS12, StandardDS12V2, StandardDS13, StandardDS13V2, StandardDS14, StandardDS14V2, StandardDS15V2, StandardDS1V2, StandardDS2, StandardDS2V2, StandardDS3, StandardDS3V2, StandardDS4, StandardDS4V2, StandardDS5V2, StandardF1, StandardF16, StandardF16s, StandardF1s, StandardF2, StandardF2s, StandardF4, StandardF4s, StandardF8, StandardF8s, StandardG1, StandardG2, StandardG3, StandardG4, StandardG5, StandardGS1, StandardGS2, StandardGS3, StandardGS4, StandardGS5, StandardH16, StandardH16m, StandardH16mr, StandardH16r, StandardH8, StandardH8m, StandardL16s, StandardL32s, StandardL4s, StandardL8s, StandardNC12, StandardNC24, StandardNC24r, StandardNC6, StandardNV12, StandardNV24, StandardNV6}
|
||||
}
|
||||
512
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-03-30/compute/images.go
generated
vendored
512
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-03-30/compute/images.go
generated
vendored
@@ -1,512 +0,0 @@
|
||||
package compute
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// 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"
|
||||
)
|
||||
|
||||
// ImagesClient is the compute Client
|
||||
type ImagesClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewImagesClient creates an instance of the ImagesClient client.
|
||||
func NewImagesClient(subscriptionID string) ImagesClient {
|
||||
return NewImagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewImagesClientWithBaseURI creates an instance of the ImagesClient client using a custom endpoint. Use this when
|
||||
// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
|
||||
func NewImagesClientWithBaseURI(baseURI string, subscriptionID string) ImagesClient {
|
||||
return ImagesClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate create or update an image.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// imageName - the name of the image.
|
||||
// parameters - parameters supplied to the Create Image operation.
|
||||
func (client ImagesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters Image) (result ImagesCreateOrUpdateFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.CreateOrUpdate")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
Constraints: []validation.Constraint{{Target: "parameters.ImageProperties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ImageProperties.StorageProfile", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "parameters.ImageProperties.StorageProfile.OsDisk", Name: validation.Null, Rule: true, Chain: nil}}},
|
||||
}}}}}); err != nil {
|
||||
return result, validation.NewError("compute.ImagesClient", "CreateOrUpdate", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, imageName, parameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateOrUpdateSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "CreateOrUpdate", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client ImagesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, imageName string, parameters Image) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"imageName": autorest.Encode("path", imageName),
|
||||
"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.AsPut(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", pathParameters),
|
||||
autorest.WithJSON(parameters),
|
||||
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 ImagesClient) CreateOrUpdateSender(req *http.Request) (future ImagesCreateOrUpdateFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ImagesClient) CreateOrUpdateResponder(resp *http.Response) (result Image, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Delete deletes an Image.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// imageName - the name of the image.
|
||||
func (client ImagesClient) Delete(ctx context.Context, resourceGroupName string, imageName string) (result ImagesDeleteFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Delete")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, imageName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Delete", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client ImagesClient) DeletePreparer(ctx context.Context, resourceGroupName string, imageName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"imageName": autorest.Encode("path", imageName),
|
||||
"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/images/{imageName}", 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 ImagesClient) DeleteSender(req *http.Request) (future ImagesDeleteFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteResponder handles the response to the Delete request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ImagesClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Get gets an image.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// imageName - the name of the image.
|
||||
// expand - the expand expression to apply on the operation.
|
||||
func (client ImagesClient) Get(ctx context.Context, resourceGroupName string, imageName string, expand string) (result Image, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.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, imageName, expand)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "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.ImagesClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "Get", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client ImagesClient) GetPreparer(ctx context.Context, resourceGroupName string, imageName string, expand string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"imageName": autorest.Encode("path", imageName),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-03-30"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/images/{imageName}", 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 ImagesClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ImagesClient) GetResponder(resp *http.Response) (result Image, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List gets the list of Images in the subscription. Use nextLink property in the response to get the next page of
|
||||
// Images. Do this till nextLink is null to fetch all the Images.
|
||||
func (client ImagesClient) List(ctx context.Context) (result ImageListResultPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.List")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.ilr.Response.Response != nil {
|
||||
sc = result.ilr.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.ImagesClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.ilr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.ilr, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.ilr.hasNextLink() && result.ilr.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client ImagesClient) 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/images", 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 ImagesClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ImagesClient) ListResponder(resp *http.Response) (result ImageListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
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 ImagesClient) listNextResults(ctx context.Context, lastResults ImageListResult) (result ImageListResult, err error) {
|
||||
req, err := lastResults.imageListResultPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "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.ImagesClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client ImagesClient) ListComplete(ctx context.Context) (result ImageListResultIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.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 gets the list of images under a resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
func (client ImagesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ImageListResultPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.ListByResourceGroup")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.ilr.Response.Response != nil {
|
||||
sc = result.ilr.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.ImagesClient", "ListByResourceGroup", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.ilr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.ilr, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "ListByResourceGroup", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.ilr.hasNextLink() && result.ilr.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
|
||||
func (client ImagesClient) 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/images", 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 ImagesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ImagesClient) ListByResourceGroupResponder(resp *http.Response) (result ImageListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
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 ImagesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ImageListResult) (result ImageListResult, err error) {
|
||||
req, err := lastResults.imageListResultPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "compute.ImagesClient", "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.ImagesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.ImagesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client ImagesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ImageListResultIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.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
|
||||
}
|
||||
8394
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-03-30/compute/models.go
generated
vendored
8394
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-03-30/compute/models.go
generated
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,144 +0,0 @@
|
||||
package compute
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// 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/tracing"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// ResourceSkusClient is the compute Client
|
||||
type ResourceSkusClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewResourceSkusClient creates an instance of the ResourceSkusClient client.
|
||||
func NewResourceSkusClient(subscriptionID string) ResourceSkusClient {
|
||||
return NewResourceSkusClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewResourceSkusClientWithBaseURI creates an instance of the ResourceSkusClient client using a custom endpoint. Use
|
||||
// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
|
||||
func NewResourceSkusClientWithBaseURI(baseURI string, subscriptionID string) ResourceSkusClient {
|
||||
return ResourceSkusClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// List gets the list of Microsoft.Compute SKUs available for your Subscription.
|
||||
func (client ResourceSkusClient) List(ctx context.Context) (result ResourceSkusResultPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.rsr.Response.Response != nil {
|
||||
sc = result.rsr.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.ResourceSkusClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.rsr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.rsr, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.rsr.hasNextLink() && result.rsr.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client ResourceSkusClient) 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/skus", 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 ResourceSkusClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client ResourceSkusClient) ListResponder(resp *http.Response) (result ResourceSkusResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
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 ResourceSkusClient) listNextResults(ctx context.Context, lastResults ResourceSkusResult) (result ResourceSkusResult, err error) {
|
||||
req, err := lastResults.resourceSkusResultPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "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.ResourceSkusClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client ResourceSkusClient) ListComplete(ctx context.Context) (result ResourceSkusResultIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.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
|
||||
}
|
||||
@@ -1,775 +0,0 @@
|
||||
package compute
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// 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"
|
||||
)
|
||||
|
||||
// SnapshotsClient is the compute Client
|
||||
type SnapshotsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewSnapshotsClient creates an instance of the SnapshotsClient client.
|
||||
func NewSnapshotsClient(subscriptionID string) SnapshotsClient {
|
||||
return NewSnapshotsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewSnapshotsClientWithBaseURI creates an instance of the SnapshotsClient client using a custom endpoint. Use this
|
||||
// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
|
||||
func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient {
|
||||
return SnapshotsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate creates or updates a snapshot.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
|
||||
// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
|
||||
// snapshot - snapshot object supplied in the body of the Put disk operation.
|
||||
func (client SnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot) (result SnapshotsCreateOrUpdateFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.CreateOrUpdate")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: snapshot,
|
||||
Constraints: []validation.Constraint{{Target: "snapshot.DiskProperties", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.CreationData", Name: validation.Null, Rule: true,
|
||||
Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.CreationData.ImageReference", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}},
|
||||
}},
|
||||
{Target: "snapshot.DiskProperties.EncryptionSettings", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "snapshot.DiskProperties.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil},
|
||||
}},
|
||||
{Target: "snapshot.DiskProperties.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
|
||||
{Target: "snapshot.DiskProperties.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil},
|
||||
}},
|
||||
}},
|
||||
}}}}}); err != nil {
|
||||
return result, validation.NewError("compute.SnapshotsClient", "CreateOrUpdate", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, snapshotName, snapshot)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateOrUpdateSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client SnapshotsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"snapshotName": autorest.Encode("path", snapshotName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-03-30"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
snapshot.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/snapshots/{snapshotName}", pathParameters),
|
||||
autorest.WithJSON(snapshot),
|
||||
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 SnapshotsClient) CreateOrUpdateSender(req *http.Request) (future SnapshotsCreateOrUpdateFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client SnapshotsClient) CreateOrUpdateResponder(resp *http.Response) (result Snapshot, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Delete deletes a snapshot.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
|
||||
// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
|
||||
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Delete")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, snapshotName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"snapshotName": autorest.Encode("path", snapshotName),
|
||||
"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/snapshots/{snapshotName}", 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 SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsDeleteFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteResponder handles the response to the Delete request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
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 snapshot.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
|
||||
// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
|
||||
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, snapshotName string) (result Snapshot, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.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, snapshotName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "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.SnapshotsClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"snapshotName": autorest.Encode("path", snapshotName),
|
||||
"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/snapshots/{snapshotName}", 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 SnapshotsClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// GrantAccess grants access to a snapshot.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
|
||||
// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
|
||||
// grantAccessData - access data object supplied in the body of the get snapshot access operation.
|
||||
func (client SnapshotsClient) GrantAccess(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData) (result SnapshotsGrantAccessFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.GrantAccess")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.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.SnapshotsClient", "GrantAccess", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.GrantAccessPreparer(ctx, resourceGroupName, snapshotName, grantAccessData)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GrantAccessSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GrantAccessPreparer prepares the GrantAccess request.
|
||||
func (client SnapshotsClient) GrantAccessPreparer(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"snapshotName": autorest.Encode("path", snapshotName),
|
||||
"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/snapshots/{snapshotName}/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 SnapshotsClient) GrantAccessSender(req *http.Request) (future SnapshotsGrantAccessFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// GrantAccessResponder handles the response to the GrantAccess request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client SnapshotsClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List lists snapshots under a subscription.
|
||||
func (client SnapshotsClient) List(ctx context.Context) (result SnapshotListPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.List")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.sl.Response.Response != nil {
|
||||
sc = result.sl.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.SnapshotsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.sl.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.sl, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.sl.hasNextLink() && result.sl.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client SnapshotsClient) 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/snapshots", 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 SnapshotsClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotList, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
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 SnapshotsClient) listNextResults(ctx context.Context, lastResults SnapshotList) (result SnapshotList, err error) {
|
||||
req, err := lastResults.snapshotListPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "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.SnapshotsClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client SnapshotsClient) ListComplete(ctx context.Context) (result SnapshotListIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.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 snapshots under a resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
func (client SnapshotsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SnapshotListPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.ListByResourceGroup")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.sl.Response.Response != nil {
|
||||
sc = result.sl.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.SnapshotsClient", "ListByResourceGroup", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListByResourceGroupSender(req)
|
||||
if err != nil {
|
||||
result.sl.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.sl, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.sl.hasNextLink() && result.sl.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
|
||||
func (client SnapshotsClient) 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/snapshots", 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 SnapshotsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client SnapshotsClient) ListByResourceGroupResponder(resp *http.Response) (result SnapshotList, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
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 SnapshotsClient) listByResourceGroupNextResults(ctx context.Context, lastResults SnapshotList) (result SnapshotList, err error) {
|
||||
req, err := lastResults.snapshotListPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "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.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListByResourceGroupResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client SnapshotsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SnapshotListIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.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 snapshot.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
|
||||
// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
|
||||
func (client SnapshotsClient) RevokeAccess(ctx context.Context, resourceGroupName string, snapshotName string) (result SnapshotsRevokeAccessFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.RevokeAccess")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, snapshotName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.RevokeAccessSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// RevokeAccessPreparer prepares the RevokeAccess request.
|
||||
func (client SnapshotsClient) RevokeAccessPreparer(ctx context.Context, resourceGroupName string, snapshotName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"snapshotName": autorest.Encode("path", snapshotName),
|
||||
"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/snapshots/{snapshotName}/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 SnapshotsClient) RevokeAccessSender(req *http.Request) (future SnapshotsRevokeAccessFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// RevokeAccessResponder handles the response to the RevokeAccess request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client SnapshotsClient) RevokeAccessResponder(resp *http.Response) (result OperationStatusResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Update updates (patches) a snapshot.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
|
||||
// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
|
||||
// snapshot - snapshot object supplied in the body of the Patch snapshot operation.
|
||||
func (client SnapshotsClient) Update(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate) (result SnapshotsUpdateFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotsClient.Update")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.UpdatePreparer(ctx, resourceGroupName, snapshotName, snapshot)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.UpdateSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UpdatePreparer prepares the Update request.
|
||||
func (client SnapshotsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"snapshotName": autorest.Encode("path", snapshotName),
|
||||
"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/snapshots/{snapshotName}", pathParameters),
|
||||
autorest.WithJSON(snapshot),
|
||||
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 SnapshotsClient) UpdateSender(req *http.Request) (future SnapshotsUpdateFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateResponder handles the response to the Update request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client SnapshotsClient) UpdateResponder(resp *http.Response) (result Snapshot, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
155
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-03-30/compute/usage.go
generated
vendored
155
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-03-30/compute/usage.go
generated
vendored
@@ -1,155 +0,0 @@
|
||||
package compute
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// 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"
|
||||
)
|
||||
|
||||
// UsageClient is the compute Client
|
||||
type UsageClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewUsageClient creates an instance of the UsageClient client.
|
||||
func NewUsageClient(subscriptionID string) UsageClient {
|
||||
return NewUsageClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewUsageClientWithBaseURI creates an instance of the UsageClient client using a custom endpoint. Use this when
|
||||
// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
|
||||
func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClient {
|
||||
return UsageClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// List gets, for the specified location, the current compute resource usage information as well as the limits for
|
||||
// compute resources under the subscription.
|
||||
// Parameters:
|
||||
// location - the location for which resource usage is queried.
|
||||
func (client UsageClient) List(ctx context.Context, location string) (result ListUsagesResultPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/UsageClient.List")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.lur.Response.Response != nil {
|
||||
sc = result.lur.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: location,
|
||||
Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("compute.UsageClient", "List", err.Error())
|
||||
}
|
||||
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, location)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.lur.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.lur, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.UsageClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.lur.hasNextLink() && result.lur.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client UsageClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"location": autorest.Encode("path", location),
|
||||
"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/locations/{location}/usages", 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 UsageClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client UsageClient) ListResponder(resp *http.Response) (result ListUsagesResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
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 UsageClient) listNextResults(ctx context.Context, lastResults ListUsagesResult) (result ListUsagesResult, err error) {
|
||||
req, err := lastResults.listUsagesResultPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "compute.UsageClient", "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.UsageClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.UsageClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client UsageClient) ListComplete(ctx context.Context, location string) (result ListUsagesResultIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/UsageClient.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, location)
|
||||
return
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package compute
|
||||
|
||||
import "github.com/Azure/azure-sdk-for-go/version"
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
// UserAgent returns the UserAgent string to use when sending http.Requests.
|
||||
func UserAgent() string {
|
||||
return "Azure-SDK-For-Go/" + Version() + " compute/2017-03-30"
|
||||
}
|
||||
|
||||
// Version returns the semantic version (see http://semver.org) of the client.
|
||||
func Version() string {
|
||||
return version.Number
|
||||
}
|
||||
@@ -1,270 +0,0 @@
|
||||
package compute
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// 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/tracing"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// VirtualMachineExtensionImagesClient is the compute Client
|
||||
type VirtualMachineExtensionImagesClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewVirtualMachineExtensionImagesClient creates an instance of the VirtualMachineExtensionImagesClient client.
|
||||
func NewVirtualMachineExtensionImagesClient(subscriptionID string) VirtualMachineExtensionImagesClient {
|
||||
return NewVirtualMachineExtensionImagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewVirtualMachineExtensionImagesClientWithBaseURI creates an instance of the VirtualMachineExtensionImagesClient
|
||||
// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI
|
||||
// (sovereign clouds, Azure stack).
|
||||
func NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionImagesClient {
|
||||
return VirtualMachineExtensionImagesClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// Get gets a virtual machine extension image.
|
||||
// Parameters:
|
||||
// location - the name of a supported Azure region.
|
||||
func (client VirtualMachineExtensionImagesClient) Get(ctx context.Context, location string, publisherName string, typeParameter string, version string) (result VirtualMachineExtensionImage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.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, location, publisherName, typeParameter, version)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "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.VirtualMachineExtensionImagesClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "Get", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client VirtualMachineExtensionImagesClient) GetPreparer(ctx context.Context, location string, publisherName string, typeParameter string, version string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"location": autorest.Encode("path", location),
|
||||
"publisherName": autorest.Encode("path", publisherName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"type": autorest.Encode("path", typeParameter),
|
||||
"version": autorest.Encode("path", version),
|
||||
}
|
||||
|
||||
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/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}", 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 VirtualMachineExtensionImagesClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineExtensionImagesClient) GetResponder(resp *http.Response) (result VirtualMachineExtensionImage, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListTypes gets a list of virtual machine extension image types.
|
||||
// Parameters:
|
||||
// location - the name of a supported Azure region.
|
||||
func (client VirtualMachineExtensionImagesClient) ListTypes(ctx context.Context, location string, publisherName string) (result ListVirtualMachineExtensionImage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.ListTypes")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response.Response != nil {
|
||||
sc = result.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.ListTypesPreparer(ctx, location, publisherName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListTypesSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListTypesResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListTypesPreparer prepares the ListTypes request.
|
||||
func (client VirtualMachineExtensionImagesClient) ListTypesPreparer(ctx context.Context, location string, publisherName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"location": autorest.Encode("path", location),
|
||||
"publisherName": autorest.Encode("path", publisherName),
|
||||
"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/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListTypesSender sends the ListTypes request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineExtensionImagesClient) ListTypesSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListTypesResponder handles the response to the ListTypes request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result.Value),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListVersions gets a list of virtual machine extension image versions.
|
||||
// Parameters:
|
||||
// location - the name of a supported Azure region.
|
||||
// filter - the filter to apply on the operation.
|
||||
func (client VirtualMachineExtensionImagesClient) ListVersions(ctx context.Context, location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (result ListVirtualMachineExtensionImage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionImagesClient.ListVersions")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response.Response != nil {
|
||||
sc = result.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.ListVersionsPreparer(ctx, location, publisherName, typeParameter, filter, top, orderby)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListVersionsSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListVersionsResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListVersionsPreparer prepares the ListVersions request.
|
||||
func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(ctx context.Context, location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"location": autorest.Encode("path", location),
|
||||
"publisherName": autorest.Encode("path", publisherName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"type": autorest.Encode("path", typeParameter),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-03-30"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(filter) > 0 {
|
||||
queryParameters["$filter"] = autorest.Encode("query", filter)
|
||||
}
|
||||
if top != nil {
|
||||
queryParameters["$top"] = autorest.Encode("query", *top)
|
||||
}
|
||||
if len(orderby) > 0 {
|
||||
queryParameters["$orderby"] = autorest.Encode("query", orderby)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListVersionsSender sends the ListVersions request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineExtensionImagesClient) ListVersionsSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListVersionsResponder handles the response to the ListVersions request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineExtensionImagesClient) ListVersionsResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result.Value),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
@@ -1,363 +0,0 @@
|
||||
package compute
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// 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/tracing"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// VirtualMachineExtensionsClient is the compute Client
|
||||
type VirtualMachineExtensionsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewVirtualMachineExtensionsClient creates an instance of the VirtualMachineExtensionsClient client.
|
||||
func NewVirtualMachineExtensionsClient(subscriptionID string) VirtualMachineExtensionsClient {
|
||||
return NewVirtualMachineExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewVirtualMachineExtensionsClientWithBaseURI creates an instance of the VirtualMachineExtensionsClient client using
|
||||
// a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign
|
||||
// clouds, Azure stack).
|
||||
func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionsClient {
|
||||
return VirtualMachineExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate the operation to create or update the extension.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine where the extension should be created or updated.
|
||||
// VMExtensionName - the name of the virtual machine extension.
|
||||
// extensionParameters - parameters supplied to the Create Virtual Machine Extension operation.
|
||||
func (client VirtualMachineExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension) (result VirtualMachineExtensionsCreateOrUpdateFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.CreateOrUpdate")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateOrUpdateSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmExtensionName": autorest.Encode("path", VMExtensionName),
|
||||
"vmName": autorest.Encode("path", VMName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-03-30"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
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/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
|
||||
autorest.WithJSON(extensionParameters),
|
||||
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 VirtualMachineExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineExtensionsCreateOrUpdateFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Delete the operation to delete the extension.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine where the extension should be deleted.
|
||||
// VMExtensionName - the name of the virtual machine extension.
|
||||
func (client VirtualMachineExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string) (result VirtualMachineExtensionsDeleteFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Delete")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, VMName, VMExtensionName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Delete", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client VirtualMachineExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmExtensionName": autorest.Encode("path", VMExtensionName),
|
||||
"vmName": autorest.Encode("path", VMName),
|
||||
}
|
||||
|
||||
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/virtualMachines/{vmName}/extensions/{vmExtensionName}", 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 VirtualMachineExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineExtensionsDeleteFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteResponder handles the response to the Delete request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineExtensionsClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Get the operation to get the extension.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine containing the extension.
|
||||
// VMExtensionName - the name of the virtual machine extension.
|
||||
// expand - the expand expression to apply on the operation.
|
||||
func (client VirtualMachineExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, expand string) (result VirtualMachineExtension, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.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, VMName, VMExtensionName, expand)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "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.VirtualMachineExtensionsClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Get", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client VirtualMachineExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, expand string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmExtensionName": autorest.Encode("path", VMExtensionName),
|
||||
"vmName": autorest.Encode("path", VMName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-03-30"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", 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 VirtualMachineExtensionsClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineExtension, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Update the operation to update the extension.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine where the extension should be updated.
|
||||
// VMExtensionName - the name of the virtual machine extension.
|
||||
// extensionParameters - parameters supplied to the Update Virtual Machine Extension operation.
|
||||
func (client VirtualMachineExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (result VirtualMachineExtensionsUpdateFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineExtensionsClient.Update")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.UpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.UpdateSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UpdatePreparer prepares the Update request.
|
||||
func (client VirtualMachineExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmExtensionName": autorest.Encode("path", VMExtensionName),
|
||||
"vmName": autorest.Encode("path", VMName),
|
||||
}
|
||||
|
||||
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/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
|
||||
autorest.WithJSON(extensionParameters),
|
||||
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 VirtualMachineExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineExtensionsUpdateFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateResponder handles the response to the Update request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
@@ -1,432 +0,0 @@
|
||||
package compute
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// 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/tracing"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// VirtualMachineImagesClient is the compute Client
|
||||
type VirtualMachineImagesClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewVirtualMachineImagesClient creates an instance of the VirtualMachineImagesClient client.
|
||||
func NewVirtualMachineImagesClient(subscriptionID string) VirtualMachineImagesClient {
|
||||
return NewVirtualMachineImagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewVirtualMachineImagesClientWithBaseURI creates an instance of the VirtualMachineImagesClient client using a custom
|
||||
// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure
|
||||
// stack).
|
||||
func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineImagesClient {
|
||||
return VirtualMachineImagesClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// Get gets a virtual machine image.
|
||||
// Parameters:
|
||||
// location - the name of a supported Azure region.
|
||||
// publisherName - a valid image publisher.
|
||||
// offer - a valid image publisher offer.
|
||||
// skus - a valid image SKU.
|
||||
// version - a valid image SKU version.
|
||||
func (client VirtualMachineImagesClient) Get(ctx context.Context, location string, publisherName string, offer string, skus string, version string) (result VirtualMachineImage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.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, location, publisherName, offer, skus, version)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "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.VirtualMachineImagesClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "Get", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client VirtualMachineImagesClient) GetPreparer(ctx context.Context, location string, publisherName string, offer string, skus string, version string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"location": autorest.Encode("path", location),
|
||||
"offer": autorest.Encode("path", offer),
|
||||
"publisherName": autorest.Encode("path", publisherName),
|
||||
"skus": autorest.Encode("path", skus),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"version": autorest.Encode("path", version),
|
||||
}
|
||||
|
||||
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/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}", 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 VirtualMachineImagesClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineImagesClient) GetResponder(resp *http.Response) (result VirtualMachineImage, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU.
|
||||
// Parameters:
|
||||
// location - the name of a supported Azure region.
|
||||
// publisherName - a valid image publisher.
|
||||
// offer - a valid image publisher offer.
|
||||
// skus - a valid image SKU.
|
||||
// expand - the expand expression to apply on the operation.
|
||||
func (client VirtualMachineImagesClient) List(ctx context.Context, location string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (result ListVirtualMachineImageResource, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.List")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response.Response != nil {
|
||||
sc = result.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.ListPreparer(ctx, location, publisherName, offer, skus, expand, top, orderby)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client VirtualMachineImagesClient) ListPreparer(ctx context.Context, location string, publisherName string, offer string, skus string, expand string, top *int32, orderby string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"location": autorest.Encode("path", location),
|
||||
"offer": autorest.Encode("path", offer),
|
||||
"publisherName": autorest.Encode("path", publisherName),
|
||||
"skus": autorest.Encode("path", skus),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-03-30"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
if top != nil {
|
||||
queryParameters["$top"] = autorest.Encode("query", *top)
|
||||
}
|
||||
if len(orderby) > 0 {
|
||||
queryParameters["$orderby"] = autorest.Encode("query", orderby)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions", 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 VirtualMachineImagesClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result.Value),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListOffers gets a list of virtual machine image offers for the specified location and publisher.
|
||||
// Parameters:
|
||||
// location - the name of a supported Azure region.
|
||||
// publisherName - a valid image publisher.
|
||||
func (client VirtualMachineImagesClient) ListOffers(ctx context.Context, location string, publisherName string) (result ListVirtualMachineImageResource, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListOffers")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response.Response != nil {
|
||||
sc = result.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.ListOffersPreparer(ctx, location, publisherName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListOffersSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListOffersResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListOffers", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListOffersPreparer prepares the ListOffers request.
|
||||
func (client VirtualMachineImagesClient) ListOffersPreparer(ctx context.Context, location string, publisherName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"location": autorest.Encode("path", location),
|
||||
"publisherName": autorest.Encode("path", publisherName),
|
||||
"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/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListOffersSender sends the ListOffers request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineImagesClient) ListOffersSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListOffersResponder handles the response to the ListOffers request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result.Value),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListPublishers gets a list of virtual machine image publishers for the specified Azure location.
|
||||
// Parameters:
|
||||
// location - the name of a supported Azure region.
|
||||
func (client VirtualMachineImagesClient) ListPublishers(ctx context.Context, location string) (result ListVirtualMachineImageResource, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListPublishers")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response.Response != nil {
|
||||
sc = result.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.ListPublishersPreparer(ctx, location)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListPublishersSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListPublishersResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListPublishers", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPublishersPreparer prepares the ListPublishers request.
|
||||
func (client VirtualMachineImagesClient) ListPublishersPreparer(ctx context.Context, location string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"location": autorest.Encode("path", location),
|
||||
"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/locations/{location}/publishers", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListPublishersSender sends the ListPublishers request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineImagesClient) ListPublishersSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListPublishersResponder handles the response to the ListPublishers request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result.Value),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ListSkus gets a list of virtual machine image SKUs for the specified location, publisher, and offer.
|
||||
// Parameters:
|
||||
// location - the name of a supported Azure region.
|
||||
// publisherName - a valid image publisher.
|
||||
// offer - a valid image publisher offer.
|
||||
func (client VirtualMachineImagesClient) ListSkus(ctx context.Context, location string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineImagesClient.ListSkus")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response.Response != nil {
|
||||
sc = result.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.ListSkusPreparer(ctx, location, publisherName, offer)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSkusSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListSkusResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineImagesClient", "ListSkus", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListSkusPreparer prepares the ListSkus request.
|
||||
func (client VirtualMachineImagesClient) ListSkusPreparer(ctx context.Context, location string, publisherName string, offer string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"location": autorest.Encode("path", location),
|
||||
"offer": autorest.Encode("path", offer),
|
||||
"publisherName": autorest.Encode("path", publisherName),
|
||||
"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/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ListSkusSender sends the ListSkus request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineImagesClient) ListSkusSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListSkusResponder handles the response to the ListSkus request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineImagesClient) ListSkusResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result.Value),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
@@ -1,237 +0,0 @@
|
||||
package compute
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// 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"
|
||||
)
|
||||
|
||||
// VirtualMachineRunCommandsClient is the compute Client
|
||||
type VirtualMachineRunCommandsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewVirtualMachineRunCommandsClient creates an instance of the VirtualMachineRunCommandsClient client.
|
||||
func NewVirtualMachineRunCommandsClient(subscriptionID string) VirtualMachineRunCommandsClient {
|
||||
return NewVirtualMachineRunCommandsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewVirtualMachineRunCommandsClientWithBaseURI creates an instance of the VirtualMachineRunCommandsClient client
|
||||
// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign
|
||||
// clouds, Azure stack).
|
||||
func NewVirtualMachineRunCommandsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineRunCommandsClient {
|
||||
return VirtualMachineRunCommandsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// Get gets specific run command for a subscription in a location.
|
||||
// Parameters:
|
||||
// location - the location upon which run commands is queried.
|
||||
// commandID - the command id.
|
||||
func (client VirtualMachineRunCommandsClient) Get(ctx context.Context, location string, commandID string) (result RunCommandDocument, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.Get")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response.Response != nil {
|
||||
sc = result.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: location,
|
||||
Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("compute.VirtualMachineRunCommandsClient", "Get", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.GetPreparer(ctx, location, commandID)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "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.VirtualMachineRunCommandsClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client VirtualMachineRunCommandsClient) GetPreparer(ctx context.Context, location string, commandID string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"commandId": autorest.Encode("path", commandID),
|
||||
"location": autorest.Encode("path", location),
|
||||
"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/locations/{location}/runCommands/{commandId}", 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 VirtualMachineRunCommandsClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineRunCommandsClient) GetResponder(resp *http.Response) (result RunCommandDocument, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List lists all available run commands for a subscription in a location.
|
||||
// Parameters:
|
||||
// location - the location upon which run commands is queried.
|
||||
func (client VirtualMachineRunCommandsClient) List(ctx context.Context, location string) (result RunCommandListResultPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.List")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.rclr.Response.Response != nil {
|
||||
sc = result.rclr.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: location,
|
||||
Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("compute.VirtualMachineRunCommandsClient", "List", err.Error())
|
||||
}
|
||||
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, location)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.rclr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.rclr, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.rclr.hasNextLink() && result.rclr.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client VirtualMachineRunCommandsClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"location": autorest.Encode("path", location),
|
||||
"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/locations/{location}/runCommands", 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 VirtualMachineRunCommandsClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineRunCommandsClient) ListResponder(resp *http.Response) (result RunCommandListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
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 VirtualMachineRunCommandsClient) listNextResults(ctx context.Context, lastResults RunCommandListResult) (result RunCommandListResult, err error) {
|
||||
req, err := lastResults.runCommandListResultPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "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.VirtualMachineRunCommandsClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client VirtualMachineRunCommandsClient) ListComplete(ctx context.Context, location string) (result RunCommandListResultIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineRunCommandsClient.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, location)
|
||||
return
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,397 +0,0 @@
|
||||
package compute
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// 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/tracing"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// VirtualMachineScaleSetExtensionsClient is the compute Client
|
||||
type VirtualMachineScaleSetExtensionsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewVirtualMachineScaleSetExtensionsClient creates an instance of the VirtualMachineScaleSetExtensionsClient client.
|
||||
func NewVirtualMachineScaleSetExtensionsClient(subscriptionID string) VirtualMachineScaleSetExtensionsClient {
|
||||
return NewVirtualMachineScaleSetExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewVirtualMachineScaleSetExtensionsClientWithBaseURI creates an instance of the
|
||||
// VirtualMachineScaleSetExtensionsClient client using a custom endpoint. Use this when interacting with an Azure
|
||||
// cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
|
||||
func NewVirtualMachineScaleSetExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetExtensionsClient {
|
||||
return VirtualMachineScaleSetExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// CreateOrUpdate the operation to create or update an extension.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set where the extension should be create or updated.
|
||||
// vmssExtensionName - the name of the VM scale set extension.
|
||||
// extensionParameters - parameters supplied to the Create VM scale set Extension operation.
|
||||
func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension) (result VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.CreateOrUpdate")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, extensionParameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CreateOrUpdateSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
|
||||
func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
|
||||
"vmssExtensionName": autorest.Encode("path", vmssExtensionName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-03-30"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
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/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters),
|
||||
autorest.WithJSON(extensionParameters),
|
||||
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 VirtualMachineScaleSetExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Delete the operation to delete the extension.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set where the extension should be deleted.
|
||||
// vmssExtensionName - the name of the VM scale set extension.
|
||||
func (client VirtualMachineScaleSetExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string) (result VirtualMachineScaleSetExtensionsDeleteFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.Delete")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client VirtualMachineScaleSetExtensionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
|
||||
"vmssExtensionName": autorest.Encode("path", vmssExtensionName),
|
||||
}
|
||||
|
||||
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/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", 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 VirtualMachineScaleSetExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetExtensionsDeleteFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteResponder handles the response to the Delete request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineScaleSetExtensionsClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Get the operation to get the extension.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set containing the extension.
|
||||
// vmssExtensionName - the name of the VM scale set extension.
|
||||
// expand - the expand expression to apply on the operation.
|
||||
func (client VirtualMachineScaleSetExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (result VirtualMachineScaleSetExtension, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.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, VMScaleSetName, vmssExtensionName, expand)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "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.VirtualMachineScaleSetExtensionsClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client VirtualMachineScaleSetExtensionsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
|
||||
"vmssExtensionName": autorest.Encode("path", vmssExtensionName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-03-30"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", 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 VirtualMachineScaleSetExtensionsClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineScaleSetExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List gets a list of all extensions in a VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set containing the extension.
|
||||
func (client VirtualMachineScaleSetExtensionsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetExtensionListResultPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.List")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.vmsselr.Response.Response != nil {
|
||||
sc = result.vmsselr.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.vmsselr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.vmsselr, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.vmsselr.hasNextLink() && result.vmsselr.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client VirtualMachineScaleSetExtensionsClient) ListPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
|
||||
}
|
||||
|
||||
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/virtualMachineScaleSets/{vmScaleSetName}/extensions", 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 VirtualMachineScaleSetExtensionsClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineScaleSetExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetExtensionListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
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 VirtualMachineScaleSetExtensionsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetExtensionListResult) (result VirtualMachineScaleSetExtensionListResult, err error) {
|
||||
req, err := lastResults.virtualMachineScaleSetExtensionListResultPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "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.VirtualMachineScaleSetExtensionsClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client VirtualMachineScaleSetExtensionsClient) ListComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetExtensionListResultIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetExtensionsClient.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, resourceGroupName, VMScaleSetName)
|
||||
return
|
||||
}
|
||||
@@ -1,268 +0,0 @@
|
||||
package compute
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// 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/tracing"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// VirtualMachineScaleSetRollingUpgradesClient is the compute Client
|
||||
type VirtualMachineScaleSetRollingUpgradesClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewVirtualMachineScaleSetRollingUpgradesClient creates an instance of the
|
||||
// VirtualMachineScaleSetRollingUpgradesClient client.
|
||||
func NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient {
|
||||
return NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI creates an instance of the
|
||||
// VirtualMachineScaleSetRollingUpgradesClient client using a custom endpoint. Use this when interacting with an Azure
|
||||
// cloud that uses a non-standard base URI (sovereign clouds, Azure stack).
|
||||
func NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient {
|
||||
return VirtualMachineScaleSetRollingUpgradesClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// Cancel cancels the current virtual machine scale set rolling upgrade.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
func (client VirtualMachineScaleSetRollingUpgradesClient) Cancel(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesCancelFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.Cancel")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.CancelPreparer(ctx, resourceGroupName, VMScaleSetName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "Cancel", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.CancelSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "Cancel", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// CancelPreparer prepares the Cancel request.
|
||||
func (client VirtualMachineScaleSetRollingUpgradesClient) CancelPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
|
||||
}
|
||||
|
||||
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/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// CancelSender sends the Cancel request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetRollingUpgradesClient) CancelSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesCancelFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// CancelResponder handles the response to the Cancel request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineScaleSetRollingUpgradesClient) CancelResponder(resp *http.Response) (result OperationStatusResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// GetLatest gets the status of the latest virtual machine scale set rolling upgrade.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatest(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result RollingUpgradeStatusInfo, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.GetLatest")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response.Response != nil {
|
||||
sc = result.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.GetLatestPreparer(ctx, resourceGroupName, VMScaleSetName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetLatestSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetLatestResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetLatestPreparer prepares the GetLatest request.
|
||||
func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
|
||||
}
|
||||
|
||||
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/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// GetLatestSender sends the GetLatest request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetLatestResponder handles the response to the GetLatest request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestResponder(resp *http.Response) (result RollingUpgradeStatusInfo, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// StartOSUpgrade starts a rolling upgrade to move all virtual machine scale set instances to the latest available
|
||||
// Platform Image OS version. Instances which are already running the latest available OS version are not affected.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgrade(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetRollingUpgradesClient.StartOSUpgrade")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.StartOSUpgradePreparer(ctx, resourceGroupName, VMScaleSetName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartOSUpgrade", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.StartOSUpgradeSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartOSUpgrade", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// StartOSUpgradePreparer prepares the StartOSUpgrade request.
|
||||
func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
|
||||
}
|
||||
|
||||
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/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// StartOSUpgradeSender sends the StartOSUpgrade request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// StartOSUpgradeResponder handles the response to the StartOSUpgrade request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeResponder(resp *http.Response) (result OperationStatusResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,890 +0,0 @@
|
||||
package compute
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// 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/tracing"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// VirtualMachineScaleSetVMsClient is the compute Client
|
||||
type VirtualMachineScaleSetVMsClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewVirtualMachineScaleSetVMsClient creates an instance of the VirtualMachineScaleSetVMsClient client.
|
||||
func NewVirtualMachineScaleSetVMsClient(subscriptionID string) VirtualMachineScaleSetVMsClient {
|
||||
return NewVirtualMachineScaleSetVMsClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewVirtualMachineScaleSetVMsClientWithBaseURI creates an instance of the VirtualMachineScaleSetVMsClient client
|
||||
// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign
|
||||
// clouds, Azure stack).
|
||||
func NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMsClient {
|
||||
return VirtualMachineScaleSetVMsClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// Deallocate deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the
|
||||
// compute resources it uses. You are not billed for the compute resources of this virtual machine once it is
|
||||
// deallocated.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) Deallocate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsDeallocateFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Deallocate")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Deallocate", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeallocateSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Deallocate", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeallocatePreparer prepares the Deallocate request.
|
||||
func (client VirtualMachineScaleSetVMsClient) DeallocatePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"instanceId": autorest.Encode("path", instanceID),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
|
||||
}
|
||||
|
||||
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/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// DeallocateSender sends the Deallocate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetVMsClient) DeallocateSender(req *http.Request) (future VirtualMachineScaleSetVMsDeallocateFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// DeallocateResponder handles the response to the Deallocate request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineScaleSetVMsClient) DeallocateResponder(resp *http.Response) (result OperationStatusResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Delete deletes a virtual machine from a VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsDeleteFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Delete")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Delete", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.DeleteSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Delete", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// DeletePreparer prepares the Delete request.
|
||||
func (client VirtualMachineScaleSetVMsClient) DeletePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"instanceId": autorest.Encode("path", instanceID),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
|
||||
}
|
||||
|
||||
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/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", 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 VirtualMachineScaleSetVMsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetVMsDeleteFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteResponder handles the response to the Delete request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineScaleSetVMsClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Get gets a virtual machine from a VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVM, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.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, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "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.VirtualMachineScaleSetVMsClient", "Get", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Get", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetPreparer prepares the Get request.
|
||||
func (client VirtualMachineScaleSetVMsClient) GetPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"instanceId": autorest.Encode("path", instanceID),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
|
||||
}
|
||||
|
||||
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/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", 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 VirtualMachineScaleSetVMsClient) GetSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetResponder handles the response to the Get request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineScaleSetVMsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetVM, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// GetInstanceView gets the status of a virtual machine from a VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMInstanceView, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.GetInstanceView")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response.Response != nil {
|
||||
sc = result.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetInstanceViewSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetInstanceViewResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "GetInstanceView", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetInstanceViewPreparer prepares the GetInstanceView request.
|
||||
func (client VirtualMachineScaleSetVMsClient) GetInstanceViewPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"instanceId": autorest.Encode("path", instanceID),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
|
||||
}
|
||||
|
||||
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/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// GetInstanceViewSender sends the GetInstanceView request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetVMsClient) GetInstanceViewSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetInstanceViewResponder handles the response to the GetInstanceView request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineScaleSetVMsClient) GetInstanceViewResponder(resp *http.Response) (result VirtualMachineScaleSetVMInstanceView, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// List gets a list of all virtual machines in a VM scale sets.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualMachineScaleSetName - the name of the VM scale set.
|
||||
// filter - the filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code,
|
||||
// 'PowerState') eq true', 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq false'.
|
||||
// selectParameter - the list parameters. Allowed values are 'instanceView', 'instanceView/statuses'.
|
||||
// expand - the expand expression to apply to the operation. Allowed values are 'instanceView'.
|
||||
func (client VirtualMachineScaleSetVMsClient) List(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResultPage, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.List")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.vmssvlr.Response.Response != nil {
|
||||
sc = result.vmssvlr.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.vmssvlr.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.vmssvlr, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
if result.vmssvlr.hasNextLink() && result.vmssvlr.IsEmpty() {
|
||||
err = result.NextWithContext(ctx)
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client VirtualMachineScaleSetVMsClient) ListPreparer(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-03-30"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(filter) > 0 {
|
||||
queryParameters["$filter"] = autorest.Encode("query", filter)
|
||||
}
|
||||
if len(selectParameter) > 0 {
|
||||
queryParameters["$select"] = autorest.Encode("query", selectParameter)
|
||||
}
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines", 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 VirtualMachineScaleSetVMsClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineScaleSetVMsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetVMListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
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 VirtualMachineScaleSetVMsClient) listNextResults(ctx context.Context, lastResults VirtualMachineScaleSetVMListResult) (result VirtualMachineScaleSetVMListResult, err error) {
|
||||
req, err := lastResults.virtualMachineScaleSetVMListResultPreparer(ctx)
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "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.VirtualMachineScaleSetVMsClient", "listNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "listNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// ListComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client VirtualMachineScaleSetVMsClient) ListComplete(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResultIterator, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.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, resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand)
|
||||
return
|
||||
}
|
||||
|
||||
// PowerOff power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are
|
||||
// getting charged for the resources. Instead, use deallocate to release resources and avoid charges.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsPowerOffFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.PowerOff")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.PowerOffSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// PowerOffPreparer prepares the PowerOff request.
|
||||
func (client VirtualMachineScaleSetVMsClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"instanceId": autorest.Encode("path", instanceID),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
|
||||
}
|
||||
|
||||
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/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// PowerOffSender sends the PowerOff request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetVMsClient) PowerOffSender(req *http.Request) (future VirtualMachineScaleSetVMsPowerOffFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// PowerOffResponder handles the response to the PowerOff request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineScaleSetVMsClient) PowerOffResponder(resp *http.Response) (result OperationStatusResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Reimage reimages (upgrade the operating system) a specific virtual machine in a VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsReimageFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Reimage")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ReimageSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ReimagePreparer prepares the Reimage request.
|
||||
func (client VirtualMachineScaleSetVMsClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"instanceId": autorest.Encode("path", instanceID),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
|
||||
}
|
||||
|
||||
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/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ReimageSender sends the Reimage request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetVMsClient) ReimageSender(req *http.Request) (future VirtualMachineScaleSetVMsReimageFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// ReimageResponder handles the response to the Reimage request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineScaleSetVMsClient) ReimageResponder(resp *http.Response) (result OperationStatusResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// ReimageAll allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This
|
||||
// operation is only supported for managed disks.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) ReimageAll(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsReimageAllFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.ReimageAll")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.ReimageAllPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "ReimageAll", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ReimageAllSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "ReimageAll", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ReimageAllPreparer prepares the ReimageAll request.
|
||||
func (client VirtualMachineScaleSetVMsClient) ReimageAllPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"instanceId": autorest.Encode("path", instanceID),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
|
||||
}
|
||||
|
||||
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/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimageall", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// ReimageAllSender sends the ReimageAll request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetVMsClient) ReimageAllSender(req *http.Request) (future VirtualMachineScaleSetVMsReimageAllFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// ReimageAllResponder handles the response to the ReimageAll request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineScaleSetVMsClient) ReimageAllResponder(resp *http.Response) (result OperationStatusResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Restart restarts a virtual machine in a VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) Restart(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsRestartFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Restart")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.RestartPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Restart", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.RestartSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Restart", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// RestartPreparer prepares the Restart request.
|
||||
func (client VirtualMachineScaleSetVMsClient) RestartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"instanceId": autorest.Encode("path", instanceID),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
|
||||
}
|
||||
|
||||
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/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// RestartSender sends the Restart request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetVMsClient) RestartSender(req *http.Request) (future VirtualMachineScaleSetVMsRestartFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// RestartResponder handles the response to the Restart request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineScaleSetVMsClient) RestartResponder(resp *http.Response) (result OperationStatusResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Start starts a virtual machine in a VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) Start(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsStartFuture, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineScaleSetVMsClient.Start")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.FutureAPI != nil && result.FutureAPI.Response() != nil {
|
||||
sc = result.FutureAPI.Response().StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
req, err := client.StartPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Start", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.StartSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Start", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// StartPreparer prepares the Start request.
|
||||
func (client VirtualMachineScaleSetVMsClient) StartPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"instanceId": autorest.Encode("path", instanceID),
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
|
||||
}
|
||||
|
||||
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/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// StartSender sends the Start request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetVMsClient) StartSender(req *http.Request) (future VirtualMachineScaleSetVMsStartFuture, err error) {
|
||||
var resp *http.Response
|
||||
future.FutureAPI = &azure.Future{}
|
||||
resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
var azf azure.Future
|
||||
azf, err = azure.NewFutureFromResponse(resp)
|
||||
future.FutureAPI = &azf
|
||||
future.Result = future.result
|
||||
return
|
||||
}
|
||||
|
||||
// StartResponder handles the response to the Start request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineScaleSetVMsClient) StartResponder(resp *http.Response) (result OperationStatusResponse, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
package compute
|
||||
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
//
|
||||
// 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"
|
||||
)
|
||||
|
||||
// VirtualMachineSizesClient is the compute Client
|
||||
type VirtualMachineSizesClient struct {
|
||||
BaseClient
|
||||
}
|
||||
|
||||
// NewVirtualMachineSizesClient creates an instance of the VirtualMachineSizesClient client.
|
||||
func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient {
|
||||
return NewVirtualMachineSizesClientWithBaseURI(DefaultBaseURI, subscriptionID)
|
||||
}
|
||||
|
||||
// NewVirtualMachineSizesClientWithBaseURI creates an instance of the VirtualMachineSizesClient client using a custom
|
||||
// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure
|
||||
// stack).
|
||||
func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineSizesClient {
|
||||
return VirtualMachineSizesClient{NewWithBaseURI(baseURI, subscriptionID)}
|
||||
}
|
||||
|
||||
// List lists all available virtual machine sizes for a subscription in a location.
|
||||
// Parameters:
|
||||
// location - the location upon which virtual-machine-sizes is queried.
|
||||
func (client VirtualMachineSizesClient) List(ctx context.Context, location string) (result VirtualMachineSizeListResult, err error) {
|
||||
if tracing.IsEnabled() {
|
||||
ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineSizesClient.List")
|
||||
defer func() {
|
||||
sc := -1
|
||||
if result.Response.Response != nil {
|
||||
sc = result.Response.Response.StatusCode
|
||||
}
|
||||
tracing.EndSpan(ctx, sc, err)
|
||||
}()
|
||||
}
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: location,
|
||||
Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil {
|
||||
return result, validation.NewError("compute.VirtualMachineSizesClient", "List", err.Error())
|
||||
}
|
||||
|
||||
req, err := client.ListPreparer(ctx, location)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.ListSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.ListResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", resp, "Failure responding to request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// ListPreparer prepares the List request.
|
||||
func (client VirtualMachineSizesClient) ListPreparer(ctx context.Context, location string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"location": autorest.Encode("path", location),
|
||||
"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/locations/{location}/vmSizes", 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 VirtualMachineSizesClient) ListSender(req *http.Request) (*http.Response, error) {
|
||||
return client.Send(req, azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// ListResponder handles the response to the List request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineSizesClient) ListResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
2
vendor/modules.txt
vendored
2
vendor/modules.txt
vendored
@@ -32,14 +32,12 @@ github.com/AlecAivazis/survey/v2/core
|
||||
github.com/AlecAivazis/survey/v2/terminal
|
||||
# github.com/Azure/azure-sdk-for-go v68.0.0+incompatible
|
||||
## explicit
|
||||
github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/compute/mgmt/compute
|
||||
github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/dns/mgmt/dns
|
||||
github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/network/mgmt/network
|
||||
github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/resources/mgmt/resources
|
||||
github.com/Azure/azure-sdk-for-go/profiles/2018-03-01/resources/mgmt/subscriptions
|
||||
github.com/Azure/azure-sdk-for-go/profiles/latest/compute/mgmt/compute
|
||||
github.com/Azure/azure-sdk-for-go/profiles/latest/marketplaceordering/mgmt/marketplaceordering
|
||||
github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-03-30/compute
|
||||
github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2022-08-01/compute
|
||||
github.com/Azure/azure-sdk-for-go/services/dns/mgmt/2016-04-01/dns
|
||||
github.com/Azure/azure-sdk-for-go/services/marketplaceordering/mgmt/2015-06-01/marketplaceordering
|
||||
|
||||
Reference in New Issue
Block a user