From 64accfc925339d2007938c7e0c705baaca929c7c Mon Sep 17 00:00:00 2001 From: Pengfei Ni Date: Sun, 21 Apr 2019 18:12:29 +0800 Subject: [PATCH 1/6] Upgrade compute API to version 2019-03-01 --- pkg/cloudprovider/providers/azure/BUILD | 4 ++-- pkg/cloudprovider/providers/azure/azure.go | 2 +- pkg/cloudprovider/providers/azure/azure_backoff.go | 2 +- pkg/cloudprovider/providers/azure/azure_client.go | 2 +- pkg/cloudprovider/providers/azure/azure_controller_common.go | 2 +- .../providers/azure/azure_controller_standard.go | 2 +- pkg/cloudprovider/providers/azure/azure_controller_vmss.go | 2 +- pkg/cloudprovider/providers/azure/azure_fakes.go | 2 +- pkg/cloudprovider/providers/azure/azure_instances_test.go | 2 +- .../providers/azure/azure_managedDiskController.go | 2 +- pkg/cloudprovider/providers/azure/azure_standard.go | 2 +- pkg/cloudprovider/providers/azure/azure_test.go | 2 +- pkg/cloudprovider/providers/azure/azure_vmsets.go | 2 +- pkg/cloudprovider/providers/azure/azure_vmss.go | 2 +- pkg/cloudprovider/providers/azure/azure_vmss_test.go | 2 +- pkg/cloudprovider/providers/azure/azure_wrap.go | 2 +- pkg/volume/azure_dd/BUILD | 4 ++-- pkg/volume/azure_dd/attacher.go | 2 +- pkg/volume/azure_dd/azure_common.go | 2 +- pkg/volume/azure_dd/azure_common_test.go | 2 +- pkg/volume/azure_dd/azure_dd.go | 2 +- pkg/volume/azure_dd/azure_dd_test.go | 2 +- 22 files changed, 24 insertions(+), 24 deletions(-) diff --git a/pkg/cloudprovider/providers/azure/BUILD b/pkg/cloudprovider/providers/azure/BUILD index bbe2482526..3f9249e93c 100644 --- a/pkg/cloudprovider/providers/azure/BUILD +++ b/pkg/cloudprovider/providers/azure/BUILD @@ -58,7 +58,7 @@ go_library( "//staging/src/k8s.io/cloud-provider/volume:go_default_library", "//staging/src/k8s.io/cloud-provider/volume/errors:go_default_library", "//staging/src/k8s.io/cloud-provider/volume/helpers:go_default_library", - "//vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute:go_default_library", + "//vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute:go_default_library", "//vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network:go_default_library", "//vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage:go_default_library", "//vendor/github.com/Azure/azure-sdk-for-go/storage:go_default_library", @@ -102,7 +102,7 @@ go_test( "//staging/src/k8s.io/apimachinery/pkg/util/sets:go_default_library", "//staging/src/k8s.io/cloud-provider:go_default_library", "//staging/src/k8s.io/cloud-provider/service/helpers:go_default_library", - "//vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute:go_default_library", + "//vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute:go_default_library", "//vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network:go_default_library", "//vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage:go_default_library", "//vendor/github.com/Azure/go-autorest/autorest:go_default_library", diff --git a/pkg/cloudprovider/providers/azure/azure.go b/pkg/cloudprovider/providers/azure/azure.go index e1cd9bbfa2..e7169a37fa 100644 --- a/pkg/cloudprovider/providers/azure/azure.go +++ b/pkg/cloudprovider/providers/azure/azure.go @@ -38,7 +38,7 @@ import ( cloudprovider "k8s.io/cloud-provider" "k8s.io/kubernetes/pkg/cloudprovider/providers/azure/auth" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "k8s.io/klog" diff --git a/pkg/cloudprovider/providers/azure/azure_backoff.go b/pkg/cloudprovider/providers/azure/azure_backoff.go index 6545ec1c44..79560532f2 100644 --- a/pkg/cloudprovider/providers/azure/azure_backoff.go +++ b/pkg/cloudprovider/providers/azure/azure_backoff.go @@ -20,7 +20,7 @@ import ( "fmt" "net/http" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network" "k8s.io/api/core/v1" diff --git a/pkg/cloudprovider/providers/azure/azure_client.go b/pkg/cloudprovider/providers/azure/azure_client.go index 8559c1cd37..73d1cd4e25 100644 --- a/pkg/cloudprovider/providers/azure/azure_client.go +++ b/pkg/cloudprovider/providers/azure/azure_client.go @@ -22,7 +22,7 @@ import ( "net/http" "time" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network" "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage" "github.com/Azure/go-autorest/autorest" diff --git a/pkg/cloudprovider/providers/azure/azure_controller_common.go b/pkg/cloudprovider/providers/azure/azure_controller_common.go index b4b2e53289..7a6f49b79b 100644 --- a/pkg/cloudprovider/providers/azure/azure_controller_common.go +++ b/pkg/cloudprovider/providers/azure/azure_controller_common.go @@ -21,7 +21,7 @@ import ( "fmt" "time" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "k8s.io/klog" "k8s.io/apimachinery/pkg/types" diff --git a/pkg/cloudprovider/providers/azure/azure_controller_standard.go b/pkg/cloudprovider/providers/azure/azure_controller_standard.go index 644b4ff88b..8e10fc7508 100644 --- a/pkg/cloudprovider/providers/azure/azure_controller_standard.go +++ b/pkg/cloudprovider/providers/azure/azure_controller_standard.go @@ -21,7 +21,7 @@ import ( "net/http" "strings" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "k8s.io/klog" "k8s.io/apimachinery/pkg/types" diff --git a/pkg/cloudprovider/providers/azure/azure_controller_vmss.go b/pkg/cloudprovider/providers/azure/azure_controller_vmss.go index 60748d8c9f..db914c2c9a 100644 --- a/pkg/cloudprovider/providers/azure/azure_controller_vmss.go +++ b/pkg/cloudprovider/providers/azure/azure_controller_vmss.go @@ -21,7 +21,7 @@ import ( "net/http" "strings" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "k8s.io/klog" "k8s.io/apimachinery/pkg/types" diff --git a/pkg/cloudprovider/providers/azure/azure_fakes.go b/pkg/cloudprovider/providers/azure/azure_fakes.go index af8e47abbb..8c007aaa7c 100644 --- a/pkg/cloudprovider/providers/azure/azure_fakes.go +++ b/pkg/cloudprovider/providers/azure/azure_fakes.go @@ -29,7 +29,7 @@ import ( "k8s.io/apimachinery/pkg/types" cloudprovider "k8s.io/cloud-provider" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network" "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage" "github.com/Azure/go-autorest/autorest" diff --git a/pkg/cloudprovider/providers/azure/azure_instances_test.go b/pkg/cloudprovider/providers/azure/azure_instances_test.go index 40c92beb9d..71f8114a3d 100644 --- a/pkg/cloudprovider/providers/azure/azure_instances_test.go +++ b/pkg/cloudprovider/providers/azure/azure_instances_test.go @@ -24,7 +24,7 @@ import ( "reflect" "testing" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "github.com/Azure/go-autorest/autorest/to" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" diff --git a/pkg/cloudprovider/providers/azure/azure_managedDiskController.go b/pkg/cloudprovider/providers/azure/azure_managedDiskController.go index b1b945d398..c6acbf280d 100644 --- a/pkg/cloudprovider/providers/azure/azure_managedDiskController.go +++ b/pkg/cloudprovider/providers/azure/azure_managedDiskController.go @@ -23,7 +23,7 @@ import ( "strconv" "strings" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "github.com/Azure/go-autorest/autorest/to" "k8s.io/klog" diff --git a/pkg/cloudprovider/providers/azure/azure_standard.go b/pkg/cloudprovider/providers/azure/azure_standard.go index c2b22e1e6d..4bf9d51412 100644 --- a/pkg/cloudprovider/providers/azure/azure_standard.go +++ b/pkg/cloudprovider/providers/azure/azure_standard.go @@ -26,7 +26,7 @@ import ( "strconv" "strings" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network" "github.com/Azure/go-autorest/autorest/to" diff --git a/pkg/cloudprovider/providers/azure/azure_test.go b/pkg/cloudprovider/providers/azure/azure_test.go index e30b0d9297..21ee22542e 100644 --- a/pkg/cloudprovider/providers/azure/azure_test.go +++ b/pkg/cloudprovider/providers/azure/azure_test.go @@ -33,7 +33,7 @@ import ( servicehelpers "k8s.io/cloud-provider/service/helpers" "k8s.io/kubernetes/pkg/cloudprovider/providers/azure/auth" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network" "github.com/Azure/go-autorest/autorest/to" "github.com/stretchr/testify/assert" diff --git a/pkg/cloudprovider/providers/azure/azure_vmsets.go b/pkg/cloudprovider/providers/azure/azure_vmsets.go index 6dbdc1dd65..c6ad05d0ca 100644 --- a/pkg/cloudprovider/providers/azure/azure_vmsets.go +++ b/pkg/cloudprovider/providers/azure/azure_vmsets.go @@ -19,7 +19,7 @@ package azure import ( "net/http" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network" "k8s.io/api/core/v1" diff --git a/pkg/cloudprovider/providers/azure/azure_vmss.go b/pkg/cloudprovider/providers/azure/azure_vmss.go index b0e20b8ce0..ba10690bfb 100644 --- a/pkg/cloudprovider/providers/azure/azure_vmss.go +++ b/pkg/cloudprovider/providers/azure/azure_vmss.go @@ -24,7 +24,7 @@ import ( "strconv" "strings" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network" "github.com/Azure/go-autorest/autorest/to" diff --git a/pkg/cloudprovider/providers/azure/azure_vmss_test.go b/pkg/cloudprovider/providers/azure/azure_vmss_test.go index 54ebff15fa..e963a854dc 100644 --- a/pkg/cloudprovider/providers/azure/azure_vmss_test.go +++ b/pkg/cloudprovider/providers/azure/azure_vmss_test.go @@ -20,7 +20,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network" "github.com/Azure/go-autorest/autorest/to" "github.com/stretchr/testify/assert" diff --git a/pkg/cloudprovider/providers/azure/azure_wrap.go b/pkg/cloudprovider/providers/azure/azure_wrap.go index 15cdf4534f..6113fc10c8 100644 --- a/pkg/cloudprovider/providers/azure/azure_wrap.go +++ b/pkg/cloudprovider/providers/azure/azure_wrap.go @@ -23,7 +23,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network" "github.com/Azure/go-autorest/autorest" "k8s.io/apimachinery/pkg/types" diff --git a/pkg/volume/azure_dd/BUILD b/pkg/volume/azure_dd/BUILD index a894b6ee53..6ec2eaf5ff 100644 --- a/pkg/volume/azure_dd/BUILD +++ b/pkg/volume/azure_dd/BUILD @@ -37,7 +37,7 @@ go_library( "//staging/src/k8s.io/apiserver/pkg/util/feature:go_default_library", "//staging/src/k8s.io/cloud-provider:go_default_library", "//staging/src/k8s.io/cloud-provider/volume/helpers:go_default_library", - "//vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute:go_default_library", + "//vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute:go_default_library", "//vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage:go_default_library", "//vendor/k8s.io/klog:go_default_library", "//vendor/k8s.io/utils/strings:go_default_library", @@ -74,7 +74,7 @@ go_test( "//staging/src/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library", "//staging/src/k8s.io/apimachinery/pkg/types:go_default_library", "//staging/src/k8s.io/client-go/util/testing:go_default_library", - "//vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute:go_default_library", + "//vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute:go_default_library", "//vendor/github.com/Azure/go-autorest/autorest/to:go_default_library", "//vendor/github.com/stretchr/testify/assert:go_default_library", ], diff --git a/pkg/volume/azure_dd/attacher.go b/pkg/volume/azure_dd/attacher.go index f7486e1e1d..a009be39da 100644 --- a/pkg/volume/azure_dd/attacher.go +++ b/pkg/volume/azure_dd/attacher.go @@ -24,7 +24,7 @@ import ( "strconv" "time" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "k8s.io/klog" "k8s.io/api/core/v1" diff --git a/pkg/volume/azure_dd/azure_common.go b/pkg/volume/azure_dd/azure_common.go index 905369d695..a6b0c2704d 100644 --- a/pkg/volume/azure_dd/azure_common.go +++ b/pkg/volume/azure_dd/azure_common.go @@ -25,7 +25,7 @@ import ( "strconv" libstrings "strings" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" diff --git a/pkg/volume/azure_dd/azure_common_test.go b/pkg/volume/azure_dd/azure_common_test.go index f100d1792b..ad07492301 100644 --- a/pkg/volume/azure_dd/azure_common_test.go +++ b/pkg/volume/azure_dd/azure_common_test.go @@ -24,7 +24,7 @@ import ( "testing" "time" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "github.com/stretchr/testify/assert" "k8s.io/kubernetes/pkg/util/mount" diff --git a/pkg/volume/azure_dd/azure_dd.go b/pkg/volume/azure_dd/azure_dd.go index a85fb712aa..4d2a730d13 100644 --- a/pkg/volume/azure_dd/azure_dd.go +++ b/pkg/volume/azure_dd/azure_dd.go @@ -22,7 +22,7 @@ import ( "strings" "time" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage" "k8s.io/klog" diff --git a/pkg/volume/azure_dd/azure_dd_test.go b/pkg/volume/azure_dd/azure_dd_test.go index 965e9d3207..dfe922872e 100644 --- a/pkg/volume/azure_dd/azure_dd_test.go +++ b/pkg/volume/azure_dd/azure_dd_test.go @@ -20,7 +20,7 @@ import ( "os" "testing" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "github.com/Azure/go-autorest/autorest/to" "github.com/stretchr/testify/assert" From cd515c85a31df8b7d9139ef8489f501d99e3ec9b Mon Sep 17 00:00:00 2001 From: Pengfei Ni Date: Mon, 15 Apr 2019 17:09:27 +0800 Subject: [PATCH 2/6] Replace vmss update API with instance-level update API commit --- .../providers/azure/azure_client.go | 25 - .../providers/azure/azure_fakes.go | 6 +- .../providers/azure/azure_loadbalancer.go | 6 +- .../providers/azure/azure_standard.go | 16 +- .../providers/azure/azure_vmsets.go | 9 +- .../providers/azure/azure_vmss.go | 444 +++++++++--------- 6 files changed, 254 insertions(+), 252 deletions(-) diff --git a/pkg/cloudprovider/providers/azure/azure_client.go b/pkg/cloudprovider/providers/azure/azure_client.go index 73d1cd4e25..22f80f0ccf 100644 --- a/pkg/cloudprovider/providers/azure/azure_client.go +++ b/pkg/cloudprovider/providers/azure/azure_client.go @@ -89,7 +89,6 @@ type SecurityGroupsClient interface { // VirtualMachineScaleSetsClient defines needed functions for azure compute.VirtualMachineScaleSetsClient type VirtualMachineScaleSetsClient interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters compute.VirtualMachineScaleSet) (resp *http.Response, err error) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result compute.VirtualMachineScaleSet, err error) List(ctx context.Context, resourceGroupName string) (result []compute.VirtualMachineScaleSet, err error) UpdateInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) (resp *http.Response, err error) @@ -835,30 +834,6 @@ func newAzVirtualMachineScaleSetsClient(config *azClientConfig) *azVirtualMachin } } -func (az *azVirtualMachineScaleSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters compute.VirtualMachineScaleSet) (resp *http.Response, err error) { - /* Write rate limiting */ - if !az.rateLimiterWriter.TryAccept() { - err = createRateLimitErr(true, "VMSSCreateOrUpdate") - return - } - - klog.V(10).Infof("azVirtualMachineScaleSetsClient.CreateOrUpdate(%q,%q): start", resourceGroupName, VMScaleSetName) - defer func() { - klog.V(10).Infof("azVirtualMachineScaleSetsClient.CreateOrUpdate(%q,%q): end", resourceGroupName, VMScaleSetName) - }() - - mc := newMetricContext("vmss", "create_or_update", resourceGroupName, az.client.SubscriptionID) - future, err := az.client.CreateOrUpdate(ctx, resourceGroupName, VMScaleSetName, parameters) - mc.Observe(err) - if err != nil { - return future.Response(), err - } - - err = future.WaitForCompletionRef(ctx, az.client.Client) - mc.Observe(err) - return future.Response(), err -} - func (az *azVirtualMachineScaleSetsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result compute.VirtualMachineScaleSet, err error) { if !az.rateLimiterReader.TryAccept() { err = createRateLimitErr(false, "VMSSGet") diff --git a/pkg/cloudprovider/providers/azure/azure_fakes.go b/pkg/cloudprovider/providers/azure/azure_fakes.go index 8c007aaa7c..17bbb8f99a 100644 --- a/pkg/cloudprovider/providers/azure/azure_fakes.go +++ b/pkg/cloudprovider/providers/azure/azure_fakes.go @@ -902,7 +902,11 @@ func (f *fakeVMSet) EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, bac return fmt.Errorf("unimplemented") } -func (f *fakeVMSet) EnsureBackendPoolDeleted(service *v1.Service, poolID, vmSetName string, backendAddressPools *[]network.BackendAddressPool) error { +func (f *fakeVMSet) EnsureHostInPool(service *v1.Service, nodeName types.NodeName, backendPoolID string, vmSetName string, isInternal bool) error { + return fmt.Errorf("unimplemented") +} + +func (f *fakeVMSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID, vmSetName string, backendAddressPools *[]network.BackendAddressPool) error { return fmt.Errorf("unimplemented") } diff --git a/pkg/cloudprovider/providers/azure/azure_loadbalancer.go b/pkg/cloudprovider/providers/azure/azure_loadbalancer.go index cf9bab1433..96edec5a8e 100644 --- a/pkg/cloudprovider/providers/azure/azure_loadbalancer.go +++ b/pkg/cloudprovider/providers/azure/azure_loadbalancer.go @@ -829,13 +829,13 @@ func (az *Cloud) reconcileLoadBalancer(clusterName string, service *v1.Service, // Remove backend pools from vmSets. This is required for virtual machine scale sets before removing the LB. vmSetName := az.mapLoadBalancerNameToVMSet(lbName, clusterName) - klog.V(10).Infof("EnsureBackendPoolDeleted(%s, %s): start", lbBackendPoolID, vmSetName) + klog.V(10).Infof("EnsureBackendPoolDeleted(%s,%s) for service %s: start", lbBackendPoolID, vmSetName, serviceName) err := az.vmSet.EnsureBackendPoolDeleted(service, lbBackendPoolID, vmSetName, lb.BackendAddressPools) if err != nil { - klog.Errorf("EnsureBackendPoolDeleted(%s, %s) failed: %v", lbBackendPoolID, vmSetName, err) + klog.Errorf("EnsureBackendPoolDeleted(%s) for service %s failed: %v", lbBackendPoolID, serviceName, err) return nil, err } - klog.V(10).Infof("EnsureBackendPoolDeleted(%s, %s): end", lbBackendPoolID, vmSetName) + klog.V(10).Infof("EnsureBackendPoolDeleted(%s) for service %s: end", lbBackendPoolID, serviceName) // Remove the LB. klog.V(10).Infof("reconcileLoadBalancer: az.DeleteLB(%q): start", lbName) diff --git a/pkg/cloudprovider/providers/azure/azure_standard.go b/pkg/cloudprovider/providers/azure/azure_standard.go index 4bf9d51412..87ba3f2f5f 100644 --- a/pkg/cloudprovider/providers/azure/azure_standard.go +++ b/pkg/cloudprovider/providers/azure/azure_standard.go @@ -632,24 +632,24 @@ func (as *availabilitySet) getPrimaryInterfaceWithVMSet(nodeName, vmSetName stri return nic, nil } -// ensureHostInPool ensures the given VM's Primary NIC's Primary IP Configuration is +// EnsureHostInPool ensures the given VM's Primary NIC's Primary IP Configuration is // participating in the specified LoadBalancer Backend Pool. -func (as *availabilitySet) ensureHostInPool(service *v1.Service, nodeName types.NodeName, backendPoolID string, vmSetName string, isInternal bool) error { +func (as *availabilitySet) EnsureHostInPool(service *v1.Service, nodeName types.NodeName, backendPoolID string, vmSetName string, isInternal bool) error { vmName := mapNodeNameToVMName(nodeName) serviceName := getServiceName(service) nic, err := as.getPrimaryInterfaceWithVMSet(vmName, vmSetName) if err != nil { if err == errNotInVMSet { - klog.V(3).Infof("ensureHostInPool skips node %s because it is not in the vmSet %s", nodeName, vmSetName) + klog.V(3).Infof("EnsureHostInPool skips node %s because it is not in the vmSet %s", nodeName, vmSetName) return nil } - klog.Errorf("error: az.ensureHostInPool(%s), az.vmSet.GetPrimaryInterface.Get(%s, %s), err=%v", nodeName, vmName, vmSetName, err) + klog.Errorf("error: az.EnsureHostInPool(%s), az.vmSet.GetPrimaryInterface.Get(%s, %s), err=%v", nodeName, vmName, vmSetName, err) return err } if nic.ProvisioningState != nil && *nic.ProvisioningState == nicFailedState { - klog.V(3).Infof("ensureHostInPool skips node %s because its primary nic %s is in Failed state", nodeName, *nic.Name) + klog.Warningf("EnsureHostInPool skips node %s because its primary nic %s is in Failed state", nodeName, *nic.Name) return nil } @@ -726,7 +726,7 @@ func (as *availabilitySet) EnsureHostsInPool(service *v1.Service, nodes []*v1.No } f := func() error { - err := as.ensureHostInPool(service, types.NodeName(localNodeName), backendPoolID, vmSetName, isInternal) + err := as.EnsureHostInPool(service, types.NodeName(localNodeName), backendPoolID, vmSetName, isInternal) if err != nil { return fmt.Errorf("ensure(%s): backendPoolID(%s) - failed to ensure host in pool: %q", getServiceName(service), backendPoolID, err) } @@ -743,8 +743,8 @@ func (as *availabilitySet) EnsureHostsInPool(service *v1.Service, nodes []*v1.No return nil } -// EnsureBackendPoolDeleted ensures the loadBalancer backendAddressPools deleted from the specified vmSet. -func (as *availabilitySet) EnsureBackendPoolDeleted(service *v1.Service, poolID, vmSetName string, backendAddressPools *[]network.BackendAddressPool) error { +// EnsureBackendPoolDeleted ensures the loadBalancer backendAddressPools deleted from the specified nodes. +func (as *availabilitySet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID, vmSetName string, backendAddressPools *[]network.BackendAddressPool) error { // Do nothing for availability set. return nil } diff --git a/pkg/cloudprovider/providers/azure/azure_vmsets.go b/pkg/cloudprovider/providers/azure/azure_vmsets.go index c6ad05d0ca..c92809c247 100644 --- a/pkg/cloudprovider/providers/azure/azure_vmsets.go +++ b/pkg/cloudprovider/providers/azure/azure_vmsets.go @@ -17,8 +17,6 @@ limitations under the License. package azure import ( - "net/http" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network" @@ -57,8 +55,11 @@ type VMSet interface { // EnsureHostsInPool ensures the given Node's primary IP configurations are // participating in the specified LoadBalancer Backend Pool. EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, backendPoolID string, vmSetName string, isInternal bool) error - // EnsureBackendPoolDeleted ensures the loadBalancer backendAddressPools deleted from the specified vmSet. - EnsureBackendPoolDeleted(service *v1.Service, poolID, vmSetName string, backendAddressPools *[]network.BackendAddressPool) error + // EnsureHostInPool ensures the given VM's Primary NIC's Primary IP Configuration is + // participating in the specified LoadBalancer Backend Pool. + EnsureHostInPool(service *v1.Service, nodeName types.NodeName, backendPoolID string, vmSetName string, isInternal bool) error + // EnsureBackendPoolDeleted ensures the loadBalancer backendAddressPools deleted from the specified nodes. + EnsureBackendPoolDeleted(service *v1.Service, backendPoolID, vmSetName string, backendAddressPools *[]network.BackendAddressPool) error // AttachDisk attaches a vhd to vm. The vhd must exist, can be identified by diskName, diskURI, and lun. AttachDisk(isManagedDisk bool, diskName, diskURI string, nodeName types.NodeName, lun int32, cachingMode compute.CachingTypes) error diff --git a/pkg/cloudprovider/providers/azure/azure_vmss.go b/pkg/cloudprovider/providers/azure/azure_vmss.go index ba10690bfb..8d101f7bdb 100644 --- a/pkg/cloudprovider/providers/azure/azure_vmss.go +++ b/pkg/cloudprovider/providers/azure/azure_vmss.go @@ -30,7 +30,7 @@ import ( "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" - "k8s.io/apimachinery/pkg/util/sets" + utilerrors "k8s.io/apimachinery/pkg/util/errors" "k8s.io/apimachinery/pkg/util/wait" cloudprovider "k8s.io/cloud-provider" "k8s.io/klog" @@ -44,6 +44,7 @@ var ( resourceGroupRE = regexp.MustCompile(`.*/subscriptions/(?:.*)/resourceGroups/(.+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?:.*)/virtualMachines(?:.*)`) vmssNicResourceGroupRE = regexp.MustCompile(`.*/subscriptions/(?:.*)/resourceGroups/(.+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?:.*)/virtualMachines/(?:.*)/networkInterfaces/(?:.*)`) vmssMachineIDTemplate = "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachineScaleSets/%s/virtualMachines/%s" + vmssIPConfigurationRE = regexp.MustCompile(`.*/subscriptions/(?:.*)/resourceGroups/(.+)/providers/Microsoft.Compute/virtualMachineScaleSets/(.+)/virtualMachines/(.+)/networkInterfaces(?:.*)`) ) // scaleSet implements VMSet interface for Azure scale set. @@ -351,6 +352,16 @@ func (ss *scaleSet) getPrimaryInterfaceID(machine compute.VirtualMachineScaleSet return "", fmt.Errorf("failed to find a primary nic for the vm. vmname=%q", *machine.Name) } +// getVmssMachineID returns the full identifier of a vmss virtual machine. +func (az *Cloud) getVmssMachineID(resourceGroup, scaleSetName, instanceID string) string { + return fmt.Sprintf( + vmssMachineIDTemplate, + az.SubscriptionID, + strings.ToLower(resourceGroup), + scaleSetName, + instanceID) +} + // machineName is composed of computerNamePrefix and 36-based instanceID. // And instanceID part if in fixed length of 6 characters. // Refer https://msftstack.wordpress.com/2017/05/10/figuring-out-azure-vm-scale-set-machine-names/. @@ -618,9 +629,8 @@ func (ss *scaleSet) getScaleSetWithRetry(service *v1.Service, name string) (comp return result, exists, err } -// getPrimaryNetworkConfiguration gets primary network interface configuration for scale sets. -func (ss *scaleSet) getPrimaryNetworkConfiguration(networkConfigurationList *[]compute.VirtualMachineScaleSetNetworkConfiguration, scaleSetName string) (*compute.VirtualMachineScaleSetNetworkConfiguration, error) { - networkConfigurations := *networkConfigurationList +// getPrimarynetworkInterfaceConfiguration gets primary network interface configuration for scale set virtual machine. +func (ss *scaleSet) getPrimarynetworkInterfaceConfiguration(networkConfigurations []compute.VirtualMachineScaleSetNetworkConfiguration, nodeName string) (*compute.VirtualMachineScaleSetNetworkConfiguration, error) { if len(networkConfigurations) == 1 { return &networkConfigurations[0], nil } @@ -632,10 +642,10 @@ func (ss *scaleSet) getPrimaryNetworkConfiguration(networkConfigurationList *[]c } } - return nil, fmt.Errorf("failed to find a primary network configuration for the scale set %q", scaleSetName) + return nil, fmt.Errorf("failed to find a primary network configuration for the scale set VM %q", nodeName) } -func (ss *scaleSet) getPrimaryIPConfigForScaleSet(config *compute.VirtualMachineScaleSetNetworkConfiguration, scaleSetName string) (*compute.VirtualMachineScaleSetIPConfiguration, error) { +func (ss *scaleSet) getPrimaryIPConfigForScaleSet(config *compute.VirtualMachineScaleSetNetworkConfiguration, nodeName string) (*compute.VirtualMachineScaleSetIPConfiguration, error) { ipConfigurations := *config.IPConfigurations if len(ipConfigurations) == 1 { return &ipConfigurations[0], nil @@ -648,31 +658,7 @@ func (ss *scaleSet) getPrimaryIPConfigForScaleSet(config *compute.VirtualMachine } } - return nil, fmt.Errorf("failed to find a primary IP configuration for the scale set %q", scaleSetName) -} - -// createOrUpdateVMSS invokes ss.VirtualMachineScaleSetsClient.CreateOrUpdate with exponential backoff retry. -func (ss *scaleSet) createOrUpdateVMSS(service *v1.Service, virtualMachineScaleSet compute.VirtualMachineScaleSet) error { - if ss.Config.shouldOmitCloudProviderBackoff() { - ctx, cancel := getContextWithCancel() - defer cancel() - resp, err := ss.VirtualMachineScaleSetsClient.CreateOrUpdate(ctx, ss.ResourceGroup, *virtualMachineScaleSet.Name, virtualMachineScaleSet) - klog.V(10).Infof("VirtualMachineScaleSetsClient.CreateOrUpdate(%s): end", *virtualMachineScaleSet.Name) - return ss.processHTTPResponse(service, "CreateOrUpdateVMSS", resp, err) - } - - return ss.createOrUpdateVMSSWithRetry(service, virtualMachineScaleSet) -} - -// createOrUpdateVMSSWithRetry invokes ss.VirtualMachineScaleSetsClient.CreateOrUpdate with exponential backoff retry. -func (ss *scaleSet) createOrUpdateVMSSWithRetry(service *v1.Service, virtualMachineScaleSet compute.VirtualMachineScaleSet) error { - return wait.ExponentialBackoff(ss.requestBackoff(), func() (bool, error) { - ctx, cancel := getContextWithCancel() - defer cancel() - resp, err := ss.VirtualMachineScaleSetsClient.CreateOrUpdate(ctx, ss.ResourceGroup, *virtualMachineScaleSet.Name, virtualMachineScaleSet) - klog.V(10).Infof("VirtualMachineScaleSetsClient.CreateOrUpdate(%s): end", *virtualMachineScaleSet.Name) - return ss.processHTTPRetryResponse(service, "CreateOrUpdateVMSS", resp, err) - }) + return nil, fmt.Errorf("failed to find a primary IP configuration for the scale set VM %q", nodeName) } // updateVMSSInstances invokes ss.VirtualMachineScaleSetsClient.UpdateInstances with exponential backoff retry. @@ -699,70 +685,35 @@ func (ss *scaleSet) updateVMSSInstancesWithRetry(service *v1.Service, scaleSetNa }) } -// getNodesScaleSets returns scalesets with instanceIDs and standard node names for given nodes. -func (ss *scaleSet) getNodesScaleSets(nodes []*v1.Node) (map[string]sets.String, []*v1.Node, error) { - scalesets := make(map[string]sets.String) - standardNodes := []*v1.Node{} - - for _, curNode := range nodes { - if ss.useStandardLoadBalancer() && ss.excludeMasterNodesFromStandardLB() && isMasterNode(curNode) { - klog.V(4).Infof("Excluding master node %q from load balancer backendpool", curNode.Name) - continue - } - - if ss.ShouldNodeExcludedFromLoadBalancer(curNode) { - klog.V(4).Infof("Excluding unmanaged/external-resource-group node %q", curNode.Name) - continue - } - - curScaleSetName, err := extractScaleSetNameByProviderID(curNode.Spec.ProviderID) - if err != nil { - klog.V(4).Infof("Node %q is not belonging to any scale sets, assuming it is belong to availability sets", curNode.Name) - standardNodes = append(standardNodes, curNode) - continue - } - - if _, ok := scalesets[curScaleSetName]; !ok { - scalesets[curScaleSetName] = sets.NewString() - } - - instanceID, err := getLastSegment(curNode.Spec.ProviderID) - if err != nil { - klog.Errorf("Failed to get instance ID for node %q: %v", curNode.Spec.ProviderID, err) - return nil, nil, err - } - - scalesets[curScaleSetName].Insert(instanceID) - } - - return scalesets, standardNodes, nil -} - -// ensureHostsInVMSetPool ensures the given Node's primary IP configurations are -// participating in the vmSet's LoadBalancer Backend Pool. -func (ss *scaleSet) ensureHostsInVMSetPool(service *v1.Service, backendPoolID string, vmSetName string, instanceIDs []string, isInternal bool) error { - klog.V(3).Infof("ensuring hosts %q of scaleset %q in LB backendpool %q", instanceIDs, vmSetName, backendPoolID) - serviceName := getServiceName(service) - virtualMachineScaleSet, exists, err := ss.getScaleSet(service, vmSetName) +// EnsureHostInPool ensures the given VM's Primary NIC's Primary IP Configuration is +// participating in the specified LoadBalancer Backend Pool. +func (ss *scaleSet) EnsureHostInPool(service *v1.Service, nodeName types.NodeName, backendPoolID string, vmSetName string, isInternal bool) error { + klog.V(3).Infof("ensuring node %q of scaleset %q in LB backendpool %q", nodeName, vmSetName, backendPoolID) + vmName := mapNodeNameToVMName(nodeName) + ssName, instanceID, vm, err := ss.getVmssVM(vmName) if err != nil { - klog.Errorf("ss.getScaleSet(%s) for service %q failed: %v", vmSetName, serviceName, err) return err } - if !exists { - errorMessage := fmt.Errorf("Scale set %q not found", vmSetName) - klog.Errorf("%v", errorMessage) - return errorMessage + + // Check scale set name: + // - For basic SKU load balancer, errNotInVMSet should be returned if the node's + // scale set is mismatched with vmSetName. + // - For standard SKU load balancer, backend could belong to multiple VMSS, so we + // don't check vmSet for it. + if vmSetName != "" && !ss.useStandardLoadBalancer() && !strings.EqualFold(vmSetName, ssName) { + klog.V(3).Infof("EnsureHostInPool skips node %s because it is not in the scaleSet %s", vmName, vmSetName) + return nil } // Find primary network interface configuration. - networkConfigureList := virtualMachineScaleSet.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations - primaryNetworkConfiguration, err := ss.getPrimaryNetworkConfiguration(networkConfigureList, vmSetName) + networkInterfaceConfigurations := *vm.NetworkProfileConfiguration.NetworkInterfaceConfigurations + primaryNetworkInterfaceConfiguration, err := ss.getPrimarynetworkInterfaceConfiguration(networkInterfaceConfigurations, vmName) if err != nil { return err } // Find primary IP configuration. - primaryIPConfiguration, err := ss.getPrimaryIPConfigForScaleSet(primaryNetworkConfiguration, vmSetName) + primaryIPConfiguration, err := ss.getPrimaryIPConfigForScaleSet(primaryNetworkInterfaceConfiguration, vmName) if err != nil { return err } @@ -779,217 +730,288 @@ func (ss *scaleSet) ensureHostsInVMSetPool(service *v1.Service, backendPoolID st break } } - if !foundPool { - if ss.useStandardLoadBalancer() && len(newBackendPools) > 0 { - // Although standard load balancer supports backends from multiple vmss, - // the same network interface couldn't be added to more than one load balancer of - // the same type. Omit those nodes (e.g. masters) so Azure ARM won't complain - // about this. - newBackendPoolsIDs := make([]string, 0, len(newBackendPools)) - for _, pool := range newBackendPools { - if pool.ID != nil { - newBackendPoolsIDs = append(newBackendPoolsIDs, *pool.ID) - } - } - isSameLB, oldLBName, err := isBackendPoolOnSameLB(backendPoolID, newBackendPoolsIDs) - if err != nil { - return err - } - if !isSameLB { - klog.V(4).Infof("VMSS %q has already been added to LB %q, omit adding it to a new one", vmSetName, oldLBName) - return nil + + // The backendPoolID has already been found from existing LoadBalancerBackendAddressPools. + if foundPool { + return nil + } + + if ss.useStandardLoadBalancer() && len(newBackendPools) > 0 { + // Although standard load balancer supports backends from multiple scale + // sets, the same network interface couldn't be added to more than one load balancer of + // the same type. Omit those nodes (e.g. masters) so Azure ARM won't complain + // about this. + newBackendPoolsIDs := make([]string, 0, len(newBackendPools)) + for _, pool := range newBackendPools { + if pool.ID != nil { + newBackendPoolsIDs = append(newBackendPoolsIDs, *pool.ID) } } - - newBackendPools = append(newBackendPools, - compute.SubResource{ - ID: to.StringPtr(backendPoolID), - }) - primaryIPConfiguration.LoadBalancerBackendAddressPools = &newBackendPools - - err := ss.createOrUpdateVMSS(service, virtualMachineScaleSet) + isSameLB, oldLBName, err := isBackendPoolOnSameLB(backendPoolID, newBackendPoolsIDs) if err != nil { return err } + if !isSameLB { + klog.V(4).Infof("Node %q has already been added to LB %q, omit adding it to a new one", nodeName, oldLBName) + return nil + } } - // Update instances to latest VMSS model. - vmInstanceIDs := compute.VirtualMachineScaleSetVMInstanceRequiredIDs{ - InstanceIds: &instanceIDs, + // Compose a new vmssVM with added backendPoolID. + newBackendPools = append(newBackendPools, + compute.SubResource{ + ID: to.StringPtr(backendPoolID), + }) + primaryIPConfiguration.LoadBalancerBackendAddressPools = &newBackendPools + newVM := compute.VirtualMachineScaleSetVM{ + Sku: vm.Sku, + Location: vm.Location, + VirtualMachineScaleSetVMProperties: &compute.VirtualMachineScaleSetVMProperties{ + HardwareProfile: vm.HardwareProfile, + NetworkProfileConfiguration: &compute.VirtualMachineScaleSetVMNetworkProfileConfiguration{ + NetworkInterfaceConfigurations: &networkInterfaceConfigurations, + }, + }, } - err = ss.updateVMSSInstances(service, vmSetName, vmInstanceIDs) + + // Get the node resource group. + nodeResourceGroup, err := ss.GetNodeResourceGroup(vmName) if err != nil { return err } - return nil + // Invalidate the cache since we would update it. + key := buildVmssCacheKey(nodeResourceGroup, ss.makeVmssVMName(ssName, instanceID)) + defer ss.vmssVMCache.Delete(key) + + // Update vmssVM with backoff. + ctx, cancel := getContextWithCancel() + defer cancel() + klog.V(2).Infof("EnsureHostInPool begins to update vmssVM(%s) with new backendPoolID %s", vmName, backendPoolID) + resp, err := ss.VirtualMachineScaleSetVMsClient.Update(ctx, nodeResourceGroup, ssName, instanceID, newVM) + if ss.CloudProviderBackoff && shouldRetryHTTPRequest(resp, err) { + klog.V(2).Infof("EnsureHostInPool update backing off vmssVM(%s) with new backendPoolID %s, err: %v", vmName, backendPoolID, err) + retryErr := ss.UpdateVmssVMWithRetry(nodeResourceGroup, ssName, instanceID, newVM) + if retryErr != nil { + err = retryErr + klog.Errorf("EnsureHostInPool update abort backoff vmssVM(%s) with new backendPoolID %s, err: %v", vmName, backendPoolID, err) + } + } + + return err } // EnsureHostsInPool ensures the given Node's primary IP configurations are // participating in the specified LoadBalancer Backend Pool. func (ss *scaleSet) EnsureHostsInPool(service *v1.Service, nodes []*v1.Node, backendPoolID string, vmSetName string, isInternal bool) error { - serviceName := getServiceName(service) - scalesets, standardNodes, err := ss.getNodesScaleSets(nodes) - if err != nil { - klog.Errorf("getNodesScaleSets() for service %q failed: %v", serviceName, err) - return err - } + hostUpdates := make([]func() error, 0, len(nodes)) + for _, node := range nodes { + localNodeName := node.Name - for ssName, instanceIDs := range scalesets { - // Only add nodes belonging to specified vmSet for basic SKU LB. - if !ss.useStandardLoadBalancer() && !strings.EqualFold(ssName, vmSetName) { + if ss.useStandardLoadBalancer() && ss.excludeMasterNodesFromStandardLB() && isMasterNode(node) { + klog.V(4).Infof("Excluding master node %q from load balancer backendpool %q", localNodeName, backendPoolID) continue } - if instanceIDs.Len() == 0 { - // This may happen when scaling a vmss capacity to 0. - klog.V(3).Infof("scale set %q has 0 nodes, adding it to load balancer anyway", ssName) - // InstanceIDs is required to update vmss, use * instead here since there are no nodes actually. - instanceIDs.Insert("*") + if ss.ShouldNodeExcludedFromLoadBalancer(node) { + klog.V(4).Infof("Excluding unmanaged/external-resource-group node %q", localNodeName) + continue } - err := ss.ensureHostsInVMSetPool(service, backendPoolID, ssName, instanceIDs.List(), isInternal) - if err != nil { - klog.Errorf("ensureHostsInVMSetPool() with scaleSet %q for service %q failed: %v", ssName, serviceName, err) - return err + f := func() error { + // VMAS nodes should also be added to the SLB backends. + if ss.useStandardLoadBalancer() { + // Check whether the node is VMAS virtual machine. + managedByAS, err := ss.isNodeManagedByAvailabilitySet(localNodeName) + if err != nil { + klog.Errorf("Failed to check isNodeManagedByAvailabilitySet(%s): %v", localNodeName, err) + return err + } + if managedByAS { + return ss.availabilitySet.EnsureHostInPool(service, types.NodeName(localNodeName), backendPoolID, vmSetName, isInternal) + } + } + + err := ss.EnsureHostInPool(service, types.NodeName(localNodeName), backendPoolID, vmSetName, isInternal) + if err != nil { + return fmt.Errorf("EnsureHostInPool(%s): backendPoolID(%s) - failed to ensure host in pool: %q", getServiceName(service), backendPoolID, err) + } + return nil } + hostUpdates = append(hostUpdates, f) } - if ss.useStandardLoadBalancer() && len(standardNodes) > 0 { - err := ss.availabilitySet.EnsureHostsInPool(service, standardNodes, backendPoolID, "", isInternal) - if err != nil { - klog.Errorf("availabilitySet.EnsureHostsInPool() for service %q failed: %v", serviceName, err) - return err - } + errs := utilerrors.AggregateGoroutines(hostUpdates...) + if errs != nil { + return utilerrors.Flatten(errs) } return nil } -// ensureScaleSetBackendPoolDeleted ensures the loadBalancer backendAddressPools deleted from the specified scaleset. -func (ss *scaleSet) ensureScaleSetBackendPoolDeleted(service *v1.Service, poolID, ssName string) error { - klog.V(3).Infof("ensuring backend pool %q deleted from scaleset %q", poolID, ssName) - virtualMachineScaleSet, exists, err := ss.getScaleSet(service, ssName) +// ensureBackendPoolDeletedFromNode ensures the loadBalancer backendAddressPools deleted from the specified node. +func (ss *scaleSet) ensureBackendPoolDeletedFromNode(service *v1.Service, nodeName, backendPoolID string) error { + ssName, instanceID, vm, err := ss.getVmssVM(nodeName) if err != nil { - klog.Errorf("ss.ensureScaleSetBackendPoolDeleted(%s, %s) getScaleSet(%s) failed: %v", poolID, ssName, ssName, err) return err } - if !exists { - klog.V(2).Infof("ss.ensureScaleSetBackendPoolDeleted(%s, %s), scale set %s has already been non-exist", poolID, ssName, ssName) - return nil - } // Find primary network interface configuration. - networkConfigureList := virtualMachineScaleSet.VirtualMachineProfile.NetworkProfile.NetworkInterfaceConfigurations - primaryNetworkConfiguration, err := ss.getPrimaryNetworkConfiguration(networkConfigureList, ssName) + networkInterfaceConfigurations := *vm.NetworkProfileConfiguration.NetworkInterfaceConfigurations + primaryNetworkInterfaceConfiguration, err := ss.getPrimarynetworkInterfaceConfiguration(networkInterfaceConfigurations, nodeName) if err != nil { return err } - // Find primary IP configuration. - primaryIPConfiguration, err := ss.getPrimaryIPConfigForScaleSet(primaryNetworkConfiguration, ssName) + // Find primary IP configuration.4 + primaryIPConfiguration, err := ss.getPrimaryIPConfigForScaleSet(primaryNetworkInterfaceConfiguration, nodeName) if err != nil { return err } - - // Construct new loadBalancerBackendAddressPools and remove backendAddressPools from primary IP configuration. if primaryIPConfiguration.LoadBalancerBackendAddressPools == nil || len(*primaryIPConfiguration.LoadBalancerBackendAddressPools) == 0 { return nil } + + // Construct new loadBalancerBackendAddressPools and remove backendAddressPools from primary IP configuration. existingBackendPools := *primaryIPConfiguration.LoadBalancerBackendAddressPools newBackendPools := []compute.SubResource{} foundPool := false for i := len(existingBackendPools) - 1; i >= 0; i-- { curPool := existingBackendPools[i] - if strings.EqualFold(poolID, *curPool.ID) { - klog.V(10).Infof("ensureScaleSetBackendPoolDeleted gets unwanted backend pool %q for scale set %q", poolID, ssName) + if strings.EqualFold(backendPoolID, *curPool.ID) { + klog.V(10).Infof("ensureBackendPoolDeletedFromNode gets unwanted backend pool %q for node %s", backendPoolID, nodeName) foundPool = true newBackendPools = append(existingBackendPools[:i], existingBackendPools[i+1:]...) } } + + // Pool not found, assume it has been already removed. if !foundPool { - // Pool not found, assume it has been already removed. return nil } - // Update scale set with backoff. + // Compose a new vmssVM with added backendPoolID. primaryIPConfiguration.LoadBalancerBackendAddressPools = &newBackendPools - klog.V(3).Infof("VirtualMachineScaleSetsClient.CreateOrUpdate: scale set (%s) - updating", ssName) - err = ss.createOrUpdateVMSS(service, virtualMachineScaleSet) + newVM := compute.VirtualMachineScaleSetVM{ + Sku: vm.Sku, + Location: vm.Location, + VirtualMachineScaleSetVMProperties: &compute.VirtualMachineScaleSetVMProperties{ + HardwareProfile: vm.HardwareProfile, + NetworkProfileConfiguration: &compute.VirtualMachineScaleSetVMNetworkProfileConfiguration{ + NetworkInterfaceConfigurations: &networkInterfaceConfigurations, + }, + }, + } + + // Get the node resource group. + nodeResourceGroup, err := ss.GetNodeResourceGroup(nodeName) if err != nil { return err } - // Update instances to latest VMSS model. - instanceIDs := []string{"*"} - vmInstanceIDs := compute.VirtualMachineScaleSetVMInstanceRequiredIDs{ - InstanceIds: &instanceIDs, - } - err = ss.updateVMSSInstances(service, ssName, vmInstanceIDs) - if err != nil { - return err - } + // Invalidate the cache since we would update it. + key := buildVmssCacheKey(nodeResourceGroup, ss.makeVmssVMName(ssName, instanceID)) + defer ss.vmssVMCache.Delete(key) - // Update virtualMachineScaleSet again. This is a workaround for removing VMSS reference from LB. - // TODO: remove this workaround when figuring out the root cause. - if len(newBackendPools) == 0 { - err = ss.createOrUpdateVMSS(service, virtualMachineScaleSet) - if err != nil { - klog.V(2).Infof("VirtualMachineScaleSetsClient.CreateOrUpdate abort backoff: scale set (%s) - updating", ssName) + // Update vmssVM with backoff. + ctx, cancel := getContextWithCancel() + defer cancel() + klog.V(2).Infof("ensureBackendPoolDeletedFromNode begins to update vmssVM(%s) with backendPoolID %s", nodeName, backendPoolID) + resp, err := ss.VirtualMachineScaleSetVMsClient.Update(ctx, nodeResourceGroup, ssName, instanceID, newVM) + if ss.CloudProviderBackoff && shouldRetryHTTPRequest(resp, err) { + klog.V(2).Infof("ensureBackendPoolDeletedFromNode update backing off vmssVM(%s) with backendPoolID %s, err: %v", nodeName, backendPoolID, err) + retryErr := ss.UpdateVmssVMWithRetry(nodeResourceGroup, ssName, instanceID, newVM) + if retryErr != nil { + err = retryErr + klog.Errorf("ensureBackendPoolDeletedFromNode update abort backoff vmssVM(%s) with backendPoolID %s, err: %v", nodeName, backendPoolID, err) } } - - return nil + if err != nil { + klog.Errorf("ensureBackendPoolDeletedFromNode failed to update vmssVM(%s) with backendPoolID %s: %v", nodeName, backendPoolID, err) + } else { + klog.V(2).Infof("ensureBackendPoolDeletedFromNode update vmssVM(%s) with backendPoolID %s succeeded", nodeName, backendPoolID) + } + return err } -// EnsureBackendPoolDeleted ensures the loadBalancer backendAddressPools deleted from the specified vmSet. -func (ss *scaleSet) EnsureBackendPoolDeleted(service *v1.Service, poolID, vmSetName string, backendAddressPools *[]network.BackendAddressPool) error { +// getNodeNameByIPConfigurationID gets the node name by IP configuration ID. +func (ss *scaleSet) getNodeNameByIPConfigurationID(ipConfigurationID string) (string, error) { + matches := vmssIPConfigurationRE.FindStringSubmatch(ipConfigurationID) + if len(matches) != 4 { + klog.V(4).Infof("Can not extract scale set name from ipConfigurationID (%s), assuming it is mananaged by availability set", ipConfigurationID) + return "", ErrorNotVmssInstance + } + + resourceGroup := matches[1] + scaleSetName := matches[2] + instanceID := matches[3] + vm, err := ss.getVmssVMByInstanceID(resourceGroup, scaleSetName, instanceID) + if err != nil { + return "", err + } + + if vm.OsProfile != nil && vm.OsProfile.ComputerName != nil { + return strings.ToLower(*vm.OsProfile.ComputerName), nil + } + + return "", nil +} + +// EnsureBackendPoolDeleted ensures the loadBalancer backendAddressPools deleted from the specified nodes. +func (ss *scaleSet) EnsureBackendPoolDeleted(service *v1.Service, backendPoolID, vmSetName string, backendAddressPools *[]network.BackendAddressPool) error { + // Returns nil if backend address pools already deleted. if backendAddressPools == nil { return nil } - scalesets := sets.NewString() + ipConfigurationIDs := []string{} for _, backendPool := range *backendAddressPools { - if strings.EqualFold(*backendPool.ID, poolID) && backendPool.BackendIPConfigurations != nil { - for _, ipConfigurations := range *backendPool.BackendIPConfigurations { - if ipConfigurations.ID == nil { + if strings.EqualFold(*backendPool.ID, backendPoolID) && backendPool.BackendIPConfigurations != nil { + for _, ipConf := range *backendPool.BackendIPConfigurations { + if ipConf.ID == nil { continue } - ssName, err := extractScaleSetNameByProviderID(*ipConfigurations.ID) - if err != nil { - klog.V(4).Infof("backend IP configuration %q is not belonging to any vmss, omit it", *ipConfigurations.ID) - continue - } - - scalesets.Insert(ssName) + ipConfigurationIDs = append(ipConfigurationIDs, *ipConf.ID) } - break } } - for ssName := range scalesets { - // Only remove nodes belonging to specified vmSet to basic LB backends. - if !ss.useStandardLoadBalancer() && !strings.EqualFold(ssName, vmSetName) { - continue - } + hostUpdates := make([]func() error, 0, len(ipConfigurationIDs)) + for i := range ipConfigurationIDs { + ipConfigurationID := ipConfigurationIDs[i] - err := ss.ensureScaleSetBackendPoolDeleted(service, poolID, ssName) - if err != nil { - klog.Errorf("ensureScaleSetBackendPoolDeleted() with scaleSet %q failed: %v", ssName, err) - return err + f := func() error { + if scaleSetName, err := extractScaleSetNameByProviderID(ipConfigurationID); err == nil { + // Only remove nodes belonging to specified vmSet to basic LB backends. + if !ss.useStandardLoadBalancer() && !strings.EqualFold(scaleSetName, vmSetName) { + return nil + } + } + + nodeName, err := ss.getNodeNameByIPConfigurationID(ipConfigurationID) + if err != nil { + if err == ErrorNotVmssInstance { // Do nothing for the VMAS nodes. + return nil + } + klog.Errorf("Failed to getNodeNameByIPConfigurationID(%s): %v", ipConfigurationID, err) + return err + } + + err = ss.ensureBackendPoolDeletedFromNode(service, nodeName, backendPoolID) + if err != nil { + return fmt.Errorf("failed to ensure backend pool %s deleted from node %s: %v", backendPoolID, nodeName, err) + } + + return nil } + hostUpdates = append(hostUpdates, f) + } + + errs := utilerrors.AggregateGoroutines(hostUpdates...) + if errs != nil { + return utilerrors.Flatten(errs) } return nil } - -// getVmssMachineID returns the full identifier of a vmss virtual machine. -func (az *Cloud) getVmssMachineID(resourceGroup, scaleSetName, instanceID string) string { - return fmt.Sprintf( - vmssMachineIDTemplate, - az.SubscriptionID, - strings.ToLower(resourceGroup), - scaleSetName, - instanceID) -} From 250745452e71a675fff2b3b341b2e0844d773b86 Mon Sep 17 00:00:00 2001 From: Pengfei Ni Date: Tue, 16 Apr 2019 16:49:30 +0800 Subject: [PATCH 3/6] Cleanup codes that not required any more --- .../providers/azure/azure_client.go | 25 ------- .../providers/azure/azure_vmss.go | 74 ------------------- 2 files changed, 99 deletions(-) diff --git a/pkg/cloudprovider/providers/azure/azure_client.go b/pkg/cloudprovider/providers/azure/azure_client.go index 22f80f0ccf..7870285348 100644 --- a/pkg/cloudprovider/providers/azure/azure_client.go +++ b/pkg/cloudprovider/providers/azure/azure_client.go @@ -91,7 +91,6 @@ type SecurityGroupsClient interface { type VirtualMachineScaleSetsClient interface { Get(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result compute.VirtualMachineScaleSet, err error) List(ctx context.Context, resourceGroupName string) (result []compute.VirtualMachineScaleSet, err error) - UpdateInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) (resp *http.Response, err error) } // VirtualMachineScaleSetVMsClient defines needed functions for azure compute.VirtualMachineScaleSetVMsClient @@ -881,30 +880,6 @@ func (az *azVirtualMachineScaleSetsClient) List(ctx context.Context, resourceGro return result, nil } -func (az *azVirtualMachineScaleSetsClient) UpdateInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) (resp *http.Response, err error) { - /* Write rate limiting */ - if !az.rateLimiterWriter.TryAccept() { - err = createRateLimitErr(true, "VMSSUpdateInstances") - return - } - - klog.V(10).Infof("azVirtualMachineScaleSetsClient.UpdateInstances(%q,%q,%v): start", resourceGroupName, VMScaleSetName, VMInstanceIDs) - defer func() { - klog.V(10).Infof("azVirtualMachineScaleSetsClient.UpdateInstances(%q,%q,%v): end", resourceGroupName, VMScaleSetName, VMInstanceIDs) - }() - - mc := newMetricContext("vmss", "update_instances", resourceGroupName, az.client.SubscriptionID) - future, err := az.client.UpdateInstances(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) - mc.Observe(err) - if err != nil { - return future.Response(), err - } - - err = future.WaitForCompletionRef(ctx, az.client.Client) - mc.Observe(err) - return future.Response(), err -} - // azVirtualMachineScaleSetVMsClient implements VirtualMachineScaleSetVMsClient. type azVirtualMachineScaleSetVMsClient struct { client compute.VirtualMachineScaleSetVMsClient diff --git a/pkg/cloudprovider/providers/azure/azure_vmss.go b/pkg/cloudprovider/providers/azure/azure_vmss.go index 8d101f7bdb..ae3aa81871 100644 --- a/pkg/cloudprovider/providers/azure/azure_vmss.go +++ b/pkg/cloudprovider/providers/azure/azure_vmss.go @@ -31,7 +31,6 @@ import ( "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" utilerrors "k8s.io/apimachinery/pkg/util/errors" - "k8s.io/apimachinery/pkg/util/wait" cloudprovider "k8s.io/cloud-provider" "k8s.io/klog" ) @@ -580,55 +579,6 @@ func (ss *scaleSet) GetPrimaryInterface(nodeName string) (network.Interface, err return nic, nil } -// getScaleSet gets scale set with exponential backoff retry -func (ss *scaleSet) getScaleSet(service *v1.Service, name string) (compute.VirtualMachineScaleSet, bool, error) { - if ss.Config.shouldOmitCloudProviderBackoff() { - var result compute.VirtualMachineScaleSet - var exists bool - - cached, err := ss.vmssCache.Get(name) - if err != nil { - ss.Event(service, v1.EventTypeWarning, "GetVirtualMachineScaleSet", err.Error()) - klog.Errorf("backoff: failure for scale set %q, will retry,err=%v", name, err) - return result, false, nil - } - - if cached != nil { - exists = true - result = *(cached.(*compute.VirtualMachineScaleSet)) - } - - return result, exists, err - } - - return ss.getScaleSetWithRetry(service, name) -} - -// getScaleSetWithRetry gets scale set with exponential backoff retry -func (ss *scaleSet) getScaleSetWithRetry(service *v1.Service, name string) (compute.VirtualMachineScaleSet, bool, error) { - var result compute.VirtualMachineScaleSet - var exists bool - - err := wait.ExponentialBackoff(ss.requestBackoff(), func() (bool, error) { - cached, retryErr := ss.vmssCache.Get(name) - if retryErr != nil { - ss.Event(service, v1.EventTypeWarning, "GetVirtualMachineScaleSet", retryErr.Error()) - klog.Errorf("backoff: failure for scale set %q, will retry,err=%v", name, retryErr) - return false, nil - } - klog.V(4).Infof("backoff: success for scale set %q", name) - - if cached != nil { - exists = true - result = *(cached.(*compute.VirtualMachineScaleSet)) - } - - return true, nil - }) - - return result, exists, err -} - // getPrimarynetworkInterfaceConfiguration gets primary network interface configuration for scale set virtual machine. func (ss *scaleSet) getPrimarynetworkInterfaceConfiguration(networkConfigurations []compute.VirtualMachineScaleSetNetworkConfiguration, nodeName string) (*compute.VirtualMachineScaleSetNetworkConfiguration, error) { if len(networkConfigurations) == 1 { @@ -661,30 +611,6 @@ func (ss *scaleSet) getPrimaryIPConfigForScaleSet(config *compute.VirtualMachine return nil, fmt.Errorf("failed to find a primary IP configuration for the scale set VM %q", nodeName) } -// updateVMSSInstances invokes ss.VirtualMachineScaleSetsClient.UpdateInstances with exponential backoff retry. -func (ss *scaleSet) updateVMSSInstances(service *v1.Service, scaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) error { - if ss.Config.shouldOmitCloudProviderBackoff() { - ctx, cancel := getContextWithCancel() - defer cancel() - resp, err := ss.VirtualMachineScaleSetsClient.UpdateInstances(ctx, ss.ResourceGroup, scaleSetName, vmInstanceIDs) - klog.V(10).Infof("VirtualMachineScaleSetsClient.UpdateInstances(%s): end", scaleSetName) - return ss.processHTTPResponse(service, "CreateOrUpdateVMSSInstance", resp, err) - } - - return ss.updateVMSSInstancesWithRetry(service, scaleSetName, vmInstanceIDs) -} - -// updateVMSSInstancesWithRetry invokes ss.VirtualMachineScaleSetsClient.UpdateInstances with exponential backoff retry. -func (ss *scaleSet) updateVMSSInstancesWithRetry(service *v1.Service, scaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) error { - return wait.ExponentialBackoff(ss.requestBackoff(), func() (bool, error) { - ctx, cancel := getContextWithCancel() - defer cancel() - resp, err := ss.VirtualMachineScaleSetsClient.UpdateInstances(ctx, ss.ResourceGroup, scaleSetName, vmInstanceIDs) - klog.V(10).Infof("VirtualMachineScaleSetsClient.UpdateInstances(%s): end", scaleSetName) - return ss.processHTTPRetryResponse(service, "CreateOrUpdateVMSSInstance", resp, err) - }) -} - // EnsureHostInPool ensures the given VM's Primary NIC's Primary IP Configuration is // participating in the specified LoadBalancer Backend Pool. func (ss *scaleSet) EnsureHostInPool(service *v1.Service, nodeName types.NodeName, backendPoolID string, vmSetName string, isInternal bool) error { From d32c2d5829e32ba114f104a66ad7133f2c949178 Mon Sep 17 00:00:00 2001 From: Pengfei Ni Date: Tue, 16 Apr 2019 17:19:04 +0800 Subject: [PATCH 4/6] Add unit tests --- .../providers/azure/azure_vmss_test.go | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/pkg/cloudprovider/providers/azure/azure_vmss_test.go b/pkg/cloudprovider/providers/azure/azure_vmss_test.go index e963a854dc..b1d818c56f 100644 --- a/pkg/cloudprovider/providers/azure/azure_vmss_test.go +++ b/pkg/cloudprovider/providers/azure/azure_vmss_test.go @@ -80,6 +80,21 @@ func setTestVirtualMachineCloud(ss *Cloud, scaleSetName, zone string, faultDomai ID: &interfaceID, }, } + ipConfigurations := []compute.VirtualMachineScaleSetIPConfiguration{ + { + Name: to.StringPtr("ipconfig1"), + VirtualMachineScaleSetIPConfigurationProperties: &compute.VirtualMachineScaleSetIPConfigurationProperties{}, + }, + } + networkConfigurations := []compute.VirtualMachineScaleSetNetworkConfiguration{ + { + Name: to.StringPtr("ipconfig1"), + ID: to.StringPtr("fakeNetworkConfiguration"), + VirtualMachineScaleSetNetworkConfigurationProperties: &compute.VirtualMachineScaleSetNetworkConfigurationProperties{ + IPConfigurations: &ipConfigurations, + }, + }, + } vmssVM := compute.VirtualMachineScaleSetVM{ VirtualMachineScaleSetVMProperties: &compute.VirtualMachineScaleSetVMProperties{ OsProfile: &compute.OSProfile{ @@ -88,6 +103,9 @@ func setTestVirtualMachineCloud(ss *Cloud, scaleSetName, zone string, faultDomai NetworkProfile: &compute.NetworkProfile{ NetworkInterfaces: &networkInterfaces, }, + NetworkProfileConfiguration: &compute.VirtualMachineScaleSetVMNetworkProfileConfiguration{ + NetworkInterfaceConfigurations: &networkConfigurations, + }, InstanceView: &compute.VirtualMachineScaleSetVMInstanceView{ PlatformFaultDomain: &faultDomain, }, @@ -307,3 +325,52 @@ func TestGetIPByNodeName(t *testing.T) { assert.Equal(t, test.expected, []string{privateIP, publicIP}, test.description) } } + +func TestGetNodeNameByIPConfigurationID(t *testing.T) { + ipConfigurationIDTemplate := "/subscriptions/script/resourceGroups/rg/providers/Microsoft.Compute/virtualMachineScaleSets/%s/virtualMachines/%s/networkInterfaces/%s/ipConfigurations/ipconfig1" + + testCases := []struct { + description string + scaleSet string + vmList []string + ipConfigurationID string + expected string + expectError bool + }{ + { + description: "getNodeNameByIPConfigurationID should get node's Name when the node is existing", + scaleSet: "scaleset1", + ipConfigurationID: fmt.Sprintf(ipConfigurationIDTemplate, "scaleset1", "0", "scaleset1"), + vmList: []string{"vmssee6c2000000", "vmssee6c2000001"}, + expected: "vmssee6c2000000", + }, + { + description: "getNodeNameByIPConfigurationID should return error for non-exist nodes", + scaleSet: "scaleset2", + ipConfigurationID: fmt.Sprintf(ipConfigurationIDTemplate, "scaleset2", "3", "scaleset1"), + vmList: []string{"vmssee6c2000002", "vmssee6c2000003"}, + expectError: true, + }, + { + description: "getNodeNameByIPConfigurationID should return error for wrong ipConfigurationID", + scaleSet: "scaleset3", + ipConfigurationID: "invalid-configuration-id", + vmList: []string{"vmssee6c2000004", "vmssee6c2000005"}, + expectError: true, + }, + } + + for _, test := range testCases { + ss, err := newTestScaleSet(test.scaleSet, "", 0, test.vmList) + assert.NoError(t, err, test.description) + + nodeName, err := ss.getNodeNameByIPConfigurationID(test.ipConfigurationID) + if test.expectError { + assert.Error(t, err, test.description) + continue + } + + assert.NoError(t, err, test.description) + assert.Equal(t, test.expected, nodeName, test.description) + } +} From 0bbf72c456b502b226d635a59398ea444d1282c2 Mon Sep 17 00:00:00 2001 From: Pengfei Ni Date: Sun, 21 Apr 2019 18:33:27 +0800 Subject: [PATCH 5/6] Update vendors --- Godeps/Godeps.json | 26 +- Godeps/LICENSES | 2 +- vendor/BUILD | 2 +- .../{2018-10-01 => 2019-03-01}/compute/BUILD | 4 +- .../compute/availabilitysets.go | 14 +- .../compute/client.go | 0 .../compute/containerservices.go | 8 - .../compute/disks.go | 48 +--- .../compute/galleries.go | 18 +- .../compute/galleryimages.go | 16 +- .../compute/galleryimageversions.go | 16 +- .../compute/images.go | 24 +- .../compute/loganalytics.go | 12 +- .../compute/models.go | 263 +++++++++++++---- .../compute/operations.go | 2 +- .../compute/resourceskus.go | 0 .../compute/snapshots.go | 48 +--- .../compute/usage.go | 2 +- .../compute/version.go | 2 +- .../compute/virtualmachineextensionimages.go | 6 +- .../compute/virtualmachineextensions.go | 22 +- .../compute/virtualmachineimages.go | 10 +- .../compute/virtualmachineruncommands.go | 4 +- .../compute/virtualmachines.go | 269 +++++++++++++----- .../virtualmachinescalesetextensions.go | 16 +- .../virtualmachinescalesetrollingupgrades.go | 20 +- .../compute/virtualmachinescalesets.go | 185 ++++++------ .../compute/virtualmachinescalesetvms.go | 98 +++---- .../compute/virtualmachinesizes.go | 2 +- .../Azure/azure-sdk-for-go/version/version.go | 2 +- 30 files changed, 639 insertions(+), 502 deletions(-) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/BUILD (95%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/availabilitysets.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/client.go (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/containerservices.go (98%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/disks.go (93%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/galleries.go (97%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/galleryimages.go (97%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/galleryimageversions.go (97%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/images.go (96%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/loganalytics.go (96%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/models.go (96%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/operations.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/resourceskus.go (100%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/snapshots.go (93%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/usage.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/version.go (94%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/virtualmachineextensionimages.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/virtualmachineextensions.go (96%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/virtualmachineimages.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/virtualmachineruncommands.go (99%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/virtualmachines.go (86%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/virtualmachinescalesetextensions.go (97%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/virtualmachinescalesetrollingupgrades.go (96%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/virtualmachinescalesets.go (93%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/virtualmachinescalesetvms.go (95%) rename vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/{2018-10-01 => 2019-03-01}/compute/virtualmachinesizes.go (99%) diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index 4d4643db0b..c56a9acdb6 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -36,34 +36,34 @@ "Rev": "3b1ae45394a234c385be014e9a488f2bb6eef821" }, { - "ImportPath": "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute", - "Comment": "v21.3.0", - "Rev": "da91af54816b4cf72949c225a2d0980f51fab01b" + "ImportPath": "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute", + "Comment": "v21.4.0", + "Rev": "32916f57ad7b421f5fdaab86b73a795632fff117" }, { "ImportPath": "github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry", - "Comment": "v21.3.0", - "Rev": "da91af54816b4cf72949c225a2d0980f51fab01b" + "Comment": "v21.4.0", + "Rev": "32916f57ad7b421f5fdaab86b73a795632fff117" }, { "ImportPath": "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network", - "Comment": "v21.3.0", - "Rev": "da91af54816b4cf72949c225a2d0980f51fab01b" + "Comment": "v21.4.0", + "Rev": "32916f57ad7b421f5fdaab86b73a795632fff117" }, { "ImportPath": "github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage", - "Comment": "v21.3.0", - "Rev": "da91af54816b4cf72949c225a2d0980f51fab01b" + "Comment": "v21.4.0", + "Rev": "32916f57ad7b421f5fdaab86b73a795632fff117" }, { "ImportPath": "github.com/Azure/azure-sdk-for-go/storage", - "Comment": "v21.3.0", - "Rev": "da91af54816b4cf72949c225a2d0980f51fab01b" + "Comment": "v21.4.0", + "Rev": "32916f57ad7b421f5fdaab86b73a795632fff117" }, { "ImportPath": "github.com/Azure/azure-sdk-for-go/version", - "Comment": "v21.3.0", - "Rev": "da91af54816b4cf72949c225a2d0980f51fab01b" + "Comment": "v21.4.0", + "Rev": "32916f57ad7b421f5fdaab86b73a795632fff117" }, { "ImportPath": "github.com/Azure/go-ansiterm", diff --git a/Godeps/LICENSES b/Godeps/LICENSES index 6887574bee..eab3324eb0 100644 --- a/Godeps/LICENSES +++ b/Godeps/LICENSES @@ -8692,7 +8692,7 @@ SOFTWARE. ================================================================================ -= vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute licensed under: = += vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute licensed under: = Apache License diff --git a/vendor/BUILD b/vendor/BUILD index ffa563d7b1..357a00612a 100644 --- a/vendor/BUILD +++ b/vendor/BUILD @@ -12,7 +12,7 @@ filegroup( "//vendor/bitbucket.org/bertimus9/systemstat:all-srcs", "//vendor/cloud.google.com/go/compute/metadata:all-srcs", "//vendor/cloud.google.com/go/internal:all-srcs", - "//vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute:all-srcs", + "//vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute:all-srcs", "//vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry:all-srcs", "//vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network:all-srcs", "//vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2018-07-01/storage:all-srcs", diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/BUILD b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/BUILD similarity index 95% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/BUILD rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/BUILD index efa5d228da..2f8fb9e769 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/BUILD +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/BUILD @@ -29,8 +29,8 @@ go_library( "virtualmachinescalesetvms.go", "virtualmachinesizes.go", ], - importmap = "k8s.io/kubernetes/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute", - importpath = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute", + importmap = "k8s.io/kubernetes/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute", + importpath = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute", visibility = ["//visibility:public"], deps = [ "//vendor/github.com/Azure/azure-sdk-for-go/version:go_default_library", diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/availabilitysets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/availabilitysets.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/availabilitysets.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/availabilitysets.go index afad9559b6..32a4301ee8 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/availabilitysets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/availabilitysets.go @@ -74,7 +74,7 @@ func (client AvailabilitySetsClient) CreateOrUpdatePreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -143,7 +143,7 @@ func (client AvailabilitySetsClient) DeletePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -209,7 +209,7 @@ func (client AvailabilitySetsClient) GetPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -275,7 +275,7 @@ func (client AvailabilitySetsClient) ListPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -370,7 +370,7 @@ func (client AvailabilitySetsClient) ListAvailableSizesPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -433,7 +433,7 @@ func (client AvailabilitySetsClient) ListBySubscriptionPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -528,7 +528,7 @@ func (client AvailabilitySetsClient) UpdatePreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/client.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/client.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/client.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/client.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/containerservices.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/containerservices.go similarity index 98% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/containerservices.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/containerservices.go index b16788bfa5..f29e552d66 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/containerservices.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/containerservices.go @@ -125,10 +125,6 @@ func (client ContainerServicesClient) CreateOrUpdateSender(req *http.Request) (f if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -199,10 +195,6 @@ func (client ContainerServicesClient) DeleteSender(req *http.Request) (future Co if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/disks.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/disks.go similarity index 93% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/disks.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/disks.go index 9cbbd79fd6..c15d270502 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/disks.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/disks.go @@ -55,16 +55,8 @@ func (client DisksClient) CreateOrUpdate(ctx context.Context, resourceGroupName 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}, - }}, - }}, + {Target: "disk.DiskProperties.EncryptionSettingsCollection", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "disk.DiskProperties.EncryptionSettingsCollection.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, }}}}}); err != nil { return result, validation.NewError("compute.DisksClient", "CreateOrUpdate", err.Error()) } @@ -92,7 +84,7 @@ func (client DisksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2018-09-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -116,10 +108,6 @@ func (client DisksClient) CreateOrUpdateSender(req *http.Request) (future DisksC if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -167,7 +155,7 @@ func (client DisksClient) DeletePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2018-09-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -189,10 +177,6 @@ func (client DisksClient) DeleteSender(req *http.Request) (future DisksDeleteFut if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -245,7 +229,7 @@ func (client DisksClient) GetPreparer(ctx context.Context, resourceGroupName str "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2018-09-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -315,7 +299,7 @@ func (client DisksClient) GrantAccessPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2018-09-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -339,10 +323,6 @@ func (client DisksClient) GrantAccessSender(req *http.Request) (future DisksGran if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -390,7 +370,7 @@ func (client DisksClient) ListPreparer(ctx context.Context) (*http.Request, erro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2018-09-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -483,7 +463,7 @@ func (client DisksClient) ListByResourceGroupPreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2018-09-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -573,7 +553,7 @@ func (client DisksClient) RevokeAccessPreparer(ctx context.Context, resourceGrou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2018-09-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -595,10 +575,6 @@ func (client DisksClient) RevokeAccessSender(req *http.Request) (future DisksRev if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -646,7 +622,7 @@ func (client DisksClient) UpdatePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2018-09-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -670,10 +646,6 @@ func (client DisksClient) UpdateSender(req *http.Request) (future DisksUpdateFut if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleries.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/galleries.go similarity index 97% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleries.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/galleries.go index bc55068685..15163b9d29 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleries.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/galleries.go @@ -69,7 +69,7 @@ func (client GalleriesClient) CreateOrUpdatePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -93,10 +93,6 @@ func (client GalleriesClient) CreateOrUpdateSender(req *http.Request) (future Ga if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -142,7 +138,7 @@ func (client GalleriesClient) DeletePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -164,10 +160,6 @@ func (client GalleriesClient) DeleteSender(req *http.Request) (future GalleriesD if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -218,7 +210,7 @@ func (client GalleriesClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -281,7 +273,7 @@ func (client GalleriesClient) ListPreparer(ctx context.Context) (*http.Request, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -374,7 +366,7 @@ func (client GalleriesClient) ListByResourceGroupPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleryimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/galleryimages.go similarity index 97% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleryimages.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/galleryimages.go index 670ea7ee29..59c93b275d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleryimages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/galleryimages.go @@ -85,7 +85,7 @@ func (client GalleryImagesClient) CreateOrUpdatePreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -109,10 +109,6 @@ func (client GalleryImagesClient) CreateOrUpdateSender(req *http.Request) (futur if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -160,7 +156,7 @@ func (client GalleryImagesClient) DeletePreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -182,10 +178,6 @@ func (client GalleryImagesClient) DeleteSender(req *http.Request) (future Galler if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -238,7 +230,7 @@ func (client GalleryImagesClient) GetPreparer(ctx context.Context, resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -306,7 +298,7 @@ func (client GalleryImagesClient) ListByGalleryPreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleryimageversions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/galleryimageversions.go similarity index 97% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleryimageversions.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/galleryimageversions.go index d179443ade..24be8d551d 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/galleryimageversions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/galleryimageversions.go @@ -82,7 +82,7 @@ func (client GalleryImageVersionsClient) CreateOrUpdatePreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -106,10 +106,6 @@ func (client GalleryImageVersionsClient) CreateOrUpdateSender(req *http.Request) if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -159,7 +155,7 @@ func (client GalleryImageVersionsClient) DeletePreparer(ctx context.Context, res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -181,10 +177,6 @@ func (client GalleryImageVersionsClient) DeleteSender(req *http.Request) (future if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -240,7 +232,7 @@ func (client GalleryImageVersionsClient) GetPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -314,7 +306,7 @@ func (client GalleryImageVersionsClient) ListByGalleryImagePreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/images.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/images.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/images.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/images.go index 2afe53551f..a7a32d5524 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/images.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/images.go @@ -68,7 +68,7 @@ func (client ImagesClient) CreateOrUpdatePreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -92,10 +92,6 @@ func (client ImagesClient) CreateOrUpdateSender(req *http.Request) (future Image if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -141,7 +137,7 @@ func (client ImagesClient) DeletePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -163,10 +159,6 @@ func (client ImagesClient) DeleteSender(req *http.Request) (future ImagesDeleteF if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -218,7 +210,7 @@ func (client ImagesClient) GetPreparer(ctx context.Context, resourceGroupName st "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -285,7 +277,7 @@ func (client ImagesClient) ListPreparer(ctx context.Context) (*http.Request, err "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -378,7 +370,7 @@ func (client ImagesClient) ListByResourceGroupPreparer(ctx context.Context, reso "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -467,7 +459,7 @@ func (client ImagesClient) UpdatePreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -491,10 +483,6 @@ func (client ImagesClient) UpdateSender(req *http.Request) (future ImagesUpdateF if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/loganalytics.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/loganalytics.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/loganalytics.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/loganalytics.go index f72c02202e..856ded45ab 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/loganalytics.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/loganalytics.go @@ -74,7 +74,7 @@ func (client LogAnalyticsClient) ExportRequestRateByIntervalPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -98,10 +98,6 @@ func (client LogAnalyticsClient) ExportRequestRateByIntervalSender(req *http.Req if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -153,7 +149,7 @@ func (client LogAnalyticsClient) ExportThrottledRequestsPreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -177,10 +173,6 @@ func (client LogAnalyticsClient) ExportThrottledRequestsSender(req *http.Request if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/models.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/models.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/models.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/models.go index 6499e4d052..cdb0aea0e6 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/models.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/models.go @@ -34,11 +34,13 @@ const ( None AccessLevel = "None" // Read ... Read AccessLevel = "Read" + // Write ... + Write AccessLevel = "Write" ) // PossibleAccessLevelValues returns an array of possible values for the AccessLevel const type. func PossibleAccessLevelValues() []AccessLevel { - return []AccessLevel{None, Read} + return []AccessLevel{None, Read, Write} } // AggregatedReplicationState enumerates the values for aggregated replication state. @@ -258,11 +260,13 @@ const ( Import DiskCreateOption = "Import" // Restore ... Restore DiskCreateOption = "Restore" + // Upload ... + Upload DiskCreateOption = "Upload" ) // PossibleDiskCreateOptionValues returns an array of possible values for the DiskCreateOption const type. func PossibleDiskCreateOptionValues() []DiskCreateOption { - return []DiskCreateOption{Attach, Copy, Empty, FromImage, Import, Restore} + return []DiskCreateOption{Attach, Copy, Empty, FromImage, Import, Restore, Upload} } // DiskCreateOptionTypes enumerates the values for disk create option types. @@ -282,6 +286,29 @@ func PossibleDiskCreateOptionTypesValues() []DiskCreateOptionTypes { return []DiskCreateOptionTypes{DiskCreateOptionTypesAttach, DiskCreateOptionTypesEmpty, DiskCreateOptionTypesFromImage} } +// DiskState enumerates the values for disk state. +type DiskState string + +const ( + // ActiveSAS ... + ActiveSAS DiskState = "ActiveSAS" + // ActiveUpload ... + ActiveUpload DiskState = "ActiveUpload" + // Attached ... + Attached DiskState = "Attached" + // ReadyToUpload ... + ReadyToUpload DiskState = "ReadyToUpload" + // Reserved ... + Reserved DiskState = "Reserved" + // Unattached ... + Unattached DiskState = "Unattached" +) + +// PossibleDiskStateValues returns an array of possible values for the DiskState const type. +func PossibleDiskStateValues() []DiskState { + return []DiskState{ActiveSAS, ActiveUpload, Attached, ReadyToUpload, Reserved, Unattached} +} + // DiskStorageAccountTypes enumerates the values for disk storage account types. type DiskStorageAccountTypes string @@ -318,6 +345,21 @@ func PossibleHostCachingValues() []HostCaching { return []HostCaching{HostCachingNone, HostCachingReadOnly, HostCachingReadWrite} } +// HyperVGeneration enumerates the values for hyper v generation. +type HyperVGeneration string + +const ( + // V1 ... + V1 HyperVGeneration = "V1" + // V2 ... + V2 HyperVGeneration = "V2" +) + +// PossibleHyperVGenerationValues returns an array of possible values for the HyperVGeneration const type. +func PossibleHyperVGenerationValues() []HyperVGeneration { + return []HyperVGeneration{V1, V2} +} + // InstanceViewTypes enumerates the values for instance view types. type InstanceViewTypes string @@ -692,6 +734,21 @@ func PossibleStatusLevelTypesValues() []StatusLevelTypes { return []StatusLevelTypes{Error, Info, Warning} } +// StorageAccountType enumerates the values for storage account type. +type StorageAccountType string + +const ( + // StorageAccountTypeStandardLRS ... + StorageAccountTypeStandardLRS StorageAccountType = "Standard_LRS" + // StorageAccountTypeStandardZRS ... + StorageAccountTypeStandardZRS StorageAccountType = "Standard_ZRS" +) + +// PossibleStorageAccountTypeValues returns an array of possible values for the StorageAccountType const type. +func PossibleStorageAccountTypeValues() []StorageAccountType { + return []StorageAccountType{StorageAccountTypeStandardLRS, StorageAccountTypeStandardZRS} +} + // StorageAccountTypes enumerates the values for storage account types. type StorageAccountTypes string @@ -1181,7 +1238,7 @@ type AdditionalUnattendContent struct { // APIEntityReference the API entity reference. type APIEntityReference struct { - // ID - The ARM resource id in the form of /subscriptions/{SubcriptionId}/resourceGroups/{ResourceGroupName}/... + // ID - The ARM resource id in the form of /subscriptions/{SubscriptionId}/resourceGroups/{ResourceGroupName}/... ID *string `json:"id,omitempty"` } @@ -1217,11 +1274,17 @@ type AutomaticOSUpgradePolicy struct { DisableAutomaticRollback *bool `json:"disableAutomaticRollback,omitempty"` } +// AutomaticOSUpgradeProperties describes automatic OS upgrade properties on the image. +type AutomaticOSUpgradeProperties struct { + // AutomaticOSUpgradeSupported - Specifies whether automatic OS upgrade is supported on the image. + AutomaticOSUpgradeSupported *bool `json:"automaticOSUpgradeSupported,omitempty"` +} + // AvailabilitySet specifies information about the availability set that the virtual machine should be assigned to. // Virtual machines specified in the same availability set are allocated to different nodes to maximize // availability. For more information about availability sets, see [Manage the availability of virtual // machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). -//

For more information on Azure planned maintainance, see [Planned maintenance for virtual machines in +//

For more information on Azure planned maintenance, see [Planned maintenance for virtual machines in // Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json) //

Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added // to an availability set. @@ -1529,9 +1592,8 @@ func (asu *AvailabilitySetUpdate) UnmarshalJSON(body []byte) error { } // BootDiagnostics boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot -// to diagnose VM status.

For Linux Virtual Machines, you can easily view the output of your console log. -//

For both Windows and Linux virtual machines, Azure also enables you to see a screenshot of the VM from -// the hypervisor. +// to diagnose VM status.

You can easily view the output of your console log.

Azure also enables +// you to see a screenshot of the VM from the hypervisor. type BootDiagnostics struct { // Enabled - Whether boot diagnostics should be enabled on the Virtual Machine. Enabled *bool `json:"enabled,omitempty"` @@ -1545,6 +1607,8 @@ type BootDiagnosticsInstanceView struct { ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` // SerialConsoleLogBlobURI - The Linux serial console log blob Uri. SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` + // Status - The boot diagnostics status information for the VM.

NOTE: It will be set only if there are errors encountered in enabling boot diagnostics. + Status *InstanceViewStatus `json:"status,omitempty"` } // CloudError an error response from the Gallery service. @@ -1671,7 +1735,7 @@ type ContainerServiceAgentPoolProfile struct { VMSize ContainerServiceVMSizeTypes `json:"vmSize,omitempty"` // DNSPrefix - DNS prefix to be used to create the FQDN for the agent pool. DNSPrefix *string `json:"dnsPrefix,omitempty"` - // Fqdn - FDQN for the agent pool. + // Fqdn - FQDN for the agent pool. Fqdn *string `json:"fqdn,omitempty"` } @@ -1803,7 +1867,7 @@ type ContainerServiceMasterProfile struct { Count *int32 `json:"count,omitempty"` // DNSPrefix - DNS prefix to be used to create the FQDN for master. DNSPrefix *string `json:"dnsPrefix,omitempty"` - // Fqdn - FDQN for the master. + // Fqdn - FQDN for the master. Fqdn *string `json:"fqdn,omitempty"` } @@ -1926,7 +1990,7 @@ type ContainerServiceWindowsProfile struct { // CreationData data used when creating a disk. type CreationData struct { - // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', 'Restore' + // CreateOption - This enumerates the possible sources of a disk's creation. Possible values include: 'Empty', 'Attach', 'FromImage', 'Import', 'Copy', 'Restore', 'Upload' CreateOption DiskCreateOption `json:"createOption,omitempty"` // StorageAccountID - If createOption is Import, the Azure Resource Manager identifier of the storage account containing the blob to import as a disk. Required only if the blob is in a different subscription StorageAccountID *string `json:"storageAccountId,omitempty"` @@ -1968,14 +2032,14 @@ type DataDiskImage struct { // DiagnosticsProfile specifies the boot diagnostic settings state.

Minimum api-version: 2015-06-15. type DiagnosticsProfile struct { - // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

For Linux Virtual Machines, you can easily view the output of your console log.

For both Windows and Linux virtual machines, Azure also enables you to see a screenshot of the VM from the hypervisor. + // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

You can easily view the output of your console log.

Azure also enables you to see a screenshot of the VM from the hypervisor. BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` } -// DiffDiskSettings describes the parameters of differencing disk settings that can be be specified for operating -// system disk.

NOTE: The differencing disk settings can only be specified for managed disk. +// DiffDiskSettings describes the parameters of ephemeral disk settings that can be specified for operating system +// disk.

NOTE: The ephemeral disk settings can only be specified for managed disk. type DiffDiskSettings struct { - // Option - Specifies the differencing disk settings for operating system disk. Possible values include: 'Local' + // Option - Specifies the ephemeral disk settings for operating system disk. Possible values include: 'Local' Option DiffDiskOptions `json:"option,omitempty"` } @@ -2263,18 +2327,22 @@ type DiskProperties struct { TimeCreated *date.Time `json:"timeCreated,omitempty"` // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' OsType OperatingSystemTypes `json:"osType,omitempty"` + // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' + HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. CreationData *CreationData `json:"creationData,omitempty"` // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // EncryptionSettings - Encryption settings for disk or snapshot - EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"` + // EncryptionSettingsCollection - Encryption settings collection used for Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. + EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` // ProvisioningState - The disk provisioning state. ProvisioningState *string `json:"provisioningState,omitempty"` // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` // DiskMBpsReadWrite - The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. DiskMBpsReadWrite *int32 `json:"diskMBpsReadWrite,omitempty"` + // DiskState - The state of the disk. Possible values include: 'Unattached', 'Attached', 'Reserved', 'ActiveSAS', 'ReadyToUpload', 'ActiveUpload' + DiskState DiskState `json:"diskState,omitempty"` } // DisksCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. @@ -2484,21 +2552,27 @@ type DiskUpdateProperties struct { OsType OperatingSystemTypes `json:"osType,omitempty"` // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // EncryptionSettings - Encryption settings for disk or snapshot - EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"` + // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. + EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` // DiskIOPSReadWrite - The number of IOPS allowed for this disk; only settable for UltraSSD disks. One operation can transfer between 4k and 256k bytes. DiskIOPSReadWrite *int64 `json:"diskIOPSReadWrite,omitempty"` // DiskMBpsReadWrite - The bandwidth allowed for this disk; only settable for UltraSSD disks. MBps means millions of bytes per second - MB here uses the ISO notation, of powers of 10. DiskMBpsReadWrite *int32 `json:"diskMBpsReadWrite,omitempty"` } -// EncryptionSettings encryption settings for disk or snapshot -type EncryptionSettings struct { +// EncryptionSettingsCollection encryption settings for disk or snapshot +type EncryptionSettingsCollection struct { // Enabled - Set this flag to true and provide DiskEncryptionKey and optional KeyEncryptionKey to enable encryption. Set this flag to false and remove DiskEncryptionKey and KeyEncryptionKey to disable encryption. If EncryptionSettings is null in the request object, the existing settings remain unchanged. Enabled *bool `json:"enabled,omitempty"` + // EncryptionSettings - A collection of encryption settings, one for each disk volume. + EncryptionSettings *[]EncryptionSettingsElement `json:"encryptionSettings,omitempty"` +} + +// EncryptionSettingsElement encryption settings for one disk volume. +type EncryptionSettingsElement struct { // DiskEncryptionKey - Key Vault Secret Url and vault id of the disk encryption key DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` - // KeyEncryptionKey - Key Vault Key Url and vault id of the key encryption key + // KeyEncryptionKey - Key Vault Key Url and vault id of the key encryption key. KeyEncryptionKey is optional and when provided is used to unwrap the disk encryption key. KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` } @@ -2664,7 +2738,7 @@ func (g *Gallery) UnmarshalJSON(body []byte) error { // GalleryArtifactPublishingProfileBase describes the basic gallery artifact publishing profile. type GalleryArtifactPublishingProfileBase struct { - // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updateable. + // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` Source *GalleryArtifactSource `json:"source,omitempty"` } @@ -2921,7 +2995,7 @@ func (page GalleryImageListPage) Values() []GalleryImage { // GalleryImageProperties describes the properties of a gallery Image Definition. type GalleryImageProperties struct { - // Description - The description of this gallery Image Definition resource. This property is updateable. + // Description - The description of this gallery Image Definition resource. This property is updatable. Description *string `json:"description,omitempty"` // Eula - The Eula agreement for the gallery Image Definition. Eula *string `json:"eula,omitempty"` @@ -2933,7 +3007,7 @@ type GalleryImageProperties struct { OsType OperatingSystemTypes `json:"osType,omitempty"` // OsState - The allowed values for OS State are 'Generalized'. Possible values include: 'Generalized', 'Specialized' OsState OperatingSystemStateTypes `json:"osState,omitempty"` - // EndOfLifeDate - The end of life date of the gallery Image Definition. This property can be used for decommissioning purposes. This property is updateable. + // EndOfLifeDate - The end of life date of the gallery Image Definition. This property can be used for decommissioning purposes. This property is updatable. EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` Recommended *RecommendedMachineConfiguration `json:"recommended,omitempty"` @@ -3216,15 +3290,17 @@ type GalleryImageVersionProperties struct { // GalleryImageVersionPublishingProfile the publishing profile of a gallery Image Version. type GalleryImageVersionPublishingProfile struct { - // ReplicaCount - The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updateable. + // ReplicaCount - The number of replicas of the Image Version to be created per region. This property would take effect for a region when regionalReplicaCount is not specified. This property is updatable. ReplicaCount *int32 `json:"replicaCount,omitempty"` // ExcludeFromLatest - If set to true, Virtual Machines deployed from the latest version of the Image Definition won't use this Image Version. ExcludeFromLatest *bool `json:"excludeFromLatest,omitempty"` // PublishedDate - The timestamp for when the gallery Image Version is published. PublishedDate *date.Time `json:"publishedDate,omitempty"` - // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updateable. + // EndOfLifeDate - The end of life date of the gallery Image Version. This property can be used for decommissioning purposes. This property is updatable. EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` - // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updateable. + // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS' + StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` + // TargetRegions - The target regions where the Image Version is going to be replicated to. This property is updatable. TargetRegions *[]TargetRegion `json:"targetRegions,omitempty"` Source *GalleryArtifactSource `json:"source,omitempty"` } @@ -3400,7 +3476,7 @@ type GalleryOSDiskImage struct { // GalleryProperties describes the properties of a Shared Image Gallery. type GalleryProperties struct { - // Description - The description of this Shared Image Gallery resource. This property is updateable. + // Description - The description of this Shared Image Gallery resource. This property is updatable. Description *string `json:"description,omitempty"` Identifier *GalleryIdentifier `json:"identifier,omitempty"` // ProvisioningState - The provisioning state, which only appears in the response. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateFailed', 'ProvisioningStateSucceeded', 'ProvisioningStateDeleting', 'ProvisioningStateMigrating' @@ -3409,7 +3485,7 @@ type GalleryProperties struct { // GrantAccessData data used for requesting a SAS. type GrantAccessData struct { - // Access - Possible values include: 'None', 'Read' + // Access - Possible values include: 'None', 'Read', 'Write' Access AccessLevel `json:"access,omitempty"` // DurationInSeconds - Time duration in seconds until the SAS access expires. DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` @@ -3551,7 +3627,7 @@ type ImageDataDisk struct { // ImageDiskReference the source image used for creating the disk. type ImageDiskReference struct { - // ID - A relative uri containing either a Platform Imgage Repository or user image reference. + // ID - A relative uri containing either a Platform Image Repository or user image reference. ID *string `json:"id,omitempty"` // Lun - If the disk is created from an image's data disk, this is an index that indicates which of the data disks in the image to use. For OS disks, this field is null. Lun *int32 `json:"lun,omitempty"` @@ -4106,7 +4182,7 @@ type LogAnalyticsInputBase struct { ToTime *date.Time `json:"toTime,omitempty"` // GroupByThrottlePolicy - Group query result by Throttle Policy applied. GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` - // GroupByOperationName - Group query result by by Operation Name. + // GroupByOperationName - Group query result by Operation Name. GroupByOperationName *bool `json:"groupByOperationName,omitempty"` // GroupByResourceName - Group query result by Resource Name. GroupByResourceName *bool `json:"groupByResourceName,omitempty"` @@ -4324,7 +4400,7 @@ type OSDisk struct { Caching CachingTypes `json:"caching,omitempty"` // WriteAcceleratorEnabled - Specifies whether writeAccelerator should be enabled or disabled on the disk. WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` - // DiffDiskSettings - Specifies the differencing Disk Settings for the operating system disk used by the virtual machine. + // DiffDiskSettings - Specifies the ephemeral Disk Settings for the operating system disk used by the virtual machine. DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` // CreateOption - Specifies how the virtual machine should be created.

Possible values are:

**Attach** \u2013 This value is used when you are using a specialized disk to create the virtual machine.

**FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` @@ -4342,7 +4418,7 @@ type OSDiskImage struct { // OSProfile specifies the operating system settings for the virtual machine. type OSProfile struct { - // ComputerName - Specifies the host OS name of the virtual machine.

**Max-length (Windows):** 15 characters

**Max-length (Linux):** 64 characters.

For naming conventions and restrictions see [Azure infrastructure services implementation guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). + // ComputerName - Specifies the host OS name of the virtual machine.

This name cannot be updated after the VM is created.

**Max-length (Windows):** 15 characters

**Max-length (Linux):** 64 characters.

For naming conventions and restrictions see [Azure infrastructure services implementation guidelines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-infrastructure-subscription-accounts-guidelines?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json#1-naming-conventions). ComputerName *string `json:"computerName,omitempty"` // AdminUsername - Specifies the name of the administrator account.

**Windows-only restriction:** Cannot end in "."

**Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5".

**Minimum-length (Linux):** 1 character

**Max-length (Linux):** 64 characters

**Max-length (Windows):** 20 characters

  • For root access to the Linux VM, see [Using root privileges on Linux virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-use-root-privileges?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json)
  • For a list of built-in system users on Linux that should not be used in this field, see [Selecting User Names for Linux on Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-usernames?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) AdminUsername *string `json:"adminUsername,omitempty"` @@ -4386,7 +4462,7 @@ type PurchasePlan struct { } // RecommendedMachineConfiguration the properties describe the recommended machine configuration for this Image -// Definition. These properties are updateable. +// Definition. These properties are updatable. type RecommendedMachineConfiguration struct { VCPUs *ResourceRange `json:"vCPUs,omitempty"` Memory *ResourceRange `json:"memory,omitempty"` @@ -4433,7 +4509,7 @@ type RequestRateByIntervalInput struct { ToTime *date.Time `json:"toTime,omitempty"` // GroupByThrottlePolicy - Group query result by Throttle Policy applied. GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` - // GroupByOperationName - Group query result by by Operation Name. + // GroupByOperationName - Group query result by Operation Name. GroupByOperationName *bool `json:"groupByOperationName,omitempty"` // GroupByResourceName - Group query result by Resource Name. GroupByResourceName *bool `json:"groupByResourceName,omitempty"` @@ -4512,7 +4588,7 @@ type ResourceSku struct { Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` } -// ResourceSkuCapabilities describes The SKU capabilites object. +// ResourceSkuCapabilities describes The SKU capabilities object. type ResourceSkuCapabilities struct { // Name - An invariant to describe the feature. Name *string `json:"name,omitempty"` @@ -5265,12 +5341,14 @@ type SnapshotProperties struct { TimeCreated *date.Time `json:"timeCreated,omitempty"` // OsType - The Operating System type. Possible values include: 'Windows', 'Linux' OsType OperatingSystemTypes `json:"osType,omitempty"` + // HyperVGeneration - The hypervisor generation of the Virtual Machine. Applicable to OS disks only. Possible values include: 'V1', 'V2' + HyperVGeneration HyperVGeneration `json:"hyperVGeneration,omitempty"` // CreationData - Disk source information. CreationData information cannot be changed after the disk has been created. CreationData *CreationData `json:"creationData,omitempty"` // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // EncryptionSettings - Encryption settings for disk or snapshot - EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"` + // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. + EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` // ProvisioningState - The disk provisioning state. ProvisioningState *string `json:"provisioningState,omitempty"` } @@ -5484,11 +5562,11 @@ type SnapshotUpdateProperties struct { OsType OperatingSystemTypes `json:"osType,omitempty"` // DiskSizeGB - If creationData.createOption is Empty, this field is mandatory and it indicates the size of the VHD to create. If this field is present for updates or creation with other options, it indicates a resize. Resizes are only allowed if the disk is not attached to a running VM, and can only increase the disk's size. DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` - // EncryptionSettings - Encryption settings for disk or snapshot - EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"` + // EncryptionSettingsCollection - Encryption settings collection used be Azure Disk Encryption, can contain multiple encryption settings per disk or snapshot. + EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"` } -// SourceVault the vault id is an Azure Resource Manager Resoure id in the form +// SourceVault the vault id is an Azure Resource Manager Resource id in the form // /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} type SourceVault struct { // ID - Resource Id @@ -5536,8 +5614,10 @@ type SubResourceReadOnly struct { type TargetRegion struct { // Name - The name of the region. Name *string `json:"name,omitempty"` - // RegionalReplicaCount - The number of replicas of the Image Version to be created per region. This property is updateable. + // RegionalReplicaCount - The number of replicas of the Image Version to be created per region. This property is updatable. RegionalReplicaCount *int32 `json:"regionalReplicaCount,omitempty"` + // StorageAccountType - Specifies the storage account type to be used to store the image. This property is not updatable. Possible values include: 'StorageAccountTypeStandardLRS', 'StorageAccountTypeStandardZRS' + StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` } // ThrottledRequestsInput api request input for LogAnalytics getThrottledRequests Api. @@ -5550,7 +5630,7 @@ type ThrottledRequestsInput struct { ToTime *date.Time `json:"toTime,omitempty"` // GroupByThrottlePolicy - Group query result by Throttle Policy applied. GroupByThrottlePolicy *bool `json:"groupByThrottlePolicy,omitempty"` - // GroupByOperationName - Group query result by by Operation Name. + // GroupByOperationName - Group query result by Operation Name. GroupByOperationName *bool `json:"groupByOperationName,omitempty"` // GroupByResourceName - Group query result by Resource Name. GroupByResourceName *bool `json:"groupByResourceName,omitempty"` @@ -5585,7 +5665,7 @@ type UpgradeOperationHistoricalStatusInfo struct { type UpgradeOperationHistoricalStatusInfoProperties struct { // RunningStatus - Information about the overall status of the upgrade operation. RunningStatus *UpgradeOperationHistoryStatus `json:"runningStatus,omitempty"` - // Progress - Counts of the VM's in each state. + // Progress - Counts of the VMs in each state. Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` // Error - Error Details for this upgrade if there are any. Error *APIError `json:"error,omitempty"` @@ -5642,7 +5722,7 @@ type UsageName struct { type VaultCertificate struct { // CertificateURL - This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). In this case, your certificate needs to be It is the Base64 encoding of the following JSON Object which is encoded in UTF-8:

    {
    "data":"",
    "dataType":"pfx",
    "password":""
    } CertificateURL *string `json:"certificateUrl,omitempty"` - // CertificateStore - For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account.

    For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name .crt for the X509 certificate file and .prv for private key. Both of these files are .pem formatted. + // CertificateStore - For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account.

    For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both of these files are .pem formatted. CertificateStore *string `json:"certificateStore,omitempty"` } @@ -6437,9 +6517,10 @@ func (vmi *VirtualMachineImage) UnmarshalJSON(body []byte) error { // VirtualMachineImageProperties describes the properties of a Virtual Machine Image. type VirtualMachineImageProperties struct { - Plan *PurchasePlan `json:"plan,omitempty"` - OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` - DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"` + Plan *PurchasePlan `json:"plan,omitempty"` + OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` + DataDiskImages *[]DataDiskImage `json:"dataDiskImages,omitempty"` + AutomaticOSUpgradeProperties *AutomaticOSUpgradeProperties `json:"automaticOSUpgradeProperties,omitempty"` } // VirtualMachineImageResource virtual machine image resource information. @@ -6495,7 +6576,7 @@ type VirtualMachineInstanceView struct { Disks *[]DiskInstanceView `json:"disks,omitempty"` // Extensions - The extensions information. Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` - // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

    For Linux Virtual Machines, you can easily view the output of your console log.

    For both Windows and Linux virtual machines, Azure also enables you to see a screenshot of the VM from the hypervisor. + // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

    You can easily view the output of your console log.

    Azure also enables you to see a screenshot of the VM from the hypervisor. BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` // Statuses - The resource status information. Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` @@ -6617,7 +6698,7 @@ type VirtualMachineProperties struct { NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` // DiagnosticsProfile - Specifies the boot diagnostic settings state.

    Minimum api-version: 2015-06-15. DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // AvailabilitySet - Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).

    For more information on Azure planned maintainance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

    Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. + // AvailabilitySet - Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).

    For more information on Azure planned maintenance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

    Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` // ProvisioningState - The provisioning state, which only appears in the response. ProvisioningState *string `json:"provisioningState,omitempty"` @@ -6629,6 +6710,13 @@ type VirtualMachineProperties struct { VMID *string `json:"vmId,omitempty"` } +// VirtualMachineReimageParameters parameters for Reimaging Virtual Machine. NOTE: Virtual Machine OS disk will +// always be reimaged +type VirtualMachineReimageParameters struct { + // TempDisk - Specifies whether to reimage temp disk. Default value: false. + TempDisk *bool `json:"tempDisk,omitempty"` +} + // VirtualMachineScaleSet describes a Virtual Machine Scale Set. type VirtualMachineScaleSet struct { autorest.Response `json:"-"` @@ -7006,6 +7094,8 @@ type VirtualMachineScaleSetExtensionProperties struct { ProtectedSettings interface{} `json:"protectedSettings,omitempty"` // ProvisioningState - The provisioning state, which only appears in the response. ProvisioningState *string `json:"provisioningState,omitempty"` + // ProvisionAfterExtensions - Collection of extension names after which this extension needs to be provisioned. + ProvisionAfterExtensions *[]string `json:"provisionAfterExtensions,omitempty"` } // VirtualMachineScaleSetExtensionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of @@ -7738,7 +7828,7 @@ type VirtualMachineScaleSetOSDisk struct { WriteAcceleratorEnabled *bool `json:"writeAcceleratorEnabled,omitempty"` // CreateOption - Specifies how the virtual machines in the scale set should be created.

    The only allowed value is: **FromImage** \u2013 This value is used when you are using an image to create the virtual machine. If you are using a platform image, you also use the imageReference element described above. If you are using a marketplace image, you also use the plan element previously described. Possible values include: 'DiskCreateOptionTypesFromImage', 'DiskCreateOptionTypesEmpty', 'DiskCreateOptionTypesAttach' CreateOption DiskCreateOptionTypes `json:"createOption,omitempty"` - // DiffDiskSettings - Specifies the differencing Disk Settings for the operating system disk used by the virtual machine scale set. + // DiffDiskSettings - Specifies the ephemeral disk Settings for the operating system disk used by the virtual machine scale set. DiffDiskSettings *DiffDiskSettings `json:"diffDiskSettings,omitempty"` // DiskSizeGB - Specifies the size of the operating system disk in gigabytes. This element can be used to overwrite the size of the disk in a virtual machine image.

    This value cannot be larger than 1023 GB DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` @@ -7780,11 +7870,13 @@ type VirtualMachineScaleSetProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` // Overprovision - Specifies whether the Virtual Machine Scale Set should be overprovisioned. Overprovision *bool `json:"overprovision,omitempty"` + // DoNotRunExtensionsOnOverprovisionedVMs - When Overprovision is enabled, extensions are launched only on the requested number of VMs which are finally kept. This property will hence ensure that the extensions do not run on the extra overprovisioned VMs. + DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"` // UniqueID - Specifies the ID which uniquely identifies a Virtual Machine Scale Set. UniqueID *string `json:"uniqueId,omitempty"` // SinglePlacementGroup - When true this limits the scale set to a single placement group, of max size 100 virtual machines. SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` - // ZoneBalance - Whether to force stictly even Virtual Machine distribution cross x-zones in case there is zone outage. + // ZoneBalance - Whether to force strictly even Virtual Machine distribution cross x-zones in case there is zone outage. ZoneBalance *bool `json:"zoneBalance,omitempty"` // PlatformFaultDomainCount - Fault Domain count for each placement group. PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` @@ -7863,6 +7955,14 @@ type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` } +// VirtualMachineScaleSetReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. +type VirtualMachineScaleSetReimageParameters struct { + // InstanceIds - The virtual machine scale set instance ids. Omitting the virtual machine scale set instance ids will result in the operation being performed on all virtual machines in the virtual machine scale set. + InstanceIds *[]string `json:"instanceIds,omitempty"` + // TempDisk - Specifies whether to reimage temp disk. Default value: false. + TempDisk *bool `json:"tempDisk,omitempty"` +} + // VirtualMachineScaleSetRollingUpgradesCancelFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type VirtualMachineScaleSetRollingUpgradesCancelFuture struct { @@ -8896,7 +8996,7 @@ type VirtualMachineScaleSetVMInstanceView struct { Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` // VMHealth - The health status for the VM. VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` - // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

    For Linux Virtual Machines, you can easily view the output of your console log.

    For both Windows and Linux virtual machines, Azure also enables you to see a screenshot of the VM from the hypervisor. + // BootDiagnostics - Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status.

    You can easily view the output of your console log.

    Azure also enables you to see a screenshot of the VM from the hypervisor. BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` // Statuses - The resource status information. Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` @@ -9007,6 +9107,12 @@ func (page VirtualMachineScaleSetVMListResultPage) Values() []VirtualMachineScal return *page.vmssvlr.Value } +// VirtualMachineScaleSetVMNetworkProfileConfiguration describes a virtual machine scale set VM network profile. +type VirtualMachineScaleSetVMNetworkProfileConfiguration struct { + // NetworkInterfaceConfigurations - The list of network configurations. + NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` +} + // VirtualMachineScaleSetVMProfile describes a virtual machine scale set virtual machine profile. type VirtualMachineScaleSetVMProfile struct { // OsProfile - Specifies the operating system settings for the virtual machines in the scale set. @@ -9047,14 +9153,34 @@ type VirtualMachineScaleSetVMProperties struct { OsProfile *OSProfile `json:"osProfile,omitempty"` // NetworkProfile - Specifies the network interfaces of the virtual machine. NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` + // NetworkProfileConfiguration - Specifies the network profile configuration of the virtual machine. + NetworkProfileConfiguration *VirtualMachineScaleSetVMNetworkProfileConfiguration `json:"networkProfileConfiguration,omitempty"` // DiagnosticsProfile - Specifies the boot diagnostic settings state.

    Minimum api-version: 2015-06-15. DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` - // AvailabilitySet - Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).

    For more information on Azure planned maintainance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

    Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. + // AvailabilitySet - Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified in the same availability set are allocated to different nodes to maximize availability. For more information about availability sets, see [Manage the availability of virtual machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-manage-availability?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json).

    For more information on Azure planned maintenance, see [Planned maintenance for virtual machines in Azure](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-planned-maintenance?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

    Currently, a VM can only be added to availability set at creation time. An existing VM cannot be added to an availability set. AvailabilitySet *SubResource `json:"availabilitySet,omitempty"` // ProvisioningState - The provisioning state, which only appears in the response. ProvisioningState *string `json:"provisioningState,omitempty"` // LicenseType - Specifies that the image or disk that is being used was licensed on-premises. This element is only used for images that contain the Windows Server operating system.

    Possible values are:

    Windows_Client

    Windows_Server

    If this element is included in a request for an update, the value must match the initial value. This value cannot be updated.

    For more information, see [Azure Hybrid Use Benefit for Windows Server](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-hybrid-use-benefit-licensing?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json)

    Minimum api-version: 2015-06-15 LicenseType *string `json:"licenseType,omitempty"` + // ModelDefinitionApplied - Specifies whether the model applied to the virtual machine is the model of the virtual machine scale set or the customized model for the virtual machine. + ModelDefinitionApplied *string `json:"modelDefinitionApplied,omitempty"` + // ProtectionPolicy - Specifies the protection policy of the virtual machine. + ProtectionPolicy *VirtualMachineScaleSetVMProtectionPolicy `json:"protectionPolicy,omitempty"` +} + +// VirtualMachineScaleSetVMProtectionPolicy the protection policy of a virtual machine scale set VM. +type VirtualMachineScaleSetVMProtectionPolicy struct { + // ProtectFromScaleIn - Indicates that the virtual machine scale set VM shouldn't be considered for deletion during a scale-in operation. + ProtectFromScaleIn *bool `json:"protectFromScaleIn,omitempty"` + // ProtectFromScaleSetActions - Indicates that model updates or actions (including scale-in) initiated on the virtual machine scale set should not be applied to the virtual machine scale set VM. + ProtectFromScaleSetActions *bool `json:"protectFromScaleSetActions,omitempty"` +} + +// VirtualMachineScaleSetVMReimageParameters describes a Virtual Machine Scale Set VM Reimage Parameters. +type VirtualMachineScaleSetVMReimageParameters struct { + // TempDisk - Specifies whether to reimage temp disk. Default value: false. + TempDisk *bool `json:"tempDisk,omitempty"` } // VirtualMachineScaleSetVMsDeallocateFuture an abstraction for monitoring and retrieving the results of a @@ -9541,6 +9667,29 @@ func (future *VirtualMachinesRedeployFuture) Result(client VirtualMachinesClient return } +// VirtualMachinesReimageFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesReimageFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualMachinesReimageFuture) Result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.Done(client) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesReimageFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("compute.VirtualMachinesReimageFuture") + return + } + ar.Response = future.Response() + return +} + // VirtualMachinesRestartFuture an abstraction for monitoring and retrieving the results of a long-running // operation. type VirtualMachinesRestartFuture struct { @@ -9747,6 +9896,12 @@ func (vmu *VirtualMachineUpdate) UnmarshalJSON(body []byte) error { return nil } +// VMScaleSetConvertToSinglePlacementGroupInput ... +type VMScaleSetConvertToSinglePlacementGroupInput struct { + // ActivePlacementGroupID - Id of the placement group in which you want future virtual machine instances to be placed. To query placement group Id, please use Virtual Machine Scale Set VMs - Get API. If not provided, the platform will choose one with maximum number of virtual machine instances. + ActivePlacementGroupID *string `json:"activePlacementGroupId,omitempty"` +} + // WindowsConfiguration specifies Windows operating system settings on the virtual machine. type WindowsConfiguration struct { // ProvisionVMAgent - Indicates whether virtual machine agent should be provisioned on the virtual machine.

    When this property is not specified in the request body, default behavior is to set it to true. This will ensure that VM Agent is installed on the VM so that extensions can be added to the VM later. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/operations.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/operations.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/operations.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/operations.go index e8fb3415b4..648375b4f3 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/operations.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/operations.go @@ -64,7 +64,7 @@ func (client OperationsClient) List(ctx context.Context) (result OperationListRe // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/resourceskus.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/resourceskus.go similarity index 100% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/resourceskus.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/resourceskus.go diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/snapshots.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/snapshots.go similarity index 93% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/snapshots.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/snapshots.go index 89e57104c4..4d6798b237 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/snapshots.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/snapshots.go @@ -54,16 +54,8 @@ func (client SnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupN Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.CreationData.ImageReference", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}}, }}, - {Target: "snapshot.SnapshotProperties.EncryptionSettings", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "snapshot.SnapshotProperties.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, - }}, - {Target: "snapshot.SnapshotProperties.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "snapshot.SnapshotProperties.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, - }}, - }}, + {Target: "snapshot.SnapshotProperties.EncryptionSettingsCollection", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "snapshot.SnapshotProperties.EncryptionSettingsCollection.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, }}}}}); err != nil { return result, validation.NewError("compute.SnapshotsClient", "CreateOrUpdate", err.Error()) } @@ -91,7 +83,7 @@ func (client SnapshotsClient) CreateOrUpdatePreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2018-09-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -115,10 +107,6 @@ func (client SnapshotsClient) CreateOrUpdateSender(req *http.Request) (future Sn if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -165,7 +153,7 @@ func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2018-09-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -187,10 +175,6 @@ func (client SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsD if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -242,7 +226,7 @@ func (client SnapshotsClient) GetPreparer(ctx context.Context, resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2018-09-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -311,7 +295,7 @@ func (client SnapshotsClient) GrantAccessPreparer(ctx context.Context, resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2018-09-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -335,10 +319,6 @@ func (client SnapshotsClient) GrantAccessSender(req *http.Request) (future Snaps if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -386,7 +366,7 @@ func (client SnapshotsClient) ListPreparer(ctx context.Context) (*http.Request, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2018-09-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -479,7 +459,7 @@ func (client SnapshotsClient) ListByResourceGroupPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2018-09-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -568,7 +548,7 @@ func (client SnapshotsClient) RevokeAccessPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2018-09-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -590,10 +570,6 @@ func (client SnapshotsClient) RevokeAccessSender(req *http.Request) (future Snap if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -640,7 +616,7 @@ func (client SnapshotsClient) UpdatePreparer(ctx context.Context, resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-06-01" + const APIVersion = "2018-09-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -664,10 +640,6 @@ func (client SnapshotsClient) UpdateSender(req *http.Request) (future SnapshotsU if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/usage.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/usage.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/usage.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/usage.go index 6e433603f8..a6ca95a1f1 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/usage.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/usage.go @@ -80,7 +80,7 @@ func (client UsageClient) ListPreparer(ctx context.Context, location string) (*h "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/version.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/version.go similarity index 94% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/version.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/version.go index e28392b5b8..184b918cc5 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + version.Number + " compute/2018-10-01" + return "Azure-SDK-For-Go/" + version.Number + " compute/2019-03-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineextensionimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachineextensionimages.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineextensionimages.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachineextensionimages.go index 6361600448..134b887dda 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineextensionimages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachineextensionimages.go @@ -75,7 +75,7 @@ func (client VirtualMachineExtensionImagesClient) GetPreparer(ctx context.Contex "version": autorest.Encode("path", version), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -141,7 +141,7 @@ func (client VirtualMachineExtensionImagesClient) ListTypesPreparer(ctx context. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -209,7 +209,7 @@ func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(ctx conte "type": autorest.Encode("path", typeParameter), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachineextensions.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineextensions.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachineextensions.go index 6bfd80ac3a..87267c9363 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineextensions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachineextensions.go @@ -70,7 +70,7 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(ctx context. "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -94,10 +94,6 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdateSender(req *http.Requ if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -145,7 +141,7 @@ func (client VirtualMachineExtensionsClient) DeletePreparer(ctx context.Context, "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -167,10 +163,6 @@ func (client VirtualMachineExtensionsClient) DeleteSender(req *http.Request) (fu if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -224,7 +216,7 @@ func (client VirtualMachineExtensionsClient) GetPreparer(ctx context.Context, re "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -295,7 +287,7 @@ func (client VirtualMachineExtensionsClient) ListPreparer(ctx context.Context, r "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -362,7 +354,7 @@ func (client VirtualMachineExtensionsClient) UpdatePreparer(ctx context.Context, "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -386,10 +378,6 @@ func (client VirtualMachineExtensionsClient) UpdateSender(req *http.Request) (fu if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineimages.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachineimages.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineimages.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachineimages.go index 23dab447a7..f3e2967a54 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineimages.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachineimages.go @@ -79,7 +79,7 @@ func (client VirtualMachineImagesClient) GetPreparer(ctx context.Context, locati "version": autorest.Encode("path", version), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -151,7 +151,7 @@ func (client VirtualMachineImagesClient) ListPreparer(ctx context.Context, locat "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -227,7 +227,7 @@ func (client VirtualMachineImagesClient) ListOffersPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -292,7 +292,7 @@ func (client VirtualMachineImagesClient) ListPublishersPreparer(ctx context.Cont "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -361,7 +361,7 @@ func (client VirtualMachineImagesClient) ListSkusPreparer(ctx context.Context, l "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineruncommands.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachineruncommands.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineruncommands.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachineruncommands.go index 525fc948b8..9eb28a0f5c 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachineruncommands.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachineruncommands.go @@ -80,7 +80,7 @@ func (client VirtualMachineRunCommandsClient) GetPreparer(ctx context.Context, l "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -152,7 +152,7 @@ func (client VirtualMachineRunCommandsClient) ListPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachines.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachines.go similarity index 86% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachines.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachines.go index e8149617e6..59c7b8c6fa 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachines.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachines.go @@ -78,7 +78,7 @@ func (client VirtualMachinesClient) CapturePreparer(ctx context.Context, resourc "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -102,10 +102,6 @@ func (client VirtualMachinesClient) CaptureSender(req *http.Request) (future Vir if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -152,7 +148,7 @@ func (client VirtualMachinesClient) ConvertToManagedDisksPreparer(ctx context.Co "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -174,10 +170,6 @@ func (client VirtualMachinesClient) ConvertToManagedDisksSender(req *http.Reques if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -244,7 +236,7 @@ func (client VirtualMachinesClient) CreateOrUpdatePreparer(ctx context.Context, "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -268,10 +260,6 @@ func (client VirtualMachinesClient) CreateOrUpdateSender(req *http.Request) (fut if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -318,7 +306,7 @@ func (client VirtualMachinesClient) DeallocatePreparer(ctx context.Context, reso "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -340,10 +328,6 @@ func (client VirtualMachinesClient) DeallocateSender(req *http.Request) (future if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -388,7 +372,7 @@ func (client VirtualMachinesClient) DeletePreparer(ctx context.Context, resource "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -410,10 +394,6 @@ func (client VirtualMachinesClient) DeleteSender(req *http.Request) (future Virt if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -464,7 +444,7 @@ func (client VirtualMachinesClient) GeneralizePreparer(ctx context.Context, reso "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -531,7 +511,7 @@ func (client VirtualMachinesClient) GetPreparer(ctx context.Context, resourceGro "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -601,7 +581,7 @@ func (client VirtualMachinesClient) InstanceViewPreparer(ctx context.Context, re "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -668,7 +648,7 @@ func (client VirtualMachinesClient) ListPreparer(ctx context.Context, resourceGr "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -759,7 +739,7 @@ func (client VirtualMachinesClient) ListAllPreparer(ctx context.Context) (*http. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -853,7 +833,7 @@ func (client VirtualMachinesClient) ListAvailableSizesPreparer(ctx context.Conte "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -886,6 +866,105 @@ func (client VirtualMachinesClient) ListAvailableSizesResponder(resp *http.Respo return } +// ListByLocation gets all the virtual machines under the specified subscription for the specified location. +// Parameters: +// location - the location for which virtual machines under the subscription are queried. +func (client VirtualMachinesClient) ListByLocation(ctx context.Context, location string) (result VirtualMachineListResultPage, err error) { + 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.VirtualMachinesClient", "ListByLocation", err.Error()) + } + + result.fn = client.listByLocationNextResults + req, err := client.ListByLocationPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", nil, "Failure preparing request") + return + } + + resp, err := client.ListByLocationSender(req) + if err != nil { + result.vmlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", resp, "Failure sending request") + return + } + + result.vmlr, err = client.ListByLocationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListByLocation", resp, "Failure responding to request") + } + + return +} + +// ListByLocationPreparer prepares the ListByLocation request. +func (client VirtualMachinesClient) ListByLocationPreparer(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 = "2019-03-01" + 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}/virtualMachines", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByLocationSender sends the ListByLocation request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) ListByLocationSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ListByLocationResponder handles the response to the ListByLocation request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) ListByLocationResponder(resp *http.Response) (result VirtualMachineListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByLocationNextResults retrieves the next set of results, if any. +func (client VirtualMachinesClient) listByLocationNextResults(lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) { + req, err := lastResults.virtualMachineListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByLocationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByLocationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "listByLocationNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByLocationComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualMachinesClient) ListByLocationComplete(ctx context.Context, location string) (result VirtualMachineListResultIterator, err error) { + result.page, err = client.ListByLocation(ctx, location) + return +} + // PerformMaintenance the operation to perform maintenance on a virtual machine. // Parameters: // resourceGroupName - the name of the resource group. @@ -914,7 +993,7 @@ func (client VirtualMachinesClient) PerformMaintenancePreparer(ctx context.Conte "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -936,10 +1015,6 @@ func (client VirtualMachinesClient) PerformMaintenanceSender(req *http.Request) if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -961,8 +1036,11 @@ func (client VirtualMachinesClient) PerformMaintenanceResponder(resp *http.Respo // Parameters: // resourceGroupName - the name of the resource group. // VMName - the name of the virtual machine. -func (client VirtualMachinesClient) PowerOff(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesPowerOffFuture, err error) { - req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMName) +// skipShutdown - the parameter to request non-graceful VM shutdown. True value for this flag indicates +// non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not +// specified +func (client VirtualMachinesClient) PowerOff(ctx context.Context, resourceGroupName string, VMName string, skipShutdown *bool) (result VirtualMachinesPowerOffFuture, err error) { + req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMName, skipShutdown) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PowerOff", nil, "Failure preparing request") return @@ -978,17 +1056,22 @@ func (client VirtualMachinesClient) PowerOff(ctx context.Context, resourceGroupN } // PowerOffPreparer prepares the PowerOff request. -func (client VirtualMachinesClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMName string) (*http.Request, error) { +func (client VirtualMachinesClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMName string, skipShutdown *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if skipShutdown != nil { + queryParameters["skipShutdown"] = autorest.Encode("query", *skipShutdown) + } else { + queryParameters["skipShutdown"] = autorest.Encode("query", false) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -1007,10 +1090,6 @@ func (client VirtualMachinesClient) PowerOffSender(req *http.Request) (future Vi if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -1055,7 +1134,7 @@ func (client VirtualMachinesClient) RedeployPreparer(ctx context.Context, resour "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1077,10 +1156,6 @@ func (client VirtualMachinesClient) RedeploySender(req *http.Request) (future Vi if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -1097,6 +1172,78 @@ func (client VirtualMachinesClient) RedeployResponder(resp *http.Response) (resu return } +// Reimage reimages the virtual machine which has an ephemeral OS disk back to its initial state. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMName - the name of the virtual machine. +// parameters - parameters supplied to the Reimage Virtual Machine operation. +func (client VirtualMachinesClient) Reimage(ctx context.Context, resourceGroupName string, VMName string, parameters *VirtualMachineReimageParameters) (result VirtualMachinesReimageFuture, err error) { + req, err := client.ReimagePreparer(ctx, resourceGroupName, VMName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reimage", nil, "Failure preparing request") + return + } + + result, err = client.ReimageSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Reimage", result.Response(), "Failure sending request") + return + } + + return +} + +// ReimagePreparer prepares the Reimage request. +func (client VirtualMachinesClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMName string, parameters *VirtualMachineReimageParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmName": autorest.Encode("path", VMName), + } + + const APIVersion = "2019-03-01" + 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/virtualMachines/{vmName}/reimage", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + 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 VirtualMachinesClient) ReimageSender(req *http.Request) (future VirtualMachinesReimageFuture, err error) { + var resp *http.Response + resp, err = autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// ReimageResponder handles the response to the Reimage request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + // Restart the operation to restart a virtual machine. // Parameters: // resourceGroupName - the name of the resource group. @@ -1125,7 +1272,7 @@ func (client VirtualMachinesClient) RestartPreparer(ctx context.Context, resourc "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1147,10 +1294,6 @@ func (client VirtualMachinesClient) RestartSender(req *http.Request) (future Vir if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -1202,7 +1345,7 @@ func (client VirtualMachinesClient) RunCommandPreparer(ctx context.Context, reso "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1226,10 +1369,6 @@ func (client VirtualMachinesClient) RunCommandSender(req *http.Request) (future if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -1275,7 +1414,7 @@ func (client VirtualMachinesClient) StartPreparer(ctx context.Context, resourceG "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1297,10 +1436,6 @@ func (client VirtualMachinesClient) StartSender(req *http.Request) (future Virtu if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -1346,7 +1481,7 @@ func (client VirtualMachinesClient) UpdatePreparer(ctx context.Context, resource "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1370,10 +1505,6 @@ func (client VirtualMachinesClient) UpdateSender(req *http.Request) (future Virt if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetextensions.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachinescalesetextensions.go similarity index 97% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetextensions.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachinescalesetextensions.go index 43e443249b..755772eb6b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetextensions.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachinescalesetextensions.go @@ -71,7 +71,7 @@ func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdatePreparer(ctx "vmssExtensionName": autorest.Encode("path", vmssExtensionName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -95,10 +95,6 @@ func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateSender(req *h if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -146,7 +142,7 @@ func (client VirtualMachineScaleSetExtensionsClient) DeletePreparer(ctx context. "vmssExtensionName": autorest.Encode("path", vmssExtensionName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -168,10 +164,6 @@ func (client VirtualMachineScaleSetExtensionsClient) DeleteSender(req *http.Requ if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -225,7 +217,7 @@ func (client VirtualMachineScaleSetExtensionsClient) GetPreparer(ctx context.Con "vmssExtensionName": autorest.Encode("path", vmssExtensionName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -296,7 +288,7 @@ func (client VirtualMachineScaleSetExtensionsClient) ListPreparer(ctx context.Co "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetrollingupgrades.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachinescalesetrollingupgrades.go similarity index 96% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetrollingupgrades.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachinescalesetrollingupgrades.go index ca98956cfd..a348963a2b 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetrollingupgrades.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachinescalesetrollingupgrades.go @@ -69,7 +69,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) CancelPreparer(ctx con "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -91,10 +91,6 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) CancelSender(req *http if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -145,7 +141,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestPreparer(ctx "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -208,7 +204,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeP "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -230,10 +226,6 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartExtensionUpgradeS if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -279,7 +271,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradePreparer "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -301,10 +293,6 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeSender(r if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesets.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachinescalesets.go similarity index 93% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesets.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachinescalesets.go index f78d824fdf..5168626375 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesets.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachinescalesets.go @@ -40,6 +40,70 @@ func NewVirtualMachineScaleSetsClientWithBaseURI(baseURI string, subscriptionID return VirtualMachineScaleSetsClient{NewWithBaseURI(baseURI, subscriptionID)} } +// ConvertToSinglePlacementGroup converts SinglePlacementGroup property to false for a existing virtual machine scale +// set. +// Parameters: +// resourceGroupName - the name of the resource group. +// VMScaleSetName - the name of the virtual machine scale set to create or update. +// parameters - the input object for ConvertToSinglePlacementGroup API. +func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroup(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput) (result autorest.Response, err error) { + req, err := client.ConvertToSinglePlacementGroupPreparer(ctx, resourceGroupName, VMScaleSetName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ConvertToSinglePlacementGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ConvertToSinglePlacementGroupSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ConvertToSinglePlacementGroup", resp, "Failure sending request") + return + } + + result, err = client.ConvertToSinglePlacementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ConvertToSinglePlacementGroup", resp, "Failure responding to request") + } + + return +} + +// ConvertToSinglePlacementGroupPreparer prepares the ConvertToSinglePlacementGroup request. +func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VMScaleSetConvertToSinglePlacementGroupInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + 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/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup", pathParameters), + autorest.WithJSON(parameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ConvertToSinglePlacementGroupSender sends the ConvertToSinglePlacementGroup request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req, + azure.DoRetryWithRegistration(client.Client)) +} + +// ConvertToSinglePlacementGroupResponder handles the response to the ConvertToSinglePlacementGroup request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + // CreateOrUpdate create or update a VM scale set. // Parameters: // resourceGroupName - the name of the resource group. @@ -92,7 +156,7 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdatePreparer(ctx context.C "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -116,10 +180,6 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdateSender(req *http.Reque if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -167,7 +227,7 @@ func (client VirtualMachineScaleSetsClient) DeallocatePreparer(ctx context.Conte "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -194,10 +254,6 @@ func (client VirtualMachineScaleSetsClient) DeallocateSender(req *http.Request) if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -242,7 +298,7 @@ func (client VirtualMachineScaleSetsClient) DeletePreparer(ctx context.Context, "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -264,10 +320,6 @@ func (client VirtualMachineScaleSetsClient) DeleteSender(req *http.Request) (fut if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -319,7 +371,7 @@ func (client VirtualMachineScaleSetsClient) DeleteInstancesPreparer(ctx context. "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -343,10 +395,6 @@ func (client VirtualMachineScaleSetsClient) DeleteInstancesSender(req *http.Requ if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -399,7 +447,7 @@ func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUp "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, "platformUpdateDomain": autorest.Encode("query", platformUpdateDomain), @@ -467,7 +515,7 @@ func (client VirtualMachineScaleSetsClient) GetPreparer(ctx context.Context, res "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -534,7 +582,7 @@ func (client VirtualMachineScaleSetsClient) GetInstanceViewPreparer(ctx context. "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -602,7 +650,7 @@ func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryPreparer(ctx cont "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -695,7 +743,7 @@ func (client VirtualMachineScaleSetsClient) ListPreparer(ctx context.Context, re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -787,7 +835,7 @@ func (client VirtualMachineScaleSetsClient) ListAllPreparer(ctx context.Context) "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -883,7 +931,7 @@ func (client VirtualMachineScaleSetsClient) ListSkusPreparer(ctx context.Context "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -974,7 +1022,7 @@ func (client VirtualMachineScaleSetsClient) PerformMaintenancePreparer(ctx conte "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1001,10 +1049,6 @@ func (client VirtualMachineScaleSetsClient) PerformMaintenanceSender(req *http.R if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -1027,8 +1071,11 @@ func (client VirtualMachineScaleSetsClient) PerformMaintenanceResponder(resp *ht // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set. // VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. -func (client VirtualMachineScaleSetsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsPowerOffFuture, err error) { - req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) +// skipShutdown - the parameter to request non-graceful VM shutdown. True value for this flag indicates +// non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not +// specified +func (client VirtualMachineScaleSetsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, skipShutdown *bool) (result VirtualMachineScaleSetsPowerOffFuture, err error) { + req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs, skipShutdown) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "PowerOff", nil, "Failure preparing request") return @@ -1044,17 +1091,22 @@ func (client VirtualMachineScaleSetsClient) PowerOff(ctx context.Context, resour } // PowerOffPreparer prepares the PowerOff request. -func (client VirtualMachineScaleSetsClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { +func (client VirtualMachineScaleSetsClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, skipShutdown *bool) (*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 = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if skipShutdown != nil { + queryParameters["skipShutdown"] = autorest.Encode("query", *skipShutdown) + } else { + queryParameters["skipShutdown"] = autorest.Encode("query", false) + } preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), @@ -1078,10 +1130,6 @@ func (client VirtualMachineScaleSetsClient) PowerOffSender(req *http.Request) (f if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -1127,7 +1175,7 @@ func (client VirtualMachineScaleSetsClient) RedeployPreparer(ctx context.Context "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1154,10 +1202,6 @@ func (client VirtualMachineScaleSetsClient) RedeploySender(req *http.Request) (f if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -1174,13 +1218,14 @@ func (client VirtualMachineScaleSetsClient) RedeployResponder(resp *http.Respons return } -// Reimage reimages (upgrade the operating system) one or more virtual machines in a VM scale set. +// Reimage reimages (upgrade the operating system) one or more virtual machines in a VM scale set which don't have a +// ephemeral OS disk, for virtual machines who have a ephemeral OS disk the virtual machine is reset to initial state. // Parameters: // resourceGroupName - the name of the resource group. // VMScaleSetName - the name of the VM scale set. -// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set. -func (client VirtualMachineScaleSetsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsReimageFuture, err error) { - req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs) +// VMScaleSetReimageInput - parameters for Reimaging VM ScaleSet. +func (client VirtualMachineScaleSetsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters) (result VirtualMachineScaleSetsReimageFuture, err error) { + req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, VMScaleSetReimageInput) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", nil, "Failure preparing request") return @@ -1196,14 +1241,14 @@ func (client VirtualMachineScaleSetsClient) Reimage(ctx context.Context, resourc } // ReimagePreparer prepares the Reimage request. -func (client VirtualMachineScaleSetsClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (*http.Request, error) { +func (client VirtualMachineScaleSetsClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters) (*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 = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1214,9 +1259,9 @@ func (client VirtualMachineScaleSetsClient) ReimagePreparer(ctx context.Context, autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage", pathParameters), autorest.WithQueryParameters(queryParameters)) - if VMInstanceIDs != nil { + if VMScaleSetReimageInput != nil { preparer = autorest.DecoratePreparer(preparer, - autorest.WithJSON(VMInstanceIDs)) + autorest.WithJSON(VMScaleSetReimageInput)) } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -1230,10 +1275,6 @@ func (client VirtualMachineScaleSetsClient) ReimageSender(req *http.Request) (fu if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -1280,7 +1321,7 @@ func (client VirtualMachineScaleSetsClient) ReimageAllPreparer(ctx context.Conte "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1307,10 +1348,6 @@ func (client VirtualMachineScaleSetsClient) ReimageAllSender(req *http.Request) if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -1356,7 +1393,7 @@ func (client VirtualMachineScaleSetsClient) RestartPreparer(ctx context.Context, "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1383,10 +1420,6 @@ func (client VirtualMachineScaleSetsClient) RestartSender(req *http.Request) (fu if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -1432,7 +1465,7 @@ func (client VirtualMachineScaleSetsClient) StartPreparer(ctx context.Context, r "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1459,10 +1492,6 @@ func (client VirtualMachineScaleSetsClient) StartSender(req *http.Request) (futu if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -1508,7 +1537,7 @@ func (client VirtualMachineScaleSetsClient) UpdatePreparer(ctx context.Context, "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1532,10 +1561,6 @@ func (client VirtualMachineScaleSetsClient) UpdateSender(req *http.Request) (fut if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -1588,7 +1613,7 @@ func (client VirtualMachineScaleSetsClient) UpdateInstancesPreparer(ctx context. "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1612,10 +1637,6 @@ func (client VirtualMachineScaleSetsClient) UpdateInstancesSender(req *http.Requ if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetvms.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachinescalesetvms.go similarity index 95% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetvms.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachinescalesetvms.go index 2742fe9112..1618ef1d92 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinescalesetvms.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachinescalesetvms.go @@ -72,7 +72,7 @@ func (client VirtualMachineScaleSetVMsClient) DeallocatePreparer(ctx context.Con "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -94,10 +94,6 @@ func (client VirtualMachineScaleSetVMsClient) DeallocateSender(req *http.Request if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -144,7 +140,7 @@ func (client VirtualMachineScaleSetVMsClient) DeletePreparer(ctx context.Context "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -166,10 +162,6 @@ func (client VirtualMachineScaleSetVMsClient) DeleteSender(req *http.Request) (f if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -222,7 +214,7 @@ func (client VirtualMachineScaleSetVMsClient) GetPreparer(ctx context.Context, r "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -291,7 +283,7 @@ func (client VirtualMachineScaleSetVMsClient) GetInstanceViewPreparer(ctx contex "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -362,7 +354,7 @@ func (client VirtualMachineScaleSetVMsClient) ListPreparer(ctx context.Context, "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -461,7 +453,7 @@ func (client VirtualMachineScaleSetVMsClient) PerformMaintenancePreparer(ctx con "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -483,10 +475,6 @@ func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceSender(req *http if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -509,8 +497,11 @@ func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceResponder(resp * // 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) { - req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) +// skipShutdown - the parameter to request non-graceful VM shutdown. True value for this flag indicates +// non-graceful shutdown whereas false indicates otherwise. Default value for this flag is false if not +// specified +func (client VirtualMachineScaleSetVMsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, skipShutdown *bool) (result VirtualMachineScaleSetVMsPowerOffFuture, err error) { + req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, skipShutdown) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "PowerOff", nil, "Failure preparing request") return @@ -526,7 +517,7 @@ func (client VirtualMachineScaleSetVMsClient) PowerOff(ctx context.Context, reso } // PowerOffPreparer prepares the PowerOff request. -func (client VirtualMachineScaleSetVMsClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { +func (client VirtualMachineScaleSetVMsClient) PowerOffPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, skipShutdown *bool) (*http.Request, error) { pathParameters := map[string]interface{}{ "instanceId": autorest.Encode("path", instanceID), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -534,10 +525,15 @@ func (client VirtualMachineScaleSetVMsClient) PowerOffPreparer(ctx context.Conte "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } + if skipShutdown != nil { + queryParameters["skipShutdown"] = autorest.Encode("query", *skipShutdown) + } else { + queryParameters["skipShutdown"] = autorest.Encode("query", false) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -556,10 +552,6 @@ func (client VirtualMachineScaleSetVMsClient) PowerOffSender(req *http.Request) if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -606,7 +598,7 @@ func (client VirtualMachineScaleSetVMsClient) RedeployPreparer(ctx context.Conte "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -628,10 +620,6 @@ func (client VirtualMachineScaleSetVMsClient) RedeploySender(req *http.Request) if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -653,8 +641,9 @@ func (client VirtualMachineScaleSetVMsClient) RedeployResponder(resp *http.Respo // 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) { - req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID) +// VMScaleSetVMReimageInput - parameters for the Reimaging Virtual machine in ScaleSet. +func (client VirtualMachineScaleSetVMsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMScaleSetVMReimageInput *VirtualMachineScaleSetVMReimageParameters) (result VirtualMachineScaleSetVMsReimageFuture, err error) { + req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID, VMScaleSetVMReimageInput) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", nil, "Failure preparing request") return @@ -670,7 +659,7 @@ func (client VirtualMachineScaleSetVMsClient) Reimage(ctx context.Context, resou } // ReimagePreparer prepares the Reimage request. -func (client VirtualMachineScaleSetVMsClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (*http.Request, error) { +func (client VirtualMachineScaleSetVMsClient) ReimagePreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, VMScaleSetVMReimageInput *VirtualMachineScaleSetVMReimageParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "instanceId": autorest.Encode("path", instanceID), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -678,16 +667,21 @@ func (client VirtualMachineScaleSetVMsClient) ReimagePreparer(ctx context.Contex "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" 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/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage", pathParameters), autorest.WithQueryParameters(queryParameters)) + if VMScaleSetVMReimageInput != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(VMScaleSetVMReimageInput)) + } return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -700,10 +694,6 @@ func (client VirtualMachineScaleSetVMsClient) ReimageSender(req *http.Request) ( if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -751,7 +741,7 @@ func (client VirtualMachineScaleSetVMsClient) ReimageAllPreparer(ctx context.Con "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -773,10 +763,6 @@ func (client VirtualMachineScaleSetVMsClient) ReimageAllSender(req *http.Request if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -823,7 +809,7 @@ func (client VirtualMachineScaleSetVMsClient) RestartPreparer(ctx context.Contex "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -845,10 +831,6 @@ func (client VirtualMachineScaleSetVMsClient) RestartSender(req *http.Request) ( if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -902,7 +884,7 @@ func (client VirtualMachineScaleSetVMsClient) RunCommandPreparer(ctx context.Con "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -926,10 +908,6 @@ func (client VirtualMachineScaleSetVMsClient) RunCommandSender(req *http.Request if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -977,7 +955,7 @@ func (client VirtualMachineScaleSetVMsClient) StartPreparer(ctx context.Context, "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -999,10 +977,6 @@ func (client VirtualMachineScaleSetVMsClient) StartSender(req *http.Request) (fu if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } @@ -1071,7 +1045,7 @@ func (client VirtualMachineScaleSetVMsClient) UpdatePreparer(ctx context.Context "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1095,10 +1069,6 @@ func (client VirtualMachineScaleSetVMsClient) UpdateSender(req *http.Request) (f if err != nil { return } - err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) - if err != nil { - return - } future.Future, err = azure.NewFutureFromResponse(resp) return } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinesizes.go b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachinesizes.go similarity index 99% rename from vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinesizes.go rename to vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachinesizes.go index 91343db942..545a675342 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute/virtualmachinesizes.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute/virtualmachinesizes.go @@ -79,7 +79,7 @@ func (client VirtualMachineSizesClient) ListPreparer(ctx context.Context, locati "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2018-10-01" + const APIVersion = "2019-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go index 7f0f6f2b66..265b802e77 100644 --- a/vendor/github.com/Azure/azure-sdk-for-go/version/version.go +++ b/vendor/github.com/Azure/azure-sdk-for-go/version/version.go @@ -18,4 +18,4 @@ package version // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Number contains the semantic version of this SDK. -const Number = "v21.3.0" +const Number = "v21.4.0" From f856655b32a62f85acbdc0c934e1a024a55e164c Mon Sep 17 00:00:00 2001 From: Pengfei Ni Date: Thu, 2 May 2019 08:30:30 +0800 Subject: [PATCH 6/6] Fix issues because of rebase --- .../providers/azure/azure_controller_common_test.go | 2 +- pkg/cloudprovider/providers/azure/azure_vmsets.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/cloudprovider/providers/azure/azure_controller_common_test.go b/pkg/cloudprovider/providers/azure/azure_controller_common_test.go index e4b30d41cf..c6bd2807bc 100644 --- a/pkg/cloudprovider/providers/azure/azure_controller_common_test.go +++ b/pkg/cloudprovider/providers/azure/azure_controller_common_test.go @@ -20,7 +20,7 @@ import ( "fmt" "testing" - "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-10-01/compute" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" ) func TestAttachDisk(t *testing.T) { diff --git a/pkg/cloudprovider/providers/azure/azure_vmsets.go b/pkg/cloudprovider/providers/azure/azure_vmsets.go index c92809c247..f8c0ee6170 100644 --- a/pkg/cloudprovider/providers/azure/azure_vmsets.go +++ b/pkg/cloudprovider/providers/azure/azure_vmsets.go @@ -17,6 +17,8 @@ limitations under the License. package azure import ( + "net/http" + "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2019-03-01/compute" "github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network"