diff --git a/cluster-autoscaler/Godeps/Godeps.json b/cluster-autoscaler/Godeps/Godeps.json index 5d07d58060fc..85c064fdbd77 100644 --- a/cluster-autoscaler/Godeps/Godeps.json +++ b/cluster-autoscaler/Godeps/Godeps.json @@ -18,28 +18,28 @@ }, { "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/compute", - "Comment": "v10.0.4-beta-1-g786cc84", - "Rev": "786cc84138518bf7fd6d60e92fad1ac9d1a117ad" + "Comment": "v11.1.1-beta", + "Rev": "509eea43b93cec2f3f17acbe2578ef58703923f8" }, { "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/containerregistry", - "Comment": "v10.0.4-beta-1-g786cc84", - "Rev": "786cc84138518bf7fd6d60e92fad1ac9d1a117ad" + "Comment": "v11.1.1-beta", + "Rev": "509eea43b93cec2f3f17acbe2578ef58703923f8" }, { "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/disk", - "Comment": "v10.0.4-beta-1-g786cc84", - "Rev": "786cc84138518bf7fd6d60e92fad1ac9d1a117ad" + "Comment": "v11.1.1-beta", + "Rev": "509eea43b93cec2f3f17acbe2578ef58703923f8" }, { "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/network", - "Comment": "v10.0.4-beta-1-g786cc84", - "Rev": "786cc84138518bf7fd6d60e92fad1ac9d1a117ad" + "Comment": "v11.1.1-beta", + "Rev": "509eea43b93cec2f3f17acbe2578ef58703923f8" }, { "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/storage", - "Comment": "v10.0.4-beta-1-g786cc84", - "Rev": "786cc84138518bf7fd6d60e92fad1ac9d1a117ad" + "Comment": "v11.1.1-beta", + "Rev": "509eea43b93cec2f3f17acbe2578ef58703923f8" }, { "ImportPath": "github.com/Azure/azure-sdk-for-go/storage", diff --git a/cluster-autoscaler/cloudprovider/azure/README.md b/cluster-autoscaler/cloudprovider/azure/README.md new file mode 100644 index 000000000000..d5fbaa6e1742 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/azure/README.md @@ -0,0 +1,202 @@ +# Cluster Autoscaler on Azure + +The cluster autoscaler on Azure scales worker nodes within any specified autoscaling group. It will run as a `Deployment` in your cluster. This README will go over some of the necessary steps required to get the cluster autoscaler up and running. + +## Kubernetes Version + +Cluster autoscaler must run on Kubernetes with Azure VMSS support ([kubernetes#43287](https://github.com/kubernetes/kubernetes/issues/43287)). It is planed in Kubernetes v1.10. + +## Permissions + +Get azure credentials by running the following command + +```sh +# replace with yours. +az ad sp create-for-rbac --role="Contributor" --scopes="/subscriptions/" --output json +``` + +And fill the values with the result you got into the configmap + +```yaml +apiVersion: v1 +data: + ClientID: + ClientSecret: + ResourceGroup: + SubscriptionID: + TenantID: + ScaleSetName: +kind: ConfigMap +metadata: + name: cluster-autoscaler-azure + namespace: kube-system +``` + +Create the configmap by running + +```sh +kubectl create -f cluster-autoscaler-azure-configmap.yaml +``` + +## Deployment + +```yaml +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: cluster-autoscaler + namespace: kube-system + labels: + app: cluster-autoscaler +spec: + replicas: 1 + selector: + matchLabels: + app: cluster-autoscaler + template: + metadata: + labels: + app: cluster-autoscaler + spec: + containers: + - image: feisky/cluster-autoscaler:dev + name: cluster-autoscaler + resources: + limits: + cpu: 100m + memory: 300Mi + requests: + cpu: 100m + memory: 300Mi + env: + - name: ARM_SUBSCRIPTION_ID + valueFrom: + configMapKeyRef: + name: cluster-autoscaler-azure + key: SubscriptionID + - name: ARM_RESOURCE_GROUP + valueFrom: + configMapKeyRef: + name: cluster-autoscaler-azure + key: ResourceGroup + - name: ARM_TENANT_ID + valueFrom: + configMapKeyRef: + name: cluster-autoscaler-azure + key: TenantID + - name: ARM_CLIENT_ID + valueFrom: + configMapKeyRef: + name: cluster-autoscaler-azure + key: ClientID + - name: ARM_CLIENT_SECRET + valueFrom: + configMapKeyRef: + name: cluster-autoscaler-azure + key: ClientSecret + - name: ARM_SCALE_SET_NAME + valueFrom: + configMapKeyRef: + name: cluster-autoscaler-azure + key: ScaleSetName + command: + - ./cluster-autoscaler + - --v=4 + - --cloud-provider=azure + - --skip-nodes-with-local-storage=false + - --nodes="1:10:$(ARM_SCALE_SET_NAME)" + volumeMounts: + - name: ssl-certs + mountPath: /etc/ssl/certs/ca-certificates.crt + readOnly: true + imagePullPolicy: "Always" + volumes: + - name: ssl-certs + hostPath: + path: "/etc/ssl/certs/ca-certificates.crt" +``` + +## Deploy in master node + +To run a CA pod in master node - CA deployment should tolerate the master `taint` and `nodeSelector` should be used to schedule the pods in master node. + +```yaml +apiVersion: extensions/v1beta1 +kind: Deployment +metadata: + name: cluster-autoscaler + namespace: kube-system + labels: + app: cluster-autoscaler +spec: + replicas: 1 + selector: + matchLabels: + app: cluster-autoscaler + template: + metadata: + labels: + app: cluster-autoscaler + spec: + tolerations: + - effect: NoSchedule + key: node-role.kubernetes.io/master + nodeSelector: + kubernetes.io/role: master + containers: + - image: feisky/cluster-autoscaler:dev + name: cluster-autoscaler + resources: + limits: + cpu: 100m + memory: 300Mi + requests: + cpu: 100m + memory: 300Mi + env: + - name: ARM_SUBSCRIPTION_ID + valueFrom: + configMapKeyRef: + name: cluster-autoscaler-azure + key: SubscriptionID + - name: ARM_RESOURCE_GROUP + valueFrom: + configMapKeyRef: + name: cluster-autoscaler-azure + key: ResourceGroup + - name: ARM_TENANT_ID + valueFrom: + configMapKeyRef: + name: cluster-autoscaler-azure + key: TenantID + - name: ARM_CLIENT_ID + valueFrom: + configMapKeyRef: + name: cluster-autoscaler-azure + key: ClientID + - name: ARM_CLIENT_SECRET + valueFrom: + configMapKeyRef: + name: cluster-autoscaler-azure + key: ClientSecret + - name: ARM_SCALE_SET_NAME + valueFrom: + configMapKeyRef: + name: cluster-autoscaler-azure + key: ScaleSetName + command: + - ./cluster-autoscaler + - --v=4 + - --cloud-provider=azure + - --skip-nodes-with-local-storage=false + - --nodes="1:10:$(ARM_SCALE_SET_NAME)" + volumeMounts: + - name: ssl-certs + mountPath: /etc/ssl/certs/ca-certificates.crt + readOnly: true + imagePullPolicy: "Always" + volumes: + - name: ssl-certs + hostPath: + path: "/etc/ssl/certs/ca-certificates.crt" +``` diff --git a/cluster-autoscaler/cloudprovider/azure/azure_cloud_provider.go b/cluster-autoscaler/cloudprovider/azure/azure_cloud_provider.go new file mode 100644 index 000000000000..3dc9ea4972b1 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/azure/azure_cloud_provider.go @@ -0,0 +1,338 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package azure + +import ( + "fmt" + "strconv" + "strings" + + "github.com/golang/glog" + + apiv1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/resource" + "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" + "k8s.io/autoscaler/cluster-autoscaler/utils/errors" + "k8s.io/kubernetes/plugin/pkg/scheduler/schedulercache" +) + +// AzureCloudProvider provides implementation of CloudProvider interface for Azure. +type AzureCloudProvider struct { + azureManager *AzureManager + scaleSets []*ScaleSet + resourceLimiter *cloudprovider.ResourceLimiter +} + +// BuildAzureCloudProvider creates new AzureCloudProvider +func BuildAzureCloudProvider(azureManager *AzureManager, specs []string, resourceLimiter *cloudprovider.ResourceLimiter) (*AzureCloudProvider, error) { + azure := &AzureCloudProvider{ + azureManager: azureManager, + resourceLimiter: resourceLimiter, + } + for _, spec := range specs { + if err := azure.addNodeGroup(spec); err != nil { + return nil, err + } + } + + return azure, nil +} + +// Cleanup stops the go routine that is handling the current view of the ASGs in the form of a cache +func (azure *AzureCloudProvider) Cleanup() error { + azure.azureManager.Cleanup() + return nil +} + +// addNodeGroup adds node group defined in string spec. Format: +// minNodes:maxNodes:scaleSetName +func (azure *AzureCloudProvider) addNodeGroup(spec string) error { + scaleSet, err := buildScaleSet(spec, azure.azureManager) + if err != nil { + return err + } + azure.scaleSets = append(azure.scaleSets, scaleSet) + azure.azureManager.RegisterScaleSet(scaleSet) + return nil +} + +// Name returns name of the cloud provider. +func (azure *AzureCloudProvider) Name() string { + return "azure" +} + +// NodeGroups returns all node groups configured for this cloud provider. +func (azure *AzureCloudProvider) NodeGroups() []cloudprovider.NodeGroup { + result := make([]cloudprovider.NodeGroup, 0, len(azure.scaleSets)) + for _, scaleSet := range azure.scaleSets { + result = append(result, scaleSet) + } + return result +} + +// NodeGroupForNode returns the node group for the given node. +func (azure *AzureCloudProvider) NodeGroupForNode(node *apiv1.Node) (cloudprovider.NodeGroup, error) { + glog.V(6).Infof("Searching for node group for the node: %s, %s\n", node.Spec.ExternalID, node.Spec.ProviderID) + ref := &AzureRef{ + Name: strings.ToLower(node.Spec.ProviderID), + } + + scaleSet, err := azure.azureManager.GetScaleSetForInstance(ref) + + return scaleSet, err +} + +// Pricing returns pricing model for this cloud provider or error if not available. +func (azure *AzureCloudProvider) Pricing() (cloudprovider.PricingModel, errors.AutoscalerError) { + return nil, cloudprovider.ErrNotImplemented +} + +// GetAvailableMachineTypes get all machine types that can be requested from the cloud provider. +func (azure *AzureCloudProvider) GetAvailableMachineTypes() ([]string, error) { + return []string{}, nil +} + +// NewNodeGroup builds a theoretical node group based on the node definition provided. The node group is not automatically +// created on the cloud provider side. The node group is not returned by NodeGroups() until it is created. +func (azure *AzureCloudProvider) NewNodeGroup(machineType string, labels map[string]string, extraResources map[string]resource.Quantity) (cloudprovider.NodeGroup, error) { + return nil, cloudprovider.ErrNotImplemented +} + +// GetResourceLimiter returns struct containing limits (max, min) for resources (cores, memory etc.). +func (azure *AzureCloudProvider) GetResourceLimiter() (*cloudprovider.ResourceLimiter, error) { + return azure.resourceLimiter, nil +} + +// Refresh is called before every main loop and can be used to dynamically update cloud provider state. +// In particular the list of node groups returned by NodeGroups can change as a result of CloudProvider.Refresh(). +func (azure *AzureCloudProvider) Refresh() error { + return nil +} + +// AzureRef contains a reference to some entity in Azure world. +type AzureRef struct { + Name string +} + +// GetKey returns key of the given azure reference. +func (m *AzureRef) GetKey() string { + return m.Name +} + +// AzureRefFromProviderId creates InstanceConfig object from provider id which +// must be in format: azure:///resourceGroupName/name +func AzureRefFromProviderId(id string) (*AzureRef, error) { + splitted := strings.Split(id[9:], "/") + if len(splitted) != 2 { + return nil, fmt.Errorf("Wrong id: expected format azure:///, got %v", id) + } + return &AzureRef{ + Name: splitted[len(splitted)-1], + }, nil +} + +// ScaleSet implements NodeGroup interface. +type ScaleSet struct { + AzureRef + + azureManager *AzureManager + minSize int + maxSize int +} + +// MinSize returns minimum size of the node group. +func (scaleSet *ScaleSet) MinSize() int { + return scaleSet.minSize +} + +// Exist checks if the node group really exists on the cloud provider side. Allows to tell the +// theoretical node group from the real one. +func (scaleSet *ScaleSet) Exist() bool { + return true +} + +// Create creates the node group on the cloud provider side. +func (scaleSet *ScaleSet) Create() error { + return cloudprovider.ErrAlreadyExist +} + +// Delete deletes the node group on the cloud provider side. +// This will be executed only for autoprovisioned node groups, once their size drops to 0. +func (scaleSet *ScaleSet) Delete() error { + return cloudprovider.ErrNotImplemented +} + +// Autoprovisioned returns true if the node group is autoprovisioned. +func (scaleSet *ScaleSet) Autoprovisioned() bool { + return false +} + +// MaxSize returns maximum size of the node group. +func (scaleSet *ScaleSet) MaxSize() int { + return scaleSet.maxSize +} + +// TargetSize returns the current TARGET size of the node group. It is possible that the +// number is different from the number of nodes registered in Kubernetes. +func (scaleSet *ScaleSet) TargetSize() (int, error) { + size, err := scaleSet.azureManager.GetScaleSetSize(scaleSet) + return int(size), err +} + +// IncreaseSize increases Scale Set size +func (scaleSet *ScaleSet) IncreaseSize(delta int) error { + if delta <= 0 { + return fmt.Errorf("size increase must be positive") + } + size, err := scaleSet.azureManager.GetScaleSetSize(scaleSet) + if err != nil { + return err + } + if int(size)+delta > scaleSet.MaxSize() { + return fmt.Errorf("size increase too large - desired:%d max:%d", int(size)+delta, scaleSet.MaxSize()) + } + return scaleSet.azureManager.SetScaleSetSize(scaleSet, size+int64(delta)) +} + +// DecreaseTargetSize decreases the target size of the node group. This function +// doesn't permit to delete any existing node and can be used only to reduce the +// request for new nodes that have not been yet fulfilled. Delta should be negative. +// It is assumed that cloud provider will not delete the existing nodes if the size +// when there is an option to just decrease the target. +func (scaleSet *ScaleSet) DecreaseTargetSize(delta int) error { + if delta >= 0 { + return fmt.Errorf("size decrease size must be negative") + } + size, err := scaleSet.azureManager.GetScaleSetSize(scaleSet) + if err != nil { + return err + } + nodes, err := scaleSet.azureManager.GetScaleSetVms(scaleSet) + if err != nil { + return err + } + if int(size)+delta < len(nodes) { + return fmt.Errorf("attempt to delete existing nodes targetSize:%d delta:%d existingNodes: %d", + size, delta, len(nodes)) + } + return scaleSet.azureManager.SetScaleSetSize(scaleSet, size+int64(delta)) +} + +// Belongs returns true if the given node belongs to the NodeGroup. +func (scaleSet *ScaleSet) Belongs(node *apiv1.Node) (bool, error) { + glog.V(6).Infof("Check if node belongs to this scale set: scaleset:%v, node:%v\n", scaleSet, node) + + ref := &AzureRef{ + Name: strings.ToLower(node.Spec.ProviderID), + } + + targetAsg, err := scaleSet.azureManager.GetScaleSetForInstance(ref) + if err != nil { + return false, err + } + if targetAsg == nil { + return false, fmt.Errorf("%s doesn't belong to a known scale set", node.Name) + } + if targetAsg.Id() != scaleSet.Id() { + return false, nil + } + return true, nil +} + +// DeleteNodes deletes the nodes from the group. +func (scaleSet *ScaleSet) DeleteNodes(nodes []*apiv1.Node) error { + glog.V(8).Infof("Delete nodes requested: %v\n", nodes) + size, err := scaleSet.azureManager.GetScaleSetSize(scaleSet) + if err != nil { + return err + } + if int(size) <= scaleSet.MinSize() { + return fmt.Errorf("min size reached, nodes will not be deleted") + } + refs := make([]*AzureRef, 0, len(nodes)) + for _, node := range nodes { + belongs, err := scaleSet.Belongs(node) + if err != nil { + return err + } + if belongs != true { + return fmt.Errorf("%s belongs to a different asg than %s", node.Name, scaleSet.Id()) + } + azureRef := &AzureRef{ + Name: strings.ToLower(node.Spec.ProviderID), + } + refs = append(refs, azureRef) + } + return scaleSet.azureManager.DeleteInstances(refs) +} + +// Id returns ScaleSet id. +func (scaleSet *ScaleSet) Id() string { + return scaleSet.Name +} + +// Debug returns a debug string for the Scale Set. +func (scaleSet *ScaleSet) Debug() string { + return fmt.Sprintf("%s (%d:%d)", scaleSet.Id(), scaleSet.MinSize(), scaleSet.MaxSize()) +} + +// TemplateNodeInfo returns a node template for this scale set. +func (scaleSet *ScaleSet) TemplateNodeInfo() (*schedulercache.NodeInfo, error) { + return nil, cloudprovider.ErrNotImplemented +} + +// Create ScaleSet from provided spec. +// spec is in the following format: min-size:max-size:scale-set-name. +func buildScaleSet(spec string, azureManager *AzureManager) (*ScaleSet, error) { + tokens := strings.SplitN(spec, ":", 3) + if len(tokens) != 3 { + return nil, fmt.Errorf("wrong nodes configuration: %s", spec) + } + + scaleSet := ScaleSet{ + azureManager: azureManager, + } + if size, err := strconv.Atoi(tokens[0]); err == nil { + if size <= 0 { + return nil, fmt.Errorf("min size must be >= 1, got: %d", size) + } + scaleSet.minSize = size + } else { + return nil, fmt.Errorf("failed to set min size: %s, expected integer", tokens[0]) + } + + if size, err := strconv.Atoi(tokens[1]); err == nil { + if size < scaleSet.minSize { + return nil, fmt.Errorf("max size must be greater or equal to min size") + } + scaleSet.maxSize = size + } else { + return nil, fmt.Errorf("failed to set max size: %s, expected integer", tokens[1]) + } + + if tokens[2] == "" { + return nil, fmt.Errorf("scale set name must not be blank, got spec: %s", spec) + } + + scaleSet.Name = tokens[2] + return &scaleSet, nil +} + +// Nodes returns a list of all nodes that belong to this node group. +func (scaleSet *ScaleSet) Nodes() ([]string, error) { + return scaleSet.azureManager.GetScaleSetVms(scaleSet) +} diff --git a/cluster-autoscaler/cloudprovider/azure/azure_cloud_provider_test.go b/cluster-autoscaler/cloudprovider/azure/azure_cloud_provider_test.go new file mode 100644 index 000000000000..9dba0b2e2e1f --- /dev/null +++ b/cluster-autoscaler/cloudprovider/azure/azure_cloud_provider_test.go @@ -0,0 +1,351 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package azure + +import ( + "net/http" + "testing" + + "github.com/Azure/azure-sdk-for-go/arm/compute" + "github.com/Azure/go-autorest/autorest" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/mock" + + apiv1 "k8s.io/api/core/v1" + "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" +) + +// Mock for VirtualMachineScaleSetsClient +type VirtualMachineScaleSetsClientMock struct { + mock.Mock +} + +func (client *VirtualMachineScaleSetsClientMock) Get(resourceGroupName string, + vmScaleSetName string) (result compute.VirtualMachineScaleSet, err error) { + capacity := int64(2) + properties := compute.VirtualMachineScaleSetProperties{} + return compute.VirtualMachineScaleSet{ + Name: &vmScaleSetName, + Sku: &compute.Sku{ + Capacity: &capacity, + }, + VirtualMachineScaleSetProperties: &properties, + }, nil +} + +func (client *VirtualMachineScaleSetsClientMock) CreateOrUpdate( + resourceGroupName string, vmScaleSetName string, parameters compute.VirtualMachineScaleSet, cancel <-chan struct{}) (<-chan compute.VirtualMachineScaleSet, <-chan error) { + errChan := make(chan error) + go func() { + errChan <- nil + }() + return nil, errChan +} + +func (client *VirtualMachineScaleSetsClientMock) DeleteInstances(resourceGroupName string, vmScaleSetName string, + vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs, cancel <-chan struct{}) (<-chan compute.OperationStatusResponse, <-chan error) { + args := client.Called(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel) + errChan := make(chan error) + go func() { + errChan <- args.Error(1) + }() + return nil, errChan +} + +// Mock for VirtualMachineScaleSetVMsClient +type VirtualMachineScaleSetVMsClientMock struct { + mock.Mock +} + +func (m *VirtualMachineScaleSetVMsClientMock) List(resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result compute.VirtualMachineScaleSetVMListResult, err error) { + value := make([]compute.VirtualMachineScaleSetVM, 1) + vmInstanceID := "test-instance-id" + properties := compute.VirtualMachineScaleSetVMProperties{} + vmID := "123E4567-E89B-12D3-A456-426655440000" + properties.VMID = &vmID + value[0] = compute.VirtualMachineScaleSetVM{ + ID: &vmID, + InstanceID: &vmInstanceID, + VirtualMachineScaleSetVMProperties: &properties, + } + + return compute.VirtualMachineScaleSetVMListResult{ + Value: &value, + }, nil + +} + +var testAzureManager = &AzureManager{ + scaleSets: make([]*scaleSetInformation, 0), + scaleSetClient: &VirtualMachineScaleSetsClientMock{}, + scaleSetVmClient: &VirtualMachineScaleSetVMsClientMock{}, + scaleSetCache: make(map[AzureRef]*ScaleSet), + interrupt: make(chan struct{}), +} + +func testProvider(t *testing.T, m *AzureManager) *AzureCloudProvider { + resourceLimiter := cloudprovider.NewResourceLimiter( + map[string]int64{cloudprovider.ResourceNameCores: 1, cloudprovider.ResourceNameMemory: 10000000}, + map[string]int64{cloudprovider.ResourceNameCores: 10, cloudprovider.ResourceNameMemory: 100000000}) + provider, err := BuildAzureCloudProvider(m, nil, resourceLimiter) + assert.NoError(t, err) + return provider +} + +func TestBuildAzureCloudProvider(t *testing.T) { + resourceLimiter := cloudprovider.NewResourceLimiter( + map[string]int64{cloudprovider.ResourceNameCores: 1, cloudprovider.ResourceNameMemory: 10000000}, + map[string]int64{cloudprovider.ResourceNameCores: 10, cloudprovider.ResourceNameMemory: 100000000}) + m := testAzureManager + _, err := BuildAzureCloudProvider(m, []string{"bad spec"}, resourceLimiter) + assert.Error(t, err) + + _, err = BuildAzureCloudProvider(m, nil, resourceLimiter) + assert.NoError(t, err) +} + +func TestAddNodeGroup(t *testing.T) { + provider := testProvider(t, testAzureManager) + err := provider.addNodeGroup("bad spec") + assert.Error(t, err) + assert.Equal(t, len(provider.scaleSets), 0) + + err = provider.addNodeGroup("1:5:test-asg") + assert.NoError(t, err) + assert.Equal(t, len(provider.scaleSets), 1) +} + +func TestName(t *testing.T) { + provider := testProvider(t, testAzureManager) + assert.Equal(t, provider.Name(), "azure") +} + +func TestNodeGroups(t *testing.T) { + provider := testProvider(t, testAzureManager) + assert.Equal(t, len(provider.NodeGroups()), 0) + err := provider.addNodeGroup("1:5:test-asg") + assert.NoError(t, err) + assert.Equal(t, len(provider.NodeGroups()), 1) +} + +func TestNodeGroupForNode(t *testing.T) { + node := &apiv1.Node{ + Spec: apiv1.NodeSpec{ + ProviderID: "azure://123E4567-E89B-12D3-A456-426655440000", + }, + } + + scaleSetVmClient := VirtualMachineScaleSetVMsClientMock{} + + var testAzureManager = &AzureManager{ + scaleSets: make([]*scaleSetInformation, 0), + scaleSetClient: &VirtualMachineScaleSetsClientMock{}, + scaleSetVmClient: &scaleSetVmClient, + scaleSetCache: make(map[AzureRef]*ScaleSet), + } + + provider := testProvider(t, testAzureManager) + err := provider.addNodeGroup("1:5:test-asg") + assert.NoError(t, err) + + assert.Equal(t, len(provider.scaleSets), 1) + + group, err := provider.NodeGroupForNode(node) + + assert.NoError(t, err) + assert.NotNil(t, group, "Group should not be nil") + + assert.Equal(t, group.Id(), "test-asg") + assert.Equal(t, group.MinSize(), 1) + assert.Equal(t, group.MaxSize(), 5) + + // test node in cluster that is not in a group managed by cluster autoscaler + nodeNotInGroup := &apiv1.Node{ + Spec: apiv1.NodeSpec{ + ProviderID: "azure:///subscriptions/subscripion/resourceGroups/test-resource-group/providers/Microsoft.Compute/virtualMachines/test-instance-id-not-in-group", + }, + } + + group, err = provider.NodeGroupForNode(nodeNotInGroup) + assert.NoError(t, err) + assert.Nil(t, group) + +} + +func TestAzureRefFromProviderId(t *testing.T) { + _, err := AzureRefFromProviderId("azure:///123") + assert.Error(t, err) + _, err = AzureRefFromProviderId("azure://test/rg/test-instance-id") + assert.Error(t, err) + + // Example id: "azure:///subscriptions/subscriptionId/resourceGroups/kubernetes/providers/Microsoft.Compute/virtualMachines/kubernetes-master" + azureRef, err := AzureRefFromProviderId("azure:////kubernetes-master") + assert.NoError(t, err) + assert.Equal(t, &AzureRef{ + Name: "kubernetes-master", + }, azureRef) +} + +func TestMaxSize(t *testing.T) { + provider := testProvider(t, testAzureManager) + err := provider.addNodeGroup("1:5:test-asg") + assert.NoError(t, err) + assert.Equal(t, len(provider.scaleSets), 1) + assert.Equal(t, provider.scaleSets[0].MaxSize(), 5) +} + +func TestMinSize(t *testing.T) { + provider := testProvider(t, testAzureManager) + err := provider.addNodeGroup("1:5:test-asg") + assert.NoError(t, err) + assert.Equal(t, len(provider.scaleSets), 1) + assert.Equal(t, provider.scaleSets[0].MinSize(), 1) +} + +func TestTargetSize(t *testing.T) { + provider := testProvider(t, testAzureManager) + err := provider.addNodeGroup("1:5:test-asg") + assert.NoError(t, err) + targetSize, err := provider.scaleSets[0].TargetSize() + assert.Equal(t, targetSize, 2) + assert.NoError(t, err) +} + +func TestIncreaseSize(t *testing.T) { + var testAzureManager = &AzureManager{ + scaleSets: make([]*scaleSetInformation, 0), + scaleSetClient: &VirtualMachineScaleSetsClientMock{}, + scaleSetVmClient: &VirtualMachineScaleSetVMsClientMock{}, + scaleSetCache: make(map[AzureRef]*ScaleSet), + } + + provider := testProvider(t, testAzureManager) + + err := provider.addNodeGroup("1:5:test-asg") + assert.NoError(t, err) + assert.Equal(t, len(provider.scaleSets), 1) + + err = provider.scaleSets[0].IncreaseSize(1) + assert.NoError(t, err) +} + +func TestBelongs(t *testing.T) { + var testAzureManager = &AzureManager{ + scaleSets: make([]*scaleSetInformation, 0), + scaleSetClient: &VirtualMachineScaleSetsClientMock{}, + scaleSetVmClient: &VirtualMachineScaleSetVMsClientMock{}, + scaleSetCache: make(map[AzureRef]*ScaleSet), + } + + provider := testProvider(t, testAzureManager) + err := provider.addNodeGroup("1:5:test-asg") + assert.NoError(t, err) + + invalidNode := &apiv1.Node{ + Spec: apiv1.NodeSpec{ + ProviderID: "azure:///subscriptions/subscriptionId/resourceGroups/kubernetes/providers/Microsoft.Compute/virtualMachines/invalid-instance-id", + }, + } + + _, err = provider.scaleSets[0].Belongs(invalidNode) + assert.Error(t, err) + + validNode := &apiv1.Node{ + Spec: apiv1.NodeSpec{ + ProviderID: "azure://123E4567-E89B-12D3-A456-426655440000", + }, + } + belongs, err := provider.scaleSets[0].Belongs(validNode) + assert.Equal(t, belongs, true) + assert.NoError(t, err) +} + +func TestDeleteNodes(t *testing.T) { + scaleSetClient := &VirtualMachineScaleSetsClientMock{} + m := &AzureManager{ + scaleSets: make([]*scaleSetInformation, 0), + scaleSetClient: scaleSetClient, + scaleSetVmClient: &VirtualMachineScaleSetVMsClientMock{}, + scaleSetCache: make(map[AzureRef]*ScaleSet), + } + + instanceIds := make([]string, 1) + instanceIds[0] = "test-instance-id" + response := autorest.Response{ + Response: &http.Response{ + Status: "OK", + }, + } + scaleSetClient.On("DeleteInstances", mock.Anything, "test-asg", mock.Anything, mock.Anything).Return(response, nil) + + provider := testProvider(t, m) + err := provider.addNodeGroup("1:5:test-asg") + assert.NoError(t, err) + + node := &apiv1.Node{ + Spec: apiv1.NodeSpec{ + ProviderID: "azure://123E4567-E89B-12D3-A456-426655440000", + }, + } + err = provider.scaleSets[0].DeleteNodes([]*apiv1.Node{node}) + assert.NoError(t, err) + scaleSetClient.AssertNumberOfCalls(t, "DeleteInstances", 1) +} + +func TestId(t *testing.T) { + provider := testProvider(t, testAzureManager) + err := provider.addNodeGroup("1:5:test-asg") + assert.NoError(t, err) + assert.Equal(t, len(provider.scaleSets), 1) + assert.Equal(t, provider.scaleSets[0].Id(), "test-asg") +} + +func TestDebug(t *testing.T) { + asg := ScaleSet{ + azureManager: testAzureManager, + minSize: 5, + maxSize: 55, + } + asg.Name = "test-scale-set" + assert.Equal(t, asg.Debug(), "test-scale-set (5:55)") +} + +func TestBuildAsg(t *testing.T) { + _, err := buildScaleSet("a", nil) + assert.Error(t, err) + _, err = buildScaleSet("a:b:c", nil) + assert.Error(t, err) + _, err = buildScaleSet("1:", nil) + assert.Error(t, err) + _, err = buildScaleSet("1:2:", nil) + assert.Error(t, err) + + _, err = buildScaleSet("-1:2:", nil) + assert.Error(t, err) + + _, err = buildScaleSet("5:3:", nil) + assert.Error(t, err) + + _, err = buildScaleSet("5:ddd:test-name", nil) + assert.Error(t, err) + + asg, err := buildScaleSet("111:222:test-name", nil) + assert.NoError(t, err) + assert.Equal(t, 111, asg.MinSize()) + assert.Equal(t, 222, asg.MaxSize()) + assert.Equal(t, "test-name", asg.Name) +} diff --git a/cluster-autoscaler/cloudprovider/azure/azure_manager.go b/cluster-autoscaler/cloudprovider/azure/azure_manager.go new file mode 100644 index 000000000000..bad882904726 --- /dev/null +++ b/cluster-autoscaler/cloudprovider/azure/azure_manager.go @@ -0,0 +1,364 @@ +/* +Copyright 2017 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package azure + +import ( + "fmt" + "io" + "net/http" + "os" + "strings" + "sync" + "time" + + "github.com/Azure/azure-sdk-for-go/arm/compute" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/adal" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/golang/glog" + + "gopkg.in/gcfg.v1" + "k8s.io/apimachinery/pkg/util/wait" +) + +type scaleSetInformation struct { + config *ScaleSet + basename string +} + +type scaleSetClient interface { + Get(resourceGroupName string, vmScaleSetName string) (result compute.VirtualMachineScaleSet, err error) + CreateOrUpdate(resourceGroupName string, name string, parameters compute.VirtualMachineScaleSet, cancel <-chan struct{}) (<-chan compute.VirtualMachineScaleSet, <-chan error) + DeleteInstances(resourceGroupName string, vmScaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs, cancel <-chan struct{}) (<-chan compute.OperationStatusResponse, <-chan error) +} + +type scaleSetVMClient interface { + List(resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result compute.VirtualMachineScaleSetVMListResult, err error) +} + +// AzureManager handles Azure communication and data caching. +type AzureManager struct { + resourceGroupName string + subscription string + scaleSetClient scaleSetClient + scaleSetVmClient scaleSetVMClient + + scaleSets []*scaleSetInformation + scaleSetCache map[AzureRef]*ScaleSet + + // cache of mapping from instance id to the scale set id + scaleSetIdCache map[string]string + + cacheMutex sync.Mutex + interrupt chan struct{} +} + +// Config holds the configuration parsed from the --cloud-config flag +type Config struct { + Cloud string `json:"cloud" yaml:"cloud"` + TenantID string `json:"tenantId" yaml:"tenantId"` + SubscriptionID string `json:"subscriptionId" yaml:"subscriptionId"` + ResourceGroup string `json:"resourceGroup" yaml:"resourceGroup"` + Location string `json:"location" yaml:"location"` + VnetName string `json:"vnetName" yaml:"vnetName"` + SubnetName string `json:"subnetName" yaml:"subnetName"` + SecurityGroupName string `json:"securityGroupName" yaml:"securityGroupName"` + RouteTableName string `json:"routeTableName" yaml:"routeTableName"` + PrimaryAvailabilitySetName string `json:"primaryAvailabilitySetName" yaml:"primaryAvailabilitySetName"` + + AADClientID string `json:"aadClientId" yaml:"aadClientId"` + AADClientSecret string `json:"aadClientSecret" yaml:"aadClientSecret"` + AADTenantID string `json:"aadTenantId" yaml:"aadTenantId"` +} + +// CreateAzureManager creates Azure Manager object to work with Azure. +func CreateAzureManager(configReader io.Reader) (*AzureManager, error) { + subscriptionId := string("") + resourceGroup := string("") + tenantId := string("") + clientId := string("") + clientSecret := string("") + var scaleSetAPI scaleSetClient + var scaleSetVmAPI scaleSetVMClient + if configReader != nil { + var cfg Config + if err := gcfg.ReadInto(&cfg, configReader); err != nil { + glog.Errorf("Couldn't read config: %v", err) + return nil, err + } + subscriptionId = cfg.SubscriptionID + resourceGroup = cfg.ResourceGroup + tenantId = cfg.AADTenantID + clientId = cfg.AADClientID + clientSecret = cfg.AADClientSecret + + } else { + subscriptionId = os.Getenv("ARM_SUBSCRIPTION_ID") + resourceGroup = os.Getenv("ARM_RESOURCE_GROUP") + tenantId = os.Getenv("ARM_TENANT_ID") + clientId = os.Getenv("ARM_CLIENT_ID") + clientSecret = os.Getenv("ARM_CLIENT_SECRET") + } + + if resourceGroup == "" { + panic("Resource group not found") + } + + if subscriptionId == "" { + panic("Subscription ID not found") + } + + if tenantId == "" { + panic("Tenant ID not found.") + } + + if clientId == "" { + panic("ARM Client ID not found") + } + + if clientSecret == "" { + panic("ARM Client Secret not found.") + } + + glog.Infof("read configuration: %v", subscriptionId) + + spt, err := NewServicePrincipalTokenFromCredentials(tenantId, clientId, clientSecret, azure.PublicCloud.ServiceManagementEndpoint) + if err != nil { + panic(err) + } + + scaleSetAPI = compute.NewVirtualMachineScaleSetsClient(subscriptionId) + scaleSetsClient := scaleSetAPI.(compute.VirtualMachineScaleSetsClient) + scaleSetsClient.Authorizer = autorest.NewBearerAuthorizer(spt) + scaleSetsClient.Sender = autorest.CreateSender( + //autorest.WithLogging(log.New(os.Stdout, "sdk-example: ", log.LstdFlags)), + ) + + //scaleSetsClient.RequestInspector = withInspection() + //scaleSetsClient.ResponseInspector = byInspecting() + + glog.Infof("Created scale set client with authorizer: %v", scaleSetsClient) + + scaleSetVmAPI = compute.NewVirtualMachineScaleSetVMsClient(subscriptionId) + scaleSetVMsClient := scaleSetVmAPI.(compute.VirtualMachineScaleSetVMsClient) + scaleSetVMsClient.Authorizer = autorest.NewBearerAuthorizer(spt) + scaleSetVMsClient.RequestInspector = withInspection() + scaleSetVMsClient.ResponseInspector = byInspecting() + + glog.Infof("Created scale set vm client with authorizer: %v", scaleSetVMsClient) + + // Create Availability Sets Azure Client. + manager := &AzureManager{ + subscription: subscriptionId, + resourceGroupName: resourceGroup, + scaleSetClient: scaleSetsClient, + scaleSetVmClient: scaleSetVMsClient, + scaleSets: make([]*scaleSetInformation, 0), + scaleSetCache: make(map[AzureRef]*ScaleSet), + interrupt: make(chan struct{}), + } + + go wait.Until(func() { + manager.cacheMutex.Lock() + defer manager.cacheMutex.Unlock() + if err := manager.regenerateCache(); err != nil { + glog.Errorf("Error while regenerating AS cache: %v", err) + } + }, time.Hour, manager.interrupt) + + return manager, nil +} + +// NewServicePrincipalTokenFromCredentials creates a new ServicePrincipalToken using values of the +// passed credentials map. +func NewServicePrincipalTokenFromCredentials(tenantID string, clientID string, clientSecret string, scope string) (*adal.ServicePrincipalToken, error) { + oauthConfig, err := adal.NewOAuthConfig(azure.PublicCloud.ActiveDirectoryEndpoint, tenantID) + if err != nil { + panic(err) + } + return adal.NewServicePrincipalToken(*oauthConfig, clientID, clientSecret, scope) +} + +func withInspection() autorest.PrepareDecorator { + return func(p autorest.Preparer) autorest.Preparer { + return autorest.PreparerFunc(func(r *http.Request) (*http.Request, error) { + glog.Infof("Inspecting Request: %s %s\n", r.Method, r.URL) + return p.Prepare(r) + }) + } +} + +func byInspecting() autorest.RespondDecorator { + return func(r autorest.Responder) autorest.Responder { + return autorest.ResponderFunc(func(resp *http.Response) error { + glog.Infof("Inspecting Response: %s for %s %s\n", resp.Status, resp.Request.Method, resp.Request.URL) + return r.Respond(resp) + }) + } +} + +// RegisterScaleSet registers scale set in Azure Manager. +func (m *AzureManager) RegisterScaleSet(scaleSet *ScaleSet) { + m.cacheMutex.Lock() + defer m.cacheMutex.Unlock() + + m.scaleSets = append(m.scaleSets, + &scaleSetInformation{ + config: scaleSet, + basename: scaleSet.Name, + }) + +} + +// GetScaleSetSize gets Scale Set size. +func (m *AzureManager) GetScaleSetSize(asConfig *ScaleSet) (int64, error) { + glog.V(5).Infof("Get scale set size: %v\n", asConfig) + set, err := m.scaleSetClient.Get(m.resourceGroupName, asConfig.Name) + if err != nil { + return -1, err + } + glog.V(5).Infof("Returning scale set capacity: %d\n", *set.Sku.Capacity) + return *set.Sku.Capacity, nil +} + +// SetScaleSetSize sets ScaleSet size. +func (m *AzureManager) SetScaleSetSize(asConfig *ScaleSet, size int64) error { + op, err := m.scaleSetClient.Get(m.resourceGroupName, asConfig.Name) + if err != nil { + return err + } + op.Sku.Capacity = &size + op.VirtualMachineScaleSetProperties.ProvisioningState = nil + cancel := make(chan struct{}) + + _, errChan := m.scaleSetClient.CreateOrUpdate(m.resourceGroupName, asConfig.Name, op, cancel) + return <-errChan +} + +// GetScaleSetForInstance returns ScaleSetConfig of the given Instance +func (m *AzureManager) GetScaleSetForInstance(instance *AzureRef) (*ScaleSet, error) { + glog.V(5).Infof("Looking for scale set for instance: %v\n", instance) + + glog.V(8).Infof("Cache BEFORE: %v\n", m.scaleSetCache) + + m.cacheMutex.Lock() + defer m.cacheMutex.Unlock() + if config, found := m.scaleSetCache[*instance]; found { + return config, nil + } + + if err := m.regenerateCache(); err != nil { + return nil, fmt.Errorf("Error while looking for ScaleSet for instance %+v, error: %v", *instance, err) + } + + glog.V(8).Infof("Cache AFTER: %v\n", m.scaleSetCache) + + if config, found := m.scaleSetCache[*instance]; found { + return config, nil + } + // instance does not belong to any configured Scale Set + return nil, nil +} + +// DeleteInstances deletes the given instances. All instances must be controlled by the same ASG. +func (m *AzureManager) DeleteInstances(instances []*AzureRef) error { + if len(instances) == 0 { + return nil + } + commonAsg, err := m.GetScaleSetForInstance(instances[0]) + if err != nil { + return err + } + for _, instance := range instances { + asg, err := m.GetScaleSetForInstance(instance) + if err != nil { + return err + } + if asg != commonAsg { + return fmt.Errorf("Cannot delete instances which don't belong to the same Scale Set.") + } + } + + instanceIds := make([]string, len(instances)) + for i, instance := range instances { + instanceIds[i] = m.scaleSetIdCache[instance.Name] + } + requiredIds := &compute.VirtualMachineScaleSetVMInstanceRequiredIDs{ + InstanceIds: &instanceIds, + } + cancel := make(chan struct{}) + _, errChan := m.scaleSetClient.DeleteInstances(m.resourceGroupName, commonAsg.Name, *requiredIds, cancel) + return <-errChan +} + +func (m *AzureManager) regenerateCache() error { + newCache := make(map[AzureRef]*ScaleSet) + newScaleSetIdCache := make(map[string]string) + + for _, sset := range m.scaleSets { + glog.V(4).Infof("Regenerating Scale Set information for %s", sset.config.Name) + scaleSet, err := m.scaleSetClient.Get(m.resourceGroupName, sset.config.Name) + if err != nil { + glog.Errorf("Failed to get scaleSet with name %s: %v", sset.config.Name, err) + return err + } + sset.basename = *scaleSet.Name + + result, err := m.scaleSetVmClient.List(m.resourceGroupName, sset.basename, "", "", "") + if err != nil { + glog.Errorf("Failed to list vm for scaleSet %s: %v", sset.config.Name, err) + return err + } + + for _, instance := range *result.Value { + // Convert to lower because instance.ID is in different in different API calls (e.g. GET and LIST). + name := "azure://" + strings.ToLower(*instance.ID) + ref := AzureRef{ + Name: name, + } + newCache[ref] = sset.config + newScaleSetIdCache[name] = *instance.InstanceID + } + } + + m.scaleSetCache = newCache + m.scaleSetIdCache = newScaleSetIdCache + return nil +} + +// GetScaleSetVms returns list of nodes for the given scale set. +func (m *AzureManager) GetScaleSetVms(scaleSet *ScaleSet) ([]string, error) { + instances, err := m.scaleSetVmClient.List(m.resourceGroupName, scaleSet.Name, "", "", "") + + if err != nil { + glog.V(4).Infof("Failed AS info request for %s: %v", scaleSet.Name, err) + return []string{}, err + } + result := make([]string, 0) + for _, instance := range *instances.Value { + // Convert to lower because instance.ID is in different in different API calls (e.g. GET and LIST). + name := "azure://" + strings.ToLower(*instance.ID) + result = append(result, name) + } + return result, nil + +} + +// Cleanup closes the channel to signal the go routine to stop that is handling the cache +func (m *AzureManager) Cleanup() { + close(m.interrupt) +} diff --git a/cluster-autoscaler/cloudprovider/builder/cloud_provider_builder.go b/cluster-autoscaler/cloudprovider/builder/cloud_provider_builder.go index 9a6ed490aec3..62e83d4e3d42 100644 --- a/cluster-autoscaler/cloudprovider/builder/cloud_provider_builder.go +++ b/cluster-autoscaler/cloudprovider/builder/cloud_provider_builder.go @@ -21,6 +21,7 @@ import ( "k8s.io/autoscaler/cluster-autoscaler/cloudprovider" "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/aws" + "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/azure" "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/gce" "k8s.io/autoscaler/cluster-autoscaler/cloudprovider/kubemark" "k8s.io/client-go/informers" @@ -112,6 +113,30 @@ func (b CloudProviderBuilder) Build(discoveryOpts cloudprovider.NodeGroupDiscove } } + if b.cloudProviderFlag == "azure" { + var azureManager *azure.AzureManager + var azureError error + if b.cloudConfig != "" { + glog.Info("Creating Azure Manager using cloud-config file: %v", b.cloudConfig) + config, fileErr := os.Open(b.cloudConfig) + if fileErr != nil { + glog.Fatalf("Couldn't open cloud provider configuration %s: %#v", b.cloudConfig, err) + } + defer config.Close() + azureManager, azureError = azure.CreateAzureManager(config) + } else { + glog.Info("Creating Azure Manager with default configuration.") + azureManager, azureError = azure.CreateAzureManager(nil) + } + if azureError != nil { + glog.Fatalf("Failed to create Azure Manager: %v", err) + } + cloudProvider, err = azure.BuildAzureCloudProvider(azureManager, nodeGroupsFlag, resourceLimiter) + if err != nil { + glog.Fatalf("Failed to create Azure cloud provider: %v", err) + } + } + if b.cloudProviderFlag == kubemark.ProviderName { glog.V(1).Infof("Building kubemark cloud provider.") externalConfig, err := rest.InClusterConfig() diff --git a/cluster-autoscaler/main.go b/cluster-autoscaler/main.go index c593ba5ceef6..57f00c2974b8 100644 --- a/cluster-autoscaler/main.go +++ b/cluster-autoscaler/main.go @@ -107,7 +107,7 @@ var ( maxNodesTotal = flag.Int("max-nodes-total", 0, "Maximum number of nodes in all node groups. Cluster autoscaler will not grow the cluster beyond this number.") coresTotal = flag.String("cores-total", minMaxFlagString(0, config.DefaultMaxClusterCores), "Minimum and maximum number of cores in cluster, in the format :. Cluster autoscaler will not scale the cluster beyond these numbers.") memoryTotal = flag.String("memory-total", minMaxFlagString(0, config.DefaultMaxClusterMemory), "Minimum and maximum number of gigabytes of memory in cluster, in the format :. Cluster autoscaler will not scale the cluster beyond these numbers.") - cloudProviderFlag = flag.String("cloud-provider", "gce", "Cloud provider type. Allowed values: gce, aws, kubemark") + cloudProviderFlag = flag.String("cloud-provider", "gce", "Cloud provider type. Allowed values: gce, aws, azure, kubemark") maxEmptyBulkDeleteFlag = flag.Int("max-empty-bulk-delete", 10, "Maximum number of empty nodes that can be deleted at the same time.") maxGracefulTerminationFlag = flag.Int("max-graceful-termination-sec", 10*60, "Maximum number of seconds CA waits for pod termination when trying to scale down a node.") maxTotalUnreadyPercentage = flag.Float64("max-total-unready-percentage", 33, "Maximum percentage of unready nodes after which CA halts operations") diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/NOTICE b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/NOTICE new file mode 100644 index 000000000000..2d1d72608c28 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/NOTICE @@ -0,0 +1,5 @@ +Microsoft Azure-SDK-for-Go +Copyright 2014-2017 Microsoft + +This product includes software developed at +the Microsoft Corporation (https://www.microsoft.com). diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/availabilitysets.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/availabilitysets.go index 738c2c61ea0f..bf1a8fc34e38 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/availabilitysets.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/availabilitysets.go @@ -14,9 +14,8 @@ package compute // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,30 +23,27 @@ import ( "net/http" ) -// AvailabilitySetsClient is the the Compute Management Client. +// AvailabilitySetsClient is the compute Client type AvailabilitySetsClient struct { ManagementClient } -// NewAvailabilitySetsClient creates an instance of the AvailabilitySetsClient -// client. +// NewAvailabilitySetsClient creates an instance of the AvailabilitySetsClient client. func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient { return NewAvailabilitySetsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewAvailabilitySetsClientWithBaseURI creates an instance of the -// AvailabilitySetsClient client. +// NewAvailabilitySetsClientWithBaseURI creates an instance of the AvailabilitySetsClient client. func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string) AvailabilitySetsClient { return AvailabilitySetsClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate create or update an availability set. // -// resourceGroupName is the name of the resource group. name is the name of the -// availability set. parameters is parameters supplied to the Create -// Availability Set operation. -func (client AvailabilitySetsClient) CreateOrUpdate(resourceGroupName string, name string, parameters AvailabilitySet) (result AvailabilitySet, err error) { - req, err := client.CreateOrUpdatePreparer(resourceGroupName, name, parameters) +// resourceGroupName is the name of the resource group. availabilitySetName is the name of the availability set. +// parameters is parameters supplied to the Create Availability Set operation. +func (client AvailabilitySetsClient) CreateOrUpdate(resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (result AvailabilitySet, err error) { + req, err := client.CreateOrUpdatePreparer(resourceGroupName, availabilitySetName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -69,14 +65,14 @@ func (client AvailabilitySetsClient) CreateOrUpdate(resourceGroupName string, na } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client AvailabilitySetsClient) CreateOrUpdatePreparer(resourceGroupName string, name string, parameters AvailabilitySet) (*http.Request, error) { +func (client AvailabilitySetsClient) CreateOrUpdatePreparer(resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (*http.Request, error) { pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), - "resourceGroupName": autorest.Encode("path", resourceGroupName), - "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "availabilitySetName": autorest.Encode("path", availabilitySetName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -85,7 +81,7 @@ func (client AvailabilitySetsClient) CreateOrUpdatePreparer(resourceGroupName st autorest.AsJSON(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{name}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare(&http.Request{}) @@ -112,8 +108,7 @@ func (client AvailabilitySetsClient) CreateOrUpdateResponder(resp *http.Response // Delete delete an availability set. // -// resourceGroupName is the name of the resource group. availabilitySetName is -// the name of the availability set. +// resourceGroupName is the name of the resource group. availabilitySetName is the name of the availability set. func (client AvailabilitySetsClient) Delete(resourceGroupName string, availabilitySetName string) (result OperationStatusResponse, err error) { req, err := client.DeletePreparer(resourceGroupName, availabilitySetName) if err != nil { @@ -144,7 +139,7 @@ func (client AvailabilitySetsClient) DeletePreparer(resourceGroupName string, av "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -178,8 +173,7 @@ func (client AvailabilitySetsClient) DeleteResponder(resp *http.Response) (resul // Get retrieves information about an availability set. // -// resourceGroupName is the name of the resource group. availabilitySetName is -// the name of the availability set. +// resourceGroupName is the name of the resource group. availabilitySetName is the name of the availability set. func (client AvailabilitySetsClient) Get(resourceGroupName string, availabilitySetName string) (result AvailabilitySet, err error) { req, err := client.GetPreparer(resourceGroupName, availabilitySetName) if err != nil { @@ -210,7 +204,7 @@ func (client AvailabilitySetsClient) GetPreparer(resourceGroupName string, avail "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -274,7 +268,7 @@ func (client AvailabilitySetsClient) ListPreparer(resourceGroupName string) (*ht "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -306,11 +300,10 @@ func (client AvailabilitySetsClient) ListResponder(resp *http.Response) (result return } -// ListAvailableSizes lists all available virtual machine sizes that can be -// used to create a new virtual machine in an existing availability set. +// ListAvailableSizes lists all available virtual machine sizes that can be used to create a new virtual machine in an +// existing availability set. // -// resourceGroupName is the name of the resource group. availabilitySetName is -// the name of the availability set. +// resourceGroupName is the name of the resource group. availabilitySetName is the name of the availability set. func (client AvailabilitySetsClient) ListAvailableSizes(resourceGroupName string, availabilitySetName string) (result VirtualMachineSizeListResult, err error) { req, err := client.ListAvailableSizesPreparer(resourceGroupName, availabilitySetName) if err != nil { @@ -341,7 +334,7 @@ func (client AvailabilitySetsClient) ListAvailableSizesPreparer(resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/client.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/client.go index c60452b9d794..98b1c0dad648 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/client.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/client.go @@ -1,7 +1,6 @@ -// Package compute implements the Azure ARM Compute service API version -// 2016-04-30-preview. +// Package compute implements the Azure ARM Compute service API version . // -// The Compute Management Client. +// Compute Client package compute // Copyright (c) Microsoft and contributors. All rights reserved. @@ -18,9 +17,8 @@ package compute // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/containerservices.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/containerservices.go new file mode 100644 index 000000000000..98c1706eef7b --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/containerservices.go @@ -0,0 +1,579 @@ +package compute + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ContainerServicesClient is the compute Client +type ContainerServicesClient struct { + ManagementClient +} + +// NewContainerServicesClient creates an instance of the ContainerServicesClient client. +func NewContainerServicesClient(subscriptionID string) ContainerServicesClient { + return NewContainerServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewContainerServicesClientWithBaseURI creates an instance of the ContainerServicesClient client. +func NewContainerServicesClientWithBaseURI(baseURI string, subscriptionID string) ContainerServicesClient { + return ContainerServicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a container service with the specified configuration of orchestrator, masters, and +// agents. This method may poll for completion. Polling can be canceled by passing the cancel channel argument. The +// channel will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. containerServiceName is the name of the container service in +// the specified subscription and resource group. parameters is parameters supplied to the Create or Update a Container +// Service operation. +func (client ContainerServicesClient) CreateOrUpdate(resourceGroupName string, containerServiceName string, parameters ContainerService, cancel <-chan struct{}) (<-chan ContainerService, <-chan error) { + resultChan := make(chan ContainerService, 1) + errChan := make(chan error, 1) + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ContainerServiceProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.CustomProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.CustomProfile.Orchestrator", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.ContainerServiceProperties.ServicePrincipalProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.ServicePrincipalProfile.ClientID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ContainerServiceProperties.ServicePrincipalProfile.Secret", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.ContainerServiceProperties.MasterProfile", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.MasterProfile.DNSPrefix", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.ContainerServiceProperties.AgentPoolProfiles", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ContainerServiceProperties.WindowsProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.WindowsProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.WindowsProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$`, Chain: nil}}}, + {Target: "parameters.ContainerServiceProperties.WindowsProfile.AdminPassword", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.WindowsProfile.AdminPassword", Name: validation.Pattern, Rule: `^(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%\^&\*\(\)])[a-zA-Z\d!@#$%\^&\*\(\)]{12,123}$`, Chain: nil}}}, + }}, + {Target: "parameters.ContainerServiceProperties.LinuxProfile", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.LinuxProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.LinuxProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-z][a-z0-9_-]*$`, Chain: nil}}}, + {Target: "parameters.ContainerServiceProperties.LinuxProfile.SSH", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.LinuxProfile.SSH.PublicKeys", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "parameters.ContainerServiceProperties.DiagnosticsProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.DiagnosticsProfile.VMDiagnostics", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ContainerServiceProperties.DiagnosticsProfile.VMDiagnostics.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + errChan <- validation.NewErrorWithValidationError(err, "compute.ContainerServicesClient", "CreateOrUpdate") + close(errChan) + close(resultChan) + return resultChan, errChan + } + + go func() { + var err error + var result ContainerService + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.CreateOrUpdatePreparer(resourceGroupName, containerServiceName, parameters, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ContainerServicesClient) CreateOrUpdatePreparer(resourceGroupName string, containerServiceName string, parameters ContainerService, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerServiceName": autorest.Encode("path", containerServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-01-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ContainerServicesClient) CreateOrUpdateResponder(resp *http.Response) (result ContainerService, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified container service in the specified subscription and resource group. The operation does +// not delete other resources created as part of creating a container service, including storage accounts, VMs, and +// availability sets. All the other resources created with the container service are part of the same resource group +// and can be deleted individually. This method may poll for completion. Polling can be canceled by passing the cancel +// channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. containerServiceName is the name of the container service in +// the specified subscription and resource group. +func (client ContainerServicesClient) Delete(resourceGroupName string, containerServiceName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { + resultChan := make(chan autorest.Response, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result autorest.Response + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.DeletePreparer(resourceGroupName, containerServiceName, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Delete", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// DeletePreparer prepares the Delete request. +func (client ContainerServicesClient) DeletePreparer(resourceGroupName string, containerServiceName string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerServiceName": autorest.Encode("path", containerServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-01-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ContainerServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified container service in the specified subscription and resource group. The +// operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of masters +// and agents. +// +// resourceGroupName is the name of the resource group. containerServiceName is the name of the container service in +// the specified subscription and resource group. +func (client ContainerServicesClient) Get(resourceGroupName string, containerServiceName string) (result ContainerService, err error) { + req, err := client.GetPreparer(resourceGroupName, containerServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ContainerServicesClient) GetPreparer(resourceGroupName string, containerServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerServiceName": autorest.Encode("path", containerServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-01-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ContainerServicesClient) GetResponder(resp *http.Response) (result ContainerService, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of container services in the specified subscription. The operation returns properties of each +// container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. +func (client ContainerServicesClient) List() (result ContainerServiceListResult, err error) { + req, err := client.ListPreparer() + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ContainerServicesClient) ListPreparer() (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-01-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ContainerServicesClient) ListResponder(resp *http.Response) (result ContainerServiceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client ContainerServicesClient) ListNextResults(lastResults ContainerServiceListResult) (result ContainerServiceListResult, err error) { + req, err := lastResults.ContainerServiceListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListComplete gets all elements from the list without paging. +func (client ContainerServicesClient) ListComplete(cancel <-chan struct{}) (<-chan ContainerService, <-chan error) { + resultChan := make(chan ContainerService) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListByResourceGroup gets a list of container services in the specified subscription and resource group. The +// operation returns properties of each container service including state, orchestrator, number of masters and agents, +// and FQDNs of masters and agents. +// +// resourceGroupName is the name of the resource group. +func (client ContainerServicesClient) ListByResourceGroup(resourceGroupName string) (result ContainerServiceListResult, err error) { + req, err := client.ListByResourceGroupPreparer(resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ContainerServicesClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-01-31" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ContainerServicesClient) ListByResourceGroupResponder(resp *http.Response) (result ContainerServiceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroupNextResults retrieves the next set of results, if any. +func (client ContainerServicesClient) ListByResourceGroupNextResults(lastResults ContainerServiceListResult) (result ContainerServiceListResult, err error) { + req, err := lastResults.ContainerServiceListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "ListByResourceGroup", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "ListByResourceGroup", resp, "Failure sending next results request") + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ContainerServicesClient", "ListByResourceGroup", resp, "Failure responding to next results request") + } + + return +} + +// ListByResourceGroupComplete gets all elements from the list without paging. +func (client ContainerServicesClient) ListByResourceGroupComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan ContainerService, <-chan error) { + resultChan := make(chan ContainerService) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListByResourceGroup(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListByResourceGroupNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/disks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/disks.go new file mode 100644 index 000000000000..47e9e4029ce7 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/disks.go @@ -0,0 +1,818 @@ +package compute + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// DisksClient is the compute Client +type DisksClient struct { + ManagementClient +} + +// NewDisksClient creates an instance of the DisksClient client. +func NewDisksClient(subscriptionID string) DisksClient { + return NewDisksClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDisksClientWithBaseURI creates an instance of the DisksClient client. +func NewDisksClientWithBaseURI(baseURI string, subscriptionID string) DisksClient { + return DisksClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a disk. This method may poll for completion. Polling can be canceled by passing +// the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. diskName is the name of the disk within the given subscription +// and resource group. disk is disk object supplied in the body of the Put disk operation. +func (client DisksClient) CreateOrUpdate(resourceGroupName string, diskName string, disk Disk, cancel <-chan struct{}) (<-chan Disk, <-chan error) { + resultChan := make(chan Disk, 1) + errChan := make(chan error, 1) + if err := validation.Validate([]validation.Validation{ + {TargetValue: disk, + Constraints: []validation.Constraint{{Target: "disk.DiskProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData.ImageReference", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "disk.DiskProperties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "disk.DiskProperties.EncryptionSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "disk.DiskProperties.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "disk.DiskProperties.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "disk.DiskProperties.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "disk.DiskProperties.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "disk.DiskProperties.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "disk.DiskProperties.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + errChan <- validation.NewErrorWithValidationError(err, "compute.DisksClient", "CreateOrUpdate") + close(errChan) + close(resultChan) + return resultChan, errChan + } + + go func() { + var err error + var result Disk + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.CreateOrUpdatePreparer(resourceGroupName, diskName, disk, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "CreateOrUpdate", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DisksClient) CreateOrUpdatePreparer(resourceGroupName string, diskName string, disk Disk, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskName": autorest.Encode("path", diskName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), + autorest.WithJSON(disk), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DisksClient) CreateOrUpdateResponder(resp *http.Response) (result Disk, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a disk. This method may poll for completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. diskName is the name of the disk within the given subscription +// and resource group. +func (client DisksClient) Delete(resourceGroupName string, diskName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { + resultChan := make(chan OperationStatusResponse, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result OperationStatusResponse + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.DeletePreparer(resourceGroupName, diskName, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "Delete", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// DeletePreparer prepares the Delete request. +func (client DisksClient) DeletePreparer(resourceGroupName string, diskName string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskName": autorest.Encode("path", diskName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DisksClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets information about a disk. +// +// resourceGroupName is the name of the resource group. diskName is the name of the disk within the given subscription +// and resource group. +func (client DisksClient) Get(resourceGroupName string, diskName string) (result Disk, err error) { + req, err := client.GetPreparer(resourceGroupName, diskName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DisksClient) GetPreparer(resourceGroupName string, diskName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskName": autorest.Encode("path", diskName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DisksClient) GetResponder(resp *http.Response) (result Disk, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GrantAccess grants access to a disk. This method may poll for completion. Polling can be canceled by passing the +// cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. diskName is the name of the disk within the given subscription +// and resource group. grantAccessData is access data object supplied in the body of the get disk access operation. +func (client DisksClient) GrantAccess(resourceGroupName string, diskName string, grantAccessData GrantAccessData, cancel <-chan struct{}) (<-chan AccessURI, <-chan error) { + resultChan := make(chan AccessURI, 1) + errChan := make(chan error, 1) + if err := validation.Validate([]validation.Validation{ + {TargetValue: grantAccessData, + Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + errChan <- validation.NewErrorWithValidationError(err, "compute.DisksClient", "GrantAccess") + close(errChan) + close(resultChan) + return resultChan, errChan + } + + go func() { + var err error + var result AccessURI + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.GrantAccessPreparer(resourceGroupName, diskName, grantAccessData, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", nil, "Failure preparing request") + return + } + + resp, err := client.GrantAccessSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", resp, "Failure sending request") + return + } + + result, err = client.GrantAccessResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "GrantAccess", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// GrantAccessPreparer prepares the GrantAccess request. +func (client DisksClient) GrantAccessPreparer(resourceGroupName string, diskName string, grantAccessData GrantAccessData, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskName": autorest.Encode("path", diskName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/beginGetAccess", pathParameters), + autorest.WithJSON(grantAccessData), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// GrantAccessSender sends the GrantAccess request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) GrantAccessSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// GrantAccessResponder handles the response to the GrantAccess request. The method always +// closes the http.Response Body. +func (client DisksClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the disks under a subscription. +func (client DisksClient) List() (result DiskList, err error) { + req, err := client.ListPreparer() + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client DisksClient) ListPreparer() (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/disks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client DisksClient) ListResponder(resp *http.Response) (result DiskList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client DisksClient) ListNextResults(lastResults DiskList) (result DiskList, err error) { + req, err := lastResults.DiskListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.DisksClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListComplete gets all elements from the list without paging. +func (client DisksClient) ListComplete(cancel <-chan struct{}) (<-chan Disk, <-chan error) { + resultChan := make(chan Disk) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListByResourceGroup lists all the disks under a resource group. +// +// resourceGroupName is the name of the resource group. +func (client DisksClient) ListByResourceGroup(resourceGroupName string) (result DiskList, err error) { + req, err := client.ListByResourceGroupPreparer(resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client DisksClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client DisksClient) ListByResourceGroupResponder(resp *http.Response) (result DiskList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroupNextResults retrieves the next set of results, if any. +func (client DisksClient) ListByResourceGroupNextResults(lastResults DiskList) (result DiskList, err error) { + req, err := lastResults.DiskListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure sending next results request") + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "ListByResourceGroup", resp, "Failure responding to next results request") + } + + return +} + +// ListByResourceGroupComplete gets all elements from the list without paging. +func (client DisksClient) ListByResourceGroupComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan Disk, <-chan error) { + resultChan := make(chan Disk) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListByResourceGroup(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListByResourceGroupNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// RevokeAccess revokes access to a disk. This method may poll for completion. Polling can be canceled by passing the +// cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. diskName is the name of the disk within the given subscription +// and resource group. +func (client DisksClient) RevokeAccess(resourceGroupName string, diskName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { + resultChan := make(chan OperationStatusResponse, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result OperationStatusResponse + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.RevokeAccessPreparer(resourceGroupName, diskName, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", nil, "Failure preparing request") + return + } + + resp, err := client.RevokeAccessSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", resp, "Failure sending request") + return + } + + result, err = client.RevokeAccessResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "RevokeAccess", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// RevokeAccessPreparer prepares the RevokeAccess request. +func (client DisksClient) RevokeAccessPreparer(resourceGroupName string, diskName string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskName": autorest.Encode("path", diskName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}/endGetAccess", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// RevokeAccessSender sends the RevokeAccess request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) RevokeAccessSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// RevokeAccessResponder handles the response to the RevokeAccess request. The method always +// closes the http.Response Body. +func (client DisksClient) RevokeAccessResponder(resp *http.Response) (result OperationStatusResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates (patches) a disk. This method may poll for completion. Polling can be canceled by passing the cancel +// channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. diskName is the name of the disk within the given subscription +// and resource group. disk is disk object supplied in the body of the Patch disk operation. +func (client DisksClient) Update(resourceGroupName string, diskName string, disk DiskUpdate, cancel <-chan struct{}) (<-chan Disk, <-chan error) { + resultChan := make(chan Disk, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result Disk + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.UpdatePreparer(resourceGroupName, diskName, disk, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.DisksClient", "Update", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// UpdatePreparer prepares the Update request. +func (client DisksClient) UpdatePreparer(resourceGroupName string, diskName string, disk DiskUpdate, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diskName": autorest.Encode("path", diskName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}", pathParameters), + autorest.WithJSON(disk), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DisksClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DisksClient) UpdateResponder(resp *http.Response) (result Disk, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/images.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/images.go index 64f14dd082ff..bbde2bc7f95f 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/images.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/images.go @@ -14,9 +14,8 @@ package compute // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -25,7 +24,7 @@ import ( "net/http" ) -// ImagesClient is the the Compute Management Client. +// ImagesClient is the compute Client type ImagesClient struct { ManagementClient } @@ -40,14 +39,11 @@ func NewImagesClientWithBaseURI(baseURI string, subscriptionID string) ImagesCli return ImagesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate create or update an image. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// CreateOrUpdate create or update an image. This method may poll for completion. Polling can be canceled by passing +// the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. imageName is the name -// of the image. parameters is parameters supplied to the Create Image -// operation. +// resourceGroupName is the name of the resource group. imageName is the name of the image. parameters is parameters +// supplied to the Create Image operation. func (client ImagesClient) CreateOrUpdate(resourceGroupName string, imageName string, parameters Image, cancel <-chan struct{}) (<-chan Image, <-chan error) { resultChan := make(chan Image, 1) errChan := make(chan error, 1) @@ -67,8 +63,10 @@ func (client ImagesClient) CreateOrUpdate(resourceGroupName string, imageName st var err error var result Image defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -101,7 +99,7 @@ func (client ImagesClient) CreateOrUpdatePreparer(resourceGroupName string, imag "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -137,12 +135,10 @@ func (client ImagesClient) CreateOrUpdateResponder(resp *http.Response) (result return } -// Delete deletes an Image. This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used to -// cancel polling and any outstanding HTTP requests. +// Delete deletes an Image. This method may poll for completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. imageName is the name -// of the image. +// resourceGroupName is the name of the resource group. imageName is the name of the image. func (client ImagesClient) Delete(resourceGroupName string, imageName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -150,8 +146,10 @@ func (client ImagesClient) Delete(resourceGroupName string, imageName string, ca var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -184,7 +182,7 @@ func (client ImagesClient) DeletePreparer(resourceGroupName string, imageName st "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -220,8 +218,8 @@ func (client ImagesClient) DeleteResponder(resp *http.Response) (result Operatio // Get gets an image. // -// resourceGroupName is the name of the resource group. imageName is the name -// of the image. expand is the expand expression to apply on the operation. +// resourceGroupName is the name of the resource group. imageName is the name of the image. expand is the expand +// expression to apply on the operation. func (client ImagesClient) Get(resourceGroupName string, imageName string, expand string) (result Image, err error) { req, err := client.GetPreparer(resourceGroupName, imageName, expand) if err != nil { @@ -252,7 +250,7 @@ func (client ImagesClient) GetPreparer(resourceGroupName string, imageName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -287,9 +285,8 @@ func (client ImagesClient) GetResponder(resp *http.Response) (result Image, err return } -// List gets the list of Images in the subscription. Use nextLink property in -// the response to get the next page of Images. Do this till nextLink is not -// null to fetch all the Images. +// List gets the list of Images in the subscription. Use nextLink property in the response to get the next page of +// Images. Do this till nextLink is not null to fetch all the Images. func (client ImagesClient) List() (result ImageListResult, err error) { req, err := client.ListPreparer() if err != nil { @@ -318,7 +315,7 @@ func (client ImagesClient) ListPreparer() (*http.Request, error) { "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -374,6 +371,51 @@ func (client ImagesClient) ListNextResults(lastResults ImageListResult) (result return } +// ListComplete gets all elements from the list without paging. +func (client ImagesClient) ListComplete(cancel <-chan struct{}) (<-chan Image, <-chan error) { + resultChan := make(chan Image) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + // ListByResourceGroup gets the list of images under a resource group. // // resourceGroupName is the name of the resource group. @@ -406,7 +448,7 @@ func (client ImagesClient) ListByResourceGroupPreparer(resourceGroupName string) "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -461,3 +503,48 @@ func (client ImagesClient) ListByResourceGroupNextResults(lastResults ImageListR return } + +// ListByResourceGroupComplete gets all elements from the list without paging. +func (client ImagesClient) ListByResourceGroupComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan Image, <-chan error) { + resultChan := make(chan Image) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListByResourceGroup(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListByResourceGroupNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/models.go index a9524daeffac..bae95ca2542e 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/models.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/models.go @@ -14,9 +14,8 @@ package compute // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -25,37 +24,176 @@ import ( "net/http" ) +// AccessLevel enumerates the values for access level. +type AccessLevel string + +const ( + // None specifies the none state for access level. + None AccessLevel = "None" + // Read specifies the read state for access level. + Read AccessLevel = "Read" +) + // CachingTypes enumerates the values for caching types. type CachingTypes string const ( - // None specifies the none state for caching types. - None CachingTypes = "None" - // ReadOnly specifies the read only state for caching types. - ReadOnly CachingTypes = "ReadOnly" - // ReadWrite specifies the read write state for caching types. - ReadWrite CachingTypes = "ReadWrite" + // CachingTypesNone specifies the caching types none state for caching types. + CachingTypesNone CachingTypes = "None" + // CachingTypesReadOnly specifies the caching types read only state for caching types. + CachingTypesReadOnly CachingTypes = "ReadOnly" + // CachingTypesReadWrite specifies the caching types read write state for caching types. + CachingTypesReadWrite CachingTypes = "ReadWrite" ) // ComponentNames enumerates the values for component names. type ComponentNames string const ( - // MicrosoftWindowsShellSetup specifies the microsoft windows shell setup - // state for component names. + // MicrosoftWindowsShellSetup specifies the microsoft windows shell setup state for component names. MicrosoftWindowsShellSetup ComponentNames = "Microsoft-Windows-Shell-Setup" ) +// ContainerServiceOrchestratorTypes enumerates the values for container service orchestrator types. +type ContainerServiceOrchestratorTypes string + +const ( + // Custom specifies the custom state for container service orchestrator types. + Custom ContainerServiceOrchestratorTypes = "Custom" + // DCOS specifies the dcos state for container service orchestrator types. + DCOS ContainerServiceOrchestratorTypes = "DCOS" + // Kubernetes specifies the kubernetes state for container service orchestrator types. + Kubernetes ContainerServiceOrchestratorTypes = "Kubernetes" + // Swarm specifies the swarm state for container service orchestrator types. + Swarm ContainerServiceOrchestratorTypes = "Swarm" +) + +// ContainerServiceVMSizeTypes enumerates the values for container service vm size types. +type ContainerServiceVMSizeTypes string + +const ( + // StandardA0 specifies the standard a0 state for container service vm size types. + StandardA0 ContainerServiceVMSizeTypes = "Standard_A0" + // StandardA1 specifies the standard a1 state for container service vm size types. + StandardA1 ContainerServiceVMSizeTypes = "Standard_A1" + // StandardA10 specifies the standard a10 state for container service vm size types. + StandardA10 ContainerServiceVMSizeTypes = "Standard_A10" + // StandardA11 specifies the standard a11 state for container service vm size types. + StandardA11 ContainerServiceVMSizeTypes = "Standard_A11" + // StandardA2 specifies the standard a2 state for container service vm size types. + StandardA2 ContainerServiceVMSizeTypes = "Standard_A2" + // StandardA3 specifies the standard a3 state for container service vm size types. + StandardA3 ContainerServiceVMSizeTypes = "Standard_A3" + // StandardA4 specifies the standard a4 state for container service vm size types. + StandardA4 ContainerServiceVMSizeTypes = "Standard_A4" + // StandardA5 specifies the standard a5 state for container service vm size types. + StandardA5 ContainerServiceVMSizeTypes = "Standard_A5" + // StandardA6 specifies the standard a6 state for container service vm size types. + StandardA6 ContainerServiceVMSizeTypes = "Standard_A6" + // StandardA7 specifies the standard a7 state for container service vm size types. + StandardA7 ContainerServiceVMSizeTypes = "Standard_A7" + // StandardA8 specifies the standard a8 state for container service vm size types. + StandardA8 ContainerServiceVMSizeTypes = "Standard_A8" + // StandardA9 specifies the standard a9 state for container service vm size types. + StandardA9 ContainerServiceVMSizeTypes = "Standard_A9" + // StandardD1 specifies the standard d1 state for container service vm size types. + StandardD1 ContainerServiceVMSizeTypes = "Standard_D1" + // StandardD11 specifies the standard d11 state for container service vm size types. + StandardD11 ContainerServiceVMSizeTypes = "Standard_D11" + // StandardD11V2 specifies the standard d11v2 state for container service vm size types. + StandardD11V2 ContainerServiceVMSizeTypes = "Standard_D11_v2" + // StandardD12 specifies the standard d12 state for container service vm size types. + StandardD12 ContainerServiceVMSizeTypes = "Standard_D12" + // StandardD12V2 specifies the standard d12v2 state for container service vm size types. + StandardD12V2 ContainerServiceVMSizeTypes = "Standard_D12_v2" + // StandardD13 specifies the standard d13 state for container service vm size types. + StandardD13 ContainerServiceVMSizeTypes = "Standard_D13" + // StandardD13V2 specifies the standard d13v2 state for container service vm size types. + StandardD13V2 ContainerServiceVMSizeTypes = "Standard_D13_v2" + // StandardD14 specifies the standard d14 state for container service vm size types. + StandardD14 ContainerServiceVMSizeTypes = "Standard_D14" + // StandardD14V2 specifies the standard d14v2 state for container service vm size types. + StandardD14V2 ContainerServiceVMSizeTypes = "Standard_D14_v2" + // StandardD1V2 specifies the standard d1v2 state for container service vm size types. + StandardD1V2 ContainerServiceVMSizeTypes = "Standard_D1_v2" + // StandardD2 specifies the standard d2 state for container service vm size types. + StandardD2 ContainerServiceVMSizeTypes = "Standard_D2" + // StandardD2V2 specifies the standard d2v2 state for container service vm size types. + StandardD2V2 ContainerServiceVMSizeTypes = "Standard_D2_v2" + // StandardD3 specifies the standard d3 state for container service vm size types. + StandardD3 ContainerServiceVMSizeTypes = "Standard_D3" + // StandardD3V2 specifies the standard d3v2 state for container service vm size types. + StandardD3V2 ContainerServiceVMSizeTypes = "Standard_D3_v2" + // StandardD4 specifies the standard d4 state for container service vm size types. + StandardD4 ContainerServiceVMSizeTypes = "Standard_D4" + // StandardD4V2 specifies the standard d4v2 state for container service vm size types. + StandardD4V2 ContainerServiceVMSizeTypes = "Standard_D4_v2" + // StandardD5V2 specifies the standard d5v2 state for container service vm size types. + StandardD5V2 ContainerServiceVMSizeTypes = "Standard_D5_v2" + // StandardDS1 specifies the standard ds1 state for container service vm size types. + StandardDS1 ContainerServiceVMSizeTypes = "Standard_DS1" + // StandardDS11 specifies the standard ds11 state for container service vm size types. + StandardDS11 ContainerServiceVMSizeTypes = "Standard_DS11" + // StandardDS12 specifies the standard ds12 state for container service vm size types. + StandardDS12 ContainerServiceVMSizeTypes = "Standard_DS12" + // StandardDS13 specifies the standard ds13 state for container service vm size types. + StandardDS13 ContainerServiceVMSizeTypes = "Standard_DS13" + // StandardDS14 specifies the standard ds14 state for container service vm size types. + StandardDS14 ContainerServiceVMSizeTypes = "Standard_DS14" + // StandardDS2 specifies the standard ds2 state for container service vm size types. + StandardDS2 ContainerServiceVMSizeTypes = "Standard_DS2" + // StandardDS3 specifies the standard ds3 state for container service vm size types. + StandardDS3 ContainerServiceVMSizeTypes = "Standard_DS3" + // StandardDS4 specifies the standard ds4 state for container service vm size types. + StandardDS4 ContainerServiceVMSizeTypes = "Standard_DS4" + // StandardG1 specifies the standard g1 state for container service vm size types. + StandardG1 ContainerServiceVMSizeTypes = "Standard_G1" + // StandardG2 specifies the standard g2 state for container service vm size types. + StandardG2 ContainerServiceVMSizeTypes = "Standard_G2" + // StandardG3 specifies the standard g3 state for container service vm size types. + StandardG3 ContainerServiceVMSizeTypes = "Standard_G3" + // StandardG4 specifies the standard g4 state for container service vm size types. + StandardG4 ContainerServiceVMSizeTypes = "Standard_G4" + // StandardG5 specifies the standard g5 state for container service vm size types. + StandardG5 ContainerServiceVMSizeTypes = "Standard_G5" + // StandardGS1 specifies the standard gs1 state for container service vm size types. + StandardGS1 ContainerServiceVMSizeTypes = "Standard_GS1" + // StandardGS2 specifies the standard gs2 state for container service vm size types. + StandardGS2 ContainerServiceVMSizeTypes = "Standard_GS2" + // StandardGS3 specifies the standard gs3 state for container service vm size types. + StandardGS3 ContainerServiceVMSizeTypes = "Standard_GS3" + // StandardGS4 specifies the standard gs4 state for container service vm size types. + StandardGS4 ContainerServiceVMSizeTypes = "Standard_GS4" + // StandardGS5 specifies the standard gs5 state for container service vm size types. + StandardGS5 ContainerServiceVMSizeTypes = "Standard_GS5" +) + +// DiskCreateOption enumerates the values for disk create option. +type DiskCreateOption string + +const ( + // Attach specifies the attach state for disk create option. + Attach DiskCreateOption = "Attach" + // Copy specifies the copy state for disk create option. + Copy DiskCreateOption = "Copy" + // Empty specifies the empty state for disk create option. + Empty DiskCreateOption = "Empty" + // FromImage specifies the from image state for disk create option. + FromImage DiskCreateOption = "FromImage" + // Import specifies the import state for disk create option. + Import DiskCreateOption = "Import" +) + // DiskCreateOptionTypes enumerates the values for disk create option types. type DiskCreateOptionTypes string const ( - // Attach specifies the attach state for disk create option types. - Attach DiskCreateOptionTypes = "attach" - // Empty specifies the empty state for disk create option types. - Empty DiskCreateOptionTypes = "empty" - // FromImage specifies the from image state for disk create option types. - FromImage DiskCreateOptionTypes = "fromImage" + // DiskCreateOptionTypesAttach specifies the disk create option types attach state for disk create option types. + DiskCreateOptionTypesAttach DiskCreateOptionTypes = "Attach" + // DiskCreateOptionTypesEmpty specifies the disk create option types empty state for disk create option types. + DiskCreateOptionTypesEmpty DiskCreateOptionTypes = "Empty" + // DiskCreateOptionTypesFromImage specifies the disk create option types from image state for disk create option types. + DiskCreateOptionTypesFromImage DiskCreateOptionTypes = "FromImage" ) // InstanceViewTypes enumerates the values for instance view types. @@ -66,16 +204,41 @@ const ( InstanceView InstanceViewTypes = "instanceView" ) -// OperatingSystemStateTypes enumerates the values for operating system state -// types. +// IPVersion enumerates the values for ip version. +type IPVersion string + +const ( + // IPv4 specifies the i pv 4 state for ip version. + IPv4 IPVersion = "IPv4" + // IPv6 specifies the i pv 6 state for ip version. + IPv6 IPVersion = "IPv6" +) + +// MaintenanceOperationResultCodeTypes enumerates the values for maintenance operation result code types. +type MaintenanceOperationResultCodeTypes string + +const ( + // MaintenanceOperationResultCodeTypesMaintenanceAborted specifies the maintenance operation result code types + // maintenance aborted state for maintenance operation result code types. + MaintenanceOperationResultCodeTypesMaintenanceAborted MaintenanceOperationResultCodeTypes = "MaintenanceAborted" + // MaintenanceOperationResultCodeTypesMaintenanceCompleted specifies the maintenance operation result code types + // maintenance completed state for maintenance operation result code types. + MaintenanceOperationResultCodeTypesMaintenanceCompleted MaintenanceOperationResultCodeTypes = "MaintenanceCompleted" + // MaintenanceOperationResultCodeTypesNone specifies the maintenance operation result code types none state for + // maintenance operation result code types. + MaintenanceOperationResultCodeTypesNone MaintenanceOperationResultCodeTypes = "None" + // MaintenanceOperationResultCodeTypesRetryLater specifies the maintenance operation result code types retry later + // state for maintenance operation result code types. + MaintenanceOperationResultCodeTypesRetryLater MaintenanceOperationResultCodeTypes = "RetryLater" +) + +// OperatingSystemStateTypes enumerates the values for operating system state types. type OperatingSystemStateTypes string const ( - // Generalized specifies the generalized state for operating system state - // types. + // Generalized specifies the generalized state for operating system state types. Generalized OperatingSystemStateTypes = "Generalized" - // Specialized specifies the specialized state for operating system state - // types. + // Specialized specifies the specialized state for operating system state types. Specialized OperatingSystemStateTypes = "Specialized" ) @@ -94,7 +257,7 @@ type PassNames string const ( // OobeSystem specifies the oobe system state for pass names. - OobeSystem PassNames = "oobeSystem" + OobeSystem PassNames = "OobeSystem" ) // ProtocolTypes enumerates the values for protocol types. @@ -111,19 +274,75 @@ const ( type ResourceIdentityType string const ( - // SystemAssigned specifies the system assigned state for resource identity - // type. + // SystemAssigned specifies the system assigned state for resource identity type. SystemAssigned ResourceIdentityType = "SystemAssigned" ) +// ResourceSkuCapacityScaleType enumerates the values for resource sku capacity scale type. +type ResourceSkuCapacityScaleType string + +const ( + // ResourceSkuCapacityScaleTypeAutomatic specifies the resource sku capacity scale type automatic state for resource + // sku capacity scale type. + ResourceSkuCapacityScaleTypeAutomatic ResourceSkuCapacityScaleType = "Automatic" + // ResourceSkuCapacityScaleTypeManual specifies the resource sku capacity scale type manual state for resource sku + // capacity scale type. + ResourceSkuCapacityScaleTypeManual ResourceSkuCapacityScaleType = "Manual" + // ResourceSkuCapacityScaleTypeNone specifies the resource sku capacity scale type none state for resource sku capacity + // scale type. + ResourceSkuCapacityScaleTypeNone ResourceSkuCapacityScaleType = "None" +) + +// ResourceSkuRestrictionsReasonCode enumerates the values for resource sku restrictions reason code. +type ResourceSkuRestrictionsReasonCode string + +const ( + // NotAvailableForSubscription specifies the not available for subscription state for resource sku restrictions reason + // code. + NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription" + // QuotaID specifies the quota id state for resource sku restrictions reason code. + QuotaID ResourceSkuRestrictionsReasonCode = "QuotaId" +) + +// ResourceSkuRestrictionsType enumerates the values for resource sku restrictions type. +type ResourceSkuRestrictionsType string + +const ( + // Location specifies the location state for resource sku restrictions type. + Location ResourceSkuRestrictionsType = "Location" +) + +// RollingUpgradeActionType enumerates the values for rolling upgrade action type. +type RollingUpgradeActionType string + +const ( + // Cancel specifies the cancel state for rolling upgrade action type. + Cancel RollingUpgradeActionType = "Cancel" + // Start specifies the start state for rolling upgrade action type. + Start RollingUpgradeActionType = "Start" +) + +// RollingUpgradeStatusCode enumerates the values for rolling upgrade status code. +type RollingUpgradeStatusCode string + +const ( + // Cancelled specifies the cancelled state for rolling upgrade status code. + Cancelled RollingUpgradeStatusCode = "Cancelled" + // Completed specifies the completed state for rolling upgrade status code. + Completed RollingUpgradeStatusCode = "Completed" + // Faulted specifies the faulted state for rolling upgrade status code. + Faulted RollingUpgradeStatusCode = "Faulted" + // RollingForward specifies the rolling forward state for rolling upgrade status code. + RollingForward RollingUpgradeStatusCode = "RollingForward" +) + // SettingNames enumerates the values for setting names. type SettingNames string const ( // AutoLogon specifies the auto logon state for setting names. AutoLogon SettingNames = "AutoLogon" - // FirstLogonCommands specifies the first logon commands state for setting - // names. + // FirstLogonCommands specifies the first logon commands state for setting names. FirstLogonCommands SettingNames = "FirstLogonCommands" ) @@ -157,218 +376,338 @@ const ( Automatic UpgradeMode = "Automatic" // Manual specifies the manual state for upgrade mode. Manual UpgradeMode = "Manual" + // Rolling specifies the rolling state for upgrade mode. + Rolling UpgradeMode = "Rolling" ) -// VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine -// scale set sku scale type. +// VirtualMachineScaleSetSkuScaleType enumerates the values for virtual machine scale set sku scale type. type VirtualMachineScaleSetSkuScaleType string const ( - // VirtualMachineScaleSetSkuScaleTypeAutomatic specifies the virtual - // machine scale set sku scale type automatic state for virtual machine - // scale set sku scale type. + // VirtualMachineScaleSetSkuScaleTypeAutomatic specifies the virtual machine scale set sku scale type automatic state + // for virtual machine scale set sku scale type. VirtualMachineScaleSetSkuScaleTypeAutomatic VirtualMachineScaleSetSkuScaleType = "Automatic" - // VirtualMachineScaleSetSkuScaleTypeNone specifies the virtual machine - // scale set sku scale type none state for virtual machine scale set sku - // scale type. + // VirtualMachineScaleSetSkuScaleTypeNone specifies the virtual machine scale set sku scale type none state for virtual + // machine scale set sku scale type. VirtualMachineScaleSetSkuScaleTypeNone VirtualMachineScaleSetSkuScaleType = "None" ) -// VirtualMachineSizeTypes enumerates the values for virtual machine size -// types. +// VirtualMachineSizeTypes enumerates the values for virtual machine size types. type VirtualMachineSizeTypes string const ( - // BasicA0 specifies the basic a0 state for virtual machine size types. - BasicA0 VirtualMachineSizeTypes = "Basic_A0" - // BasicA1 specifies the basic a1 state for virtual machine size types. - BasicA1 VirtualMachineSizeTypes = "Basic_A1" - // BasicA2 specifies the basic a2 state for virtual machine size types. - BasicA2 VirtualMachineSizeTypes = "Basic_A2" - // BasicA3 specifies the basic a3 state for virtual machine size types. - BasicA3 VirtualMachineSizeTypes = "Basic_A3" - // BasicA4 specifies the basic a4 state for virtual machine size types. - BasicA4 VirtualMachineSizeTypes = "Basic_A4" - // StandardA0 specifies the standard a0 state for virtual machine size - // types. - StandardA0 VirtualMachineSizeTypes = "Standard_A0" - // StandardA1 specifies the standard a1 state for virtual machine size - // types. - StandardA1 VirtualMachineSizeTypes = "Standard_A1" - // StandardA10 specifies the standard a10 state for virtual machine size + // VirtualMachineSizeTypesBasicA0 specifies the virtual machine size types basic a0 state for virtual machine size // types. - StandardA10 VirtualMachineSizeTypes = "Standard_A10" - // StandardA11 specifies the standard a11 state for virtual machine size + VirtualMachineSizeTypesBasicA0 VirtualMachineSizeTypes = "Basic_A0" + // VirtualMachineSizeTypesBasicA1 specifies the virtual machine size types basic a1 state for virtual machine size // types. - StandardA11 VirtualMachineSizeTypes = "Standard_A11" - // StandardA2 specifies the standard a2 state for virtual machine size + VirtualMachineSizeTypesBasicA1 VirtualMachineSizeTypes = "Basic_A1" + // VirtualMachineSizeTypesBasicA2 specifies the virtual machine size types basic a2 state for virtual machine size // types. - StandardA2 VirtualMachineSizeTypes = "Standard_A2" - // StandardA3 specifies the standard a3 state for virtual machine size + VirtualMachineSizeTypesBasicA2 VirtualMachineSizeTypes = "Basic_A2" + // VirtualMachineSizeTypesBasicA3 specifies the virtual machine size types basic a3 state for virtual machine size // types. - StandardA3 VirtualMachineSizeTypes = "Standard_A3" - // StandardA4 specifies the standard a4 state for virtual machine size + VirtualMachineSizeTypesBasicA3 VirtualMachineSizeTypes = "Basic_A3" + // VirtualMachineSizeTypesBasicA4 specifies the virtual machine size types basic a4 state for virtual machine size // types. - StandardA4 VirtualMachineSizeTypes = "Standard_A4" - // StandardA5 specifies the standard a5 state for virtual machine size - // types. - StandardA5 VirtualMachineSizeTypes = "Standard_A5" - // StandardA6 specifies the standard a6 state for virtual machine size - // types. - StandardA6 VirtualMachineSizeTypes = "Standard_A6" - // StandardA7 specifies the standard a7 state for virtual machine size - // types. - StandardA7 VirtualMachineSizeTypes = "Standard_A7" - // StandardA8 specifies the standard a8 state for virtual machine size - // types. - StandardA8 VirtualMachineSizeTypes = "Standard_A8" - // StandardA9 specifies the standard a9 state for virtual machine size - // types. - StandardA9 VirtualMachineSizeTypes = "Standard_A9" - // StandardD1 specifies the standard d1 state for virtual machine size - // types. - StandardD1 VirtualMachineSizeTypes = "Standard_D1" - // StandardD11 specifies the standard d11 state for virtual machine size - // types. - StandardD11 VirtualMachineSizeTypes = "Standard_D11" - // StandardD11V2 specifies the standard d11v2 state for virtual machine + VirtualMachineSizeTypesBasicA4 VirtualMachineSizeTypes = "Basic_A4" + // VirtualMachineSizeTypesStandardA0 specifies the virtual machine size types standard a0 state for virtual machine // size types. - StandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2" - // StandardD12 specifies the standard d12 state for virtual machine size - // types. - StandardD12 VirtualMachineSizeTypes = "Standard_D12" - // StandardD12V2 specifies the standard d12v2 state for virtual machine + VirtualMachineSizeTypesStandardA0 VirtualMachineSizeTypes = "Standard_A0" + // VirtualMachineSizeTypesStandardA1 specifies the virtual machine size types standard a1 state for virtual machine // size types. - StandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2" - // StandardD13 specifies the standard d13 state for virtual machine size - // types. - StandardD13 VirtualMachineSizeTypes = "Standard_D13" - // StandardD13V2 specifies the standard d13v2 state for virtual machine + VirtualMachineSizeTypesStandardA1 VirtualMachineSizeTypes = "Standard_A1" + // VirtualMachineSizeTypesStandardA10 specifies the virtual machine size types standard a10 state for virtual machine // size types. - StandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2" - // StandardD14 specifies the standard d14 state for virtual machine size - // types. - StandardD14 VirtualMachineSizeTypes = "Standard_D14" - // StandardD14V2 specifies the standard d14v2 state for virtual machine + VirtualMachineSizeTypesStandardA10 VirtualMachineSizeTypes = "Standard_A10" + // VirtualMachineSizeTypesStandardA11 specifies the virtual machine size types standard a11 state for virtual machine // size types. - StandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2" - // StandardD15V2 specifies the standard d15v2 state for virtual machine + VirtualMachineSizeTypesStandardA11 VirtualMachineSizeTypes = "Standard_A11" + // VirtualMachineSizeTypesStandardA1V2 specifies the virtual machine size types standard a1v2 state for virtual machine // size types. - StandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2" - // StandardD1V2 specifies the standard d1v2 state for virtual machine size - // types. - StandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2" - // StandardD2 specifies the standard d2 state for virtual machine size - // types. - StandardD2 VirtualMachineSizeTypes = "Standard_D2" - // StandardD2V2 specifies the standard d2v2 state for virtual machine size - // types. - StandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2" - // StandardD3 specifies the standard d3 state for virtual machine size - // types. - StandardD3 VirtualMachineSizeTypes = "Standard_D3" - // StandardD3V2 specifies the standard d3v2 state for virtual machine size - // types. - StandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2" - // StandardD4 specifies the standard d4 state for virtual machine size - // types. - StandardD4 VirtualMachineSizeTypes = "Standard_D4" - // StandardD4V2 specifies the standard d4v2 state for virtual machine size - // types. - StandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2" - // StandardD5V2 specifies the standard d5v2 state for virtual machine size - // types. - StandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2" - // StandardDS1 specifies the standard ds1 state for virtual machine size - // types. - StandardDS1 VirtualMachineSizeTypes = "Standard_DS1" - // StandardDS11 specifies the standard ds11 state for virtual machine size - // types. - StandardDS11 VirtualMachineSizeTypes = "Standard_DS11" - // StandardDS11V2 specifies the standard ds11v2 state for virtual machine + VirtualMachineSizeTypesStandardA1V2 VirtualMachineSizeTypes = "Standard_A1_v2" + // VirtualMachineSizeTypesStandardA2 specifies the virtual machine size types standard a2 state for virtual machine // size types. - StandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2" - // StandardDS12 specifies the standard ds12 state for virtual machine size - // types. - StandardDS12 VirtualMachineSizeTypes = "Standard_DS12" - // StandardDS12V2 specifies the standard ds12v2 state for virtual machine + VirtualMachineSizeTypesStandardA2 VirtualMachineSizeTypes = "Standard_A2" + // VirtualMachineSizeTypesStandardA2mV2 specifies the virtual machine size types standard a2mv2 state for virtual + // machine size types. + VirtualMachineSizeTypesStandardA2mV2 VirtualMachineSizeTypes = "Standard_A2m_v2" + // VirtualMachineSizeTypesStandardA2V2 specifies the virtual machine size types standard a2v2 state for virtual machine // size types. - StandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2" - // StandardDS13 specifies the standard ds13 state for virtual machine size - // types. - StandardDS13 VirtualMachineSizeTypes = "Standard_DS13" - // StandardDS13V2 specifies the standard ds13v2 state for virtual machine + VirtualMachineSizeTypesStandardA2V2 VirtualMachineSizeTypes = "Standard_A2_v2" + // VirtualMachineSizeTypesStandardA3 specifies the virtual machine size types standard a3 state for virtual machine // size types. - StandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2" - // StandardDS14 specifies the standard ds14 state for virtual machine size - // types. - StandardDS14 VirtualMachineSizeTypes = "Standard_DS14" - // StandardDS14V2 specifies the standard ds14v2 state for virtual machine + VirtualMachineSizeTypesStandardA3 VirtualMachineSizeTypes = "Standard_A3" + // VirtualMachineSizeTypesStandardA4 specifies the virtual machine size types standard a4 state for virtual machine // size types. - StandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2" - // StandardDS15V2 specifies the standard ds15v2 state for virtual machine + VirtualMachineSizeTypesStandardA4 VirtualMachineSizeTypes = "Standard_A4" + // VirtualMachineSizeTypesStandardA4mV2 specifies the virtual machine size types standard a4mv2 state for virtual + // machine size types. + VirtualMachineSizeTypesStandardA4mV2 VirtualMachineSizeTypes = "Standard_A4m_v2" + // VirtualMachineSizeTypesStandardA4V2 specifies the virtual machine size types standard a4v2 state for virtual machine // size types. - StandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2" - // StandardDS1V2 specifies the standard ds1v2 state for virtual machine + VirtualMachineSizeTypesStandardA4V2 VirtualMachineSizeTypes = "Standard_A4_v2" + // VirtualMachineSizeTypesStandardA5 specifies the virtual machine size types standard a5 state for virtual machine // size types. - StandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2" - // StandardDS2 specifies the standard ds2 state for virtual machine size - // types. - StandardDS2 VirtualMachineSizeTypes = "Standard_DS2" - // StandardDS2V2 specifies the standard ds2v2 state for virtual machine + VirtualMachineSizeTypesStandardA5 VirtualMachineSizeTypes = "Standard_A5" + // VirtualMachineSizeTypesStandardA6 specifies the virtual machine size types standard a6 state for virtual machine // size types. - StandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2" - // StandardDS3 specifies the standard ds3 state for virtual machine size - // types. - StandardDS3 VirtualMachineSizeTypes = "Standard_DS3" - // StandardDS3V2 specifies the standard ds3v2 state for virtual machine + VirtualMachineSizeTypesStandardA6 VirtualMachineSizeTypes = "Standard_A6" + // VirtualMachineSizeTypesStandardA7 specifies the virtual machine size types standard a7 state for virtual machine // size types. - StandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2" - // StandardDS4 specifies the standard ds4 state for virtual machine size - // types. - StandardDS4 VirtualMachineSizeTypes = "Standard_DS4" - // StandardDS4V2 specifies the standard ds4v2 state for virtual machine + VirtualMachineSizeTypesStandardA7 VirtualMachineSizeTypes = "Standard_A7" + // VirtualMachineSizeTypesStandardA8 specifies the virtual machine size types standard a8 state for virtual machine // size types. - StandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2" - // StandardDS5V2 specifies the standard ds5v2 state for virtual machine + VirtualMachineSizeTypesStandardA8 VirtualMachineSizeTypes = "Standard_A8" + // VirtualMachineSizeTypesStandardA8mV2 specifies the virtual machine size types standard a8mv2 state for virtual + // machine size types. + VirtualMachineSizeTypesStandardA8mV2 VirtualMachineSizeTypes = "Standard_A8m_v2" + // VirtualMachineSizeTypesStandardA8V2 specifies the virtual machine size types standard a8v2 state for virtual machine // size types. - StandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2" - // StandardG1 specifies the standard g1 state for virtual machine size - // types. - StandardG1 VirtualMachineSizeTypes = "Standard_G1" - // StandardG2 specifies the standard g2 state for virtual machine size - // types. - StandardG2 VirtualMachineSizeTypes = "Standard_G2" - // StandardG3 specifies the standard g3 state for virtual machine size - // types. - StandardG3 VirtualMachineSizeTypes = "Standard_G3" - // StandardG4 specifies the standard g4 state for virtual machine size - // types. - StandardG4 VirtualMachineSizeTypes = "Standard_G4" - // StandardG5 specifies the standard g5 state for virtual machine size - // types. - StandardG5 VirtualMachineSizeTypes = "Standard_G5" - // StandardGS1 specifies the standard gs1 state for virtual machine size - // types. - StandardGS1 VirtualMachineSizeTypes = "Standard_GS1" - // StandardGS2 specifies the standard gs2 state for virtual machine size - // types. - StandardGS2 VirtualMachineSizeTypes = "Standard_GS2" - // StandardGS3 specifies the standard gs3 state for virtual machine size - // types. - StandardGS3 VirtualMachineSizeTypes = "Standard_GS3" - // StandardGS4 specifies the standard gs4 state for virtual machine size - // types. - StandardGS4 VirtualMachineSizeTypes = "Standard_GS4" - // StandardGS5 specifies the standard gs5 state for virtual machine size - // types. - StandardGS5 VirtualMachineSizeTypes = "Standard_GS5" + VirtualMachineSizeTypesStandardA8V2 VirtualMachineSizeTypes = "Standard_A8_v2" + // VirtualMachineSizeTypesStandardA9 specifies the virtual machine size types standard a9 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardA9 VirtualMachineSizeTypes = "Standard_A9" + // VirtualMachineSizeTypesStandardD1 specifies the virtual machine size types standard d1 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardD1 VirtualMachineSizeTypes = "Standard_D1" + // VirtualMachineSizeTypesStandardD11 specifies the virtual machine size types standard d11 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardD11 VirtualMachineSizeTypes = "Standard_D11" + // VirtualMachineSizeTypesStandardD11V2 specifies the virtual machine size types standard d11v2 state for virtual + // machine size types. + VirtualMachineSizeTypesStandardD11V2 VirtualMachineSizeTypes = "Standard_D11_v2" + // VirtualMachineSizeTypesStandardD12 specifies the virtual machine size types standard d12 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardD12 VirtualMachineSizeTypes = "Standard_D12" + // VirtualMachineSizeTypesStandardD12V2 specifies the virtual machine size types standard d12v2 state for virtual + // machine size types. + VirtualMachineSizeTypesStandardD12V2 VirtualMachineSizeTypes = "Standard_D12_v2" + // VirtualMachineSizeTypesStandardD13 specifies the virtual machine size types standard d13 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardD13 VirtualMachineSizeTypes = "Standard_D13" + // VirtualMachineSizeTypesStandardD13V2 specifies the virtual machine size types standard d13v2 state for virtual + // machine size types. + VirtualMachineSizeTypesStandardD13V2 VirtualMachineSizeTypes = "Standard_D13_v2" + // VirtualMachineSizeTypesStandardD14 specifies the virtual machine size types standard d14 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardD14 VirtualMachineSizeTypes = "Standard_D14" + // VirtualMachineSizeTypesStandardD14V2 specifies the virtual machine size types standard d14v2 state for virtual + // machine size types. + VirtualMachineSizeTypesStandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2" + // VirtualMachineSizeTypesStandardD15V2 specifies the virtual machine size types standard d15v2 state for virtual + // machine size types. + VirtualMachineSizeTypesStandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2" + // VirtualMachineSizeTypesStandardD1V2 specifies the virtual machine size types standard d1v2 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2" + // VirtualMachineSizeTypesStandardD2 specifies the virtual machine size types standard d2 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardD2 VirtualMachineSizeTypes = "Standard_D2" + // VirtualMachineSizeTypesStandardD2V2 specifies the virtual machine size types standard d2v2 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardD2V2 VirtualMachineSizeTypes = "Standard_D2_v2" + // VirtualMachineSizeTypesStandardD3 specifies the virtual machine size types standard d3 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardD3 VirtualMachineSizeTypes = "Standard_D3" + // VirtualMachineSizeTypesStandardD3V2 specifies the virtual machine size types standard d3v2 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardD3V2 VirtualMachineSizeTypes = "Standard_D3_v2" + // VirtualMachineSizeTypesStandardD4 specifies the virtual machine size types standard d4 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardD4 VirtualMachineSizeTypes = "Standard_D4" + // VirtualMachineSizeTypesStandardD4V2 specifies the virtual machine size types standard d4v2 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardD4V2 VirtualMachineSizeTypes = "Standard_D4_v2" + // VirtualMachineSizeTypesStandardD5V2 specifies the virtual machine size types standard d5v2 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardD5V2 VirtualMachineSizeTypes = "Standard_D5_v2" + // VirtualMachineSizeTypesStandardDS1 specifies the virtual machine size types standard ds1 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardDS1 VirtualMachineSizeTypes = "Standard_DS1" + // VirtualMachineSizeTypesStandardDS11 specifies the virtual machine size types standard ds11 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardDS11 VirtualMachineSizeTypes = "Standard_DS11" + // VirtualMachineSizeTypesStandardDS11V2 specifies the virtual machine size types standard ds11v2 state for virtual + // machine size types. + VirtualMachineSizeTypesStandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2" + // VirtualMachineSizeTypesStandardDS12 specifies the virtual machine size types standard ds12 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardDS12 VirtualMachineSizeTypes = "Standard_DS12" + // VirtualMachineSizeTypesStandardDS12V2 specifies the virtual machine size types standard ds12v2 state for virtual + // machine size types. + VirtualMachineSizeTypesStandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2" + // VirtualMachineSizeTypesStandardDS13 specifies the virtual machine size types standard ds13 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardDS13 VirtualMachineSizeTypes = "Standard_DS13" + // VirtualMachineSizeTypesStandardDS13V2 specifies the virtual machine size types standard ds13v2 state for virtual + // machine size types. + VirtualMachineSizeTypesStandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2" + // VirtualMachineSizeTypesStandardDS14 specifies the virtual machine size types standard ds14 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardDS14 VirtualMachineSizeTypes = "Standard_DS14" + // VirtualMachineSizeTypesStandardDS14V2 specifies the virtual machine size types standard ds14v2 state for virtual + // machine size types. + VirtualMachineSizeTypesStandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2" + // VirtualMachineSizeTypesStandardDS15V2 specifies the virtual machine size types standard ds15v2 state for virtual + // machine size types. + VirtualMachineSizeTypesStandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2" + // VirtualMachineSizeTypesStandardDS1V2 specifies the virtual machine size types standard ds1v2 state for virtual + // machine size types. + VirtualMachineSizeTypesStandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2" + // VirtualMachineSizeTypesStandardDS2 specifies the virtual machine size types standard ds2 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardDS2 VirtualMachineSizeTypes = "Standard_DS2" + // VirtualMachineSizeTypesStandardDS2V2 specifies the virtual machine size types standard ds2v2 state for virtual + // machine size types. + VirtualMachineSizeTypesStandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2" + // VirtualMachineSizeTypesStandardDS3 specifies the virtual machine size types standard ds3 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardDS3 VirtualMachineSizeTypes = "Standard_DS3" + // VirtualMachineSizeTypesStandardDS3V2 specifies the virtual machine size types standard ds3v2 state for virtual + // machine size types. + VirtualMachineSizeTypesStandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2" + // VirtualMachineSizeTypesStandardDS4 specifies the virtual machine size types standard ds4 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardDS4 VirtualMachineSizeTypes = "Standard_DS4" + // VirtualMachineSizeTypesStandardDS4V2 specifies the virtual machine size types standard ds4v2 state for virtual + // machine size types. + VirtualMachineSizeTypesStandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2" + // VirtualMachineSizeTypesStandardDS5V2 specifies the virtual machine size types standard ds5v2 state for virtual + // machine size types. + VirtualMachineSizeTypesStandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2" + // VirtualMachineSizeTypesStandardF1 specifies the virtual machine size types standard f1 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardF1 VirtualMachineSizeTypes = "Standard_F1" + // VirtualMachineSizeTypesStandardF16 specifies the virtual machine size types standard f16 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardF16 VirtualMachineSizeTypes = "Standard_F16" + // VirtualMachineSizeTypesStandardF16s specifies the virtual machine size types standard f16s state for virtual machine + // size types. + VirtualMachineSizeTypesStandardF16s VirtualMachineSizeTypes = "Standard_F16s" + // VirtualMachineSizeTypesStandardF1s specifies the virtual machine size types standard f1s state for virtual machine + // size types. + VirtualMachineSizeTypesStandardF1s VirtualMachineSizeTypes = "Standard_F1s" + // VirtualMachineSizeTypesStandardF2 specifies the virtual machine size types standard f2 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardF2 VirtualMachineSizeTypes = "Standard_F2" + // VirtualMachineSizeTypesStandardF2s specifies the virtual machine size types standard f2s state for virtual machine + // size types. + VirtualMachineSizeTypesStandardF2s VirtualMachineSizeTypes = "Standard_F2s" + // VirtualMachineSizeTypesStandardF4 specifies the virtual machine size types standard f4 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardF4 VirtualMachineSizeTypes = "Standard_F4" + // VirtualMachineSizeTypesStandardF4s specifies the virtual machine size types standard f4s state for virtual machine + // size types. + VirtualMachineSizeTypesStandardF4s VirtualMachineSizeTypes = "Standard_F4s" + // VirtualMachineSizeTypesStandardF8 specifies the virtual machine size types standard f8 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardF8 VirtualMachineSizeTypes = "Standard_F8" + // VirtualMachineSizeTypesStandardF8s specifies the virtual machine size types standard f8s state for virtual machine + // size types. + VirtualMachineSizeTypesStandardF8s VirtualMachineSizeTypes = "Standard_F8s" + // VirtualMachineSizeTypesStandardG1 specifies the virtual machine size types standard g1 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardG1 VirtualMachineSizeTypes = "Standard_G1" + // VirtualMachineSizeTypesStandardG2 specifies the virtual machine size types standard g2 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardG2 VirtualMachineSizeTypes = "Standard_G2" + // VirtualMachineSizeTypesStandardG3 specifies the virtual machine size types standard g3 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardG3 VirtualMachineSizeTypes = "Standard_G3" + // VirtualMachineSizeTypesStandardG4 specifies the virtual machine size types standard g4 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardG4 VirtualMachineSizeTypes = "Standard_G4" + // VirtualMachineSizeTypesStandardG5 specifies the virtual machine size types standard g5 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardG5 VirtualMachineSizeTypes = "Standard_G5" + // VirtualMachineSizeTypesStandardGS1 specifies the virtual machine size types standard gs1 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardGS1 VirtualMachineSizeTypes = "Standard_GS1" + // VirtualMachineSizeTypesStandardGS2 specifies the virtual machine size types standard gs2 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardGS2 VirtualMachineSizeTypes = "Standard_GS2" + // VirtualMachineSizeTypesStandardGS3 specifies the virtual machine size types standard gs3 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardGS3 VirtualMachineSizeTypes = "Standard_GS3" + // VirtualMachineSizeTypesStandardGS4 specifies the virtual machine size types standard gs4 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardGS4 VirtualMachineSizeTypes = "Standard_GS4" + // VirtualMachineSizeTypesStandardGS5 specifies the virtual machine size types standard gs5 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardGS5 VirtualMachineSizeTypes = "Standard_GS5" + // VirtualMachineSizeTypesStandardH16 specifies the virtual machine size types standard h16 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardH16 VirtualMachineSizeTypes = "Standard_H16" + // VirtualMachineSizeTypesStandardH16m specifies the virtual machine size types standard h16m state for virtual machine + // size types. + VirtualMachineSizeTypesStandardH16m VirtualMachineSizeTypes = "Standard_H16m" + // VirtualMachineSizeTypesStandardH16mr specifies the virtual machine size types standard h16mr state for virtual + // machine size types. + VirtualMachineSizeTypesStandardH16mr VirtualMachineSizeTypes = "Standard_H16mr" + // VirtualMachineSizeTypesStandardH16r specifies the virtual machine size types standard h16r state for virtual machine + // size types. + VirtualMachineSizeTypesStandardH16r VirtualMachineSizeTypes = "Standard_H16r" + // VirtualMachineSizeTypesStandardH8 specifies the virtual machine size types standard h8 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardH8 VirtualMachineSizeTypes = "Standard_H8" + // VirtualMachineSizeTypesStandardH8m specifies the virtual machine size types standard h8m state for virtual machine + // size types. + VirtualMachineSizeTypesStandardH8m VirtualMachineSizeTypes = "Standard_H8m" + // VirtualMachineSizeTypesStandardL16s specifies the virtual machine size types standard l16s state for virtual machine + // size types. + VirtualMachineSizeTypesStandardL16s VirtualMachineSizeTypes = "Standard_L16s" + // VirtualMachineSizeTypesStandardL32s specifies the virtual machine size types standard l32s state for virtual machine + // size types. + VirtualMachineSizeTypesStandardL32s VirtualMachineSizeTypes = "Standard_L32s" + // VirtualMachineSizeTypesStandardL4s specifies the virtual machine size types standard l4s state for virtual machine + // size types. + VirtualMachineSizeTypesStandardL4s VirtualMachineSizeTypes = "Standard_L4s" + // VirtualMachineSizeTypesStandardL8s specifies the virtual machine size types standard l8s state for virtual machine + // size types. + VirtualMachineSizeTypesStandardL8s VirtualMachineSizeTypes = "Standard_L8s" + // VirtualMachineSizeTypesStandardNC12 specifies the virtual machine size types standard nc12 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardNC12 VirtualMachineSizeTypes = "Standard_NC12" + // VirtualMachineSizeTypesStandardNC24 specifies the virtual machine size types standard nc24 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardNC24 VirtualMachineSizeTypes = "Standard_NC24" + // VirtualMachineSizeTypesStandardNC24r specifies the virtual machine size types standard nc24r state for virtual + // machine size types. + VirtualMachineSizeTypesStandardNC24r VirtualMachineSizeTypes = "Standard_NC24r" + // VirtualMachineSizeTypesStandardNC6 specifies the virtual machine size types standard nc6 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardNC6 VirtualMachineSizeTypes = "Standard_NC6" + // VirtualMachineSizeTypesStandardNV12 specifies the virtual machine size types standard nv12 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardNV12 VirtualMachineSizeTypes = "Standard_NV12" + // VirtualMachineSizeTypesStandardNV24 specifies the virtual machine size types standard nv24 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardNV24 VirtualMachineSizeTypes = "Standard_NV24" + // VirtualMachineSizeTypesStandardNV6 specifies the virtual machine size types standard nv6 state for virtual machine + // size types. + VirtualMachineSizeTypesStandardNV6 VirtualMachineSizeTypes = "Standard_NV6" ) -// AdditionalUnattendContent is additional XML formatted information that can -// be included in the Unattend.xml file, which is used by Windows Setup. -// Contents are defined by setting name, component name, and the pass in which -// the content is a applied. +// AccessURI is a disk access SAS uri. +type AccessURI struct { + autorest.Response `json:"-"` + *AccessURIOutput `json:"properties,omitempty"` +} + +// AccessURIOutput is azure properties, including output. +type AccessURIOutput struct { + *AccessURIRaw `json:"output,omitempty"` +} + +// AccessURIRaw is this object gets 'bubbled up' through flattening. +type AccessURIRaw struct { + AccessSAS *string `json:"accessSAS,omitempty"` +} + +// AdditionalUnattendContent is specifies additional XML formatted information that can be included in the Unattend.xml +// file, which is used by Windows Setup. Contents are defined by setting name, component name, and the pass in which +// the content is applied. type AdditionalUnattendContent struct { PassName PassNames `json:"passName,omitempty"` ComponentName ComponentNames `json:"componentName,omitempty"` @@ -397,7 +736,14 @@ type APIErrorBase struct { Message *string `json:"message,omitempty"` } -// AvailabilitySet is create or update availability set parameters. +// AvailabilitySet is 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. type AvailabilitySet struct { autorest.Response `json:"-"` ID *string `json:"id,omitempty"` @@ -421,22 +767,141 @@ type AvailabilitySetProperties struct { PlatformFaultDomainCount *int32 `json:"platformFaultDomainCount,omitempty"` VirtualMachines *[]SubResource `json:"virtualMachines,omitempty"` Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` - Managed *bool `json:"managed,omitempty"` } -// BootDiagnostics is describes Boot Diagnostics. +// BootDiagnostics is 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. type BootDiagnostics struct { Enabled *bool `json:"enabled,omitempty"` StorageURI *string `json:"storageUri,omitempty"` } -// BootDiagnosticsInstanceView is the instance view of a virtual machine boot -// diagnostics. +// BootDiagnosticsInstanceView is the instance view of a virtual machine boot diagnostics. type BootDiagnosticsInstanceView struct { ConsoleScreenshotBlobURI *string `json:"consoleScreenshotBlobUri,omitempty"` SerialConsoleLogBlobURI *string `json:"serialConsoleLogBlobUri,omitempty"` } +// ContainerService is container service. +type ContainerService struct { + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *ContainerServiceProperties `json:"properties,omitempty"` +} + +// ContainerServiceAgentPoolProfile is profile for the container service agent pool. +type ContainerServiceAgentPoolProfile struct { + Name *string `json:"name,omitempty"` + Count *int32 `json:"count,omitempty"` + VMSize ContainerServiceVMSizeTypes `json:"vmSize,omitempty"` + DNSPrefix *string `json:"dnsPrefix,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` +} + +// ContainerServiceCustomProfile is properties to configure a custom container service cluster. +type ContainerServiceCustomProfile struct { + Orchestrator *string `json:"orchestrator,omitempty"` +} + +// ContainerServiceDiagnosticsProfile is +type ContainerServiceDiagnosticsProfile struct { + VMDiagnostics *ContainerServiceVMDiagnostics `json:"vmDiagnostics,omitempty"` +} + +// ContainerServiceLinuxProfile is profile for Linux VMs in the container service cluster. +type ContainerServiceLinuxProfile struct { + AdminUsername *string `json:"adminUsername,omitempty"` + SSH *ContainerServiceSSHConfiguration `json:"ssh,omitempty"` +} + +// ContainerServiceListResult is the response from the List Container Services operation. +type ContainerServiceListResult struct { + autorest.Response `json:"-"` + Value *[]ContainerService `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// ContainerServiceListResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client ContainerServiceListResult) ContainerServiceListResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// ContainerServiceMasterProfile is profile for the container service master. +type ContainerServiceMasterProfile struct { + Count *int32 `json:"count,omitempty"` + DNSPrefix *string `json:"dnsPrefix,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` +} + +// ContainerServiceOrchestratorProfile is profile for the container service orchestrator. +type ContainerServiceOrchestratorProfile struct { + OrchestratorType ContainerServiceOrchestratorTypes `json:"orchestratorType,omitempty"` +} + +// ContainerServiceProperties is properties of the container service. +type ContainerServiceProperties struct { + ProvisioningState *string `json:"provisioningState,omitempty"` + OrchestratorProfile *ContainerServiceOrchestratorProfile `json:"orchestratorProfile,omitempty"` + CustomProfile *ContainerServiceCustomProfile `json:"customProfile,omitempty"` + ServicePrincipalProfile *ContainerServiceServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` + MasterProfile *ContainerServiceMasterProfile `json:"masterProfile,omitempty"` + AgentPoolProfiles *[]ContainerServiceAgentPoolProfile `json:"agentPoolProfiles,omitempty"` + WindowsProfile *ContainerServiceWindowsProfile `json:"windowsProfile,omitempty"` + LinuxProfile *ContainerServiceLinuxProfile `json:"linuxProfile,omitempty"` + DiagnosticsProfile *ContainerServiceDiagnosticsProfile `json:"diagnosticsProfile,omitempty"` +} + +// ContainerServiceServicePrincipalProfile is information about a service principal identity for the cluster to use for +// manipulating Azure APIs. +type ContainerServiceServicePrincipalProfile struct { + ClientID *string `json:"clientId,omitempty"` + Secret *string `json:"secret,omitempty"` +} + +// ContainerServiceSSHConfiguration is SSH configuration for Linux-based VMs running on Azure. +type ContainerServiceSSHConfiguration struct { + PublicKeys *[]ContainerServiceSSHPublicKey `json:"publicKeys,omitempty"` +} + +// ContainerServiceSSHPublicKey is contains information about SSH certificate public key data. +type ContainerServiceSSHPublicKey struct { + KeyData *string `json:"keyData,omitempty"` +} + +// ContainerServiceVMDiagnostics is profile for diagnostics on the container service VMs. +type ContainerServiceVMDiagnostics struct { + Enabled *bool `json:"enabled,omitempty"` + StorageURI *string `json:"storageUri,omitempty"` +} + +// ContainerServiceWindowsProfile is profile for Windows VMs in the container service cluster. +type ContainerServiceWindowsProfile struct { + AdminUsername *string `json:"adminUsername,omitempty"` + AdminPassword *string `json:"adminPassword,omitempty"` +} + +// CreationData is data used when creating a disk. +type CreationData struct { + CreateOption DiskCreateOption `json:"createOption,omitempty"` + StorageAccountID *string `json:"storageAccountId,omitempty"` + ImageReference *ImageDiskReference `json:"imageReference,omitempty"` + SourceURI *string `json:"sourceUri,omitempty"` + SourceResourceID *string `json:"sourceResourceId,omitempty"` +} + // DataDisk is describes a data disk. type DataDisk struct { Lun *int32 `json:"lun,omitempty"` @@ -454,11 +919,25 @@ type DataDiskImage struct { Lun *int32 `json:"lun,omitempty"` } -// DiagnosticsProfile is describes a diagnostics profile. +// DiagnosticsProfile is specifies the boot diagnostic settings state.

Minimum api-version: 2015-06-15. type DiagnosticsProfile struct { BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"` } +// Disk is disk resource. +type Disk struct { + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + ManagedBy *string `json:"managedBy,omitempty"` + Sku *DiskSku `json:"sku,omitempty"` + Zones *[]string `json:"zones,omitempty"` + *DiskProperties `json:"properties,omitempty"` +} + // DiskEncryptionSettings is describes a Encryption Settings for a Disk type DiskEncryptionSettings struct { DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"` @@ -468,16 +947,80 @@ type DiskEncryptionSettings struct { // DiskInstanceView is the instance view of the disk. type DiskInstanceView struct { - Name *string `json:"name,omitempty"` - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` + Name *string `json:"name,omitempty"` + EncryptionSettings *[]DiskEncryptionSettings `json:"encryptionSettings,omitempty"` + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` +} + +// DiskList is the List Disks operation response. +type DiskList struct { + autorest.Response `json:"-"` + Value *[]Disk `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// DiskListPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client DiskList) DiskListPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// DiskProperties is disk resource properties. +type DiskProperties struct { + TimeCreated *date.Time `json:"timeCreated,omitempty"` + OsType OperatingSystemTypes `json:"osType,omitempty"` + CreationData *CreationData `json:"creationData,omitempty"` + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// DiskSku is the disks and snapshots sku name. Can be Standard_LRS or Premium_LRS. +type DiskSku struct { + Name StorageAccountTypes `json:"name,omitempty"` + Tier *string `json:"tier,omitempty"` +} + +// DiskUpdate is disk update resource. +type DiskUpdate struct { + Tags *map[string]*string `json:"tags,omitempty"` + Sku *DiskSku `json:"sku,omitempty"` + *DiskUpdateProperties `json:"properties,omitempty"` +} + +// DiskUpdateProperties is disk resource update properties. +type DiskUpdateProperties struct { + OsType OperatingSystemTypes `json:"osType,omitempty"` + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + EncryptionSettings *EncryptionSettings `json:"encryptionSettings,omitempty"` +} + +// EncryptionSettings is encryption settings for disk or snapshot +type EncryptionSettings struct { + Enabled *bool `json:"enabled,omitempty"` + DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"` + KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"` } -// HardwareProfile is describes a hardware profile. +// GrantAccessData is data used for requesting a SAS. +type GrantAccessData struct { + Access AccessLevel `json:"access,omitempty"` + DurationInSeconds *int32 `json:"durationInSeconds,omitempty"` +} + +// HardwareProfile is specifies the hardware settings for the virtual machine. type HardwareProfile struct { VMSize VirtualMachineSizeTypes `json:"vmSize,omitempty"` } -// Image is describes an Image. +// Image is the source user image virtual hard disk. The virtual hard disk will be copied before being attached to the +// virtual machine. If SourceImage is provided, the destination virtual hard drive must not exist. type Image struct { autorest.Response `json:"-"` ID *string `json:"id,omitempty"` @@ -490,12 +1033,19 @@ type Image struct { // ImageDataDisk is describes a data disk. type ImageDataDisk struct { - Lun *int32 `json:"lun,omitempty"` - Snapshot *SubResource `json:"snapshot,omitempty"` - ManagedDisk *SubResource `json:"managedDisk,omitempty"` - BlobURI *string `json:"blobUri,omitempty"` - Caching CachingTypes `json:"caching,omitempty"` - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + Lun *int32 `json:"lun,omitempty"` + Snapshot *SubResource `json:"snapshot,omitempty"` + ManagedDisk *SubResource `json:"managedDisk,omitempty"` + BlobURI *string `json:"blobUri,omitempty"` + Caching CachingTypes `json:"caching,omitempty"` + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` +} + +// ImageDiskReference is the source image used for creating the disk. +type ImageDiskReference struct { + ID *string `json:"id,omitempty"` + Lun *int32 `json:"lun,omitempty"` } // ImageListResult is the List Image operation response. @@ -519,13 +1069,14 @@ func (client ImageListResult) ImageListResultPreparer() (*http.Request, error) { // ImageOSDisk is describes an Operating System disk. type ImageOSDisk struct { - OsType OperatingSystemTypes `json:"osType,omitempty"` - OsState OperatingSystemStateTypes `json:"osState,omitempty"` - Snapshot *SubResource `json:"snapshot,omitempty"` - ManagedDisk *SubResource `json:"managedDisk,omitempty"` - BlobURI *string `json:"blobUri,omitempty"` - Caching CachingTypes `json:"caching,omitempty"` - DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + OsType OperatingSystemTypes `json:"osType,omitempty"` + OsState OperatingSystemStateTypes `json:"osState,omitempty"` + Snapshot *SubResource `json:"snapshot,omitempty"` + ManagedDisk *SubResource `json:"managedDisk,omitempty"` + BlobURI *string `json:"blobUri,omitempty"` + Caching CachingTypes `json:"caching,omitempty"` + DiskSizeGB *int32 `json:"diskSizeGB,omitempty"` + StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` } // ImageProperties is describes the properties of an Image. @@ -535,7 +1086,9 @@ type ImageProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ImageReference is the image reference. +// ImageReference is specifies information about the image to use. You can specify information about platform images, +// marketplace images, or virtual machine images. This element is required when you want to use a platform image, +// marketplace image, or virtual machine image, but is not used in other creation operations. type ImageReference struct { ID *string `json:"id,omitempty"` Publisher *string `json:"publisher,omitempty"` @@ -565,6 +1118,19 @@ type InstanceViewStatus struct { Time *date.Time `json:"time,omitempty"` } +// KeyVaultAndKeyReference is key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to +// unwrap the encryptionKey +type KeyVaultAndKeyReference struct { + SourceVault *SourceVault `json:"sourceVault,omitempty"` + KeyURL *string `json:"keyUrl,omitempty"` +} + +// KeyVaultAndSecretReference is key Vault Secret Url and vault id of the encryption key +type KeyVaultAndSecretReference struct { + SourceVault *SourceVault `json:"sourceVault,omitempty"` + SecretURL *string `json:"secretUrl,omitempty"` +} + // KeyVaultKeyReference is describes a reference to Key Vault Key type KeyVaultKeyReference struct { KeyURL *string `json:"keyUrl,omitempty"` @@ -577,7 +1143,11 @@ type KeyVaultSecretReference struct { SourceVault *SubResource `json:"sourceVault,omitempty"` } -// LinuxConfiguration is describes Windows configuration of the OS Profile. +// LinuxConfiguration is specifies the Linux operating system settings on the virtual machine.

For a list of +// supported Linux distributions, see [Linux on Azure-Endorsed +// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-endorsed-distros?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json) +//

For running non-endorsed distributions, see [Information for Non-Endorsed +// Distributions](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-linux-create-upload-generic?toc=%2fazure%2fvirtual-machines%2flinux%2ftoc.json). type LinuxConfiguration struct { DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` SSH *SSHConfiguration `json:"ssh,omitempty"` @@ -614,12 +1184,22 @@ type ListVirtualMachineImageResource struct { Value *[]VirtualMachineImageResource `json:"value,omitempty"` } -// LongRunningOperationProperties is compute-specific operation properties, -// including output +// LongRunningOperationProperties is compute-specific operation properties, including output type LongRunningOperationProperties struct { Output *map[string]interface{} `json:"output,omitempty"` } +// MaintenanceRedeployStatus is maintenance Operation Status. +type MaintenanceRedeployStatus struct { + IsCustomerInitiatedMaintenanceAllowed *bool `json:"isCustomerInitiatedMaintenanceAllowed,omitempty"` + PreMaintenanceWindowStartTime *date.Time `json:"preMaintenanceWindowStartTime,omitempty"` + PreMaintenanceWindowEndTime *date.Time `json:"preMaintenanceWindowEndTime,omitempty"` + MaintenanceWindowStartTime *date.Time `json:"maintenanceWindowStartTime,omitempty"` + MaintenanceWindowEndTime *date.Time `json:"maintenanceWindowEndTime,omitempty"` + LastOperationResultCode MaintenanceOperationResultCodeTypes `json:"lastOperationResultCode,omitempty"` + LastOperationMessage *string `json:"lastOperationMessage,omitempty"` +} + // ManagedDiskParameters is the parameters of a managed disk. type ManagedDiskParameters struct { ID *string `json:"id,omitempty"` @@ -632,13 +1212,12 @@ type NetworkInterfaceReference struct { *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` } -// NetworkInterfaceReferenceProperties is describes a network interface -// reference properties. +// NetworkInterfaceReferenceProperties is describes a network interface reference properties. type NetworkInterfaceReferenceProperties struct { Primary *bool `json:"primary,omitempty"` } -// NetworkProfile is describes a network profile. +// NetworkProfile is specifies the network interfaces of the virtual machine. type NetworkProfile struct { NetworkInterfaces *[]NetworkInterfaceReference `json:"networkInterfaces,omitempty"` } @@ -653,7 +1232,9 @@ type OperationStatusResponse struct { Error *APIError `json:"error,omitempty"` } -// OSDisk is describes an Operating System disk. +// OSDisk is specifies information about the operating system disk used by the virtual machine.

For more +// information about disks, see [About disks and VHDs for Azure virtual +// machines](https://docs.microsoft.com/azure/virtual-machines/virtual-machines-windows-about-disks-vhds?toc=%2fazure%2fvirtual-machines%2fwindows%2ftoc.json). type OSDisk struct { OsType OperatingSystemTypes `json:"osType,omitempty"` EncryptionSettings *DiskEncryptionSettings `json:"encryptionSettings,omitempty"` @@ -671,7 +1252,7 @@ type OSDiskImage struct { OperatingSystem OperatingSystemTypes `json:"operatingSystem,omitempty"` } -// OSProfile is describes an OS profile. +// OSProfile is specifies the operating system settings for the virtual machine. type OSProfile struct { ComputerName *string `json:"computerName,omitempty"` AdminUsername *string `json:"adminUsername,omitempty"` @@ -682,7 +1263,10 @@ type OSProfile struct { Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` } -// Plan is plan for the resource. +// Plan is specifies information about the marketplace image used to create the virtual machine. This element is only +// used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for +// programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to +// deploy programmatically, Get Started ->**. Enter any required information and then click **Save**. type Plan struct { Name *string `json:"name,omitempty"` Publisher *string `json:"publisher,omitempty"` @@ -690,8 +1274,7 @@ type Plan struct { PromotionCode *string `json:"promotionCode,omitempty"` } -// PurchasePlan is used for establishing the purchase context of any 3rd Party -// artifact through MarketPlace. +// PurchasePlan is used for establishing the purchase context of any 3rd Party artifact through MarketPlace. type PurchasePlan struct { Publisher *string `json:"publisher,omitempty"` Name *string `json:"name,omitempty"` @@ -707,6 +1290,195 @@ type Resource struct { Tags *map[string]*string `json:"tags,omitempty"` } +// ResourceSku is describes an available Compute SKU. +type ResourceSku struct { + ResourceType *string `json:"resourceType,omitempty"` + Name *string `json:"name,omitempty"` + Tier *string `json:"tier,omitempty"` + Size *string `json:"size,omitempty"` + Family *string `json:"family,omitempty"` + Kind *string `json:"kind,omitempty"` + Capacity *ResourceSkuCapacity `json:"capacity,omitempty"` + Locations *[]string `json:"locations,omitempty"` + APIVersions *[]string `json:"apiVersions,omitempty"` + Costs *[]ResourceSkuCosts `json:"costs,omitempty"` + Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` + Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` +} + +// ResourceSkuCapabilities is describes The SKU capabilites object. +type ResourceSkuCapabilities struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} + +// ResourceSkuCapacity is describes scaling information of a SKU. +type ResourceSkuCapacity struct { + Minimum *int64 `json:"minimum,omitempty"` + Maximum *int64 `json:"maximum,omitempty"` + Default *int64 `json:"default,omitempty"` + ScaleType ResourceSkuCapacityScaleType `json:"scaleType,omitempty"` +} + +// ResourceSkuCosts is describes metadata for retrieving price info. +type ResourceSkuCosts struct { + MeterID *string `json:"meterID,omitempty"` + Quantity *int64 `json:"quantity,omitempty"` + ExtendedUnit *string `json:"extendedUnit,omitempty"` +} + +// ResourceSkuRestrictions is describes scaling information of a SKU. +type ResourceSkuRestrictions struct { + Type ResourceSkuRestrictionsType `json:"type,omitempty"` + Values *[]string `json:"values,omitempty"` + ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` +} + +// ResourceSkusResult is the Compute List Skus operation response. +type ResourceSkusResult struct { + autorest.Response `json:"-"` + Value *[]ResourceSku `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// ResourceSkusResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client ResourceSkusResult) ResourceSkusResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// ResourceUpdate is the Resource model definition. +type ResourceUpdate struct { + Tags *map[string]*string `json:"tags,omitempty"` + Sku *DiskSku `json:"sku,omitempty"` +} + +// RollingUpgradePolicy is the configuration parameters used while performing a rolling upgrade. +type RollingUpgradePolicy struct { + MaxBatchInstancePercent *int32 `json:"maxBatchInstancePercent,omitempty"` + MaxUnhealthyInstancePercent *int32 `json:"maxUnhealthyInstancePercent,omitempty"` + MaxUnhealthyUpgradedInstancePercent *int32 `json:"maxUnhealthyUpgradedInstancePercent,omitempty"` + PauseTimeBetweenBatches *string `json:"pauseTimeBetweenBatches,omitempty"` +} + +// RollingUpgradeProgressInfo is information about the number of virtual machine instances in each upgrade state. +type RollingUpgradeProgressInfo struct { + SuccessfulInstanceCount *int32 `json:"successfulInstanceCount,omitempty"` + FailedInstanceCount *int32 `json:"failedInstanceCount,omitempty"` + InProgressInstanceCount *int32 `json:"inProgressInstanceCount,omitempty"` + PendingInstanceCount *int32 `json:"pendingInstanceCount,omitempty"` +} + +// RollingUpgradeRunningStatus is information about the current running state of the overall upgrade. +type RollingUpgradeRunningStatus struct { + Code RollingUpgradeStatusCode `json:"code,omitempty"` + StartTime *date.Time `json:"startTime,omitempty"` + LastAction RollingUpgradeActionType `json:"lastAction,omitempty"` + LastActionTime *date.Time `json:"lastActionTime,omitempty"` +} + +// RollingUpgradeStatusInfo is the status of the latest virtual machine scale set rolling upgrade. +type RollingUpgradeStatusInfo struct { + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *RollingUpgradeStatusInfoProperties `json:"properties,omitempty"` +} + +// RollingUpgradeStatusInfoProperties is the status of the latest virtual machine scale set rolling upgrade. +type RollingUpgradeStatusInfoProperties struct { + Policy *RollingUpgradePolicy `json:"policy,omitempty"` + RunningStatus *RollingUpgradeRunningStatus `json:"runningStatus,omitempty"` + Progress *RollingUpgradeProgressInfo `json:"progress,omitempty"` + Error *APIError `json:"error,omitempty"` +} + +// RunCommandDocument is describes the properties of a Run Command. +type RunCommandDocument struct { + autorest.Response `json:"-"` + Schema *string `json:"$schema,omitempty"` + ID *string `json:"id,omitempty"` + OsType OperatingSystemTypes `json:"osType,omitempty"` + Label *string `json:"label,omitempty"` + Description *string `json:"description,omitempty"` + Script *[]string `json:"script,omitempty"` + Parameters *[]RunCommandParameterDefinition `json:"parameters,omitempty"` +} + +// RunCommandDocumentBase is describes the properties of a Run Command metadata. +type RunCommandDocumentBase struct { + Schema *string `json:"$schema,omitempty"` + ID *string `json:"id,omitempty"` + OsType OperatingSystemTypes `json:"osType,omitempty"` + Label *string `json:"label,omitempty"` + Description *string `json:"description,omitempty"` +} + +// RunCommandInput is capture Virtual Machine parameters. +type RunCommandInput struct { + CommandID *string `json:"commandId,omitempty"` + Script *[]string `json:"script,omitempty"` + Parameters *[]RunCommandInputParameter `json:"parameters,omitempty"` +} + +// RunCommandInputParameter is describes the properties of a run command parameter. +type RunCommandInputParameter struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} + +// RunCommandListResult is the List Virtual Machine operation response. +type RunCommandListResult struct { + autorest.Response `json:"-"` + Value *[]RunCommandDocumentBase `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// RunCommandListResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client RunCommandListResult) RunCommandListResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// RunCommandParameterDefinition is describes the properties of a run command parameter. +type RunCommandParameterDefinition struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + DefaultValue *string `json:"defaultValue,omitempty"` + Required *bool `json:"required,omitempty"` +} + +// RunCommandResult is run command operation response. +type RunCommandResult struct { + autorest.Response `json:"-"` + Name *string `json:"name,omitempty"` + Status *string `json:"status,omitempty"` + StartTime *date.Time `json:"startTime,omitempty"` + EndTime *date.Time `json:"endTime,omitempty"` + Error *APIError `json:"error,omitempty"` + *RunCommandResultProperties `json:"properties,omitempty"` +} + +// RunCommandResultProperties is compute-specific operation properties, including output +type RunCommandResultProperties struct { + Output *map[string]interface{} `json:"output,omitempty"` +} + // Sku is describes a virtual machine scale set sku. type Sku struct { Name *string `json:"name,omitempty"` @@ -714,19 +1486,64 @@ type Sku struct { Capacity *int64 `json:"capacity,omitempty"` } -// SSHConfiguration is sSH configuration for Linux based VMs running on Azure +// Snapshot is snapshot resource. +type Snapshot struct { + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + ManagedBy *string `json:"managedBy,omitempty"` + Sku *DiskSku `json:"sku,omitempty"` + *DiskProperties `json:"properties,omitempty"` +} + +// SnapshotList is the List Snapshots operation response. +type SnapshotList struct { + autorest.Response `json:"-"` + Value *[]Snapshot `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// SnapshotListPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client SnapshotList) SnapshotListPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// SnapshotUpdate is snapshot update resource. +type SnapshotUpdate struct { + Tags *map[string]*string `json:"tags,omitempty"` + Sku *DiskSku `json:"sku,omitempty"` + *DiskUpdateProperties `json:"properties,omitempty"` +} + +// SourceVault is the vault id is an Azure Resource Manager Resoure id in the form +// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName} +type SourceVault struct { + ID *string `json:"id,omitempty"` +} + +// SSHConfiguration is SSH configuration for Linux based VMs running on Azure type SSHConfiguration struct { PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` } -// SSHPublicKey is contains information about SSH certificate public key and -// the path on the Linux VM where the public key is placed. +// SSHPublicKey is contains information about SSH certificate public key and the path on the Linux VM where the public +// key is placed. type SSHPublicKey struct { Path *string `json:"path,omitempty"` KeyData *string `json:"keyData,omitempty"` } -// StorageProfile is describes a storage profile. +// StorageProfile is specifies the storage settings for the virtual machine disks. type StorageProfile struct { ImageReference *ImageReference `json:"imageReference,omitempty"` OsDisk *OSDisk `json:"osDisk,omitempty"` @@ -743,9 +1560,16 @@ type SubResourceReadOnly struct { ID *string `json:"id,omitempty"` } -// UpgradePolicy is describes an upgrade policy - automatic or manual. +// UpdateResource is the Update Resource model definition. +type UpdateResource struct { + Tags *map[string]*string `json:"tags,omitempty"` +} + +// UpgradePolicy is describes an upgrade policy - automatic, manual, or rolling. type UpgradePolicy struct { - Mode UpgradeMode `json:"mode,omitempty"` + Mode UpgradeMode `json:"mode,omitempty"` + RollingUpgradePolicy *RollingUpgradePolicy `json:"rollingUpgradePolicy,omitempty"` + AutomaticOSUpgrade *bool `json:"automaticOSUpgrade,omitempty"` } // Usage is describes Compute Resource Usage. @@ -762,15 +1586,14 @@ type UsageName struct { LocalizedValue *string `json:"localizedValue,omitempty"` } -// VaultCertificate is describes a single certificate reference in a Key Vault, -// and where the certificate should reside on the VM. +// VaultCertificate is describes a single certificate reference in a Key Vault, and where the certificate should reside +// on the VM. type VaultCertificate struct { CertificateURL *string `json:"certificateUrl,omitempty"` CertificateStore *string `json:"certificateStore,omitempty"` } -// VaultSecretGroup is describes a set of certificates which are all in the -// same Key Vault. +// VaultSecretGroup is describes a set of certificates which are all in the same Key Vault. type VaultSecretGroup struct { SourceVault *SubResource `json:"sourceVault,omitempty"` VaultCertificates *[]VaultCertificate `json:"vaultCertificates,omitempty"` @@ -793,10 +1616,10 @@ type VirtualMachine struct { *VirtualMachineProperties `json:"properties,omitempty"` Resources *[]VirtualMachineExtension `json:"resources,omitempty"` Identity *VirtualMachineIdentity `json:"identity,omitempty"` + Zones *[]string `json:"zones,omitempty"` } -// VirtualMachineAgentInstanceView is the instance view of the VM Agent running -// on the virtual machine. +// VirtualMachineAgentInstanceView is the instance view of the VM Agent running on the virtual machine. type VirtualMachineAgentInstanceView struct { VMAgentVersion *string `json:"vmAgentVersion,omitempty"` ExtensionHandlers *[]VirtualMachineExtensionHandlerInstanceView `json:"extensionHandlers,omitempty"` @@ -817,8 +1640,7 @@ type VirtualMachineCaptureResult struct { *VirtualMachineCaptureResultProperties `json:"properties,omitempty"` } -// VirtualMachineCaptureResultProperties is compute-specific operation -// properties, including output +// VirtualMachineCaptureResultProperties is compute-specific operation properties, including output type VirtualMachineCaptureResultProperties struct { Output *map[string]interface{} `json:"output,omitempty"` } @@ -834,8 +1656,7 @@ type VirtualMachineExtension struct { *VirtualMachineExtensionProperties `json:"properties,omitempty"` } -// VirtualMachineExtensionHandlerInstanceView is the instance view of a virtual -// machine extension handler. +// VirtualMachineExtensionHandlerInstanceView is the instance view of a virtual machine extension handler. type VirtualMachineExtensionHandlerInstanceView struct { Type *string `json:"type,omitempty"` TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` @@ -853,8 +1674,7 @@ type VirtualMachineExtensionImage struct { *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` } -// VirtualMachineExtensionImageProperties is describes the properties of a -// Virtual Machine Extension Image. +// VirtualMachineExtensionImageProperties is describes the properties of a Virtual Machine Extension Image. type VirtualMachineExtensionImageProperties struct { OperatingSystem *string `json:"operatingSystem,omitempty"` ComputeRole *string `json:"computeRole,omitempty"` @@ -863,8 +1683,7 @@ type VirtualMachineExtensionImageProperties struct { SupportsMultipleExtensions *bool `json:"supportsMultipleExtensions,omitempty"` } -// VirtualMachineExtensionInstanceView is the instance view of a virtual -// machine extension. +// VirtualMachineExtensionInstanceView is the instance view of a virtual machine extension. type VirtualMachineExtensionInstanceView struct { Name *string `json:"name,omitempty"` Type *string `json:"type,omitempty"` @@ -873,8 +1692,7 @@ type VirtualMachineExtensionInstanceView struct { Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` } -// VirtualMachineExtensionProperties is describes the properties of a Virtual -// Machine Extension. +// VirtualMachineExtensionProperties is describes the properties of a Virtual Machine Extension. type VirtualMachineExtensionProperties struct { ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` Publisher *string `json:"publisher,omitempty"` @@ -887,6 +1705,11 @@ type VirtualMachineExtensionProperties struct { InstanceView *VirtualMachineExtensionInstanceView `json:"instanceView,omitempty"` } +// VirtualMachineHealthStatus is the health status of the VM. +type VirtualMachineHealthStatus struct { + Status *InstanceViewStatus `json:"status,omitempty"` +} + // VirtualMachineIdentity is identity for the virtual machine. type VirtualMachineIdentity struct { PrincipalID *string `json:"principalId,omitempty"` @@ -904,8 +1727,7 @@ type VirtualMachineImage struct { *VirtualMachineImageProperties `json:"properties,omitempty"` } -// VirtualMachineImageProperties is describes the properties of a Virtual -// Machine Image. +// VirtualMachineImageProperties is describes the properties of a Virtual Machine Image. type VirtualMachineImageProperties struct { Plan *PurchasePlan `json:"plan,omitempty"` OsDiskImage *OSDiskImage `json:"osDiskImage,omitempty"` @@ -922,14 +1744,16 @@ type VirtualMachineImageResource struct { // VirtualMachineInstanceView is the instance view of a virtual machine. type VirtualMachineInstanceView struct { - PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` - PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` - RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` - VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` - Disks *[]DiskInstanceView `json:"disks,omitempty"` - Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` - BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` + autorest.Response `json:"-"` + PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` + PlatformFaultDomain *int32 `json:"platformFaultDomain,omitempty"` + RdpThumbPrint *string `json:"rdpThumbPrint,omitempty"` + VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` + MaintenanceRedeployStatus *MaintenanceRedeployStatus `json:"maintenanceRedeployStatus,omitempty"` + Disks *[]DiskInstanceView `json:"disks,omitempty"` + Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` + BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` + Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` } // VirtualMachineListResult is the List Virtual Machine operation response. @@ -977,10 +1801,10 @@ type VirtualMachineScaleSet struct { Plan *Plan `json:"plan,omitempty"` *VirtualMachineScaleSetProperties `json:"properties,omitempty"` Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` + Zones *[]string `json:"zones,omitempty"` } -// VirtualMachineScaleSetDataDisk is describes a virtual machine scale set data -// disk. +// VirtualMachineScaleSetDataDisk is describes a virtual machine scale set data disk. type VirtualMachineScaleSetDataDisk struct { Name *string `json:"name,omitempty"` Lun *int32 `json:"lun,omitempty"` @@ -990,23 +1814,41 @@ type VirtualMachineScaleSetDataDisk struct { ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` } -// VirtualMachineScaleSetExtension is describes a Virtual Machine Scale Set -// Extension. +// VirtualMachineScaleSetExtension is describes a Virtual Machine Scale Set Extension. type VirtualMachineScaleSetExtension struct { + autorest.Response `json:"-"` ID *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` } -// VirtualMachineScaleSetExtensionProfile is describes a virtual machine scale -// set extension profile. +// VirtualMachineScaleSetExtensionListResult is the List VM scale set extension operation response. +type VirtualMachineScaleSetExtensionListResult struct { + autorest.Response `json:"-"` + Value *[]VirtualMachineScaleSetExtension `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// VirtualMachineScaleSetExtensionListResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client VirtualMachineScaleSetExtensionListResult) VirtualMachineScaleSetExtensionListResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// VirtualMachineScaleSetExtensionProfile is describes a virtual machine scale set extension profile. type VirtualMachineScaleSetExtensionProfile struct { Extensions *[]VirtualMachineScaleSetExtension `json:"extensions,omitempty"` } -// VirtualMachineScaleSetExtensionProperties is describes the properties of a -// Virtual Machine Scale Set Extension. +// VirtualMachineScaleSetExtensionProperties is describes the properties of a Virtual Machine Scale Set Extension. type VirtualMachineScaleSetExtensionProperties struct { + ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` Publisher *string `json:"publisher,omitempty"` Type *string `json:"type,omitempty"` TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` @@ -1016,16 +1858,14 @@ type VirtualMachineScaleSetExtensionProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// VirtualMachineScaleSetIdentity is identity for the virtual machine scale -// set. +// VirtualMachineScaleSetIdentity is identity for the virtual machine scale set. type VirtualMachineScaleSetIdentity struct { PrincipalID *string `json:"principalId,omitempty"` TenantID *string `json:"tenantId,omitempty"` Type ResourceIdentityType `json:"type,omitempty"` } -// VirtualMachineScaleSetInstanceView is the instance view of a virtual machine -// scale set. +// VirtualMachineScaleSetInstanceView is the instance view of a virtual machine scale set. type VirtualMachineScaleSetInstanceView struct { autorest.Response `json:"-"` VirtualMachine *VirtualMachineScaleSetInstanceViewStatusesSummary `json:"virtualMachine,omitempty"` @@ -1033,31 +1873,32 @@ type VirtualMachineScaleSetInstanceView struct { Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` } -// VirtualMachineScaleSetInstanceViewStatusesSummary is instance view statuses -// summary for virtual machines of a virtual machine scale set. +// VirtualMachineScaleSetInstanceViewStatusesSummary is instance view statuses summary for virtual machines of a +// virtual machine scale set. type VirtualMachineScaleSetInstanceViewStatusesSummary struct { StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` } -// VirtualMachineScaleSetIPConfiguration is describes a virtual machine scale -// set network profile's IP configuration. +// VirtualMachineScaleSetIPConfiguration is describes a virtual machine scale set network profile's IP configuration. type VirtualMachineScaleSetIPConfiguration struct { ID *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` } -// VirtualMachineScaleSetIPConfigurationProperties is describes a virtual -// machine scale set network profile's IP configuration properties. +// VirtualMachineScaleSetIPConfigurationProperties is describes a virtual machine scale set network profile's IP +// configuration properties. type VirtualMachineScaleSetIPConfigurationProperties struct { - Subnet *APIEntityReference `json:"subnet,omitempty"` - ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` - LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` + Subnet *APIEntityReference `json:"subnet,omitempty"` + Primary *bool `json:"primary,omitempty"` + PublicIPAddressConfiguration *VirtualMachineScaleSetPublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` + PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` + ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` + LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` + LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` } -// VirtualMachineScaleSetListResult is the List Virtual Machine operation -// response. +// VirtualMachineScaleSetListResult is the List Virtual Machine operation response. type VirtualMachineScaleSetListResult struct { autorest.Response `json:"-"` Value *[]VirtualMachineScaleSet `json:"value,omitempty"` @@ -1076,8 +1917,7 @@ func (client VirtualMachineScaleSetListResult) VirtualMachineScaleSetListResultP autorest.WithBaseURL(to.String(client.NextLink))) } -// VirtualMachineScaleSetListSkusResult is the Virtual Machine Scale Set List -// Skus operation response. +// VirtualMachineScaleSetListSkusResult is the Virtual Machine Scale Set List Skus operation response. type VirtualMachineScaleSetListSkusResult struct { autorest.Response `json:"-"` Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"` @@ -1096,8 +1936,7 @@ func (client VirtualMachineScaleSetListSkusResult) VirtualMachineScaleSetListSku autorest.WithBaseURL(to.String(client.NextLink))) } -// VirtualMachineScaleSetListWithLinkResult is the List Virtual Machine -// operation response. +// VirtualMachineScaleSetListWithLinkResult is the List Virtual Machine operation response. type VirtualMachineScaleSetListWithLinkResult struct { autorest.Response `json:"-"` Value *[]VirtualMachineScaleSet `json:"value,omitempty"` @@ -1116,35 +1955,42 @@ func (client VirtualMachineScaleSetListWithLinkResult) VirtualMachineScaleSetLis autorest.WithBaseURL(to.String(client.NextLink))) } -// VirtualMachineScaleSetManagedDiskParameters is describes the parameters of a -// ScaleSet managed disk. +// VirtualMachineScaleSetManagedDiskParameters is describes the parameters of a ScaleSet managed disk. type VirtualMachineScaleSetManagedDiskParameters struct { StorageAccountType StorageAccountTypes `json:"storageAccountType,omitempty"` } -// VirtualMachineScaleSetNetworkConfiguration is describes a virtual machine -// scale set network profile's network configurations. +// VirtualMachineScaleSetNetworkConfiguration is describes a virtual machine scale set network profile's network +// configurations. type VirtualMachineScaleSetNetworkConfiguration struct { ID *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` } -// VirtualMachineScaleSetNetworkConfigurationProperties is describes a virtual -// machine scale set network profile's IP configuration. +// VirtualMachineScaleSetNetworkConfigurationDNSSettings is describes a virtual machines scale sets network +// configuration's DNS settings. +type VirtualMachineScaleSetNetworkConfigurationDNSSettings struct { + DNSServers *[]string `json:"dnsServers,omitempty"` +} + +// VirtualMachineScaleSetNetworkConfigurationProperties is describes a virtual machine scale set network profile's IP +// configuration. type VirtualMachineScaleSetNetworkConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` + Primary *bool `json:"primary,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` + DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` + IPConfigurations *[]VirtualMachineScaleSetIPConfiguration `json:"ipConfigurations,omitempty"` } -// VirtualMachineScaleSetNetworkProfile is describes a virtual machine scale -// set network profile. +// VirtualMachineScaleSetNetworkProfile is describes a virtual machine scale set network profile. type VirtualMachineScaleSetNetworkProfile struct { + HealthProbe *APIEntityReference `json:"healthProbe,omitempty"` NetworkInterfaceConfigurations *[]VirtualMachineScaleSetNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` } -// VirtualMachineScaleSetOSDisk is describes a virtual machine scale set -// operating system disk. +// VirtualMachineScaleSetOSDisk is describes a virtual machine scale set operating system disk. type VirtualMachineScaleSetOSDisk struct { Name *string `json:"name,omitempty"` Caching CachingTypes `json:"caching,omitempty"` @@ -1155,8 +2001,7 @@ type VirtualMachineScaleSetOSDisk struct { ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` } -// VirtualMachineScaleSetOSProfile is describes a virtual machine scale set OS -// profile. +// VirtualMachineScaleSetOSProfile is describes a virtual machine scale set OS profile. type VirtualMachineScaleSetOSProfile struct { ComputerNamePrefix *string `json:"computerNamePrefix,omitempty"` AdminUsername *string `json:"adminUsername,omitempty"` @@ -1167,18 +2012,37 @@ type VirtualMachineScaleSetOSProfile struct { Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` } -// VirtualMachineScaleSetProperties is describes the properties of a Virtual -// Machine Scale Set. +// VirtualMachineScaleSetProperties is describes the properties of a Virtual Machine Scale Set. type VirtualMachineScaleSetProperties struct { UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` Overprovision *bool `json:"overprovision,omitempty"` + UniqueID *string `json:"uniqueId,omitempty"` SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` } -// VirtualMachineScaleSetSku is describes an available virtual machine scale -// set sku. +// VirtualMachineScaleSetPublicIPAddressConfiguration is describes a virtual machines scale set IP Configuration's +// PublicIPAddress configuration +type VirtualMachineScaleSetPublicIPAddressConfiguration struct { + Name *string `json:"name,omitempty"` + *VirtualMachineScaleSetPublicIPAddressConfigurationProperties `json:"properties,omitempty"` +} + +// VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings is describes a virtual machines scale sets network +// configuration's DNS settings. +type VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` +} + +// VirtualMachineScaleSetPublicIPAddressConfigurationProperties is describes a virtual machines scale set IP +// Configuration's PublicIPAddress configuration +type VirtualMachineScaleSetPublicIPAddressConfigurationProperties struct { + IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` + DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` +} + +// VirtualMachineScaleSetSku is describes an available virtual machine scale set sku. type VirtualMachineScaleSetSku struct { ResourceType *string `json:"resourceType,omitempty"` Sku *Sku `json:"sku,omitempty"` @@ -1193,16 +2057,122 @@ type VirtualMachineScaleSetSkuCapacity struct { ScaleType VirtualMachineScaleSetSkuScaleType `json:"scaleType,omitempty"` } -// VirtualMachineScaleSetStorageProfile is describes a virtual machine scale -// set storage profile. +// VirtualMachineScaleSetStorageProfile is describes a virtual machine scale set storage profile. type VirtualMachineScaleSetStorageProfile struct { ImageReference *ImageReference `json:"imageReference,omitempty"` OsDisk *VirtualMachineScaleSetOSDisk `json:"osDisk,omitempty"` DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` } -// VirtualMachineScaleSetVM is describes a virtual machine scale set virtual -// machine. +// VirtualMachineScaleSetUpdate is describes a Virtual Machine Scale Set. +type VirtualMachineScaleSetUpdate struct { + Tags *map[string]*string `json:"tags,omitempty"` + Sku *Sku `json:"sku,omitempty"` + Plan *Plan `json:"plan,omitempty"` + *VirtualMachineScaleSetUpdateProperties `json:"properties,omitempty"` + Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"` +} + +// VirtualMachineScaleSetUpdateIPConfiguration is describes a virtual machine scale set network profile's IP +// configuration. +type VirtualMachineScaleSetUpdateIPConfiguration struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + *VirtualMachineScaleSetUpdateIPConfigurationProperties `json:"properties,omitempty"` +} + +// VirtualMachineScaleSetUpdateIPConfigurationProperties is describes a virtual machine scale set network profile's IP +// configuration properties. +type VirtualMachineScaleSetUpdateIPConfigurationProperties struct { + Subnet *APIEntityReference `json:"subnet,omitempty"` + Primary *bool `json:"primary,omitempty"` + PublicIPAddressConfiguration *VirtualMachineScaleSetUpdatePublicIPAddressConfiguration `json:"publicIPAddressConfiguration,omitempty"` + PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"` + ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"` + LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"` + LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"` +} + +// VirtualMachineScaleSetUpdateNetworkConfiguration is describes a virtual machine scale set network profile's network +// configurations. +type VirtualMachineScaleSetUpdateNetworkConfiguration struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + *VirtualMachineScaleSetUpdateNetworkConfigurationProperties `json:"properties,omitempty"` +} + +// VirtualMachineScaleSetUpdateNetworkConfigurationProperties is describes a virtual machine scale set updatable +// network profile's IP configuration.Use this object for updating network profile's IP Configuration. +type VirtualMachineScaleSetUpdateNetworkConfigurationProperties struct { + Primary *bool `json:"primary,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` + DNSSettings *VirtualMachineScaleSetNetworkConfigurationDNSSettings `json:"dnsSettings,omitempty"` + IPConfigurations *[]VirtualMachineScaleSetUpdateIPConfiguration `json:"ipConfigurations,omitempty"` +} + +// VirtualMachineScaleSetUpdateNetworkProfile is describes a virtual machine scale set network profile. +type VirtualMachineScaleSetUpdateNetworkProfile struct { + NetworkInterfaceConfigurations *[]VirtualMachineScaleSetUpdateNetworkConfiguration `json:"networkInterfaceConfigurations,omitempty"` +} + +// VirtualMachineScaleSetUpdateOSDisk is describes virtual machine scale set operating system disk Update Object. This +// should be used for Updating VMSS OS Disk. +type VirtualMachineScaleSetUpdateOSDisk struct { + Caching CachingTypes `json:"caching,omitempty"` + Image *VirtualHardDisk `json:"image,omitempty"` + VhdContainers *[]string `json:"vhdContainers,omitempty"` + ManagedDisk *VirtualMachineScaleSetManagedDiskParameters `json:"managedDisk,omitempty"` +} + +// VirtualMachineScaleSetUpdateOSProfile is describes a virtual machine scale set OS profile. +type VirtualMachineScaleSetUpdateOSProfile struct { + CustomData *string `json:"customData,omitempty"` + WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` + LinuxConfiguration *LinuxConfiguration `json:"linuxConfiguration,omitempty"` + Secrets *[]VaultSecretGroup `json:"secrets,omitempty"` +} + +// VirtualMachineScaleSetUpdateProperties is describes the properties of a Virtual Machine Scale Set. +type VirtualMachineScaleSetUpdateProperties struct { + UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"` + VirtualMachineProfile *VirtualMachineScaleSetUpdateVMProfile `json:"virtualMachineProfile,omitempty"` + Overprovision *bool `json:"overprovision,omitempty"` + SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"` +} + +// VirtualMachineScaleSetUpdatePublicIPAddressConfiguration is describes a virtual machines scale set IP +// Configuration's PublicIPAddress configuration +type VirtualMachineScaleSetUpdatePublicIPAddressConfiguration struct { + Name *string `json:"name,omitempty"` + *VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties `json:"properties,omitempty"` +} + +// VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties is describes a virtual machines scale set IP +// Configuration's PublicIPAddress configuration +type VirtualMachineScaleSetUpdatePublicIPAddressConfigurationProperties struct { + IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` + DNSSettings *VirtualMachineScaleSetPublicIPAddressConfigurationDNSSettings `json:"dnsSettings,omitempty"` +} + +// VirtualMachineScaleSetUpdateStorageProfile is describes a virtual machine scale set storage profile. +type VirtualMachineScaleSetUpdateStorageProfile struct { + ImageReference *ImageReference `json:"imageReference,omitempty"` + OsDisk *VirtualMachineScaleSetUpdateOSDisk `json:"osDisk,omitempty"` + DataDisks *[]VirtualMachineScaleSetDataDisk `json:"dataDisks,omitempty"` +} + +// VirtualMachineScaleSetUpdateVMProfile is describes a virtual machine scale set virtual machine profile. +type VirtualMachineScaleSetUpdateVMProfile struct { + OsProfile *VirtualMachineScaleSetUpdateOSProfile `json:"osProfile,omitempty"` + StorageProfile *VirtualMachineScaleSetUpdateStorageProfile `json:"storageProfile,omitempty"` + NetworkProfile *VirtualMachineScaleSetUpdateNetworkProfile `json:"networkProfile,omitempty"` + DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` + ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` + LicenseType *string `json:"licenseType,omitempty"` +} + +// VirtualMachineScaleSetVM is describes a virtual machine scale set virtual machine. type VirtualMachineScaleSetVM struct { autorest.Response `json:"-"` ID *string `json:"id,omitempty"` @@ -1217,27 +2187,24 @@ type VirtualMachineScaleSetVM struct { Resources *[]VirtualMachineExtension `json:"resources,omitempty"` } -// VirtualMachineScaleSetVMExtensionsSummary is extensions summary for virtual -// machines of a virtual machine scale set. +// VirtualMachineScaleSetVMExtensionsSummary is extensions summary for virtual machines of a virtual machine scale set. type VirtualMachineScaleSetVMExtensionsSummary struct { Name *string `json:"name,omitempty"` StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` } -// VirtualMachineScaleSetVMInstanceIDs is specifies a list of virtual machine -// instance IDs from the VM scale set. +// VirtualMachineScaleSetVMInstanceIDs is specifies a list of virtual machine instance IDs from the VM scale set. type VirtualMachineScaleSetVMInstanceIDs struct { InstanceIds *[]string `json:"instanceIds,omitempty"` } -// VirtualMachineScaleSetVMInstanceRequiredIDs is specifies a list of virtual -// machine instance IDs from the VM scale set. +// VirtualMachineScaleSetVMInstanceRequiredIDs is specifies a list of virtual machine instance IDs from the VM scale +// set. type VirtualMachineScaleSetVMInstanceRequiredIDs struct { InstanceIds *[]string `json:"instanceIds,omitempty"` } -// VirtualMachineScaleSetVMInstanceView is the instance view of a virtual -// machine scale set VM. +// VirtualMachineScaleSetVMInstanceView is the instance view of a virtual machine scale set VM. type VirtualMachineScaleSetVMInstanceView struct { autorest.Response `json:"-"` PlatformUpdateDomain *int32 `json:"platformUpdateDomain,omitempty"` @@ -1246,13 +2213,13 @@ type VirtualMachineScaleSetVMInstanceView struct { VMAgent *VirtualMachineAgentInstanceView `json:"vmAgent,omitempty"` Disks *[]DiskInstanceView `json:"disks,omitempty"` Extensions *[]VirtualMachineExtensionInstanceView `json:"extensions,omitempty"` + VMHealth *VirtualMachineHealthStatus `json:"vmHealth,omitempty"` BootDiagnostics *BootDiagnosticsInstanceView `json:"bootDiagnostics,omitempty"` Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` PlacementGroupID *string `json:"placementGroupId,omitempty"` } -// VirtualMachineScaleSetVMListResult is the List Virtual Machine Scale Set VMs -// operation response. +// VirtualMachineScaleSetVMListResult is the List Virtual Machine Scale Set VMs operation response. type VirtualMachineScaleSetVMListResult struct { autorest.Response `json:"-"` Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"` @@ -1271,17 +2238,17 @@ func (client VirtualMachineScaleSetVMListResult) VirtualMachineScaleSetVMListRes autorest.WithBaseURL(to.String(client.NextLink))) } -// VirtualMachineScaleSetVMProfile is describes a virtual machine scale set -// virtual machine profile. +// VirtualMachineScaleSetVMProfile is describes a virtual machine scale set virtual machine profile. type VirtualMachineScaleSetVMProfile struct { - OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` - StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` - NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` - ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` + OsProfile *VirtualMachineScaleSetOSProfile `json:"osProfile,omitempty"` + StorageProfile *VirtualMachineScaleSetStorageProfile `json:"storageProfile,omitempty"` + NetworkProfile *VirtualMachineScaleSetNetworkProfile `json:"networkProfile,omitempty"` + DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` + ExtensionProfile *VirtualMachineScaleSetExtensionProfile `json:"extensionProfile,omitempty"` + LicenseType *string `json:"licenseType,omitempty"` } -// VirtualMachineScaleSetVMProperties is describes the properties of a virtual -// machine scale set virtual machine. +// VirtualMachineScaleSetVMProperties is describes the properties of a virtual machine scale set virtual machine. type VirtualMachineScaleSetVMProperties struct { LatestModelApplied *bool `json:"latestModelApplied,omitempty"` VMID *string `json:"vmId,omitempty"` @@ -1312,14 +2279,14 @@ type VirtualMachineSizeListResult struct { Value *[]VirtualMachineSize `json:"value,omitempty"` } -// VirtualMachineStatusCodeCount is the status code and count of the virtual -// machine scale set instance view status summary. +// VirtualMachineStatusCodeCount is the status code and count of the virtual machine scale set instance view status +// summary. type VirtualMachineStatusCodeCount struct { Code *string `json:"code,omitempty"` Count *int32 `json:"count,omitempty"` } -// WindowsConfiguration is describes Windows Configuration of the OS Profile. +// WindowsConfiguration is specifies Windows operating system settings on the virtual machine. type WindowsConfiguration struct { ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` @@ -1328,14 +2295,12 @@ type WindowsConfiguration struct { WinRM *WinRMConfiguration `json:"winRM,omitempty"` } -// WinRMConfiguration is describes Windows Remote Management configuration of -// the VM +// WinRMConfiguration is describes Windows Remote Management configuration of the VM type WinRMConfiguration struct { Listeners *[]WinRMListener `json:"listeners,omitempty"` } -// WinRMListener is describes Protocol and thumbprint of Windows Remote -// Management listener +// WinRMListener is describes Protocol and thumbprint of Windows Remote Management listener type WinRMListener struct { Protocol ProtocolTypes `json:"protocol,omitempty"` CertificateURL *string `json:"certificateUrl,omitempty"` diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/resourceskus.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/resourceskus.go new file mode 100644 index 000000000000..9dd7fffa8564 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/resourceskus.go @@ -0,0 +1,169 @@ +package compute + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ResourceSkusClient is the compute Client +type ResourceSkusClient struct { + ManagementClient +} + +// NewResourceSkusClient creates an instance of the ResourceSkusClient client. +func NewResourceSkusClient(subscriptionID string) ResourceSkusClient { + return NewResourceSkusClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewResourceSkusClientWithBaseURI creates an instance of the ResourceSkusClient client. +func NewResourceSkusClientWithBaseURI(baseURI string, subscriptionID string) ResourceSkusClient { + return ResourceSkusClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List gets the list of Microsoft.Compute SKUs available for your Subscription. +func (client ResourceSkusClient) List() (result ResourceSkusResult, err error) { + req, err := client.ListPreparer() + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ResourceSkusClient) ListPreparer() (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceSkusClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ResourceSkusClient) ListResponder(resp *http.Response) (result ResourceSkusResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client ResourceSkusClient) ListNextResults(lastResults ResourceSkusResult) (result ResourceSkusResult, err error) { + req, err := lastResults.ResourceSkusResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListComplete gets all elements from the list without paging. +func (client ResourceSkusClient) ListComplete(cancel <-chan struct{}) (<-chan ResourceSku, <-chan error) { + resultChan := make(chan ResourceSku) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/snapshots.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/snapshots.go new file mode 100644 index 000000000000..2c7135292156 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/snapshots.go @@ -0,0 +1,819 @@ +package compute + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// SnapshotsClient is the compute Client +type SnapshotsClient struct { + ManagementClient +} + +// NewSnapshotsClient creates an instance of the SnapshotsClient client. +func NewSnapshotsClient(subscriptionID string) SnapshotsClient { + return NewSnapshotsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSnapshotsClientWithBaseURI creates an instance of the SnapshotsClient client. +func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) SnapshotsClient { + return SnapshotsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a snapshot. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot within the given +// subscription and resource group. snapshot is snapshot object supplied in the body of the Put disk operation. +func (client SnapshotsClient) CreateOrUpdate(resourceGroupName string, snapshotName string, snapshot Snapshot, cancel <-chan struct{}) (<-chan Snapshot, <-chan error) { + resultChan := make(chan Snapshot, 1) + errChan := make(chan error, 1) + if err := validation.Validate([]validation.Validation{ + {TargetValue: snapshot, + Constraints: []validation.Constraint{{Target: "snapshot.DiskProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.CreationData", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.CreationData.ImageReference", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.CreationData.ImageReference.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "snapshot.DiskProperties.EncryptionSettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "snapshot.DiskProperties.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "snapshot.DiskProperties.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "snapshot.DiskProperties.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "snapshot.DiskProperties.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + errChan <- validation.NewErrorWithValidationError(err, "compute.SnapshotsClient", "CreateOrUpdate") + close(errChan) + close(resultChan) + return resultChan, errChan + } + + go func() { + var err error + var result Snapshot + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.CreateOrUpdatePreparer(resourceGroupName, snapshotName, snapshot, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SnapshotsClient) CreateOrUpdatePreparer(resourceGroupName string, snapshotName string, snapshot Snapshot, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), + autorest.WithJSON(snapshot), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) CreateOrUpdateResponder(resp *http.Response) (result Snapshot, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a snapshot. This method may poll for completion. Polling can be canceled by passing the cancel +// channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot within the given +// subscription and resource group. +func (client SnapshotsClient) Delete(resourceGroupName string, snapshotName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { + resultChan := make(chan OperationStatusResponse, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result OperationStatusResponse + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.DeletePreparer(resourceGroupName, snapshotName, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Delete", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// DeletePreparer prepares the Delete request. +func (client SnapshotsClient) DeletePreparer(resourceGroupName string, snapshotName string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets information about a snapshot. +// +// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot within the given +// subscription and resource group. +func (client SnapshotsClient) Get(resourceGroupName string, snapshotName string) (result Snapshot, err error) { + req, err := client.GetPreparer(resourceGroupName, snapshotName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SnapshotsClient) GetPreparer(resourceGroupName string, snapshotName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GrantAccess grants access to a snapshot. This method may poll for completion. Polling can be canceled by passing the +// cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot within the given +// subscription and resource group. grantAccessData is access data object supplied in the body of the get snapshot +// access operation. +func (client SnapshotsClient) GrantAccess(resourceGroupName string, snapshotName string, grantAccessData GrantAccessData, cancel <-chan struct{}) (<-chan AccessURI, <-chan error) { + resultChan := make(chan AccessURI, 1) + errChan := make(chan error, 1) + if err := validation.Validate([]validation.Validation{ + {TargetValue: grantAccessData, + Constraints: []validation.Constraint{{Target: "grantAccessData.DurationInSeconds", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + errChan <- validation.NewErrorWithValidationError(err, "compute.SnapshotsClient", "GrantAccess") + close(errChan) + close(resultChan) + return resultChan, errChan + } + + go func() { + var err error + var result AccessURI + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.GrantAccessPreparer(resourceGroupName, snapshotName, grantAccessData, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", nil, "Failure preparing request") + return + } + + resp, err := client.GrantAccessSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", resp, "Failure sending request") + return + } + + result, err = client.GrantAccessResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "GrantAccess", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// GrantAccessPreparer prepares the GrantAccess request. +func (client SnapshotsClient) GrantAccessPreparer(resourceGroupName string, snapshotName string, grantAccessData GrantAccessData, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/beginGetAccess", pathParameters), + autorest.WithJSON(grantAccessData), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// GrantAccessSender sends the GrantAccess request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) GrantAccessSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// GrantAccessResponder handles the response to the GrantAccess request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) GrantAccessResponder(resp *http.Response) (result AccessURI, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists snapshots under a subscription. +func (client SnapshotsClient) List() (result SnapshotList, err error) { + req, err := client.ListPreparer() + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SnapshotsClient) ListPreparer() (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/snapshots", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) ListResponder(resp *http.Response) (result SnapshotList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client SnapshotsClient) ListNextResults(lastResults SnapshotList) (result SnapshotList, err error) { + req, err := lastResults.SnapshotListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListComplete gets all elements from the list without paging. +func (client SnapshotsClient) ListComplete(cancel <-chan struct{}) (<-chan Snapshot, <-chan error) { + resultChan := make(chan Snapshot) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListByResourceGroup lists snapshots under a resource group. +// +// resourceGroupName is the name of the resource group. +func (client SnapshotsClient) ListByResourceGroup(resourceGroupName string) (result SnapshotList, err error) { + req, err := client.ListByResourceGroupPreparer(resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client SnapshotsClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) ListByResourceGroupResponder(resp *http.Response) (result SnapshotList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroupNextResults retrieves the next set of results, if any. +func (client SnapshotsClient) ListByResourceGroupNextResults(lastResults SnapshotList) (result SnapshotList, err error) { + req, err := lastResults.SnapshotListPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure sending next results request") + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "ListByResourceGroup", resp, "Failure responding to next results request") + } + + return +} + +// ListByResourceGroupComplete gets all elements from the list without paging. +func (client SnapshotsClient) ListByResourceGroupComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan Snapshot, <-chan error) { + resultChan := make(chan Snapshot) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListByResourceGroup(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListByResourceGroupNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// RevokeAccess revokes access to a snapshot. This method may poll for completion. Polling can be canceled by passing +// the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot within the given +// subscription and resource group. +func (client SnapshotsClient) RevokeAccess(resourceGroupName string, snapshotName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { + resultChan := make(chan OperationStatusResponse, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result OperationStatusResponse + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.RevokeAccessPreparer(resourceGroupName, snapshotName, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", nil, "Failure preparing request") + return + } + + resp, err := client.RevokeAccessSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", resp, "Failure sending request") + return + } + + result, err = client.RevokeAccessResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "RevokeAccess", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// RevokeAccessPreparer prepares the RevokeAccess request. +func (client SnapshotsClient) RevokeAccessPreparer(resourceGroupName string, snapshotName string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}/endGetAccess", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// RevokeAccessSender sends the RevokeAccess request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) RevokeAccessSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// RevokeAccessResponder handles the response to the RevokeAccess request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) RevokeAccessResponder(resp *http.Response) (result OperationStatusResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates (patches) a snapshot. This method may poll for completion. Polling can be canceled by passing the +// cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot within the given +// subscription and resource group. snapshot is snapshot object supplied in the body of the Patch snapshot operation. +func (client SnapshotsClient) Update(resourceGroupName string, snapshotName string, snapshot SnapshotUpdate, cancel <-chan struct{}) (<-chan Snapshot, <-chan error) { + resultChan := make(chan Snapshot, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result Snapshot + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.UpdatePreparer(resourceGroupName, snapshotName, snapshot, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.SnapshotsClient", "Update", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// UpdatePreparer prepares the Update request. +func (client SnapshotsClient) UpdatePreparer(resourceGroupName string, snapshotName string, snapshot SnapshotUpdate, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotName": autorest.Encode("path", snapshotName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/snapshots/{snapshotName}", pathParameters), + autorest.WithJSON(snapshot), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client SnapshotsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client SnapshotsClient) UpdateResponder(resp *http.Response) (result Snapshot, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/usage.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/usage.go index 97c53e0efd7f..86e9ebabf3b7 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/usage.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/usage.go @@ -14,9 +14,8 @@ package compute // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -25,7 +24,7 @@ import ( "net/http" ) -// UsageClient is the the Compute Management Client. +// UsageClient is the compute Client type UsageClient struct { ManagementClient } @@ -40,9 +39,8 @@ func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClien return UsageClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List gets, for the specified location, the current compute resource usage -// information as well as the limits for compute resources under the -// subscription. +// List gets, for the specified location, the current compute resource usage information as well as the limits for +// compute resources under the subscription. // // location is the location for which resource usage is queried. func (client UsageClient) List(location string) (result ListUsagesResult, err error) { @@ -80,7 +78,7 @@ func (client UsageClient) ListPreparer(location string) (*http.Request, error) { "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -135,3 +133,48 @@ func (client UsageClient) ListNextResults(lastResults ListUsagesResult) (result return } + +// ListComplete gets all elements from the list without paging. +func (client UsageClient) ListComplete(location string, cancel <-chan struct{}) (<-chan Usage, <-chan error) { + resultChan := make(chan Usage) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(location) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/version.go index a5318ebf7983..2f9cac6f3bc7 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/version.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/version.go @@ -14,16 +14,15 @@ package compute // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v10.0.2-beta arm-compute/2016-04-30-preview" + return "Azure-SDK-For-Go/v11.0.0-beta arm-compute/" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v10.0.2-beta" + return "v11.0.0-beta" } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensionimages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensionimages.go index fcd122704284..c486f63ced50 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensionimages.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensionimages.go @@ -14,9 +14,8 @@ package compute // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,25 +23,25 @@ import ( "net/http" ) -// VirtualMachineExtensionImagesClient is the the Compute Management Client. +// VirtualMachineExtensionImagesClient is the compute Client type VirtualMachineExtensionImagesClient struct { ManagementClient } -// NewVirtualMachineExtensionImagesClient creates an instance of the -// VirtualMachineExtensionImagesClient client. +// NewVirtualMachineExtensionImagesClient creates an instance of the VirtualMachineExtensionImagesClient client. func NewVirtualMachineExtensionImagesClient(subscriptionID string) VirtualMachineExtensionImagesClient { return NewVirtualMachineExtensionImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewVirtualMachineExtensionImagesClientWithBaseURI creates an instance of the -// VirtualMachineExtensionImagesClient client. +// NewVirtualMachineExtensionImagesClientWithBaseURI creates an instance of the VirtualMachineExtensionImagesClient +// client. func NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionImagesClient { return VirtualMachineExtensionImagesClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets a virtual machine extension image. // +// location is the name of a supported Azure region. func (client VirtualMachineExtensionImagesClient) Get(location string, publisherName string, typeParameter string, version string) (result VirtualMachineExtensionImage, err error) { req, err := client.GetPreparer(location, publisherName, typeParameter, version) if err != nil { @@ -75,7 +74,7 @@ func (client VirtualMachineExtensionImagesClient) GetPreparer(location string, p "version": autorest.Encode("path", version), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -109,6 +108,7 @@ func (client VirtualMachineExtensionImagesClient) GetResponder(resp *http.Respon // ListTypes gets a list of virtual machine extension image types. // +// location is the name of a supported Azure region. func (client VirtualMachineExtensionImagesClient) ListTypes(location string, publisherName string) (result ListVirtualMachineExtensionImage, err error) { req, err := client.ListTypesPreparer(location, publisherName) if err != nil { @@ -139,7 +139,7 @@ func (client VirtualMachineExtensionImagesClient) ListTypesPreparer(location str "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -173,7 +173,7 @@ func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http. // ListVersions gets a list of virtual machine extension image versions. // -// filter is the filter to apply on the operation. +// location is the name of a supported Azure region. filter is the filter to apply on the operation. func (client VirtualMachineExtensionImagesClient) ListVersions(location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (result ListVirtualMachineExtensionImage, err error) { req, err := client.ListVersionsPreparer(location, publisherName, typeParameter, filter, top, orderby) if err != nil { @@ -205,7 +205,7 @@ func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(location "type": autorest.Encode("path", typeParameter), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensions.go index 7a876cfef1a2..e8f0b27f1b00 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensions.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineextensions.go @@ -14,9 +14,8 @@ package compute // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,33 +23,28 @@ import ( "net/http" ) -// VirtualMachineExtensionsClient is the the Compute Management Client. +// VirtualMachineExtensionsClient is the compute Client type VirtualMachineExtensionsClient struct { ManagementClient } -// NewVirtualMachineExtensionsClient creates an instance of the -// VirtualMachineExtensionsClient client. +// NewVirtualMachineExtensionsClient creates an instance of the VirtualMachineExtensionsClient client. func NewVirtualMachineExtensionsClient(subscriptionID string) VirtualMachineExtensionsClient { return NewVirtualMachineExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewVirtualMachineExtensionsClientWithBaseURI creates an instance of the -// VirtualMachineExtensionsClient client. +// NewVirtualMachineExtensionsClientWithBaseURI creates an instance of the VirtualMachineExtensionsClient client. func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionsClient { return VirtualMachineExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate the operation to create or update the extension. This method -// may poll for completion. Polling can be canceled by passing the cancel -// channel argument. The channel will be used to cancel polling and any -// outstanding HTTP requests. +// CreateOrUpdate the operation to create or update the extension. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. // -// resourceGroupName is the name of the resource group. VMName is the name of -// the virtual machine where the extension should be create or updated. -// VMExtensionName is the name of the virtual machine extension. -// extensionParameters is parameters supplied to the Create Virtual Machine -// Extension operation. +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine where the extension +// should be create or updated. VMExtensionName is the name of the virtual machine extension. extensionParameters is +// parameters supplied to the Create Virtual Machine Extension operation. func (client VirtualMachineExtensionsClient) CreateOrUpdate(resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension, cancel <-chan struct{}) (<-chan VirtualMachineExtension, <-chan error) { resultChan := make(chan VirtualMachineExtension, 1) errChan := make(chan error, 1) @@ -58,8 +52,10 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdate(resourceGroupName st var err error var result VirtualMachineExtension defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -93,7 +89,7 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(resourceGrou "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -129,14 +125,11 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http. return } -// Delete the operation to delete the extension. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// Delete the operation to delete the extension. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. VMName is the name of -// the virtual machine where the extension should be deleted. VMExtensionName -// is the name of the virtual machine extension. +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine where the extension +// should be deleted. VMExtensionName is the name of the virtual machine extension. func (client VirtualMachineExtensionsClient) Delete(resourceGroupName string, VMName string, VMExtensionName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -144,8 +137,10 @@ func (client VirtualMachineExtensionsClient) Delete(resourceGroupName string, VM var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -179,7 +174,7 @@ func (client VirtualMachineExtensionsClient) DeletePreparer(resourceGroupName st "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -215,9 +210,8 @@ func (client VirtualMachineExtensionsClient) DeleteResponder(resp *http.Response // Get the operation to get the extension. // -// resourceGroupName is the name of the resource group. VMName is the name of -// the virtual machine containing the extension. VMExtensionName is the name of -// the virtual machine extension. expand is the expand expression to apply on +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine containing the +// extension. VMExtensionName is the name of the virtual machine extension. expand is the expand expression to apply on // the operation. func (client VirtualMachineExtensionsClient) Get(resourceGroupName string, VMName string, VMExtensionName string, expand string) (result VirtualMachineExtension, err error) { req, err := client.GetPreparer(resourceGroupName, VMName, VMExtensionName, expand) @@ -250,7 +244,7 @@ func (client VirtualMachineExtensionsClient) GetPreparer(resourceGroupName strin "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineimages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineimages.go index 6c090568f520..9eda416e9584 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineimages.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineimages.go @@ -14,9 +14,8 @@ package compute // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,28 +23,25 @@ import ( "net/http" ) -// VirtualMachineImagesClient is the the Compute Management Client. +// VirtualMachineImagesClient is the compute Client type VirtualMachineImagesClient struct { ManagementClient } -// NewVirtualMachineImagesClient creates an instance of the -// VirtualMachineImagesClient client. +// NewVirtualMachineImagesClient creates an instance of the VirtualMachineImagesClient client. func NewVirtualMachineImagesClient(subscriptionID string) VirtualMachineImagesClient { return NewVirtualMachineImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewVirtualMachineImagesClientWithBaseURI creates an instance of the -// VirtualMachineImagesClient client. +// NewVirtualMachineImagesClientWithBaseURI creates an instance of the VirtualMachineImagesClient client. func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineImagesClient { return VirtualMachineImagesClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets a virtual machine image. // -// location is the name of a supported Azure region. publisherName is a valid -// image publisher. offer is a valid image publisher offer. skus is a valid -// image SKU. version is a valid image SKU version. +// location is the name of a supported Azure region. publisherName is a valid image publisher. offer is a valid image +// publisher offer. skus is a valid image SKU. version is a valid image SKU version. func (client VirtualMachineImagesClient) Get(location string, publisherName string, offer string, skus string, version string) (result VirtualMachineImage, err error) { req, err := client.GetPreparer(location, publisherName, offer, skus, version) if err != nil { @@ -79,7 +75,7 @@ func (client VirtualMachineImagesClient) GetPreparer(location string, publisherN "version": autorest.Encode("path", version), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -111,12 +107,10 @@ func (client VirtualMachineImagesClient) GetResponder(resp *http.Response) (resu return } -// List gets a list of all virtual machine image versions for the specified -// location, publisher, offer, and SKU. +// List gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. // -// location is the name of a supported Azure region. publisherName is a valid -// image publisher. offer is a valid image publisher offer. skus is a valid -// image SKU. filter is the filter to apply on the operation. +// location is the name of a supported Azure region. publisherName is a valid image publisher. offer is a valid image +// publisher offer. skus is a valid image SKU. filter is the filter to apply on the operation. func (client VirtualMachineImagesClient) List(location string, publisherName string, offer string, skus string, filter string, top *int32, orderby string) (result ListVirtualMachineImageResource, err error) { req, err := client.ListPreparer(location, publisherName, offer, skus, filter, top, orderby) if err != nil { @@ -149,7 +143,7 @@ func (client VirtualMachineImagesClient) ListPreparer(location string, publisher "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -190,11 +184,9 @@ func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (res return } -// ListOffers gets a list of virtual machine image offers for the specified -// location and publisher. +// ListOffers gets a list of virtual machine image offers for the specified location and publisher. // -// location is the name of a supported Azure region. publisherName is a valid -// image publisher. +// location is the name of a supported Azure region. publisherName is a valid image publisher. func (client VirtualMachineImagesClient) ListOffers(location string, publisherName string) (result ListVirtualMachineImageResource, err error) { req, err := client.ListOffersPreparer(location, publisherName) if err != nil { @@ -225,7 +217,7 @@ func (client VirtualMachineImagesClient) ListOffersPreparer(location string, pub "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -257,8 +249,7 @@ func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response return } -// ListPublishers gets a list of virtual machine image publishers for the -// specified Azure location. +// ListPublishers gets a list of virtual machine image publishers for the specified Azure location. // // location is the name of a supported Azure region. func (client VirtualMachineImagesClient) ListPublishers(location string) (result ListVirtualMachineImageResource, err error) { @@ -290,7 +281,7 @@ func (client VirtualMachineImagesClient) ListPublishersPreparer(location string) "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -322,11 +313,10 @@ func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Resp return } -// ListSkus gets a list of virtual machine image SKUs for the specified -// location, publisher, and offer. +// ListSkus gets a list of virtual machine image SKUs for the specified location, publisher, and offer. // -// location is the name of a supported Azure region. publisherName is a valid -// image publisher. offer is a valid image publisher offer. +// location is the name of a supported Azure region. publisherName is a valid image publisher. offer is a valid image +// publisher offer. func (client VirtualMachineImagesClient) ListSkus(location string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) { req, err := client.ListSkusPreparer(location, publisherName, offer) if err != nil { @@ -358,7 +348,7 @@ func (client VirtualMachineImagesClient) ListSkusPreparer(location string, publi "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineruncommands.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineruncommands.go new file mode 100644 index 000000000000..f422c92f58c0 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachineruncommands.go @@ -0,0 +1,250 @@ +package compute + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// VirtualMachineRunCommandsClient is the compute Client +type VirtualMachineRunCommandsClient struct { + ManagementClient +} + +// NewVirtualMachineRunCommandsClient creates an instance of the VirtualMachineRunCommandsClient client. +func NewVirtualMachineRunCommandsClient(subscriptionID string) VirtualMachineRunCommandsClient { + return NewVirtualMachineRunCommandsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachineRunCommandsClientWithBaseURI creates an instance of the VirtualMachineRunCommandsClient client. +func NewVirtualMachineRunCommandsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineRunCommandsClient { + return VirtualMachineRunCommandsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets specific run command for a subscription in a location. +// +// location is the location upon which run commands is queried. commandID is the command id. +func (client VirtualMachineRunCommandsClient) Get(location string, commandID string) (result RunCommandDocument, 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.NewErrorWithValidationError(err, "compute.VirtualMachineRunCommandsClient", "Get") + } + + req, err := client.GetPreparer(location, commandID) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualMachineRunCommandsClient) GetPreparer(location string, commandID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "commandId": autorest.Encode("path", commandID), + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands/{commandId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineRunCommandsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VirtualMachineRunCommandsClient) GetResponder(resp *http.Response) (result RunCommandDocument, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all available run commands for a subscription in a location. +// +// location is the location upon which run commands is queried. +func (client VirtualMachineRunCommandsClient) List(location string) (result RunCommandListResult, 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.NewErrorWithValidationError(err, "compute.VirtualMachineRunCommandsClient", "List") + } + + req, err := client.ListPreparer(location) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualMachineRunCommandsClient) ListPreparer(location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/runCommands", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineRunCommandsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VirtualMachineRunCommandsClient) ListResponder(resp *http.Response) (result RunCommandListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client VirtualMachineRunCommandsClient) ListNextResults(lastResults RunCommandListResult) (result RunCommandListResult, err error) { + req, err := lastResults.RunCommandListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineRunCommandsClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListComplete gets all elements from the list without paging. +func (client VirtualMachineRunCommandsClient) ListComplete(location string, cancel <-chan struct{}) (<-chan RunCommandDocumentBase, <-chan error) { + resultChan := make(chan RunCommandDocumentBase) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(location) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachines.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachines.go index 686b7ace2327..ad1d829d14dc 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachines.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachines.go @@ -14,9 +14,8 @@ package compute // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -25,32 +24,27 @@ import ( "net/http" ) -// VirtualMachinesClient is the the Compute Management Client. +// VirtualMachinesClient is the compute Client type VirtualMachinesClient struct { ManagementClient } -// NewVirtualMachinesClient creates an instance of the VirtualMachinesClient -// client. +// NewVirtualMachinesClient creates an instance of the VirtualMachinesClient client. func NewVirtualMachinesClient(subscriptionID string) VirtualMachinesClient { return NewVirtualMachinesClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewVirtualMachinesClientWithBaseURI creates an instance of the -// VirtualMachinesClient client. +// NewVirtualMachinesClientWithBaseURI creates an instance of the VirtualMachinesClient client. func NewVirtualMachinesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachinesClient { return VirtualMachinesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Capture captures the VM by copying virtual hard disks of the VM and outputs -// a template that can be used to create similar VMs. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// Capture captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create +// similar VMs. This method may poll for completion. Polling can be canceled by passing the cancel channel argument. +// The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. VMName is the name of -// the virtual machine. parameters is parameters supplied to the Capture -// Virtual Machine operation. +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. parameters is +// parameters supplied to the Capture Virtual Machine operation. func (client VirtualMachinesClient) Capture(resourceGroupName string, VMName string, parameters VirtualMachineCaptureParameters, cancel <-chan struct{}) (<-chan VirtualMachineCaptureResult, <-chan error) { resultChan := make(chan VirtualMachineCaptureResult, 1) errChan := make(chan error, 1) @@ -69,8 +63,10 @@ func (client VirtualMachinesClient) Capture(resourceGroupName string, VMName str var err error var result VirtualMachineCaptureResult defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -103,7 +99,7 @@ func (client VirtualMachinesClient) CapturePreparer(resourceGroupName string, VM "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -139,14 +135,11 @@ func (client VirtualMachinesClient) CaptureResponder(resp *http.Response) (resul return } -// ConvertToManagedDisks converts virtual machine disks from blob-based to -// managed disks. Virtual machine must be stop-deallocated before invoking this -// operation. This method may poll for completion. Polling can be canceled by -// passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// ConvertToManagedDisks converts virtual machine disks from blob-based to managed disks. Virtual machine must be +// stop-deallocated before invoking this operation. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. VMName is the name of -// the virtual machine. +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. func (client VirtualMachinesClient) ConvertToManagedDisks(resourceGroupName string, VMName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -154,8 +147,10 @@ func (client VirtualMachinesClient) ConvertToManagedDisks(resourceGroupName stri var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -188,7 +183,7 @@ func (client VirtualMachinesClient) ConvertToManagedDisksPreparer(resourceGroupN "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -222,14 +217,12 @@ func (client VirtualMachinesClient) ConvertToManagedDisksResponder(resp *http.Re return } -// CreateOrUpdate the operation to create or update a virtual machine. This -// method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and any -// outstanding HTTP requests. +// CreateOrUpdate the operation to create or update a virtual machine. This method may poll for completion. Polling can +// be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // -// resourceGroupName is the name of the resource group. VMName is the name of -// the virtual machine. parameters is parameters supplied to the Create Virtual -// Machine operation. +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. parameters is +// parameters supplied to the Create Virtual Machine operation. func (client VirtualMachinesClient) CreateOrUpdate(resourceGroupName string, VMName string, parameters VirtualMachine, cancel <-chan struct{}) (<-chan VirtualMachine, <-chan error) { resultChan := make(chan VirtualMachine, 1) errChan := make(chan error, 1) @@ -261,8 +254,10 @@ func (client VirtualMachinesClient) CreateOrUpdate(resourceGroupName string, VMN var err error var result VirtualMachine defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -295,7 +290,7 @@ func (client VirtualMachinesClient) CreateOrUpdatePreparer(resourceGroupName str "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -331,14 +326,11 @@ func (client VirtualMachinesClient) CreateOrUpdateResponder(resp *http.Response) return } -// Deallocate shuts down the virtual machine and releases the compute -// resources. You are not billed for the compute resources that this virtual -// machine uses. This method may poll for completion. Polling can be canceled -// by passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// Deallocate shuts down the virtual machine and releases the compute resources. You are not billed for the compute +// resources that this virtual machine uses. This method may poll for completion. Polling can be canceled by passing +// the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. VMName is the name of -// the virtual machine. +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. func (client VirtualMachinesClient) Deallocate(resourceGroupName string, VMName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -346,8 +338,10 @@ func (client VirtualMachinesClient) Deallocate(resourceGroupName string, VMName var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -380,7 +374,7 @@ func (client VirtualMachinesClient) DeallocatePreparer(resourceGroupName string, "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -414,13 +408,10 @@ func (client VirtualMachinesClient) DeallocateResponder(resp *http.Response) (re return } -// Delete the operation to delete a virtual machine. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// Delete the operation to delete a virtual machine. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. VMName is the name of -// the virtual machine. +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. func (client VirtualMachinesClient) Delete(resourceGroupName string, VMName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -428,8 +419,10 @@ func (client VirtualMachinesClient) Delete(resourceGroupName string, VMName stri var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -462,7 +455,7 @@ func (client VirtualMachinesClient) DeletePreparer(resourceGroupName string, VMN "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -498,8 +491,7 @@ func (client VirtualMachinesClient) DeleteResponder(resp *http.Response) (result // Generalize sets the state of the virtual machine to generalized. // -// resourceGroupName is the name of the resource group. VMName is the name of -// the virtual machine. +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. func (client VirtualMachinesClient) Generalize(resourceGroupName string, VMName string) (result OperationStatusResponse, err error) { req, err := client.GeneralizePreparer(resourceGroupName, VMName) if err != nil { @@ -530,7 +522,7 @@ func (client VirtualMachinesClient) GeneralizePreparer(resourceGroupName string, "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -562,12 +554,10 @@ func (client VirtualMachinesClient) GeneralizeResponder(resp *http.Response) (re return } -// Get retrieves information about the model view or the instance view of a -// virtual machine. +// Get retrieves information about the model view or the instance view of a virtual machine. // -// resourceGroupName is the name of the resource group. VMName is the name of -// the virtual machine. expand is the expand expression to apply on the -// operation. +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. expand is the expand +// expression to apply on the operation. func (client VirtualMachinesClient) Get(resourceGroupName string, VMName string, expand InstanceViewTypes) (result VirtualMachine, err error) { req, err := client.GetPreparer(resourceGroupName, VMName, expand) if err != nil { @@ -598,7 +588,7 @@ func (client VirtualMachinesClient) GetPreparer(resourceGroupName string, VMName "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -633,9 +623,73 @@ func (client VirtualMachinesClient) GetResponder(resp *http.Response) (result Vi return } -// List lists all of the virtual machines in the specified resource group. Use -// the nextLink property in the response to get the next page of virtual -// machines. +// InstanceView retrieves information about the run-time state of a virtual machine. +// +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. +func (client VirtualMachinesClient) InstanceView(resourceGroupName string, VMName string) (result VirtualMachineInstanceView, err error) { + req, err := client.InstanceViewPreparer(resourceGroupName, VMName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", nil, "Failure preparing request") + return + } + + resp, err := client.InstanceViewSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", resp, "Failure sending request") + return + } + + result, err = client.InstanceViewResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "InstanceView", resp, "Failure responding to request") + } + + return +} + +// InstanceViewPreparer prepares the InstanceView request. +func (client VirtualMachinesClient) InstanceViewPreparer(resourceGroupName string, VMName string) (*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 = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/instanceView", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// InstanceViewSender sends the InstanceView request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) InstanceViewSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// InstanceViewResponder handles the response to the InstanceView request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) InstanceViewResponder(resp *http.Response) (result VirtualMachineInstanceView, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to +// get the next page of virtual machines. // // resourceGroupName is the name of the resource group. func (client VirtualMachinesClient) List(resourceGroupName string) (result VirtualMachineListResult, err error) { @@ -667,7 +721,7 @@ func (client VirtualMachinesClient) ListPreparer(resourceGroupName string) (*htt "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -723,9 +777,53 @@ func (client VirtualMachinesClient) ListNextResults(lastResults VirtualMachineLi return } -// ListAll lists all of the virtual machines in the specified subscription. Use -// the nextLink property in the response to get the next page of virtual -// machines. +// ListComplete gets all elements from the list without paging. +func (client VirtualMachinesClient) ListComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan VirtualMachine, <-chan error) { + resultChan := make(chan VirtualMachine) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListAll lists all of the virtual machines in the specified subscription. Use the nextLink property in the response +// to get the next page of virtual machines. func (client VirtualMachinesClient) ListAll() (result VirtualMachineListResult, err error) { req, err := client.ListAllPreparer() if err != nil { @@ -754,7 +852,7 @@ func (client VirtualMachinesClient) ListAllPreparer() (*http.Request, error) { "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -810,11 +908,54 @@ func (client VirtualMachinesClient) ListAllNextResults(lastResults VirtualMachin return } -// ListAvailableSizes lists all available virtual machine sizes to which the -// specified virtual machine can be resized. +// ListAllComplete gets all elements from the list without paging. +func (client VirtualMachinesClient) ListAllComplete(cancel <-chan struct{}) (<-chan VirtualMachine, <-chan error) { + resultChan := make(chan VirtualMachine) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListAll() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListAllNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListAvailableSizes lists all available virtual machine sizes to which the specified virtual machine can be resized. // -// resourceGroupName is the name of the resource group. VMName is the name of -// the virtual machine. +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. func (client VirtualMachinesClient) ListAvailableSizes(resourceGroupName string, VMName string) (result VirtualMachineSizeListResult, err error) { req, err := client.ListAvailableSizesPreparer(resourceGroupName, VMName) if err != nil { @@ -845,7 +986,7 @@ func (client VirtualMachinesClient) ListAvailableSizesPreparer(resourceGroupName "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -877,14 +1018,94 @@ func (client VirtualMachinesClient) ListAvailableSizesResponder(resp *http.Respo return } -// PowerOff the operation to power off (stop) a virtual machine. The virtual -// machine can be restarted with the same provisioned resources. You are still -// charged for this virtual machine. This method may poll for completion. -// Polling can be canceled by passing the cancel channel argument. The channel -// will be used to cancel polling and any outstanding HTTP requests. +// PerformMaintenance the operation to perform maintenance on a virtual machine. This method may poll for completion. +// Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any +// outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. +func (client VirtualMachinesClient) PerformMaintenance(resourceGroupName string, VMName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { + resultChan := make(chan OperationStatusResponse, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result OperationStatusResponse + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.PerformMaintenancePreparer(resourceGroupName, VMName, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PerformMaintenance", nil, "Failure preparing request") + return + } + + resp, err := client.PerformMaintenanceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PerformMaintenance", resp, "Failure sending request") + return + } + + result, err = client.PerformMaintenanceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "PerformMaintenance", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// PerformMaintenancePreparer prepares the PerformMaintenance request. +func (client VirtualMachinesClient) PerformMaintenancePreparer(resourceGroupName string, VMName string, cancel <-chan struct{}) (*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 = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/performMaintenance", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) PerformMaintenanceSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// PerformMaintenanceResponder handles the response to the PerformMaintenance request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) PerformMaintenanceResponder(resp *http.Response) (result OperationStatusResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// PowerOff the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same +// provisioned resources. You are still charged for this virtual machine. This method may poll for completion. Polling +// can be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any +// outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. VMName is the name of -// the virtual machine. +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. func (client VirtualMachinesClient) PowerOff(resourceGroupName string, VMName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -892,8 +1113,10 @@ func (client VirtualMachinesClient) PowerOff(resourceGroupName string, VMName st var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -926,7 +1149,7 @@ func (client VirtualMachinesClient) PowerOffPreparer(resourceGroupName string, V "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -960,13 +1183,11 @@ func (client VirtualMachinesClient) PowerOffResponder(resp *http.Response) (resu return } -// Redeploy the operation to redeploy a virtual machine. This method may poll -// for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// Redeploy the operation to redeploy a virtual machine. This method may poll for completion. Polling can be canceled +// by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. // -// resourceGroupName is the name of the resource group. VMName is the name of -// the virtual machine. +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. func (client VirtualMachinesClient) Redeploy(resourceGroupName string, VMName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -974,8 +1195,10 @@ func (client VirtualMachinesClient) Redeploy(resourceGroupName string, VMName st var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -1008,7 +1231,7 @@ func (client VirtualMachinesClient) RedeployPreparer(resourceGroupName string, V "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1042,13 +1265,10 @@ func (client VirtualMachinesClient) RedeployResponder(resp *http.Response) (resu return } -// Restart the operation to restart a virtual machine. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// Restart the operation to restart a virtual machine. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. VMName is the name of -// the virtual machine. +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. func (client VirtualMachinesClient) Restart(resourceGroupName string, VMName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -1056,8 +1276,10 @@ func (client VirtualMachinesClient) Restart(resourceGroupName string, VMName str var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -1090,7 +1312,7 @@ func (client VirtualMachinesClient) RestartPreparer(resourceGroupName string, VM "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1124,13 +1346,103 @@ func (client VirtualMachinesClient) RestartResponder(resp *http.Response) (resul return } -// Start the operation to start a virtual machine. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// RunCommand run command on the VM. This method may poll for completion. Polling can be canceled by passing the cancel +// channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. VMName is the name of -// the virtual machine. +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. parameters is +// parameters supplied to the Run command operation. +func (client VirtualMachinesClient) RunCommand(resourceGroupName string, VMName string, parameters RunCommandInput, cancel <-chan struct{}) (<-chan RunCommandResult, <-chan error) { + resultChan := make(chan RunCommandResult, 1) + errChan := make(chan error, 1) + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.CommandID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + errChan <- validation.NewErrorWithValidationError(err, "compute.VirtualMachinesClient", "RunCommand") + close(errChan) + close(resultChan) + return resultChan, errChan + } + + go func() { + var err error + var result RunCommandResult + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.RunCommandPreparer(resourceGroupName, VMName, parameters, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RunCommand", nil, "Failure preparing request") + return + } + + resp, err := client.RunCommandSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RunCommand", resp, "Failure sending request") + return + } + + result, err = client.RunCommandResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "RunCommand", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// RunCommandPreparer prepares the RunCommand request. +func (client VirtualMachinesClient) RunCommandPreparer(resourceGroupName string, VMName string, parameters RunCommandInput, cancel <-chan struct{}) (*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 = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/runCommand", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// RunCommandSender sends the RunCommand request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) RunCommandSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// RunCommandResponder handles the response to the RunCommand request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) RunCommandResponder(resp *http.Response) (result RunCommandResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Start the operation to start a virtual machine. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. func (client VirtualMachinesClient) Start(resourceGroupName string, VMName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -1138,8 +1450,10 @@ func (client VirtualMachinesClient) Start(resourceGroupName string, VMName strin var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -1172,7 +1486,7 @@ func (client VirtualMachinesClient) StartPreparer(resourceGroupName string, VMNa "vmName": autorest.Encode("path", VMName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesetextensions.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesetextensions.go new file mode 100644 index 000000000000..9a198f148d20 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesetextensions.go @@ -0,0 +1,416 @@ +package compute + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// VirtualMachineScaleSetExtensionsClient is the compute Client +type VirtualMachineScaleSetExtensionsClient struct { + ManagementClient +} + +// NewVirtualMachineScaleSetExtensionsClient creates an instance of the VirtualMachineScaleSetExtensionsClient client. +func NewVirtualMachineScaleSetExtensionsClient(subscriptionID string) VirtualMachineScaleSetExtensionsClient { + return NewVirtualMachineScaleSetExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachineScaleSetExtensionsClientWithBaseURI creates an instance of the +// VirtualMachineScaleSetExtensionsClient client. +func NewVirtualMachineScaleSetExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetExtensionsClient { + return VirtualMachineScaleSetExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate the operation to create or update an extension. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. +// +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set where the +// extension should be create or updated. vmssExtensionName is the name of the VM scale set extension. +// extensionParameters is parameters supplied to the Create VM scale set Extension operation. +func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdate(resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension, cancel <-chan struct{}) (<-chan VirtualMachineScaleSetExtension, <-chan error) { + resultChan := make(chan VirtualMachineScaleSetExtension, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result VirtualMachineScaleSetExtension + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.CreateOrUpdatePreparer(resourceGroupName, VMScaleSetName, vmssExtensionName, extensionParameters, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdatePreparer(resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + "vmssExtensionName": autorest.Encode("path", vmssExtensionName), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), + autorest.WithJSON(extensionParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete the operation to delete the extension. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set where the +// extension should be deleted. vmssExtensionName is the name of the VM scale set extension. +func (client VirtualMachineScaleSetExtensionsClient) Delete(resourceGroupName string, VMScaleSetName string, vmssExtensionName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { + resultChan := make(chan OperationStatusResponse, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result OperationStatusResponse + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.DeletePreparer(resourceGroupName, VMScaleSetName, vmssExtensionName, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Delete", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// DeletePreparer prepares the Delete request. +func (client VirtualMachineScaleSetExtensionsClient) DeletePreparer(resourceGroupName string, VMScaleSetName string, vmssExtensionName string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + "vmssExtensionName": autorest.Encode("path", vmssExtensionName), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetExtensionsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetExtensionsClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get the operation to get the extension. +// +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set containing the +// extension. vmssExtensionName is the name of the VM scale set extension. expand is the expand expression to apply on +// the operation. +func (client VirtualMachineScaleSetExtensionsClient) Get(resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (result VirtualMachineScaleSetExtension, err error) { + req, err := client.GetPreparer(resourceGroupName, VMScaleSetName, vmssExtensionName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualMachineScaleSetExtensionsClient) GetPreparer(resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + "vmssExtensionName": autorest.Encode("path", vmssExtensionName), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetExtensionsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetExtensionsClient) GetResponder(resp *http.Response) (result VirtualMachineScaleSetExtension, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of all extensions in a VM scale set. +// +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set containing the +// extension. +func (client VirtualMachineScaleSetExtensionsClient) List(resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetExtensionListResult, err error) { + req, err := client.ListPreparer(resourceGroupName, VMScaleSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualMachineScaleSetExtensionsClient) ListPreparer(resourceGroupName string, VMScaleSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetExtensionsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetExtensionsClient) ListResponder(resp *http.Response) (result VirtualMachineScaleSetExtensionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client VirtualMachineScaleSetExtensionsClient) ListNextResults(lastResults VirtualMachineScaleSetExtensionListResult) (result VirtualMachineScaleSetExtensionListResult, err error) { + req, err := lastResults.VirtualMachineScaleSetExtensionListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetExtensionsClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListComplete gets all elements from the list without paging. +func (client VirtualMachineScaleSetExtensionsClient) ListComplete(resourceGroupName string, VMScaleSetName string, cancel <-chan struct{}) (<-chan VirtualMachineScaleSetExtension, <-chan error) { + resultChan := make(chan VirtualMachineScaleSetExtension) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName, VMScaleSetName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesetrollingupgrades.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesetrollingupgrades.go new file mode 100644 index 000000000000..45cc6e5c51cb --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesetrollingupgrades.go @@ -0,0 +1,271 @@ +package compute + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// VirtualMachineScaleSetRollingUpgradesClient is the compute Client +type VirtualMachineScaleSetRollingUpgradesClient struct { + ManagementClient +} + +// NewVirtualMachineScaleSetRollingUpgradesClient creates an instance of the +// VirtualMachineScaleSetRollingUpgradesClient client. +func NewVirtualMachineScaleSetRollingUpgradesClient(subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient { + return NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI creates an instance of the +// VirtualMachineScaleSetRollingUpgradesClient client. +func NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetRollingUpgradesClient { + return VirtualMachineScaleSetRollingUpgradesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Cancel cancels the current virtual machine scale set rolling upgrade. This method may poll for completion. Polling +// can be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any +// outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. +func (client VirtualMachineScaleSetRollingUpgradesClient) Cancel(resourceGroupName string, VMScaleSetName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { + resultChan := make(chan OperationStatusResponse, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result OperationStatusResponse + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.CancelPreparer(resourceGroupName, VMScaleSetName, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "Cancel", nil, "Failure preparing request") + return + } + + resp, err := client.CancelSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "Cancel", resp, "Failure sending request") + return + } + + result, err = client.CancelResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "Cancel", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// CancelPreparer prepares the Cancel request. +func (client VirtualMachineScaleSetRollingUpgradesClient) CancelPreparer(resourceGroupName string, VMScaleSetName string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/cancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// CancelSender sends the Cancel request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetRollingUpgradesClient) CancelSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// CancelResponder handles the response to the Cancel request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetRollingUpgradesClient) CancelResponder(resp *http.Response) (result OperationStatusResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetLatest gets the status of the latest virtual machine scale set rolling upgrade. +// +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. +func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatest(resourceGroupName string, VMScaleSetName string) (result RollingUpgradeStatusInfo, err error) { + req, err := client.GetLatestPreparer(resourceGroupName, VMScaleSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", nil, "Failure preparing request") + return + } + + resp, err := client.GetLatestSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", resp, "Failure sending request") + return + } + + result, err = client.GetLatestResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "GetLatest", resp, "Failure responding to request") + } + + return +} + +// GetLatestPreparer prepares the GetLatest request. +func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestPreparer(resourceGroupName string, VMScaleSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/rollingUpgrades/latest", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetLatestSender sends the GetLatest request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetLatestResponder handles the response to the GetLatest request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestResponder(resp *http.Response) (result RollingUpgradeStatusInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// StartOSUpgrade starts a rolling upgrade to move all virtual machine scale set instances to the latest available +// Platform Image OS version. Instances which are already running the latest available OS version are not affected. +// This method may poll for completion. Polling can be canceled by passing the cancel channel argument. The channel +// will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. +func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgrade(resourceGroupName string, VMScaleSetName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { + resultChan := make(chan OperationStatusResponse, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result OperationStatusResponse + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.StartOSUpgradePreparer(resourceGroupName, VMScaleSetName, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartOSUpgrade", nil, "Failure preparing request") + return + } + + resp, err := client.StartOSUpgradeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartOSUpgrade", resp, "Failure sending request") + return + } + + result, err = client.StartOSUpgradeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetRollingUpgradesClient", "StartOSUpgrade", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// StartOSUpgradePreparer prepares the StartOSUpgrade request. +func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradePreparer(resourceGroupName string, VMScaleSetName string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osRollingUpgrade", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// StartOSUpgradeSender sends the StartOSUpgrade request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// StartOSUpgradeResponder handles the response to the StartOSUpgrade request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeResponder(resp *http.Response) (result OperationStatusResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesets.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesets.go index 53700c8dd9e7..72a868579acb 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesets.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesets.go @@ -14,9 +14,8 @@ package compute // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -25,43 +24,67 @@ import ( "net/http" ) -// VirtualMachineScaleSetsClient is the the Compute Management Client. +// VirtualMachineScaleSetsClient is the compute Client type VirtualMachineScaleSetsClient struct { ManagementClient } -// NewVirtualMachineScaleSetsClient creates an instance of the -// VirtualMachineScaleSetsClient client. +// NewVirtualMachineScaleSetsClient creates an instance of the VirtualMachineScaleSetsClient client. func NewVirtualMachineScaleSetsClient(subscriptionID string) VirtualMachineScaleSetsClient { return NewVirtualMachineScaleSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewVirtualMachineScaleSetsClientWithBaseURI creates an instance of the -// VirtualMachineScaleSetsClient client. +// NewVirtualMachineScaleSetsClientWithBaseURI creates an instance of the VirtualMachineScaleSetsClient client. func NewVirtualMachineScaleSetsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetsClient { return VirtualMachineScaleSetsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate create or update a VM scale set. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// CreateOrUpdate create or update a VM scale set. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. name is the name of the -// VM scale set to create or update. parameters is the scale set object. -func (client VirtualMachineScaleSetsClient) CreateOrUpdate(resourceGroupName string, name string, parameters VirtualMachineScaleSet, cancel <-chan struct{}) (<-chan VirtualMachineScaleSet, <-chan error) { +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set to create or +// update. parameters is the scale set object. +func (client VirtualMachineScaleSetsClient) CreateOrUpdate(resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSet, cancel <-chan struct{}) (<-chan VirtualMachineScaleSet, <-chan error) { resultChan := make(chan VirtualMachineScaleSet, 1) errChan := make(chan error, 1) + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxBatchInstancePercent", Name: validation.InclusiveMinimum, Rule: 5, Chain: nil}, + }}, + {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyInstancePercent", Name: validation.InclusiveMinimum, Rule: 5, Chain: nil}, + }}, + {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMaximum, Rule: 100, Chain: nil}, + {Target: "parameters.VirtualMachineScaleSetProperties.UpgradePolicy.RollingUpgradePolicy.MaxUnhealthyUpgradedInstancePercent", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, + }}, + }}, + }}, + }}}}}); err != nil { + errChan <- validation.NewErrorWithValidationError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate") + close(errChan) + close(resultChan) + return resultChan, errChan + } + go func() { var err error var result VirtualMachineScaleSet defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() - req, err := client.CreateOrUpdatePreparer(resourceGroupName, name, parameters, cancel) + req, err := client.CreateOrUpdatePreparer(resourceGroupName, VMScaleSetName, parameters, cancel) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -83,14 +106,14 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdate(resourceGroupName str } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client VirtualMachineScaleSetsClient) CreateOrUpdatePreparer(resourceGroupName string, name string, parameters VirtualMachineScaleSet, cancel <-chan struct{}) (*http.Request, error) { +func (client VirtualMachineScaleSetsClient) CreateOrUpdatePreparer(resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSet, cancel <-chan struct{}) (*http.Request, error) { pathParameters := map[string]interface{}{ - "name": autorest.Encode("path", name), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -99,7 +122,7 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdatePreparer(resourceGroup autorest.AsJSON(), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{name}", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare(&http.Request{Cancel: cancel}) @@ -126,16 +149,13 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdateResponder(resp *http.R return } -// Deallocate deallocates specific virtual machines in a VM scale set. Shuts -// down the virtual machines and releases the compute resources. You are not -// billed for the compute resources that this virtual machine scale set -// deallocates. This method may poll for completion. Polling can be canceled by -// passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// Deallocate deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the +// compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates. +// This method may poll for completion. Polling can be canceled by passing the cancel channel argument. The channel +// will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. VMInstanceIDs is a list of virtual machine -// instance IDs from the VM scale set. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. VMInstanceIDs +// is a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) Deallocate(resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -143,8 +163,10 @@ func (client VirtualMachineScaleSetsClient) Deallocate(resourceGroupName string, var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -177,7 +199,7 @@ func (client VirtualMachineScaleSetsClient) DeallocatePreparer(resourceGroupName "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -216,12 +238,10 @@ func (client VirtualMachineScaleSetsClient) DeallocateResponder(resp *http.Respo return } -// Delete deletes a VM scale set. This method may poll for completion. Polling -// can be canceled by passing the cancel channel argument. The channel will be -// used to cancel polling and any outstanding HTTP requests. +// Delete deletes a VM scale set. This method may poll for completion. Polling can be canceled by passing the cancel +// channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. func (client VirtualMachineScaleSetsClient) Delete(resourceGroupName string, VMScaleSetName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -229,8 +249,10 @@ func (client VirtualMachineScaleSetsClient) Delete(resourceGroupName string, VMS var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -263,7 +285,7 @@ func (client VirtualMachineScaleSetsClient) DeletePreparer(resourceGroupName str "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -297,14 +319,12 @@ func (client VirtualMachineScaleSetsClient) DeleteResponder(resp *http.Response) return } -// DeleteInstances deletes virtual machines in a VM scale set. This method may -// poll for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// DeleteInstances deletes virtual machines in a VM scale set. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. VMInstanceIDs is a list of virtual machine -// instance IDs from the VM scale set. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. VMInstanceIDs +// is a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) DeleteInstances(resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -321,8 +341,10 @@ func (client VirtualMachineScaleSetsClient) DeleteInstances(resourceGroupName st var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -355,7 +377,7 @@ func (client VirtualMachineScaleSetsClient) DeleteInstancesPreparer(resourceGrou "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -393,8 +415,7 @@ func (client VirtualMachineScaleSetsClient) DeleteInstancesResponder(resp *http. // Get display information about a virtual machine scale set. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. func (client VirtualMachineScaleSetsClient) Get(resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSet, err error) { req, err := client.GetPreparer(resourceGroupName, VMScaleSetName) if err != nil { @@ -425,7 +446,7 @@ func (client VirtualMachineScaleSetsClient) GetPreparer(resourceGroupName string "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -459,8 +480,7 @@ func (client VirtualMachineScaleSetsClient) GetResponder(resp *http.Response) (r // GetInstanceView gets the status of a VM scale set instance. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. func (client VirtualMachineScaleSetsClient) GetInstanceView(resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetInstanceView, err error) { req, err := client.GetInstanceViewPreparer(resourceGroupName, VMScaleSetName) if err != nil { @@ -491,7 +511,7 @@ func (client VirtualMachineScaleSetsClient) GetInstanceViewPreparer(resourceGrou "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -555,7 +575,7 @@ func (client VirtualMachineScaleSetsClient) ListPreparer(resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -611,9 +631,53 @@ func (client VirtualMachineScaleSetsClient) ListNextResults(lastResults VirtualM return } -// ListAll gets a list of all VM Scale Sets in the subscription, regardless of -// the associated resource group. Use nextLink property in the response to get -// the next page of VM Scale Sets. Do this till nextLink is not null to fetch +// ListComplete gets all elements from the list without paging. +func (client VirtualMachineScaleSetsClient) ListComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan VirtualMachineScaleSet, <-chan error) { + resultChan := make(chan VirtualMachineScaleSet) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListAll gets a list of all VM Scale Sets in the subscription, regardless of the associated resource group. Use +// nextLink property in the response to get the next page of VM Scale Sets. Do this till nextLink is not null to fetch // all the VM Scale Sets. func (client VirtualMachineScaleSetsClient) ListAll() (result VirtualMachineScaleSetListWithLinkResult, err error) { req, err := client.ListAllPreparer() @@ -643,7 +707,7 @@ func (client VirtualMachineScaleSetsClient) ListAllPreparer() (*http.Request, er "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -699,11 +763,55 @@ func (client VirtualMachineScaleSetsClient) ListAllNextResults(lastResults Virtu return } -// ListSkus gets a list of SKUs available for your VM scale set, including the -// minimum and maximum VM instances allowed for each SKU. +// ListAllComplete gets all elements from the list without paging. +func (client VirtualMachineScaleSetsClient) ListAllComplete(cancel <-chan struct{}) (<-chan VirtualMachineScaleSet, <-chan error) { + resultChan := make(chan VirtualMachineScaleSet) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListAll() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListAllNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListSkus gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed +// for each SKU. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. func (client VirtualMachineScaleSetsClient) ListSkus(resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListSkusResult, err error) { req, err := client.ListSkusPreparer(resourceGroupName, VMScaleSetName) if err != nil { @@ -734,7 +842,7 @@ func (client VirtualMachineScaleSetsClient) ListSkusPreparer(resourceGroupName s "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -790,16 +898,58 @@ func (client VirtualMachineScaleSetsClient) ListSkusNextResults(lastResults Virt return } -// PowerOff power off (stop) one or more virtual machines in a VM scale set. -// Note that resources are still attached and you are getting charged for the -// resources. Instead, use deallocate to release resources and avoid charges. -// This method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and any -// outstanding HTTP requests. +// ListSkusComplete gets all elements from the list without paging. +func (client VirtualMachineScaleSetsClient) ListSkusComplete(resourceGroupName string, VMScaleSetName string, cancel <-chan struct{}) (<-chan VirtualMachineScaleSetSku, <-chan error) { + resultChan := make(chan VirtualMachineScaleSetSku) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListSkus(resourceGroupName, VMScaleSetName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListSkusNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// PowerOff power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and +// you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges. This +// method may poll for completion. Polling can be canceled by passing the cancel channel argument. The channel will be +// used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. VMInstanceIDs is a list of virtual machine -// instance IDs from the VM scale set. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. VMInstanceIDs +// is a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) PowerOff(resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -807,8 +957,10 @@ func (client VirtualMachineScaleSetsClient) PowerOff(resourceGroupName string, V var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -841,7 +993,7 @@ func (client VirtualMachineScaleSetsClient) PowerOffPreparer(resourceGroupName s "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -880,26 +1032,27 @@ func (client VirtualMachineScaleSetsClient) PowerOffResponder(resp *http.Respons return } -// Reimage reimages (upgrade the operating system) one or more virtual machines -// in a VM scale set. This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used to -// cancel polling and any outstanding HTTP requests. +// Reimage reimages (upgrade the operating system) one or more virtual machines in a VM scale set. This method may poll +// for completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel +// polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. -func (client VirtualMachineScaleSetsClient) Reimage(resourceGroupName string, VMScaleSetName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. VMInstanceIDs +// is a list of virtual machine instance IDs from the VM scale set. +func (client VirtualMachineScaleSetsClient) Reimage(resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) go func() { var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() - req, err := client.ReimagePreparer(resourceGroupName, VMScaleSetName, cancel) + req, err := client.ReimagePreparer(resourceGroupName, VMScaleSetName, VMInstanceIDs, cancel) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", nil, "Failure preparing request") return @@ -921,23 +1074,28 @@ func (client VirtualMachineScaleSetsClient) Reimage(resourceGroupName string, VM } // ReimagePreparer prepares the Reimage request. -func (client VirtualMachineScaleSetsClient) ReimagePreparer(resourceGroupName string, VMScaleSetName string, cancel <-chan struct{}) (*http.Request, error) { +func (client VirtualMachineScaleSetsClient) ReimagePreparer(resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (*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 = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( + autorest.AsJSON(), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage", pathParameters), autorest.WithQueryParameters(queryParameters)) + if VMInstanceIDs != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(VMInstanceIDs)) + } return preparer.Prepare(&http.Request{Cancel: cancel}) } @@ -962,27 +1120,27 @@ func (client VirtualMachineScaleSetsClient) ReimageResponder(resp *http.Response return } -// ReimageAll reimages all the disks ( including data disks ) in the virtual -// machines in a virtual machine scale set. This operation is only supported -// for managed disks. This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used to -// cancel polling and any outstanding HTTP requests. +// ReimageAll reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation +// is only supported for managed disks. This method may poll for completion. Polling can be canceled by passing the +// cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. -func (client VirtualMachineScaleSetsClient) ReimageAll(resourceGroupName string, VMScaleSetName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. VMInstanceIDs +// is a list of virtual machine instance IDs from the VM scale set. +func (client VirtualMachineScaleSetsClient) ReimageAll(resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) go func() { var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() - req, err := client.ReimageAllPreparer(resourceGroupName, VMScaleSetName, cancel) + req, err := client.ReimageAllPreparer(resourceGroupName, VMScaleSetName, VMInstanceIDs, cancel) if err != nil { err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "ReimageAll", nil, "Failure preparing request") return @@ -1004,23 +1162,28 @@ func (client VirtualMachineScaleSetsClient) ReimageAll(resourceGroupName string, } // ReimageAllPreparer prepares the ReimageAll request. -func (client VirtualMachineScaleSetsClient) ReimageAllPreparer(resourceGroupName string, VMScaleSetName string, cancel <-chan struct{}) (*http.Request, error) { +func (client VirtualMachineScaleSetsClient) ReimageAllPreparer(resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (*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 = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } preparer := autorest.CreatePreparer( + autorest.AsJSON(), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimageall", pathParameters), autorest.WithQueryParameters(queryParameters)) + if VMInstanceIDs != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(VMInstanceIDs)) + } return preparer.Prepare(&http.Request{Cancel: cancel}) } @@ -1045,14 +1208,12 @@ func (client VirtualMachineScaleSetsClient) ReimageAllResponder(resp *http.Respo return } -// Restart restarts one or more virtual machines in a VM scale set. This method -// may poll for completion. Polling can be canceled by passing the cancel -// channel argument. The channel will be used to cancel polling and any -// outstanding HTTP requests. +// Restart restarts one or more virtual machines in a VM scale set. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. VMInstanceIDs is a list of virtual machine -// instance IDs from the VM scale set. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. VMInstanceIDs +// is a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) Restart(resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -1060,8 +1221,10 @@ func (client VirtualMachineScaleSetsClient) Restart(resourceGroupName string, VM var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -1094,7 +1257,7 @@ func (client VirtualMachineScaleSetsClient) RestartPreparer(resourceGroupName st "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1133,14 +1296,12 @@ func (client VirtualMachineScaleSetsClient) RestartResponder(resp *http.Response return } -// Start starts one or more virtual machines in a VM scale set. This method may -// poll for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// Start starts one or more virtual machines in a VM scale set. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. VMInstanceIDs is a list of virtual machine -// instance IDs from the VM scale set. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. VMInstanceIDs +// is a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) Start(resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -1148,8 +1309,10 @@ func (client VirtualMachineScaleSetsClient) Start(resourceGroupName string, VMSc var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -1182,7 +1345,7 @@ func (client VirtualMachineScaleSetsClient) StartPreparer(resourceGroupName stri "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1221,14 +1384,96 @@ func (client VirtualMachineScaleSetsClient) StartResponder(resp *http.Response) return } -// UpdateInstances upgrades one or more virtual machines to the latest SKU set -// in the VM scale set model. This method may poll for completion. Polling can -// be canceled by passing the cancel channel argument. The channel will be used -// to cancel polling and any outstanding HTTP requests. +// Update update a VM scale set. This method may poll for completion. Polling can be canceled by passing the cancel +// channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set to create or +// update. parameters is the scale set object. +func (client VirtualMachineScaleSetsClient) Update(resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSetUpdate, cancel <-chan struct{}) (<-chan VirtualMachineScaleSet, <-chan error) { + resultChan := make(chan VirtualMachineScaleSet, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result VirtualMachineScaleSet + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.UpdatePreparer(resourceGroupName, VMScaleSetName, parameters, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Update", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// UpdatePreparer prepares the Update request. +func (client VirtualMachineScaleSetsClient) UpdatePreparer(resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSetUpdate, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vmScaleSetName": autorest.Encode("path", VMScaleSetName), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachineScaleSetsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client VirtualMachineScaleSetsClient) UpdateResponder(resp *http.Response) (result VirtualMachineScaleSet, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateInstances upgrades one or more virtual machines to the latest SKU set in the VM scale set model. This method +// may poll for completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to +// cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. VMInstanceIDs is a list of virtual machine -// instance IDs from the VM scale set. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. VMInstanceIDs +// is a list of virtual machine instance IDs from the VM scale set. func (client VirtualMachineScaleSetsClient) UpdateInstances(resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -1245,8 +1490,10 @@ func (client VirtualMachineScaleSetsClient) UpdateInstances(resourceGroupName st var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -1279,7 +1526,7 @@ func (client VirtualMachineScaleSetsClient) UpdateInstancesPreparer(resourceGrou "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesetvms.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesetvms.go index 34e0934dcb68..5a15edae9131 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesetvms.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinescalesetvms.go @@ -14,9 +14,8 @@ package compute // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,33 +23,28 @@ import ( "net/http" ) -// VirtualMachineScaleSetVMsClient is the the Compute Management Client. +// VirtualMachineScaleSetVMsClient is the compute Client type VirtualMachineScaleSetVMsClient struct { ManagementClient } -// NewVirtualMachineScaleSetVMsClient creates an instance of the -// VirtualMachineScaleSetVMsClient client. +// NewVirtualMachineScaleSetVMsClient creates an instance of the VirtualMachineScaleSetVMsClient client. func NewVirtualMachineScaleSetVMsClient(subscriptionID string) VirtualMachineScaleSetVMsClient { return NewVirtualMachineScaleSetVMsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewVirtualMachineScaleSetVMsClientWithBaseURI creates an instance of the -// VirtualMachineScaleSetVMsClient client. +// NewVirtualMachineScaleSetVMsClientWithBaseURI creates an instance of the VirtualMachineScaleSetVMsClient client. func NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMsClient { return VirtualMachineScaleSetVMsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Deallocate deallocates a specific virtual machine in a VM scale set. Shuts -// down the virtual machine and releases the compute resources it uses. You are -// not billed for the compute resources of this virtual machine once it is -// deallocated. This method may poll for completion. Polling can be canceled by -// passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// Deallocate deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the +// compute resources it uses. You are not billed for the compute resources of this virtual machine once it is +// deallocated. This method may poll for completion. Polling can be canceled by passing the cancel channel argument. +// The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. instanceID is the instance ID of the virtual -// machine. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID is +// the instance ID of the virtual machine. func (client VirtualMachineScaleSetVMsClient) Deallocate(resourceGroupName string, VMScaleSetName string, instanceID string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -58,8 +52,10 @@ func (client VirtualMachineScaleSetVMsClient) Deallocate(resourceGroupName strin var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -93,7 +89,7 @@ func (client VirtualMachineScaleSetVMsClient) DeallocatePreparer(resourceGroupNa "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -127,14 +123,12 @@ func (client VirtualMachineScaleSetVMsClient) DeallocateResponder(resp *http.Res return } -// Delete deletes a virtual machine from a VM scale set. This method may poll -// for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// Delete deletes a virtual machine from a VM scale set. This method may poll for completion. Polling can be canceled +// by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. instanceID is the instance ID of the virtual -// machine. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID is +// the instance ID of the virtual machine. func (client VirtualMachineScaleSetVMsClient) Delete(resourceGroupName string, VMScaleSetName string, instanceID string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -142,8 +136,10 @@ func (client VirtualMachineScaleSetVMsClient) Delete(resourceGroupName string, V var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -177,7 +173,7 @@ func (client VirtualMachineScaleSetVMsClient) DeletePreparer(resourceGroupName s "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -213,9 +209,8 @@ func (client VirtualMachineScaleSetVMsClient) DeleteResponder(resp *http.Respons // Get gets a virtual machine from a VM scale set. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. instanceID is the instance ID of the virtual -// machine. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID is +// the instance ID of the virtual machine. func (client VirtualMachineScaleSetVMsClient) Get(resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVM, err error) { req, err := client.GetPreparer(resourceGroupName, VMScaleSetName, instanceID) if err != nil { @@ -247,7 +242,7 @@ func (client VirtualMachineScaleSetVMsClient) GetPreparer(resourceGroupName stri "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -281,9 +276,8 @@ func (client VirtualMachineScaleSetVMsClient) GetResponder(resp *http.Response) // GetInstanceView gets the status of a virtual machine from a VM scale set. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. instanceID is the instance ID of the virtual -// machine. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID is +// the instance ID of the virtual machine. func (client VirtualMachineScaleSetVMsClient) GetInstanceView(resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMInstanceView, err error) { req, err := client.GetInstanceViewPreparer(resourceGroupName, VMScaleSetName, instanceID) if err != nil { @@ -315,7 +309,7 @@ func (client VirtualMachineScaleSetVMsClient) GetInstanceViewPreparer(resourceGr "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -349,10 +343,9 @@ func (client VirtualMachineScaleSetVMsClient) GetInstanceViewResponder(resp *htt // List gets a list of all virtual machines in a VM scale sets. // -// resourceGroupName is the name of the resource group. -// virtualMachineScaleSetName is the name of the VM scale set. filter is the -// filter to apply to the operation. selectParameter is the list parameters. -// expand is the expand expression to apply to the operation. +// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the VM scale set. +// filter is the filter to apply to the operation. selectParameter is the list parameters. expand is the expand +// expression to apply to the operation. func (client VirtualMachineScaleSetVMsClient) List(resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResult, err error) { req, err := client.ListPreparer(resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand) if err != nil { @@ -383,7 +376,7 @@ func (client VirtualMachineScaleSetVMsClient) ListPreparer(resourceGroupName str "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -448,16 +441,58 @@ func (client VirtualMachineScaleSetVMsClient) ListNextResults(lastResults Virtua return } -// PowerOff power off (stop) a virtual machine in a VM scale set. Note that -// resources are still attached and you are getting charged for the resources. -// Instead, use deallocate to release resources and avoid charges. This method -// may poll for completion. Polling can be canceled by passing the cancel -// channel argument. The channel will be used to cancel polling and any -// outstanding HTTP requests. +// ListComplete gets all elements from the list without paging. +func (client VirtualMachineScaleSetVMsClient) ListComplete(resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string, cancel <-chan struct{}) (<-chan VirtualMachineScaleSetVM, <-chan error) { + resultChan := make(chan VirtualMachineScaleSetVM) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// PowerOff power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are +// getting charged for the resources. Instead, use deallocate to release resources and avoid charges. This method may +// poll for completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to +// cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. instanceID is the instance ID of the virtual -// machine. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID is +// the instance ID of the virtual machine. func (client VirtualMachineScaleSetVMsClient) PowerOff(resourceGroupName string, VMScaleSetName string, instanceID string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -465,8 +500,10 @@ func (client VirtualMachineScaleSetVMsClient) PowerOff(resourceGroupName string, var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -500,7 +537,7 @@ func (client VirtualMachineScaleSetVMsClient) PowerOffPreparer(resourceGroupName "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -534,14 +571,12 @@ func (client VirtualMachineScaleSetVMsClient) PowerOffResponder(resp *http.Respo return } -// Reimage reimages (upgrade the operating system) a specific virtual machine -// in a VM scale set. This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used to -// cancel polling and any outstanding HTTP requests. +// Reimage reimages (upgrade the operating system) a specific virtual machine in a VM scale set. This method may poll +// for completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel +// polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. instanceID is the instance ID of the virtual -// machine. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID is +// the instance ID of the virtual machine. func (client VirtualMachineScaleSetVMsClient) Reimage(resourceGroupName string, VMScaleSetName string, instanceID string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -549,8 +584,10 @@ func (client VirtualMachineScaleSetVMsClient) Reimage(resourceGroupName string, var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -584,7 +621,7 @@ func (client VirtualMachineScaleSetVMsClient) ReimagePreparer(resourceGroupName "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -618,15 +655,12 @@ func (client VirtualMachineScaleSetVMsClient) ReimageResponder(resp *http.Respon return } -// ReimageAll allows you to re-image all the disks ( including data disks ) in -// the a virtual machine scale set instance. This operation is only supported -// for managed disks. This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used to -// cancel polling and any outstanding HTTP requests. +// ReimageAll allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This +// operation is only supported for managed disks. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. instanceID is the instance ID of the virtual -// machine. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID is +// the instance ID of the virtual machine. func (client VirtualMachineScaleSetVMsClient) ReimageAll(resourceGroupName string, VMScaleSetName string, instanceID string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -634,8 +668,10 @@ func (client VirtualMachineScaleSetVMsClient) ReimageAll(resourceGroupName strin var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -669,7 +705,7 @@ func (client VirtualMachineScaleSetVMsClient) ReimageAllPreparer(resourceGroupNa "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -703,14 +739,12 @@ func (client VirtualMachineScaleSetVMsClient) ReimageAllResponder(resp *http.Res return } -// Restart restarts a virtual machine in a VM scale set. This method may poll -// for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// Restart restarts a virtual machine in a VM scale set. This method may poll for completion. Polling can be canceled +// by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. instanceID is the instance ID of the virtual -// machine. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID is +// the instance ID of the virtual machine. func (client VirtualMachineScaleSetVMsClient) Restart(resourceGroupName string, VMScaleSetName string, instanceID string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -718,8 +752,10 @@ func (client VirtualMachineScaleSetVMsClient) Restart(resourceGroupName string, var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -753,7 +789,7 @@ func (client VirtualMachineScaleSetVMsClient) RestartPreparer(resourceGroupName "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -787,14 +823,11 @@ func (client VirtualMachineScaleSetVMsClient) RestartResponder(resp *http.Respon return } -// Start starts a virtual machine in a VM scale set. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// Start starts a virtual machine in a VM scale set. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. VMScaleSetName is the -// name of the VM scale set. instanceID is the instance ID of the virtual -// machine. +// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID is +// the instance ID of the virtual machine. func (client VirtualMachineScaleSetVMsClient) Start(resourceGroupName string, VMScaleSetName string, instanceID string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { resultChan := make(chan OperationStatusResponse, 1) errChan := make(chan error, 1) @@ -802,8 +835,10 @@ func (client VirtualMachineScaleSetVMsClient) Start(resourceGroupName string, VM var err error var result OperationStatusResponse defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -837,7 +872,7 @@ func (client VirtualMachineScaleSetVMsClient) StartPreparer(resourceGroupName st "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinesizes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinesizes.go index c76b203e7e9d..dc2f2778bea2 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinesizes.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/compute/virtualmachinesizes.go @@ -14,9 +14,8 @@ package compute // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -25,25 +24,22 @@ import ( "net/http" ) -// VirtualMachineSizesClient is the the Compute Management Client. +// VirtualMachineSizesClient is the compute Client type VirtualMachineSizesClient struct { ManagementClient } -// NewVirtualMachineSizesClient creates an instance of the -// VirtualMachineSizesClient client. +// NewVirtualMachineSizesClient creates an instance of the VirtualMachineSizesClient client. func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient { return NewVirtualMachineSizesClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewVirtualMachineSizesClientWithBaseURI creates an instance of the -// VirtualMachineSizesClient client. +// NewVirtualMachineSizesClientWithBaseURI creates an instance of the VirtualMachineSizesClient client. func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineSizesClient { return VirtualMachineSizesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists all available virtual machine sizes for a subscription in a -// location. +// List lists all available virtual machine sizes for a subscription in a location. // // location is the location upon which virtual-machine-sizes is queried. func (client VirtualMachineSizesClient) List(location string) (result VirtualMachineSizeListResult, err error) { @@ -81,7 +77,7 @@ func (client VirtualMachineSizesClient) ListPreparer(location string) (*http.Req "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-04-30-preview" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/client.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/client.go index e5e99db676c3..b3eea6cb2f49 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/client.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/client.go @@ -1,5 +1,4 @@ -// Package containerregistry implements the Azure ARM Containerregistry service -// API version 2017-03-01. +// Package containerregistry implements the Azure ARM Containerregistry service API version 2017-10-01. // // package containerregistry @@ -18,9 +17,8 @@ package containerregistry // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/models.go index 66edd68c5694..fefd82b8d402 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/models.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/models.go @@ -14,9 +14,8 @@ package containerregistry // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -39,28 +38,159 @@ const ( type ProvisioningState string const ( + // Canceled specifies the canceled state for provisioning state. + Canceled ProvisioningState = "Canceled" // Creating specifies the creating state for provisioning state. Creating ProvisioningState = "Creating" + // Deleting specifies the deleting state for provisioning state. + Deleting ProvisioningState = "Deleting" + // Failed specifies the failed state for provisioning state. + Failed ProvisioningState = "Failed" // Succeeded specifies the succeeded state for provisioning state. Succeeded ProvisioningState = "Succeeded" + // Updating specifies the updating state for provisioning state. + Updating ProvisioningState = "Updating" +) + +// RegistryUsageUnit enumerates the values for registry usage unit. +type RegistryUsageUnit string + +const ( + // Bytes specifies the bytes state for registry usage unit. + Bytes RegistryUsageUnit = "Bytes" + // Count specifies the count state for registry usage unit. + Count RegistryUsageUnit = "Count" +) + +// SkuName enumerates the values for sku name. +type SkuName string + +const ( + // Basic specifies the basic state for sku name. + Basic SkuName = "Basic" + // Classic specifies the classic state for sku name. + Classic SkuName = "Classic" + // Premium specifies the premium state for sku name. + Premium SkuName = "Premium" + // Standard specifies the standard state for sku name. + Standard SkuName = "Standard" ) // SkuTier enumerates the values for sku tier. type SkuTier string const ( - // Basic specifies the basic state for sku tier. - Basic SkuTier = "Basic" + // SkuTierBasic specifies the sku tier basic state for sku tier. + SkuTierBasic SkuTier = "Basic" + // SkuTierClassic specifies the sku tier classic state for sku tier. + SkuTierClassic SkuTier = "Classic" + // SkuTierPremium specifies the sku tier premium state for sku tier. + SkuTierPremium SkuTier = "Premium" + // SkuTierStandard specifies the sku tier standard state for sku tier. + SkuTierStandard SkuTier = "Standard" +) + +// WebhookAction enumerates the values for webhook action. +type WebhookAction string + +const ( + // Delete specifies the delete state for webhook action. + Delete WebhookAction = "delete" + // Push specifies the push state for webhook action. + Push WebhookAction = "push" +) + +// WebhookStatus enumerates the values for webhook status. +type WebhookStatus string + +const ( + // Disabled specifies the disabled state for webhook status. + Disabled WebhookStatus = "disabled" + // Enabled specifies the enabled state for webhook status. + Enabled WebhookStatus = "enabled" ) +// Actor is the agent that initiated the event. For most situations, this could be from the authorization context of +// the request. +type Actor struct { + Name *string `json:"name,omitempty"` +} + +// CallbackConfig is the configuration of service URI and custom headers for the webhook. +type CallbackConfig struct { + autorest.Response `json:"-"` + ServiceURI *string `json:"serviceUri,omitempty"` + CustomHeaders *map[string]*string `json:"customHeaders,omitempty"` +} + +// Event is the event for a webhook. +type Event struct { + ID *string `json:"id,omitempty"` + EventRequestMessage *EventRequestMessage `json:"eventRequestMessage,omitempty"` + EventResponseMessage *EventResponseMessage `json:"eventResponseMessage,omitempty"` +} + +// EventContent is the content of the event request message. +type EventContent struct { + ID *string `json:"id,omitempty"` + Timestamp *date.Time `json:"timestamp,omitempty"` + Action *string `json:"action,omitempty"` + Target *Target `json:"target,omitempty"` + Request *Request `json:"request,omitempty"` + Actor *Actor `json:"actor,omitempty"` + Source *Source `json:"source,omitempty"` +} + +// EventInfo is the basic information of an event. +type EventInfo struct { + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` +} + +// EventListResult is the result of a request to list events for a webhook. +type EventListResult struct { + autorest.Response `json:"-"` + Value *[]Event `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// EventListResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client EventListResult) EventListResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// EventRequestMessage is the event request message sent to the service URI. +type EventRequestMessage struct { + Content *EventContent `json:"content,omitempty"` + Headers *map[string]*string `json:"headers,omitempty"` + Method *string `json:"method,omitempty"` + RequestURI *string `json:"requestUri,omitempty"` + Version *string `json:"version,omitempty"` +} + +// EventResponseMessage is the event response message received from the service URI. +type EventResponseMessage struct { + Content *string `json:"content,omitempty"` + Headers *map[string]*string `json:"headers,omitempty"` + ReasonPhrase *string `json:"reasonPhrase,omitempty"` + StatusCode *string `json:"statusCode,omitempty"` + Version *string `json:"version,omitempty"` +} + // OperationDefinition is the definition of a container registry operation. type OperationDefinition struct { Name *string `json:"name,omitempty"` Display *OperationDisplayDefinition `json:"display,omitempty"` } -// OperationDisplayDefinition is the display information for a container -// registry operation. +// OperationDisplayDefinition is the display information for a container registry operation. type OperationDisplayDefinition struct { Provider *string `json:"provider,omitempty"` Resource *string `json:"resource,omitempty"` @@ -68,8 +198,7 @@ type OperationDisplayDefinition struct { Description *string `json:"description,omitempty"` } -// OperationListResult is the result of a request to list container registry -// operations. +// OperationListResult is the result of a request to list container registry operations. type OperationListResult struct { autorest.Response `json:"-"` Value *[]OperationDefinition `json:"value,omitempty"` @@ -88,8 +217,7 @@ func (client OperationListResult) OperationListResultPreparer() (*http.Request, autorest.WithBaseURL(to.String(client.NextLink))) } -// RegenerateCredentialParameters is the parameters used to regenerate the -// login credential. +// RegenerateCredentialParameters is the parameters used to regenerate the login credential. type RegenerateCredentialParameters struct { Name PasswordName `json:"name,omitempty"` } @@ -106,17 +234,7 @@ type Registry struct { *RegistryProperties `json:"properties,omitempty"` } -// RegistryCreateParameters is the parameters for creating a container -// registry. -type RegistryCreateParameters struct { - Tags *map[string]*string `json:"tags,omitempty"` - Location *string `json:"location,omitempty"` - Sku *Sku `json:"sku,omitempty"` - *RegistryPropertiesCreateParameters `json:"properties,omitempty"` -} - -// RegistryListCredentialsResult is the response from the ListCredentials -// operation. +// RegistryListCredentialsResult is the response from the ListCredentials operation. type RegistryListCredentialsResult struct { autorest.Response `json:"-"` Username *string `json:"username,omitempty"` @@ -142,15 +260,13 @@ func (client RegistryListResult) RegistryListResultPreparer() (*http.Request, er autorest.WithBaseURL(to.String(client.NextLink))) } -// RegistryNameCheckRequest is a request to check whether a container registry -// name is available. +// RegistryNameCheckRequest is a request to check whether a container registry name is available. type RegistryNameCheckRequest struct { Name *string `json:"name,omitempty"` Type *string `json:"type,omitempty"` } -// RegistryNameStatus is the result of a request to check the availability of a -// container registry name. +// RegistryNameStatus is the result of a request to check the availability of a container registry name. type RegistryNameStatus struct { autorest.Response `json:"-"` NameAvailable *bool `json:"nameAvailable,omitempty"` @@ -169,31 +285,88 @@ type RegistryProperties struct { LoginServer *string `json:"loginServer,omitempty"` CreationDate *date.Time `json:"creationDate,omitempty"` ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + Status *Status `json:"status,omitempty"` AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"` StorageAccount *StorageAccountProperties `json:"storageAccount,omitempty"` } -// RegistryPropertiesCreateParameters is the parameters for creating the -// properties of a container registry. -type RegistryPropertiesCreateParameters struct { - AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"` - StorageAccount *StorageAccountParameters `json:"storageAccount,omitempty"` -} - -// RegistryPropertiesUpdateParameters is the parameters for updating the -// properties of a container registry. +// RegistryPropertiesUpdateParameters is the parameters for updating the properties of a container registry. type RegistryPropertiesUpdateParameters struct { AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"` - StorageAccount *StorageAccountParameters `json:"storageAccount,omitempty"` + StorageAccount *StorageAccountProperties `json:"storageAccount,omitempty"` } -// RegistryUpdateParameters is the parameters for updating a container -// registry. +// RegistryUpdateParameters is the parameters for updating a container registry. type RegistryUpdateParameters struct { Tags *map[string]*string `json:"tags,omitempty"` + Sku *Sku `json:"sku,omitempty"` *RegistryPropertiesUpdateParameters `json:"properties,omitempty"` } +// RegistryUsage is the quota usage for a container registry. +type RegistryUsage struct { + Name *string `json:"name,omitempty"` + Limit *int64 `json:"limit,omitempty"` + CurrentValue *int64 `json:"currentValue,omitempty"` + Unit RegistryUsageUnit `json:"unit,omitempty"` +} + +// RegistryUsageListResult is the result of a request to get container registry quota usages. +type RegistryUsageListResult struct { + autorest.Response `json:"-"` + Value *[]RegistryUsage `json:"value,omitempty"` +} + +// Replication is an object that represents a replication for a container registry. +type Replication struct { + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *ReplicationProperties `json:"properties,omitempty"` +} + +// ReplicationListResult is the result of a request to list replications for a container registry. +type ReplicationListResult struct { + autorest.Response `json:"-"` + Value *[]Replication `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// ReplicationListResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client ReplicationListResult) ReplicationListResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// ReplicationProperties is the properties of a replication. +type ReplicationProperties struct { + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + Status *Status `json:"status,omitempty"` +} + +// ReplicationUpdateParameters is the parameters for updating a replication. +type ReplicationUpdateParameters struct { + Tags *map[string]*string `json:"tags,omitempty"` +} + +// Request is the request that generated the event. +type Request struct { + ID *string `json:"id,omitempty"` + Addr *string `json:"addr,omitempty"` + Host *string `json:"host,omitempty"` + Method *string `json:"method,omitempty"` + Useragent *string `json:"useragent,omitempty"` +} + // Resource is an Azure resource. type Resource struct { ID *string `json:"id,omitempty"` @@ -205,19 +378,106 @@ type Resource struct { // Sku is the SKU of a container registry. type Sku struct { - Name *string `json:"name,omitempty"` + Name SkuName `json:"name,omitempty"` Tier SkuTier `json:"tier,omitempty"` } -// StorageAccountParameters is the parameters of a storage account for a -// container registry. -type StorageAccountParameters struct { - Name *string `json:"name,omitempty"` - AccessKey *string `json:"accessKey,omitempty"` +// Source is the registry node that generated the event. Put differently, while the actor initiates the event, the +// source generates it. +type Source struct { + Addr *string `json:"addr,omitempty"` + InstanceID *string `json:"instanceID,omitempty"` } -// StorageAccountProperties is the properties of a storage account for a -// container registry. +// Status is the status of an Azure resource at the time the operation was called. +type Status struct { + DisplayStatus *string `json:"displayStatus,omitempty"` + Message *string `json:"message,omitempty"` + Timestamp *date.Time `json:"timestamp,omitempty"` +} + +// StorageAccountProperties is the properties of a storage account for a container registry. Only applicable to Classic +// SKU. type StorageAccountProperties struct { - Name *string `json:"name,omitempty"` + ID *string `json:"id,omitempty"` +} + +// Target is the target of the event. +type Target struct { + MediaType *string `json:"mediaType,omitempty"` + Size *int64 `json:"size,omitempty"` + Digest *string `json:"digest,omitempty"` + Length *int64 `json:"length,omitempty"` + Repository *string `json:"repository,omitempty"` + URL *string `json:"url,omitempty"` + Tag *string `json:"tag,omitempty"` +} + +// Webhook is an object that represents a webhook for a container registry. +type Webhook struct { + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *WebhookProperties `json:"properties,omitempty"` +} + +// WebhookCreateParameters is the parameters for creating a webhook. +type WebhookCreateParameters struct { + Tags *map[string]*string `json:"tags,omitempty"` + Location *string `json:"location,omitempty"` + *WebhookPropertiesCreateParameters `json:"properties,omitempty"` +} + +// WebhookListResult is the result of a request to list webhooks for a container registry. +type WebhookListResult struct { + autorest.Response `json:"-"` + Value *[]Webhook `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// WebhookListResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client WebhookListResult) WebhookListResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// WebhookProperties is the properties of a webhook. +type WebhookProperties struct { + Status WebhookStatus `json:"status,omitempty"` + Scope *string `json:"scope,omitempty"` + Actions *[]WebhookAction `json:"actions,omitempty"` + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// WebhookPropertiesCreateParameters is the parameters for creating the properties of a webhook. +type WebhookPropertiesCreateParameters struct { + ServiceURI *string `json:"serviceUri,omitempty"` + CustomHeaders *map[string]*string `json:"customHeaders,omitempty"` + Status WebhookStatus `json:"status,omitempty"` + Scope *string `json:"scope,omitempty"` + Actions *[]WebhookAction `json:"actions,omitempty"` +} + +// WebhookPropertiesUpdateParameters is the parameters for updating the properties of a webhook. +type WebhookPropertiesUpdateParameters struct { + ServiceURI *string `json:"serviceUri,omitempty"` + CustomHeaders *map[string]*string `json:"customHeaders,omitempty"` + Status WebhookStatus `json:"status,omitempty"` + Scope *string `json:"scope,omitempty"` + Actions *[]WebhookAction `json:"actions,omitempty"` +} + +// WebhookUpdateParameters is the parameters for updating a webhook. +type WebhookUpdateParameters struct { + Tags *map[string]*string `json:"tags,omitempty"` + *WebhookPropertiesUpdateParameters `json:"properties,omitempty"` } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/operations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/operations.go index a1694180c5fb..a9143e739664 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/operations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/operations.go @@ -14,9 +14,8 @@ package containerregistry // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,8 +23,7 @@ import ( "net/http" ) -// OperationsClient is the client for the Operations methods of the -// Containerregistry service. +// OperationsClient is the client for the Operations methods of the Containerregistry service. type OperationsClient struct { ManagementClient } @@ -35,14 +33,12 @@ func NewOperationsClient(subscriptionID string) OperationsClient { return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewOperationsClientWithBaseURI creates an instance of the OperationsClient -// client. +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists all of the available Azure Container Registry REST API -// operations. +// List lists all of the available Azure Container Registry REST API operations. func (client OperationsClient) List() (result OperationListResult, err error) { req, err := client.ListPreparer() if err != nil { @@ -67,7 +63,7 @@ func (client OperationsClient) List() (result OperationListResult, err error) { // ListPreparer prepares the List request. func (client OperationsClient) ListPreparer() (*http.Request, error) { - const APIVersion = "2017-03-01" + const APIVersion = "2017-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -122,3 +118,48 @@ func (client OperationsClient) ListNextResults(lastResults OperationListResult) return } + +// ListComplete gets all elements from the list without paging. +func (client OperationsClient) ListComplete(cancel <-chan struct{}) (<-chan OperationDefinition, <-chan error) { + resultChan := make(chan OperationDefinition) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/registries.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/registries.go index fe03ba33818e..c1c9af59e838 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/registries.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/registries.go @@ -14,9 +14,8 @@ package containerregistry // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -25,8 +24,7 @@ import ( "net/http" ) -// RegistriesClient is the client for the Registries methods of the -// Containerregistry service. +// RegistriesClient is the client for the Registries methods of the Containerregistry service. type RegistriesClient struct { ManagementClient } @@ -36,18 +34,15 @@ func NewRegistriesClient(subscriptionID string) RegistriesClient { return NewRegistriesClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewRegistriesClientWithBaseURI creates an instance of the RegistriesClient -// client. +// NewRegistriesClientWithBaseURI creates an instance of the RegistriesClient client. func NewRegistriesClientWithBaseURI(baseURI string, subscriptionID string) RegistriesClient { return RegistriesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CheckNameAvailability checks whether the container registry name is -// available for use. The name must contain only alphanumeric characters, be -// globally unique, and between 5 and 60 characters in length. +// CheckNameAvailability checks whether the container registry name is available for use. The name must contain only +// alphanumeric characters, be globally unique, and between 5 and 50 characters in length. // -// registryNameCheckRequest is the object containing information for the -// availability request. +// registryNameCheckRequest is the object containing information for the availability request. func (client RegistriesClient) CheckNameAvailability(registryNameCheckRequest RegistryNameCheckRequest) (result RegistryNameStatus, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: registryNameCheckRequest, @@ -87,7 +82,7 @@ func (client RegistriesClient) CheckNameAvailabilityPreparer(registryNameCheckRe "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -121,16 +116,13 @@ func (client RegistriesClient) CheckNameAvailabilityResponder(resp *http.Respons return } -// Create creates a container registry with the specified parameters. This -// method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and any -// outstanding HTTP requests. +// Create creates a container registry with the specified parameters. This method may poll for completion. Polling can +// be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // -// resourceGroupName is the name of the resource group to which the container -// registry belongs. registryName is the name of the container registry. -// registryCreateParameters is the parameters for creating a container -// registry. -func (client RegistriesClient) Create(resourceGroupName string, registryName string, registryCreateParameters RegistryCreateParameters, cancel <-chan struct{}) (<-chan Registry, <-chan error) { +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. registry is the parameters for creating a container registry. +func (client RegistriesClient) Create(resourceGroupName string, registryName string, registry Registry, cancel <-chan struct{}) (<-chan Registry, <-chan error) { resultChan := make(chan Registry, 1) errChan := make(chan error, 1) if err := validation.Validate([]validation.Validation{ @@ -138,15 +130,11 @@ func (client RegistriesClient) Create(resourceGroupName string, registryName str Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, - {TargetValue: registryCreateParameters, - Constraints: []validation.Constraint{{Target: "registryCreateParameters.Location", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "registryCreateParameters.Sku", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "registryCreateParameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "registryCreateParameters.RegistryPropertiesCreateParameters", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "registryCreateParameters.RegistryPropertiesCreateParameters.StorageAccount", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "registryCreateParameters.RegistryPropertiesCreateParameters.StorageAccount.Name", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "registryCreateParameters.RegistryPropertiesCreateParameters.StorageAccount.AccessKey", Name: validation.Null, Rule: true, Chain: nil}, - }}, + {TargetValue: registry, + Constraints: []validation.Constraint{{Target: "registry.Sku", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "registry.RegistryProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "registry.RegistryProperties.StorageAccount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "registry.RegistryProperties.StorageAccount.ID", Name: validation.Null, Rule: true, Chain: nil}}}, }}}}}); err != nil { errChan <- validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "Create") close(errChan) @@ -158,12 +146,14 @@ func (client RegistriesClient) Create(resourceGroupName string, registryName str var err error var result Registry defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() - req, err := client.CreatePreparer(resourceGroupName, registryName, registryCreateParameters, cancel) + req, err := client.CreatePreparer(resourceGroupName, registryName, registry, cancel) if err != nil { err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Create", nil, "Failure preparing request") return @@ -185,14 +175,14 @@ func (client RegistriesClient) Create(resourceGroupName string, registryName str } // CreatePreparer prepares the Create request. -func (client RegistriesClient) CreatePreparer(resourceGroupName string, registryName string, registryCreateParameters RegistryCreateParameters, cancel <-chan struct{}) (*http.Request, error) { +func (client RegistriesClient) CreatePreparer(resourceGroupName string, registryName string, registry Registry, cancel <-chan struct{}) (*http.Request, error) { pathParameters := map[string]interface{}{ "registryName": autorest.Encode("path", registryName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -202,7 +192,7 @@ func (client RegistriesClient) CreatePreparer(resourceGroupName string, registry autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", pathParameters), - autorest.WithJSON(registryCreateParameters), + autorest.WithJSON(registry), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare(&http.Request{Cancel: cancel}) } @@ -221,56 +211,73 @@ func (client RegistriesClient) CreateResponder(resp *http.Response) (result Regi err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} return } -// Delete deletes a container registry. +// Delete deletes a container registry. This method may poll for completion. Polling can be canceled by passing the +// cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group to which the container -// registry belongs. registryName is the name of the container registry. -func (client RegistriesClient) Delete(resourceGroupName string, registryName string) (result autorest.Response, err error) { +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. +func (client RegistriesClient) Delete(resourceGroupName string, registryName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { + resultChan := make(chan autorest.Response, 1) + errChan := make(chan error, 1) if err := validation.Validate([]validation.Validation{ {TargetValue: registryName, Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "Delete") - } - - req, err := client.DeletePreparer(resourceGroupName, registryName) - if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", nil, "Failure preparing request") - return + errChan <- validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "Delete") + close(errChan) + close(resultChan) + return resultChan, errChan } - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = resp - err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", resp, "Failure sending request") - return - } + go func() { + var err error + var result autorest.Response + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.DeletePreparer(resourceGroupName, registryName, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", nil, "Failure preparing request") + return + } - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", resp, "Failure responding to request") - } + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", resp, "Failure sending request") + return + } - return + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", resp, "Failure responding to request") + } + }() + return resultChan, errChan } // DeletePreparer prepares the Delete request. -func (client RegistriesClient) DeletePreparer(resourceGroupName string, registryName string) (*http.Request, error) { +func (client RegistriesClient) DeletePreparer(resourceGroupName string, registryName string, cancel <-chan struct{}) (*http.Request, error) { pathParameters := map[string]interface{}{ "registryName": autorest.Encode("path", registryName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -280,13 +287,15 @@ func (client RegistriesClient) DeletePreparer(resourceGroupName string, registry autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", pathParameters), autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare(&http.Request{}) + return preparer.Prepare(&http.Request{Cancel: cancel}) } // DeleteSender sends the Delete request. The method will close the // http.Response Body if it receives an error. func (client RegistriesClient) DeleteSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req) + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) } // DeleteResponder handles the response to the Delete request. The method always @@ -295,7 +304,7 @@ func (client RegistriesClient) DeleteResponder(resp *http.Response) (result auto err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), autorest.ByClosing()) result.Response = resp return @@ -303,8 +312,8 @@ func (client RegistriesClient) DeleteResponder(resp *http.Response) (result auto // Get gets the properties of the specified container registry. // -// resourceGroupName is the name of the resource group to which the container -// registry belongs. registryName is the name of the container registry. +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. func (client RegistriesClient) Get(resourceGroupName string, registryName string) (result Registry, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: registryName, @@ -343,7 +352,7 @@ func (client RegistriesClient) GetPreparer(resourceGroupName string, registryNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -404,7 +413,7 @@ func (client RegistriesClient) ListPreparer() (*http.Request, error) { "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -460,11 +469,54 @@ func (client RegistriesClient) ListNextResults(lastResults RegistryListResult) ( return } -// ListByResourceGroup lists all the container registries under the specified -// resource group. +// ListComplete gets all elements from the list without paging. +func (client RegistriesClient) ListComplete(cancel <-chan struct{}) (<-chan Registry, <-chan error) { + resultChan := make(chan Registry) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListByResourceGroup lists all the container registries under the specified resource group. // -// resourceGroupName is the name of the resource group to which the container -// registry belongs. +// resourceGroupName is the name of the resource group to which the container registry belongs. func (client RegistriesClient) ListByResourceGroup(resourceGroupName string) (result RegistryListResult, err error) { req, err := client.ListByResourceGroupPreparer(resourceGroupName) if err != nil { @@ -494,7 +546,7 @@ func (client RegistriesClient) ListByResourceGroupPreparer(resourceGroupName str "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -550,11 +602,55 @@ func (client RegistriesClient) ListByResourceGroupNextResults(lastResults Regist return } -// ListCredentials lists the login credentials for the specified container -// registry. +// ListByResourceGroupComplete gets all elements from the list without paging. +func (client RegistriesClient) ListByResourceGroupComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan Registry, <-chan error) { + resultChan := make(chan Registry) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListByResourceGroup(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListByResourceGroupNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListCredentials lists the login credentials for the specified container registry. // -// resourceGroupName is the name of the resource group to which the container -// registry belongs. registryName is the name of the container registry. +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. func (client RegistriesClient) ListCredentials(resourceGroupName string, registryName string) (result RegistryListCredentialsResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: registryName, @@ -593,7 +689,7 @@ func (client RegistriesClient) ListCredentialsPreparer(resourceGroupName string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -625,13 +721,85 @@ func (client RegistriesClient) ListCredentialsResponder(resp *http.Response) (re return } -// RegenerateCredential regenerates one of the login credentials for the -// specified container registry. +// ListUsages gets the quota usages for the specified container registry. // -// resourceGroupName is the name of the resource group to which the container -// registry belongs. registryName is the name of the container registry. -// regenerateCredentialParameters is specifies name of the password which -// should be regenerated -- password or password2. +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. +func (client RegistriesClient) ListUsages(resourceGroupName string, registryName string) (result RegistryUsageListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "ListUsages") + } + + req, err := client.ListUsagesPreparer(resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListUsages", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListUsages", resp, "Failure sending request") + return + } + + result, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListUsages", resp, "Failure responding to request") + } + + return +} + +// ListUsagesPreparer prepares the ListUsages request. +func (client RegistriesClient) ListUsagesPreparer(resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listUsages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListUsagesSender sends the ListUsages request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) ListUsagesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListUsagesResponder handles the response to the ListUsages request. The method always +// closes the http.Response Body. +func (client RegistriesClient) ListUsagesResponder(resp *http.Response) (result RegistryUsageListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegenerateCredential regenerates one of the login credentials for the specified container registry. +// +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. regenerateCredentialParameters is specifies name of the password which should be +// regenerated -- password or password2. func (client RegistriesClient) RegenerateCredential(resourceGroupName string, registryName string, regenerateCredentialParameters RegenerateCredentialParameters) (result RegistryListCredentialsResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: registryName, @@ -670,7 +838,7 @@ func (client RegistriesClient) RegenerateCredentialPreparer(resourceGroupName st "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -704,51 +872,67 @@ func (client RegistriesClient) RegenerateCredentialResponder(resp *http.Response return } -// Update updates a container registry with the specified parameters. +// Update updates a container registry with the specified parameters. This method may poll for completion. Polling can +// be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // -// resourceGroupName is the name of the resource group to which the container -// registry belongs. registryName is the name of the container registry. -// registryUpdateParameters is the parameters for updating a container -// registry. -func (client RegistriesClient) Update(resourceGroupName string, registryName string, registryUpdateParameters RegistryUpdateParameters) (result Registry, err error) { +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. registryUpdateParameters is the parameters for updating a container registry. +func (client RegistriesClient) Update(resourceGroupName string, registryName string, registryUpdateParameters RegistryUpdateParameters, cancel <-chan struct{}) (<-chan Registry, <-chan error) { + resultChan := make(chan Registry, 1) + errChan := make(chan error, 1) if err := validation.Validate([]validation.Validation{ {TargetValue: registryName, Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { - return result, validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "Update") - } - - req, err := client.UpdatePreparer(resourceGroupName, registryName, registryUpdateParameters) - if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", nil, "Failure preparing request") - return + errChan <- validation.NewErrorWithValidationError(err, "containerregistry.RegistriesClient", "Update") + close(errChan) + close(resultChan) + return resultChan, errChan } - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", resp, "Failure sending request") - return - } + go func() { + var err error + var result Registry + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.UpdatePreparer(resourceGroupName, registryName, registryUpdateParameters, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", nil, "Failure preparing request") + return + } - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", resp, "Failure responding to request") - } + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", resp, "Failure sending request") + return + } - return + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", resp, "Failure responding to request") + } + }() + return resultChan, errChan } // UpdatePreparer prepares the Update request. -func (client RegistriesClient) UpdatePreparer(resourceGroupName string, registryName string, registryUpdateParameters RegistryUpdateParameters) (*http.Request, error) { +func (client RegistriesClient) UpdatePreparer(resourceGroupName string, registryName string, registryUpdateParameters RegistryUpdateParameters, cancel <-chan struct{}) (*http.Request, error) { pathParameters := map[string]interface{}{ "registryName": autorest.Encode("path", registryName), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-10-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -760,13 +944,15 @@ func (client RegistriesClient) UpdatePreparer(resourceGroupName string, registry autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", pathParameters), autorest.WithJSON(registryUpdateParameters), autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare(&http.Request{}) + return preparer.Prepare(&http.Request{Cancel: cancel}) } // UpdateSender sends the Update request. The method will close the // http.Response Body if it receives an error. func (client RegistriesClient) UpdateSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req) + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) } // UpdateResponder handles the response to the Update request. The method always @@ -775,7 +961,7 @@ func (client RegistriesClient) UpdateResponder(resp *http.Response) (result Regi err = autorest.Respond( resp, client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/replications.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/replications.go new file mode 100644 index 000000000000..79fce2d21ee8 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/replications.go @@ -0,0 +1,564 @@ +package containerregistry + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// ReplicationsClient is the client for the Replications methods of the Containerregistry service. +type ReplicationsClient struct { + ManagementClient +} + +// NewReplicationsClient creates an instance of the ReplicationsClient client. +func NewReplicationsClient(subscriptionID string) ReplicationsClient { + return NewReplicationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewReplicationsClientWithBaseURI creates an instance of the ReplicationsClient client. +func NewReplicationsClientWithBaseURI(baseURI string, subscriptionID string) ReplicationsClient { + return ReplicationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a replication for a container registry with the specified parameters. This method may poll for +// completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel +// polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. replicationName is the name of the replication. replication is the parameters for +// creating a replication. +func (client ReplicationsClient) Create(resourceGroupName string, registryName string, replicationName string, replication Replication, cancel <-chan struct{}) (<-chan Replication, <-chan error) { + resultChan := make(chan Replication, 1) + errChan := make(chan error, 1) + if err := validation.Validate([]validation.Validation{ + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: replicationName, + Constraints: []validation.Constraint{{Target: "replicationName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "replicationName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "replicationName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + errChan <- validation.NewErrorWithValidationError(err, "containerregistry.ReplicationsClient", "Create") + close(errChan) + close(resultChan) + return resultChan, errChan + } + + go func() { + var err error + var result Replication + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.CreatePreparer(resourceGroupName, registryName, replicationName, replication, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Create", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// CreatePreparer prepares the Create request. +func (client ReplicationsClient) CreatePreparer(resourceGroupName string, registryName string, replicationName string, replication Replication, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "replicationName": autorest.Encode("path", replicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", pathParameters), + autorest.WithJSON(replication), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationsClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationsClient) CreateResponder(resp *http.Response) (result Replication, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a replication from a container registry. This method may poll for completion. Polling can be canceled +// by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. +// +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. replicationName is the name of the replication. +func (client ReplicationsClient) Delete(resourceGroupName string, registryName string, replicationName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { + resultChan := make(chan autorest.Response, 1) + errChan := make(chan error, 1) + if err := validation.Validate([]validation.Validation{ + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: replicationName, + Constraints: []validation.Constraint{{Target: "replicationName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "replicationName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "replicationName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + errChan <- validation.NewErrorWithValidationError(err, "containerregistry.ReplicationsClient", "Delete") + close(errChan) + close(resultChan) + return resultChan, errChan + } + + go func() { + var err error + var result autorest.Response + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.DeletePreparer(resourceGroupName, registryName, replicationName, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Delete", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationsClient) DeletePreparer(resourceGroupName string, registryName string, replicationName string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "replicationName": autorest.Encode("path", replicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified replication. +// +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. replicationName is the name of the replication. +func (client ReplicationsClient) Get(resourceGroupName string, registryName string, replicationName string) (result Replication, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: replicationName, + Constraints: []validation.Constraint{{Target: "replicationName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "replicationName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "replicationName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "containerregistry.ReplicationsClient", "Get") + } + + req, err := client.GetPreparer(resourceGroupName, registryName, replicationName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationsClient) GetPreparer(resourceGroupName string, registryName string, replicationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "replicationName": autorest.Encode("path", replicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationsClient) GetResponder(resp *http.Response) (result Replication, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the replications for the specified container registry. +// +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. +func (client ReplicationsClient) List(resourceGroupName string, registryName string) (result ReplicationListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "containerregistry.ReplicationsClient", "List") + } + + req, err := client.ListPreparer(resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationsClient) ListPreparer(resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationsClient) ListResponder(resp *http.Response) (result ReplicationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client ReplicationsClient) ListNextResults(lastResults ReplicationListResult) (result ReplicationListResult, err error) { + req, err := lastResults.ReplicationListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListComplete gets all elements from the list without paging. +func (client ReplicationsClient) ListComplete(resourceGroupName string, registryName string, cancel <-chan struct{}) (<-chan Replication, <-chan error) { + resultChan := make(chan Replication) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName, registryName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// Update updates a replication for a container registry with the specified parameters. This method may poll for +// completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel +// polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. replicationName is the name of the replication. replicationUpdateParameters is the +// parameters for updating a replication. +func (client ReplicationsClient) Update(resourceGroupName string, registryName string, replicationName string, replicationUpdateParameters ReplicationUpdateParameters, cancel <-chan struct{}) (<-chan Replication, <-chan error) { + resultChan := make(chan Replication, 1) + errChan := make(chan error, 1) + if err := validation.Validate([]validation.Validation{ + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: replicationName, + Constraints: []validation.Constraint{{Target: "replicationName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "replicationName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "replicationName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + errChan <- validation.NewErrorWithValidationError(err, "containerregistry.ReplicationsClient", "Update") + close(errChan) + close(resultChan) + return resultChan, errChan + } + + go func() { + var err error + var result Replication + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.UpdatePreparer(resourceGroupName, registryName, replicationName, replicationUpdateParameters, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Update", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationsClient) UpdatePreparer(resourceGroupName string, registryName string, replicationName string, replicationUpdateParameters ReplicationUpdateParameters, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "replicationName": autorest.Encode("path", replicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", pathParameters), + autorest.WithJSON(replicationUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationsClient) UpdateResponder(resp *http.Response) (result Replication, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/version.go index e586a01ce796..6e3ee863831d 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/version.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/version.go @@ -14,16 +14,15 @@ package containerregistry // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v10.0.2-beta arm-containerregistry/2017-03-01" + return "Azure-SDK-For-Go/v11.1.0-beta arm-containerregistry/2017-10-01" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v10.0.2-beta" + return "v11.1.0-beta" } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/webhooks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/webhooks.go new file mode 100644 index 000000000000..ff5f9ce7844d --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/containerregistry/webhooks.go @@ -0,0 +1,875 @@ +package containerregistry + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// WebhooksClient is the client for the Webhooks methods of the Containerregistry service. +type WebhooksClient struct { + ManagementClient +} + +// NewWebhooksClient creates an instance of the WebhooksClient client. +func NewWebhooksClient(subscriptionID string) WebhooksClient { + return NewWebhooksClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWebhooksClientWithBaseURI creates an instance of the WebhooksClient client. +func NewWebhooksClientWithBaseURI(baseURI string, subscriptionID string) WebhooksClient { + return WebhooksClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a webhook for a container registry with the specified parameters. This method may poll for +// completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel +// polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. webhookName is the name of the webhook. webhookCreateParameters is the parameters +// for creating a webhook. +func (client WebhooksClient) Create(resourceGroupName string, registryName string, webhookName string, webhookCreateParameters WebhookCreateParameters, cancel <-chan struct{}) (<-chan Webhook, <-chan error) { + resultChan := make(chan Webhook, 1) + errChan := make(chan error, 1) + if err := validation.Validate([]validation.Validation{ + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookCreateParameters, + Constraints: []validation.Constraint{{Target: "webhookCreateParameters.Location", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "webhookCreateParameters.WebhookPropertiesCreateParameters", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "webhookCreateParameters.WebhookPropertiesCreateParameters.ServiceURI", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "webhookCreateParameters.WebhookPropertiesCreateParameters.Actions", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + errChan <- validation.NewErrorWithValidationError(err, "containerregistry.WebhooksClient", "Create") + close(errChan) + close(resultChan) + return resultChan, errChan + } + + go func() { + var err error + var result Webhook + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.CreatePreparer(resourceGroupName, registryName, webhookName, webhookCreateParameters, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Create", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// CreatePreparer prepares the Create request. +func (client WebhooksClient) CreatePreparer(resourceGroupName string, registryName string, webhookName string, webhookCreateParameters WebhookCreateParameters, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2017-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", pathParameters), + autorest.WithJSON(webhookCreateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client WebhooksClient) CreateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client WebhooksClient) CreateResponder(resp *http.Response) (result Webhook, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a webhook from a container registry. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. webhookName is the name of the webhook. +func (client WebhooksClient) Delete(resourceGroupName string, registryName string, webhookName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { + resultChan := make(chan autorest.Response, 1) + errChan := make(chan error, 1) + if err := validation.Validate([]validation.Validation{ + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + errChan <- validation.NewErrorWithValidationError(err, "containerregistry.WebhooksClient", "Delete") + close(errChan) + close(resultChan) + return resultChan, errChan + } + + go func() { + var err error + var result autorest.Response + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.DeletePreparer(resourceGroupName, registryName, webhookName, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Delete", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// DeletePreparer prepares the Delete request. +func (client WebhooksClient) DeletePreparer(resourceGroupName string, registryName string, webhookName string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2017-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client WebhooksClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client WebhooksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified webhook. +// +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. webhookName is the name of the webhook. +func (client WebhooksClient) Get(resourceGroupName string, registryName string, webhookName string) (result Webhook, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "containerregistry.WebhooksClient", "Get") + } + + req, err := client.GetPreparer(resourceGroupName, registryName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WebhooksClient) GetPreparer(resourceGroupName string, registryName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2017-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client WebhooksClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WebhooksClient) GetResponder(resp *http.Response) (result Webhook, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetCallbackConfig gets the configuration of service URI and custom headers for the webhook. +// +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. webhookName is the name of the webhook. +func (client WebhooksClient) GetCallbackConfig(resourceGroupName string, registryName string, webhookName string) (result CallbackConfig, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "containerregistry.WebhooksClient", "GetCallbackConfig") + } + + req, err := client.GetCallbackConfigPreparer(resourceGroupName, registryName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "GetCallbackConfig", nil, "Failure preparing request") + return + } + + resp, err := client.GetCallbackConfigSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "GetCallbackConfig", resp, "Failure sending request") + return + } + + result, err = client.GetCallbackConfigResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "GetCallbackConfig", resp, "Failure responding to request") + } + + return +} + +// GetCallbackConfigPreparer prepares the GetCallbackConfig request. +func (client WebhooksClient) GetCallbackConfigPreparer(resourceGroupName string, registryName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2017-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetCallbackConfigSender sends the GetCallbackConfig request. The method will close the +// http.Response Body if it receives an error. +func (client WebhooksClient) GetCallbackConfigSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetCallbackConfigResponder handles the response to the GetCallbackConfig request. The method always +// closes the http.Response Body. +func (client WebhooksClient) GetCallbackConfigResponder(resp *http.Response) (result CallbackConfig, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the webhooks for the specified container registry. +// +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. +func (client WebhooksClient) List(resourceGroupName string, registryName string) (result WebhookListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "containerregistry.WebhooksClient", "List") + } + + req, err := client.ListPreparer(resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WebhooksClient) ListPreparer(resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client WebhooksClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WebhooksClient) ListResponder(resp *http.Response) (result WebhookListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client WebhooksClient) ListNextResults(lastResults WebhookListResult) (result WebhookListResult, err error) { + req, err := lastResults.WebhookListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListComplete gets all elements from the list without paging. +func (client WebhooksClient) ListComplete(resourceGroupName string, registryName string, cancel <-chan struct{}) (<-chan Webhook, <-chan error) { + resultChan := make(chan Webhook) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName, registryName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListEvents lists recent events for the specified webhook. +// +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. webhookName is the name of the webhook. +func (client WebhooksClient) ListEvents(resourceGroupName string, registryName string, webhookName string) (result EventListResult, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "containerregistry.WebhooksClient", "ListEvents") + } + + req, err := client.ListEventsPreparer(resourceGroupName, registryName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "ListEvents", nil, "Failure preparing request") + return + } + + resp, err := client.ListEventsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "ListEvents", resp, "Failure sending request") + return + } + + result, err = client.ListEventsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "ListEvents", resp, "Failure responding to request") + } + + return +} + +// ListEventsPreparer prepares the ListEvents request. +func (client WebhooksClient) ListEventsPreparer(resourceGroupName string, registryName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2017-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListEventsSender sends the ListEvents request. The method will close the +// http.Response Body if it receives an error. +func (client WebhooksClient) ListEventsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListEventsResponder handles the response to the ListEvents request. The method always +// closes the http.Response Body. +func (client WebhooksClient) ListEventsResponder(resp *http.Response) (result EventListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListEventsNextResults retrieves the next set of results, if any. +func (client WebhooksClient) ListEventsNextResults(lastResults EventListResult) (result EventListResult, err error) { + req, err := lastResults.EventListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "ListEvents", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListEventsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "ListEvents", resp, "Failure sending next results request") + } + + result, err = client.ListEventsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "ListEvents", resp, "Failure responding to next results request") + } + + return +} + +// ListEventsComplete gets all elements from the list without paging. +func (client WebhooksClient) ListEventsComplete(resourceGroupName string, registryName string, webhookName string, cancel <-chan struct{}) (<-chan Event, <-chan error) { + resultChan := make(chan Event) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListEvents(resourceGroupName, registryName, webhookName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListEventsNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// Ping triggers a ping event to be sent to the webhook. +// +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. webhookName is the name of the webhook. +func (client WebhooksClient) Ping(resourceGroupName string, registryName string, webhookName string) (result EventInfo, err error) { + if err := validation.Validate([]validation.Validation{ + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewErrorWithValidationError(err, "containerregistry.WebhooksClient", "Ping") + } + + req, err := client.PingPreparer(resourceGroupName, registryName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Ping", nil, "Failure preparing request") + return + } + + resp, err := client.PingSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Ping", resp, "Failure sending request") + return + } + + result, err = client.PingResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Ping", resp, "Failure responding to request") + } + + return +} + +// PingPreparer prepares the Ping request. +func (client WebhooksClient) PingPreparer(resourceGroupName string, registryName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2017-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/ping", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// PingSender sends the Ping request. The method will close the +// http.Response Body if it receives an error. +func (client WebhooksClient) PingSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// PingResponder handles the response to the Ping request. The method always +// closes the http.Response Body. +func (client WebhooksClient) PingResponder(resp *http.Response) (result EventInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates a webhook with the specified parameters. This method may poll for completion. Polling can be canceled +// by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. +// +// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the +// name of the container registry. webhookName is the name of the webhook. webhookUpdateParameters is the parameters +// for updating a webhook. +func (client WebhooksClient) Update(resourceGroupName string, registryName string, webhookName string, webhookUpdateParameters WebhookUpdateParameters, cancel <-chan struct{}) (<-chan Webhook, <-chan error) { + resultChan := make(chan Webhook, 1) + errChan := make(chan error, 1) + if err := validation.Validate([]validation.Validation{ + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + errChan <- validation.NewErrorWithValidationError(err, "containerregistry.WebhooksClient", "Update") + close(errChan) + close(resultChan) + return resultChan, errChan + } + + go func() { + var err error + var result Webhook + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.UpdatePreparer(resourceGroupName, registryName, webhookName, webhookUpdateParameters, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Update", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// UpdatePreparer prepares the Update request. +func (client WebhooksClient) UpdatePreparer(resourceGroupName string, registryName string, webhookName string, webhookUpdateParameters WebhookUpdateParameters, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2017-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", pathParameters), + autorest.WithJSON(webhookUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client WebhooksClient) UpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client WebhooksClient) UpdateResponder(resp *http.Response) (result Webhook, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/disk/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/disk/version.go index a78b351a0e36..11c4a35ee9c3 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/disk/version.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/disk/version.go @@ -14,16 +14,15 @@ package disk // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator 1.1.0.0 +// Changes may cause incorrect behavior and will be lost if the code is regenerated. // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v10.0.2-beta arm-disk/2016-04-30-preview" + return "Azure-SDK-For-Go/v10.2.0-beta arm-disk/2016-04-30-preview" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v10.0.2-beta" + return "v10.2.0-beta" } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/applicationgateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/applicationgateways.go index 4ab4e0734905..c000be117bcd 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/applicationgateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/applicationgateways.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -25,31 +24,27 @@ import ( "net/http" ) -// ApplicationGatewaysClient is the composite Swagger for Network Client +// ApplicationGatewaysClient is the network Client type ApplicationGatewaysClient struct { ManagementClient } -// NewApplicationGatewaysClient creates an instance of the -// ApplicationGatewaysClient client. +// NewApplicationGatewaysClient creates an instance of the ApplicationGatewaysClient client. func NewApplicationGatewaysClient(subscriptionID string) ApplicationGatewaysClient { return NewApplicationGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewApplicationGatewaysClientWithBaseURI creates an instance of the -// ApplicationGatewaysClient client. +// NewApplicationGatewaysClientWithBaseURI creates an instance of the ApplicationGatewaysClient client. func NewApplicationGatewaysClientWithBaseURI(baseURI string, subscriptionID string) ApplicationGatewaysClient { return ApplicationGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} } -// BackendHealth gets the backend health of the specified application gateway -// in a resource group. This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used to -// cancel polling and any outstanding HTTP requests. +// BackendHealth gets the backend health of the specified application gateway in a resource group. This method may poll +// for completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel +// polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. applicationGatewayName -// is the name of the application gateway. expand is expands BackendAddressPool -// and BackendHttpSettings referenced in backend health. +// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application gateway. +// expand is expands BackendAddressPool and BackendHttpSettings referenced in backend health. func (client ApplicationGatewaysClient) BackendHealth(resourceGroupName string, applicationGatewayName string, expand string, cancel <-chan struct{}) (<-chan ApplicationGatewayBackendHealth, <-chan error) { resultChan := make(chan ApplicationGatewayBackendHealth, 1) errChan := make(chan error, 1) @@ -57,8 +52,10 @@ func (client ApplicationGatewaysClient) BackendHealth(resourceGroupName string, var err error var result ApplicationGatewayBackendHealth defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -91,7 +88,7 @@ func (client ApplicationGatewaysClient) BackendHealthPreparer(resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -128,14 +125,12 @@ func (client ApplicationGatewaysClient) BackendHealthResponder(resp *http.Respon return } -// CreateOrUpdate creates or updates the specified application gateway. This -// method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and any +// CreateOrUpdate creates or updates the specified application gateway. This method may poll for completion. Polling +// can be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any // outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. applicationGatewayName -// is the name of the application gateway. parameters is parameters supplied to -// the create or update application gateway operation. +// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application gateway. +// parameters is parameters supplied to the create or update application gateway operation. func (client ApplicationGatewaysClient) CreateOrUpdate(resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway, cancel <-chan struct{}) (<-chan ApplicationGateway, <-chan error) { resultChan := make(chan ApplicationGateway, 1) errChan := make(chan error, 1) @@ -158,8 +153,10 @@ func (client ApplicationGatewaysClient) CreateOrUpdate(resourceGroupName string, var err error var result ApplicationGateway defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -192,7 +189,7 @@ func (client ApplicationGatewaysClient) CreateOrUpdatePreparer(resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -228,13 +225,10 @@ func (client ApplicationGatewaysClient) CreateOrUpdateResponder(resp *http.Respo return } -// Delete deletes the specified application gateway. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// Delete deletes the specified application gateway. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. applicationGatewayName -// is the name of the application gateway. +// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application gateway. func (client ApplicationGatewaysClient) Delete(resourceGroupName string, applicationGatewayName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -242,8 +236,10 @@ func (client ApplicationGatewaysClient) Delete(resourceGroupName string, applica var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -276,7 +272,7 @@ func (client ApplicationGatewaysClient) DeletePreparer(resourceGroupName string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -311,8 +307,7 @@ func (client ApplicationGatewaysClient) DeleteResponder(resp *http.Response) (re // Get gets the specified application gateway. // -// resourceGroupName is the name of the resource group. applicationGatewayName -// is the name of the application gateway. +// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application gateway. func (client ApplicationGatewaysClient) Get(resourceGroupName string, applicationGatewayName string) (result ApplicationGateway, err error) { req, err := client.GetPreparer(resourceGroupName, applicationGatewayName) if err != nil { @@ -343,7 +338,7 @@ func (client ApplicationGatewaysClient) GetPreparer(resourceGroupName string, ap "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -375,6 +370,70 @@ func (client ApplicationGatewaysClient) GetResponder(resp *http.Response) (resul return } +// GetSslPredefinedPolicy gets Ssl predefined policy with the specified policy name. +// +// predefinedPolicyName is name of Ssl predefined policy. +func (client ApplicationGatewaysClient) GetSslPredefinedPolicy(predefinedPolicyName string) (result ApplicationGatewaySslPredefinedPolicy, err error) { + req, err := client.GetSslPredefinedPolicyPreparer(predefinedPolicyName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "GetSslPredefinedPolicy", nil, "Failure preparing request") + return + } + + resp, err := client.GetSslPredefinedPolicySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "GetSslPredefinedPolicy", resp, "Failure sending request") + return + } + + result, err = client.GetSslPredefinedPolicyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "GetSslPredefinedPolicy", resp, "Failure responding to request") + } + + return +} + +// GetSslPredefinedPolicyPreparer prepares the GetSslPredefinedPolicy request. +func (client ApplicationGatewaysClient) GetSslPredefinedPolicyPreparer(predefinedPolicyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "predefinedPolicyName": autorest.Encode("path", predefinedPolicyName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSslPredefinedPolicySender sends the GetSslPredefinedPolicy request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationGatewaysClient) GetSslPredefinedPolicySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetSslPredefinedPolicyResponder handles the response to the GetSslPredefinedPolicy request. The method always +// closes the http.Response Body. +func (client ApplicationGatewaysClient) GetSslPredefinedPolicyResponder(resp *http.Response) (result ApplicationGatewaySslPredefinedPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // List lists all application gateways in a resource group. // // resourceGroupName is the name of the resource group. @@ -407,7 +466,7 @@ func (client ApplicationGatewaysClient) ListPreparer(resourceGroupName string) ( "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -463,6 +522,51 @@ func (client ApplicationGatewaysClient) ListNextResults(lastResults ApplicationG return } +// ListComplete gets all elements from the list without paging. +func (client ApplicationGatewaysClient) ListComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan ApplicationGateway, <-chan error) { + resultChan := make(chan ApplicationGateway) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + // ListAll gets all the application gateways in a subscription. func (client ApplicationGatewaysClient) ListAll() (result ApplicationGatewayListResult, err error) { req, err := client.ListAllPreparer() @@ -492,7 +596,7 @@ func (client ApplicationGatewaysClient) ListAllPreparer() (*http.Request, error) "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -548,8 +652,243 @@ func (client ApplicationGatewaysClient) ListAllNextResults(lastResults Applicati return } -// ListAvailableWafRuleSets lists all available web application firewall rule -// sets. +// ListAllComplete gets all elements from the list without paging. +func (client ApplicationGatewaysClient) ListAllComplete(cancel <-chan struct{}) (<-chan ApplicationGateway, <-chan error) { + resultChan := make(chan ApplicationGateway) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListAll() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListAllNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListAvailableSslOptions lists available Ssl options for configuring Ssl policy. +func (client ApplicationGatewaysClient) ListAvailableSslOptions() (result ApplicationGatewayAvailableSslOptions, err error) { + req, err := client.ListAvailableSslOptionsPreparer() + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslOptions", nil, "Failure preparing request") + return + } + + resp, err := client.ListAvailableSslOptionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslOptions", resp, "Failure sending request") + return + } + + result, err = client.ListAvailableSslOptionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslOptions", resp, "Failure responding to request") + } + + return +} + +// ListAvailableSslOptionsPreparer prepares the ListAvailableSslOptions request. +func (client ApplicationGatewaysClient) ListAvailableSslOptionsPreparer() (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListAvailableSslOptionsSender sends the ListAvailableSslOptions request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationGatewaysClient) ListAvailableSslOptionsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListAvailableSslOptionsResponder handles the response to the ListAvailableSslOptions request. The method always +// closes the http.Response Body. +func (client ApplicationGatewaysClient) ListAvailableSslOptionsResponder(resp *http.Response) (result ApplicationGatewayAvailableSslOptions, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListAvailableSslPredefinedPolicies lists all SSL predefined policies for configuring Ssl policy. +func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPolicies() (result ApplicationGatewayAvailableSslPredefinedPolicies, err error) { + req, err := client.ListAvailableSslPredefinedPoliciesPreparer() + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslPredefinedPolicies", nil, "Failure preparing request") + return + } + + resp, err := client.ListAvailableSslPredefinedPoliciesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslPredefinedPolicies", resp, "Failure sending request") + return + } + + result, err = client.ListAvailableSslPredefinedPoliciesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslPredefinedPolicies", resp, "Failure responding to request") + } + + return +} + +// ListAvailableSslPredefinedPoliciesPreparer prepares the ListAvailableSslPredefinedPolicies request. +func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesPreparer() (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListAvailableSslPredefinedPoliciesSender sends the ListAvailableSslPredefinedPolicies request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListAvailableSslPredefinedPoliciesResponder handles the response to the ListAvailableSslPredefinedPolicies request. The method always +// closes the http.Response Body. +func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesResponder(resp *http.Response) (result ApplicationGatewayAvailableSslPredefinedPolicies, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListAvailableSslPredefinedPoliciesNextResults retrieves the next set of results, if any. +func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesNextResults(lastResults ApplicationGatewayAvailableSslPredefinedPolicies) (result ApplicationGatewayAvailableSslPredefinedPolicies, err error) { + req, err := lastResults.ApplicationGatewayAvailableSslPredefinedPoliciesPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslPredefinedPolicies", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListAvailableSslPredefinedPoliciesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslPredefinedPolicies", resp, "Failure sending next results request") + } + + result, err = client.ListAvailableSslPredefinedPoliciesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationGatewaysClient", "ListAvailableSslPredefinedPolicies", resp, "Failure responding to next results request") + } + + return +} + +// ListAvailableSslPredefinedPoliciesComplete gets all elements from the list without paging. +func (client ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesComplete(cancel <-chan struct{}) (<-chan ApplicationGatewaySslPredefinedPolicy, <-chan error) { + resultChan := make(chan ApplicationGatewaySslPredefinedPolicy) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListAvailableSslPredefinedPolicies() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListAvailableSslPredefinedPoliciesNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListAvailableWafRuleSets lists all available web application firewall rule sets. func (client ApplicationGatewaysClient) ListAvailableWafRuleSets() (result ApplicationGatewayAvailableWafRuleSetsResult, err error) { req, err := client.ListAvailableWafRuleSetsPreparer() if err != nil { @@ -578,7 +917,7 @@ func (client ApplicationGatewaysClient) ListAvailableWafRuleSetsPreparer() (*htt "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -610,13 +949,10 @@ func (client ApplicationGatewaysClient) ListAvailableWafRuleSetsResponder(resp * return } -// Start starts the specified application gateway. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// Start starts the specified application gateway. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. applicationGatewayName -// is the name of the application gateway. +// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application gateway. func (client ApplicationGatewaysClient) Start(resourceGroupName string, applicationGatewayName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -624,8 +960,10 @@ func (client ApplicationGatewaysClient) Start(resourceGroupName string, applicat var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -658,7 +996,7 @@ func (client ApplicationGatewaysClient) StartPreparer(resourceGroupName string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -691,13 +1029,11 @@ func (client ApplicationGatewaysClient) StartResponder(resp *http.Response) (res return } -// Stop stops the specified application gateway in a resource group. This -// method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and any -// outstanding HTTP requests. +// Stop stops the specified application gateway in a resource group. This method may poll for completion. Polling can +// be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // -// resourceGroupName is the name of the resource group. applicationGatewayName -// is the name of the application gateway. +// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application gateway. func (client ApplicationGatewaysClient) Stop(resourceGroupName string, applicationGatewayName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -705,8 +1041,10 @@ func (client ApplicationGatewaysClient) Stop(resourceGroupName string, applicati var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -739,7 +1077,7 @@ func (client ApplicationGatewaysClient) StopPreparer(resourceGroupName string, a "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/applicationsecuritygroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/applicationsecuritygroups.go new file mode 100644 index 000000000000..1e84e706466f --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/applicationsecuritygroups.go @@ -0,0 +1,535 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// ApplicationSecurityGroupsClient is the network Client +type ApplicationSecurityGroupsClient struct { + ManagementClient +} + +// NewApplicationSecurityGroupsClient creates an instance of the ApplicationSecurityGroupsClient client. +func NewApplicationSecurityGroupsClient(subscriptionID string) ApplicationSecurityGroupsClient { + return NewApplicationSecurityGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewApplicationSecurityGroupsClientWithBaseURI creates an instance of the ApplicationSecurityGroupsClient client. +func NewApplicationSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string) ApplicationSecurityGroupsClient { + return ApplicationSecurityGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an application security group. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. +// +// resourceGroupName is the name of the resource group. applicationSecurityGroupName is the name of the application +// security group. parameters is parameters supplied to the create or update ApplicationSecurityGroup operation. +func (client ApplicationSecurityGroupsClient) CreateOrUpdate(resourceGroupName string, applicationSecurityGroupName string, parameters ApplicationSecurityGroup, cancel <-chan struct{}) (<-chan ApplicationSecurityGroup, <-chan error) { + resultChan := make(chan ApplicationSecurityGroup, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result ApplicationSecurityGroup + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.CreateOrUpdatePreparer(resourceGroupName, applicationSecurityGroupName, parameters, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ApplicationSecurityGroupsClient) CreateOrUpdatePreparer(resourceGroupName string, applicationSecurityGroupName string, parameters ApplicationSecurityGroup, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationSecurityGroupName": autorest.Encode("path", applicationSecurityGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationSecurityGroupsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ApplicationSecurityGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ApplicationSecurityGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified application security group. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. +// +// resourceGroupName is the name of the resource group. applicationSecurityGroupName is the name of the application +// security group. +func (client ApplicationSecurityGroupsClient) Delete(resourceGroupName string, applicationSecurityGroupName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { + resultChan := make(chan autorest.Response, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result autorest.Response + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.DeletePreparer(resourceGroupName, applicationSecurityGroupName, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "Delete", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// DeletePreparer prepares the Delete request. +func (client ApplicationSecurityGroupsClient) DeletePreparer(resourceGroupName string, applicationSecurityGroupName string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationSecurityGroupName": autorest.Encode("path", applicationSecurityGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationSecurityGroupsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ApplicationSecurityGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets information about the specified application security group. +// +// resourceGroupName is the name of the resource group. applicationSecurityGroupName is the name of the application +// security group. +func (client ApplicationSecurityGroupsClient) Get(resourceGroupName string, applicationSecurityGroupName string) (result ApplicationSecurityGroup, err error) { + req, err := client.GetPreparer(resourceGroupName, applicationSecurityGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ApplicationSecurityGroupsClient) GetPreparer(resourceGroupName string, applicationSecurityGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationSecurityGroupName": autorest.Encode("path", applicationSecurityGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationSecurityGroupsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ApplicationSecurityGroupsClient) GetResponder(resp *http.Response) (result ApplicationSecurityGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets all the application security groups in a resource group. +// +// resourceGroupName is the name of the resource group. +func (client ApplicationSecurityGroupsClient) List(resourceGroupName string) (result ApplicationSecurityGroupListResult, err error) { + req, err := client.ListPreparer(resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ApplicationSecurityGroupsClient) ListPreparer(resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationSecurityGroupsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ApplicationSecurityGroupsClient) ListResponder(resp *http.Response) (result ApplicationSecurityGroupListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client ApplicationSecurityGroupsClient) ListNextResults(lastResults ApplicationSecurityGroupListResult) (result ApplicationSecurityGroupListResult, err error) { + req, err := lastResults.ApplicationSecurityGroupListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListComplete gets all elements from the list without paging. +func (client ApplicationSecurityGroupsClient) ListComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan ApplicationSecurityGroup, <-chan error) { + resultChan := make(chan ApplicationSecurityGroup) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListAll gets all application security groups in a subscription. +func (client ApplicationSecurityGroupsClient) ListAll() (result ApplicationSecurityGroupListResult, err error) { + req, err := client.ListAllPreparer() + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "ListAll", nil, "Failure preparing request") + return + } + + resp, err := client.ListAllSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "ListAll", resp, "Failure sending request") + return + } + + result, err = client.ListAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "ListAll", resp, "Failure responding to request") + } + + return +} + +// ListAllPreparer prepares the ListAll request. +func (client ApplicationSecurityGroupsClient) ListAllPreparer() (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationSecurityGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListAllSender sends the ListAll request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationSecurityGroupsClient) ListAllSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListAllResponder handles the response to the ListAll request. The method always +// closes the http.Response Body. +func (client ApplicationSecurityGroupsClient) ListAllResponder(resp *http.Response) (result ApplicationSecurityGroupListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListAllNextResults retrieves the next set of results, if any. +func (client ApplicationSecurityGroupsClient) ListAllNextResults(lastResults ApplicationSecurityGroupListResult) (result ApplicationSecurityGroupListResult, err error) { + req, err := lastResults.ApplicationSecurityGroupListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "ListAll", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListAllSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "ListAll", resp, "Failure sending next results request") + } + + result, err = client.ListAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.ApplicationSecurityGroupsClient", "ListAll", resp, "Failure responding to next results request") + } + + return +} + +// ListAllComplete gets all elements from the list without paging. +func (client ApplicationSecurityGroupsClient) ListAllComplete(cancel <-chan struct{}) (<-chan ApplicationSecurityGroup, <-chan error) { + resultChan := make(chan ApplicationSecurityGroup) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListAll() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListAllNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/availableendpointservices.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/availableendpointservices.go new file mode 100644 index 000000000000..26bcaf8b647c --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/availableendpointservices.go @@ -0,0 +1,172 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// AvailableEndpointServicesClient is the network Client +type AvailableEndpointServicesClient struct { + ManagementClient +} + +// NewAvailableEndpointServicesClient creates an instance of the AvailableEndpointServicesClient client. +func NewAvailableEndpointServicesClient(subscriptionID string) AvailableEndpointServicesClient { + return NewAvailableEndpointServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAvailableEndpointServicesClientWithBaseURI creates an instance of the AvailableEndpointServicesClient client. +func NewAvailableEndpointServicesClientWithBaseURI(baseURI string, subscriptionID string) AvailableEndpointServicesClient { + return AvailableEndpointServicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List list what values of endpoint services are available for use. +// +// location is the location to check available endpoint services. +func (client AvailableEndpointServicesClient) List(location string) (result EndpointServicesListResult, err error) { + req, err := client.ListPreparer(location) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AvailableEndpointServicesClient) ListPreparer(location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/virtualNetworkAvailableEndpointServices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AvailableEndpointServicesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AvailableEndpointServicesClient) ListResponder(resp *http.Response) (result EndpointServicesListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client AvailableEndpointServicesClient) ListNextResults(lastResults EndpointServicesListResult) (result EndpointServicesListResult, err error) { + req, err := lastResults.EndpointServicesListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.AvailableEndpointServicesClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListComplete gets all elements from the list without paging. +func (client AvailableEndpointServicesClient) ListComplete(location string, cancel <-chan struct{}) (<-chan EndpointServiceResult, <-chan error) { + resultChan := make(chan EndpointServiceResult) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(location) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/bgpservicecommunities.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/bgpservicecommunities.go index 5024f5164965..10cfa2cdd558 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/bgpservicecommunities.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/bgpservicecommunities.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,19 +23,17 @@ import ( "net/http" ) -// BgpServiceCommunitiesClient is the composite Swagger for Network Client +// BgpServiceCommunitiesClient is the network Client type BgpServiceCommunitiesClient struct { ManagementClient } -// NewBgpServiceCommunitiesClient creates an instance of the -// BgpServiceCommunitiesClient client. +// NewBgpServiceCommunitiesClient creates an instance of the BgpServiceCommunitiesClient client. func NewBgpServiceCommunitiesClient(subscriptionID string) BgpServiceCommunitiesClient { return NewBgpServiceCommunitiesClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewBgpServiceCommunitiesClientWithBaseURI creates an instance of the -// BgpServiceCommunitiesClient client. +// NewBgpServiceCommunitiesClientWithBaseURI creates an instance of the BgpServiceCommunitiesClient client. func NewBgpServiceCommunitiesClientWithBaseURI(baseURI string, subscriptionID string) BgpServiceCommunitiesClient { return BgpServiceCommunitiesClient{NewWithBaseURI(baseURI, subscriptionID)} } @@ -70,7 +67,7 @@ func (client BgpServiceCommunitiesClient) ListPreparer() (*http.Request, error) "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -125,3 +122,48 @@ func (client BgpServiceCommunitiesClient) ListNextResults(lastResults BgpService return } + +// ListComplete gets all elements from the list without paging. +func (client BgpServiceCommunitiesClient) ListComplete(cancel <-chan struct{}) (<-chan BgpServiceCommunity, <-chan error) { + resultChan := make(chan BgpServiceCommunity) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/client.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/client.go index ec5bf7ced542..a3576c393aa9 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/client.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/client.go @@ -1,6 +1,6 @@ // Package network implements the Azure ARM Network service API version . // -// Composite Swagger for Network Client +// Network Client package network // Copyright (c) Microsoft and contributors. All rights reserved. @@ -17,9 +17,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -53,12 +52,10 @@ func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient { } } -// CheckDNSNameAvailability checks whether a domain name in the cloudapp.net -// zone is available for use. +// CheckDNSNameAvailability checks whether a domain name in the cloudapp.azure.com zone is available for use. // -// location is the location of the domain name. domainNameLabel is the domain -// name to be verified. It must conform to the following regular expression: -// ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. +// location is the location of the domain name. domainNameLabel is the domain name to be verified. It must conform to +// the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. func (client ManagementClient) CheckDNSNameAvailability(location string, domainNameLabel string) (result DNSNameAvailabilityResult, err error) { req, err := client.CheckDNSNameAvailabilityPreparer(location, domainNameLabel) if err != nil { @@ -88,12 +85,10 @@ func (client ManagementClient) CheckDNSNameAvailabilityPreparer(location string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - if len(domainNameLabel) > 0 { - queryParameters["domainNameLabel"] = autorest.Encode("query", domainNameLabel) + "api-version": APIVersion, + "domainNameLabel": autorest.Encode("query", domainNameLabel), } preparer := autorest.CreatePreparer( diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/defaultsecurityrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/defaultsecurityrules.go new file mode 100644 index 000000000000..9a3ded19d5c2 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/defaultsecurityrules.go @@ -0,0 +1,241 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// DefaultSecurityRulesClient is the network Client +type DefaultSecurityRulesClient struct { + ManagementClient +} + +// NewDefaultSecurityRulesClient creates an instance of the DefaultSecurityRulesClient client. +func NewDefaultSecurityRulesClient(subscriptionID string) DefaultSecurityRulesClient { + return NewDefaultSecurityRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDefaultSecurityRulesClientWithBaseURI creates an instance of the DefaultSecurityRulesClient client. +func NewDefaultSecurityRulesClientWithBaseURI(baseURI string, subscriptionID string) DefaultSecurityRulesClient { + return DefaultSecurityRulesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get the specified default network security rule. +// +// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network security +// group. defaultSecurityRuleName is the name of the default security rule. +func (client DefaultSecurityRulesClient) Get(resourceGroupName string, networkSecurityGroupName string, defaultSecurityRuleName string) (result SecurityRule, err error) { + req, err := client.GetPreparer(resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DefaultSecurityRulesClient) GetPreparer(resourceGroupName string, networkSecurityGroupName string, defaultSecurityRuleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "defaultSecurityRuleName": autorest.Encode("path", defaultSecurityRuleName), + "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules/{defaultSecurityRuleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DefaultSecurityRulesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DefaultSecurityRulesClient) GetResponder(resp *http.Response) (result SecurityRule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets all default security rules in a network security group. +// +// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network security +// group. +func (client DefaultSecurityRulesClient) List(resourceGroupName string, networkSecurityGroupName string) (result SecurityRuleListResult, err error) { + req, err := client.ListPreparer(resourceGroupName, networkSecurityGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client DefaultSecurityRulesClient) ListPreparer(resourceGroupName string, networkSecurityGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/defaultSecurityRules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client DefaultSecurityRulesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client DefaultSecurityRulesClient) ListResponder(resp *http.Response) (result SecurityRuleListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client DefaultSecurityRulesClient) ListNextResults(lastResults SecurityRuleListResult) (result SecurityRuleListResult, err error) { + req, err := lastResults.SecurityRuleListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.DefaultSecurityRulesClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListComplete gets all elements from the list without paging. +func (client DefaultSecurityRulesClient) ListComplete(resourceGroupName string, networkSecurityGroupName string, cancel <-chan struct{}) (<-chan SecurityRule, <-chan error) { + resultChan := make(chan SecurityRule) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName, networkSecurityGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitauthorizations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitauthorizations.go index feb974fb97ca..9b7fd524e73c 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitauthorizations.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitauthorizations.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,33 +23,30 @@ import ( "net/http" ) -// ExpressRouteCircuitAuthorizationsClient is the composite Swagger for Network -// Client +// ExpressRouteCircuitAuthorizationsClient is the network Client type ExpressRouteCircuitAuthorizationsClient struct { ManagementClient } -// NewExpressRouteCircuitAuthorizationsClient creates an instance of the -// ExpressRouteCircuitAuthorizationsClient client. +// NewExpressRouteCircuitAuthorizationsClient creates an instance of the ExpressRouteCircuitAuthorizationsClient +// client. func NewExpressRouteCircuitAuthorizationsClient(subscriptionID string) ExpressRouteCircuitAuthorizationsClient { return NewExpressRouteCircuitAuthorizationsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewExpressRouteCircuitAuthorizationsClientWithBaseURI creates an instance of -// the ExpressRouteCircuitAuthorizationsClient client. +// NewExpressRouteCircuitAuthorizationsClientWithBaseURI creates an instance of the +// ExpressRouteCircuitAuthorizationsClient client. func NewExpressRouteCircuitAuthorizationsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitAuthorizationsClient { return ExpressRouteCircuitAuthorizationsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates an authorization in the specified express -// route circuit. This method may poll for completion. Polling can be canceled -// by passing the cancel channel argument. The channel will be used to cancel +// CreateOrUpdate creates or updates an authorization in the specified express route circuit. This method may poll for +// completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel // polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. circuitName is the name -// of the express route circuit. authorizationName is the name of the -// authorization. authorizationParameters is parameters supplied to the create -// or update express route circuit authorization operation. +// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. +// authorizationName is the name of the authorization. authorizationParameters is parameters supplied to the create or +// update express route circuit authorization operation. func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization, cancel <-chan struct{}) (<-chan ExpressRouteCircuitAuthorization, <-chan error) { resultChan := make(chan ExpressRouteCircuitAuthorization, 1) errChan := make(chan error, 1) @@ -58,8 +54,10 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(resourceGro var err error var result ExpressRouteCircuitAuthorization defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -93,7 +91,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdatePreparer(res "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -129,14 +127,12 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateResponder(re return } -// Delete deletes the specified authorization from the specified express route -// circuit. This method may poll for completion. Polling can be canceled by -// passing the cancel channel argument. The channel will be used to cancel +// Delete deletes the specified authorization from the specified express route circuit. This method may poll for +// completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel // polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. circuitName is the name -// of the express route circuit. authorizationName is the name of the -// authorization. +// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. +// authorizationName is the name of the authorization. func (client ExpressRouteCircuitAuthorizationsClient) Delete(resourceGroupName string, circuitName string, authorizationName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -144,8 +140,10 @@ func (client ExpressRouteCircuitAuthorizationsClient) Delete(resourceGroupName s var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -179,7 +177,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) DeletePreparer(resourceGro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -212,12 +210,10 @@ func (client ExpressRouteCircuitAuthorizationsClient) DeleteResponder(resp *http return } -// Get gets the specified authorization from the specified express route -// circuit. +// Get gets the specified authorization from the specified express route circuit. // -// resourceGroupName is the name of the resource group. circuitName is the name -// of the express route circuit. authorizationName is the name of the -// authorization. +// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. +// authorizationName is the name of the authorization. func (client ExpressRouteCircuitAuthorizationsClient) Get(resourceGroupName string, circuitName string, authorizationName string) (result ExpressRouteCircuitAuthorization, err error) { req, err := client.GetPreparer(resourceGroupName, circuitName, authorizationName) if err != nil { @@ -249,7 +245,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) GetPreparer(resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -283,8 +279,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) GetResponder(resp *http.Re // List gets all authorizations in an express route circuit. // -// resourceGroupName is the name of the resource group. circuitName is the name -// of the circuit. +// resourceGroupName is the name of the resource group. circuitName is the name of the circuit. func (client ExpressRouteCircuitAuthorizationsClient) List(resourceGroupName string, circuitName string) (result AuthorizationListResult, err error) { req, err := client.ListPreparer(resourceGroupName, circuitName) if err != nil { @@ -315,7 +310,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) ListPreparer(resourceGroup "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -370,3 +365,48 @@ func (client ExpressRouteCircuitAuthorizationsClient) ListNextResults(lastResult return } + +// ListComplete gets all elements from the list without paging. +func (client ExpressRouteCircuitAuthorizationsClient) ListComplete(resourceGroupName string, circuitName string, cancel <-chan struct{}) (<-chan ExpressRouteCircuitAuthorization, <-chan error) { + resultChan := make(chan ExpressRouteCircuitAuthorization) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName, circuitName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitpeerings.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitpeerings.go index 28b926f24438..af9fc67e0394 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitpeerings.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuitpeerings.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,32 +23,27 @@ import ( "net/http" ) -// ExpressRouteCircuitPeeringsClient is the composite Swagger for Network -// Client +// ExpressRouteCircuitPeeringsClient is the network Client type ExpressRouteCircuitPeeringsClient struct { ManagementClient } -// NewExpressRouteCircuitPeeringsClient creates an instance of the -// ExpressRouteCircuitPeeringsClient client. +// NewExpressRouteCircuitPeeringsClient creates an instance of the ExpressRouteCircuitPeeringsClient client. func NewExpressRouteCircuitPeeringsClient(subscriptionID string) ExpressRouteCircuitPeeringsClient { return NewExpressRouteCircuitPeeringsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewExpressRouteCircuitPeeringsClientWithBaseURI creates an instance of the -// ExpressRouteCircuitPeeringsClient client. +// NewExpressRouteCircuitPeeringsClientWithBaseURI creates an instance of the ExpressRouteCircuitPeeringsClient client. func NewExpressRouteCircuitPeeringsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitPeeringsClient { return ExpressRouteCircuitPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a peering in the specified express route -// circuits. This method may poll for completion. Polling can be canceled by -// passing the cancel channel argument. The channel will be used to cancel +// CreateOrUpdate creates or updates a peering in the specified express route circuits. This method may poll for +// completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel // polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. circuitName is the name -// of the express route circuit. peeringName is the name of the peering. -// peeringParameters is parameters supplied to the create or update express +// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. +// peeringName is the name of the peering. peeringParameters is parameters supplied to the create or update express // route circuit peering operation. func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering, cancel <-chan struct{}) (<-chan ExpressRouteCircuitPeering, <-chan error) { resultChan := make(chan ExpressRouteCircuitPeering, 1) @@ -58,8 +52,10 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(resourceGroupName var err error var result ExpressRouteCircuitPeering defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -93,7 +89,7 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdatePreparer(resourceG "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -129,13 +125,12 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateResponder(resp *ht return } -// Delete deletes the specified peering from the specified express route -// circuit. This method may poll for completion. Polling can be canceled by -// passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// Delete deletes the specified peering from the specified express route circuit. This method may poll for completion. +// Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any +// outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. circuitName is the name -// of the express route circuit. peeringName is the name of the peering. +// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. +// peeringName is the name of the peering. func (client ExpressRouteCircuitPeeringsClient) Delete(resourceGroupName string, circuitName string, peeringName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -143,8 +138,10 @@ func (client ExpressRouteCircuitPeeringsClient) Delete(resourceGroupName string, var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -178,7 +175,7 @@ func (client ExpressRouteCircuitPeeringsClient) DeletePreparer(resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -211,11 +208,10 @@ func (client ExpressRouteCircuitPeeringsClient) DeleteResponder(resp *http.Respo return } -// Get gets the specified authorization from the specified express route -// circuit. +// Get gets the specified authorization from the specified express route circuit. // -// resourceGroupName is the name of the resource group. circuitName is the name -// of the express route circuit. peeringName is the name of the peering. +// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. +// peeringName is the name of the peering. func (client ExpressRouteCircuitPeeringsClient) Get(resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitPeering, err error) { req, err := client.GetPreparer(resourceGroupName, circuitName, peeringName) if err != nil { @@ -247,7 +243,7 @@ func (client ExpressRouteCircuitPeeringsClient) GetPreparer(resourceGroupName st "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -281,8 +277,7 @@ func (client ExpressRouteCircuitPeeringsClient) GetResponder(resp *http.Response // List gets all peerings in a specified express route circuit. // -// resourceGroupName is the name of the resource group. circuitName is the name -// of the express route circuit. +// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. func (client ExpressRouteCircuitPeeringsClient) List(resourceGroupName string, circuitName string) (result ExpressRouteCircuitPeeringListResult, err error) { req, err := client.ListPreparer(resourceGroupName, circuitName) if err != nil { @@ -313,7 +308,7 @@ func (client ExpressRouteCircuitPeeringsClient) ListPreparer(resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -368,3 +363,48 @@ func (client ExpressRouteCircuitPeeringsClient) ListNextResults(lastResults Expr return } + +// ListComplete gets all elements from the list without paging. +func (client ExpressRouteCircuitPeeringsClient) ListComplete(resourceGroupName string, circuitName string, cancel <-chan struct{}) (<-chan ExpressRouteCircuitPeering, <-chan error) { + resultChan := make(chan ExpressRouteCircuitPeering) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName, circuitName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuits.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuits.go index b60aa10a4e94..63cfeff9e0a1 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuits.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressroutecircuits.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,31 +23,27 @@ import ( "net/http" ) -// ExpressRouteCircuitsClient is the composite Swagger for Network Client +// ExpressRouteCircuitsClient is the network Client type ExpressRouteCircuitsClient struct { ManagementClient } -// NewExpressRouteCircuitsClient creates an instance of the -// ExpressRouteCircuitsClient client. +// NewExpressRouteCircuitsClient creates an instance of the ExpressRouteCircuitsClient client. func NewExpressRouteCircuitsClient(subscriptionID string) ExpressRouteCircuitsClient { return NewExpressRouteCircuitsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewExpressRouteCircuitsClientWithBaseURI creates an instance of the -// ExpressRouteCircuitsClient client. +// NewExpressRouteCircuitsClientWithBaseURI creates an instance of the ExpressRouteCircuitsClient client. func NewExpressRouteCircuitsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitsClient { return ExpressRouteCircuitsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates an express route circuit. This method may -// poll for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// CreateOrUpdate creates or updates an express route circuit. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. // -// resourceGroupName is the name of the resource group. circuitName is the name -// of the circuit. parameters is parameters supplied to the create or update -// express route circuit operation. +// resourceGroupName is the name of the resource group. circuitName is the name of the circuit. parameters is +// parameters supplied to the create or update express route circuit operation. func (client ExpressRouteCircuitsClient) CreateOrUpdate(resourceGroupName string, circuitName string, parameters ExpressRouteCircuit, cancel <-chan struct{}) (<-chan ExpressRouteCircuit, <-chan error) { resultChan := make(chan ExpressRouteCircuit, 1) errChan := make(chan error, 1) @@ -56,8 +51,10 @@ func (client ExpressRouteCircuitsClient) CreateOrUpdate(resourceGroupName string var err error var result ExpressRouteCircuit defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -90,7 +87,7 @@ func (client ExpressRouteCircuitsClient) CreateOrUpdatePreparer(resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -126,13 +123,10 @@ func (client ExpressRouteCircuitsClient) CreateOrUpdateResponder(resp *http.Resp return } -// Delete deletes the specified express route circuit. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// Delete deletes the specified express route circuit. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. circuitName is the name -// of the express route circuit. +// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. func (client ExpressRouteCircuitsClient) Delete(resourceGroupName string, circuitName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -140,8 +134,10 @@ func (client ExpressRouteCircuitsClient) Delete(resourceGroupName string, circui var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -174,7 +170,7 @@ func (client ExpressRouteCircuitsClient) DeletePreparer(resourceGroupName string "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -209,8 +205,7 @@ func (client ExpressRouteCircuitsClient) DeleteResponder(resp *http.Response) (r // Get gets information about the specified express route circuit. // -// resourceGroupName is the name of the resource group. circuitName is the name -// of express route circuit. +// resourceGroupName is the name of the resource group. circuitName is the name of express route circuit. func (client ExpressRouteCircuitsClient) Get(resourceGroupName string, circuitName string) (result ExpressRouteCircuit, err error) { req, err := client.GetPreparer(resourceGroupName, circuitName) if err != nil { @@ -241,7 +236,7 @@ func (client ExpressRouteCircuitsClient) GetPreparer(resourceGroupName string, c "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -273,11 +268,10 @@ func (client ExpressRouteCircuitsClient) GetResponder(resp *http.Response) (resu return } -// GetPeeringStats gets all stats from an express route circuit in a resource -// group. +// GetPeeringStats gets all stats from an express route circuit in a resource group. // -// resourceGroupName is the name of the resource group. circuitName is the name -// of the express route circuit. peeringName is the name of the peering. +// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. +// peeringName is the name of the peering. func (client ExpressRouteCircuitsClient) GetPeeringStats(resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitStats, err error) { req, err := client.GetPeeringStatsPreparer(resourceGroupName, circuitName, peeringName) if err != nil { @@ -309,7 +303,7 @@ func (client ExpressRouteCircuitsClient) GetPeeringStatsPreparer(resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -341,11 +335,9 @@ func (client ExpressRouteCircuitsClient) GetPeeringStatsResponder(resp *http.Res return } -// GetStats gets all the stats from an express route circuit in a resource -// group. +// GetStats gets all the stats from an express route circuit in a resource group. // -// resourceGroupName is the name of the resource group. circuitName is the name -// of the express route circuit. +// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. func (client ExpressRouteCircuitsClient) GetStats(resourceGroupName string, circuitName string) (result ExpressRouteCircuitStats, err error) { req, err := client.GetStatsPreparer(resourceGroupName, circuitName) if err != nil { @@ -376,7 +368,7 @@ func (client ExpressRouteCircuitsClient) GetStatsPreparer(resourceGroupName stri "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -440,7 +432,7 @@ func (client ExpressRouteCircuitsClient) ListPreparer(resourceGroupName string) "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -496,6 +488,51 @@ func (client ExpressRouteCircuitsClient) ListNextResults(lastResults ExpressRout return } +// ListComplete gets all elements from the list without paging. +func (client ExpressRouteCircuitsClient) ListComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan ExpressRouteCircuit, <-chan error) { + resultChan := make(chan ExpressRouteCircuit) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + // ListAll gets all the express route circuits in a subscription. func (client ExpressRouteCircuitsClient) ListAll() (result ExpressRouteCircuitListResult, err error) { req, err := client.ListAllPreparer() @@ -525,7 +562,7 @@ func (client ExpressRouteCircuitsClient) ListAllPreparer() (*http.Request, error "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -581,15 +618,57 @@ func (client ExpressRouteCircuitsClient) ListAllNextResults(lastResults ExpressR return } -// ListArpTable gets the currently advertised ARP table associated with the -// express route circuit in a resource group. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// ListAllComplete gets all elements from the list without paging. +func (client ExpressRouteCircuitsClient) ListAllComplete(cancel <-chan struct{}) (<-chan ExpressRouteCircuit, <-chan error) { + resultChan := make(chan ExpressRouteCircuit) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListAll() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListAllNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListArpTable gets the currently advertised ARP table associated with the express route circuit in a resource group. +// This method may poll for completion. Polling can be canceled by passing the cancel channel argument. The channel +// will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. circuitName is the name -// of the express route circuit. peeringName is the name of the peering. -// devicePath is the path of the device. +// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. +// peeringName is the name of the peering. devicePath is the path of the device. func (client ExpressRouteCircuitsClient) ListArpTable(resourceGroupName string, circuitName string, peeringName string, devicePath string, cancel <-chan struct{}) (<-chan ExpressRouteCircuitsArpTableListResult, <-chan error) { resultChan := make(chan ExpressRouteCircuitsArpTableListResult, 1) errChan := make(chan error, 1) @@ -597,8 +676,10 @@ func (client ExpressRouteCircuitsClient) ListArpTable(resourceGroupName string, var err error var result ExpressRouteCircuitsArpTableListResult defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -633,7 +714,7 @@ func (client ExpressRouteCircuitsClient) ListArpTablePreparer(resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -667,15 +748,12 @@ func (client ExpressRouteCircuitsClient) ListArpTableResponder(resp *http.Respon return } -// ListRoutesTable gets the currently advertised routes table associated with -// the express route circuit in a resource group. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// ListRoutesTable gets the currently advertised routes table associated with the express route circuit in a resource +// group. This method may poll for completion. Polling can be canceled by passing the cancel channel argument. The +// channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. circuitName is the name -// of the express route circuit. peeringName is the name of the peering. -// devicePath is the path of the device. +// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. +// peeringName is the name of the peering. devicePath is the path of the device. func (client ExpressRouteCircuitsClient) ListRoutesTable(resourceGroupName string, circuitName string, peeringName string, devicePath string, cancel <-chan struct{}) (<-chan ExpressRouteCircuitsRoutesTableListResult, <-chan error) { resultChan := make(chan ExpressRouteCircuitsRoutesTableListResult, 1) errChan := make(chan error, 1) @@ -683,8 +761,10 @@ func (client ExpressRouteCircuitsClient) ListRoutesTable(resourceGroupName strin var err error var result ExpressRouteCircuitsRoutesTableListResult defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -719,7 +799,7 @@ func (client ExpressRouteCircuitsClient) ListRoutesTablePreparer(resourceGroupNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -753,15 +833,12 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableResponder(resp *http.Res return } -// ListRoutesTableSummary gets the currently advertised routes table summary -// associated with the express route circuit in a resource group. This method -// may poll for completion. Polling can be canceled by passing the cancel -// channel argument. The channel will be used to cancel polling and any -// outstanding HTTP requests. +// ListRoutesTableSummary gets the currently advertised routes table summary associated with the express route circuit +// in a resource group. This method may poll for completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. circuitName is the name -// of the express route circuit. peeringName is the name of the peering. -// devicePath is the path of the device. +// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. +// peeringName is the name of the peering. devicePath is the path of the device. func (client ExpressRouteCircuitsClient) ListRoutesTableSummary(resourceGroupName string, circuitName string, peeringName string, devicePath string, cancel <-chan struct{}) (<-chan ExpressRouteCircuitsRoutesTableSummaryListResult, <-chan error) { resultChan := make(chan ExpressRouteCircuitsRoutesTableSummaryListResult, 1) errChan := make(chan error, 1) @@ -769,8 +846,10 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableSummary(resourceGroupNam var err error var result ExpressRouteCircuitsRoutesTableSummaryListResult defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -805,7 +884,7 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableSummaryPreparer(resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressrouteserviceproviders.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressrouteserviceproviders.go index 94db9a4f6147..5e39087b2a5c 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressrouteserviceproviders.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/expressrouteserviceproviders.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,20 +23,18 @@ import ( "net/http" ) -// ExpressRouteServiceProvidersClient is the composite Swagger for Network -// Client +// ExpressRouteServiceProvidersClient is the network Client type ExpressRouteServiceProvidersClient struct { ManagementClient } -// NewExpressRouteServiceProvidersClient creates an instance of the -// ExpressRouteServiceProvidersClient client. +// NewExpressRouteServiceProvidersClient creates an instance of the ExpressRouteServiceProvidersClient client. func NewExpressRouteServiceProvidersClient(subscriptionID string) ExpressRouteServiceProvidersClient { return NewExpressRouteServiceProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewExpressRouteServiceProvidersClientWithBaseURI creates an instance of the -// ExpressRouteServiceProvidersClient client. +// NewExpressRouteServiceProvidersClientWithBaseURI creates an instance of the ExpressRouteServiceProvidersClient +// client. func NewExpressRouteServiceProvidersClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteServiceProvidersClient { return ExpressRouteServiceProvidersClient{NewWithBaseURI(baseURI, subscriptionID)} } @@ -71,7 +68,7 @@ func (client ExpressRouteServiceProvidersClient) ListPreparer() (*http.Request, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -126,3 +123,48 @@ func (client ExpressRouteServiceProvidersClient) ListNextResults(lastResults Exp return } + +// ListComplete gets all elements from the list without paging. +func (client ExpressRouteServiceProvidersClient) ListComplete(cancel <-chan struct{}) (<-chan ExpressRouteServiceProvider, <-chan error) { + resultChan := make(chan ExpressRouteServiceProvider) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/inboundnatrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/inboundnatrules.go new file mode 100644 index 000000000000..eab80ac57669 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/inboundnatrules.go @@ -0,0 +1,436 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "net/http" +) + +// InboundNatRulesClient is the network Client +type InboundNatRulesClient struct { + ManagementClient +} + +// NewInboundNatRulesClient creates an instance of the InboundNatRulesClient client. +func NewInboundNatRulesClient(subscriptionID string) InboundNatRulesClient { + return NewInboundNatRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewInboundNatRulesClientWithBaseURI creates an instance of the InboundNatRulesClient client. +func NewInboundNatRulesClientWithBaseURI(baseURI string, subscriptionID string) InboundNatRulesClient { + return InboundNatRulesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a load balancer inbound nat rule. This method may poll for completion. Polling can +// be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. +// +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. +// inboundNatRuleName is the name of the inbound nat rule. inboundNatRuleParameters is parameters supplied to the +// create or update inbound nat rule operation. +func (client InboundNatRulesClient) CreateOrUpdate(resourceGroupName string, loadBalancerName string, inboundNatRuleName string, inboundNatRuleParameters InboundNatRule, cancel <-chan struct{}) (<-chan InboundNatRule, <-chan error) { + resultChan := make(chan InboundNatRule, 1) + errChan := make(chan error, 1) + if err := validation.Validate([]validation.Validation{ + {TargetValue: inboundNatRuleParameters, + Constraints: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "inboundNatRuleParameters.InboundNatRulePropertiesFormat.BackendIPConfiguration.InterfaceIPConfigurationPropertiesFormat.PublicIPAddress.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}}}, + }}, + }}, + }}, + }}, + }}, + }}}}}); err != nil { + errChan <- validation.NewErrorWithValidationError(err, "network.InboundNatRulesClient", "CreateOrUpdate") + close(errChan) + close(resultChan) + return resultChan, errChan + } + + go func() { + var err error + var result InboundNatRule + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.CreateOrUpdatePreparer(resourceGroupName, loadBalancerName, inboundNatRuleName, inboundNatRuleParameters, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client InboundNatRulesClient) CreateOrUpdatePreparer(resourceGroupName string, loadBalancerName string, inboundNatRuleName string, inboundNatRuleParameters InboundNatRule, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "inboundNatRuleName": autorest.Encode("path", inboundNatRuleName), + "loadBalancerName": autorest.Encode("path", loadBalancerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", pathParameters), + autorest.WithJSON(inboundNatRuleParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client InboundNatRulesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client InboundNatRulesClient) CreateOrUpdateResponder(resp *http.Response) (result InboundNatRule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified load balancer inbound nat rule. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. +// +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. +// inboundNatRuleName is the name of the inbound nat rule. +func (client InboundNatRulesClient) Delete(resourceGroupName string, loadBalancerName string, inboundNatRuleName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { + resultChan := make(chan autorest.Response, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result autorest.Response + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.DeletePreparer(resourceGroupName, loadBalancerName, inboundNatRuleName, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "Delete", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// DeletePreparer prepares the Delete request. +func (client InboundNatRulesClient) DeletePreparer(resourceGroupName string, loadBalancerName string, inboundNatRuleName string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "inboundNatRuleName": autorest.Encode("path", inboundNatRuleName), + "loadBalancerName": autorest.Encode("path", loadBalancerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client InboundNatRulesClient) DeleteSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client InboundNatRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusAccepted, http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the specified load balancer inbound nat rule. +// +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. +// inboundNatRuleName is the name of the inbound nat rule. expand is expands referenced resources. +func (client InboundNatRulesClient) Get(resourceGroupName string, loadBalancerName string, inboundNatRuleName string, expand string) (result InboundNatRule, err error) { + req, err := client.GetPreparer(resourceGroupName, loadBalancerName, inboundNatRuleName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client InboundNatRulesClient) GetPreparer(resourceGroupName string, loadBalancerName string, inboundNatRuleName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "inboundNatRuleName": autorest.Encode("path", inboundNatRuleName), + "loadBalancerName": autorest.Encode("path", loadBalancerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client InboundNatRulesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client InboundNatRulesClient) GetResponder(resp *http.Response) (result InboundNatRule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets all the inbound nat rules in a load balancer. +// +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. +func (client InboundNatRulesClient) List(resourceGroupName string, loadBalancerName string) (result InboundNatRuleListResult, err error) { + req, err := client.ListPreparer(resourceGroupName, loadBalancerName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client InboundNatRulesClient) ListPreparer(resourceGroupName string, loadBalancerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "loadBalancerName": autorest.Encode("path", loadBalancerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client InboundNatRulesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client InboundNatRulesClient) ListResponder(resp *http.Response) (result InboundNatRuleListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client InboundNatRulesClient) ListNextResults(lastResults InboundNatRuleListResult) (result InboundNatRuleListResult, err error) { + req, err := lastResults.InboundNatRuleListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InboundNatRulesClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListComplete gets all elements from the list without paging. +func (client InboundNatRulesClient) ListComplete(resourceGroupName string, loadBalancerName string, cancel <-chan struct{}) (<-chan InboundNatRule, <-chan error) { + resultChan := make(chan InboundNatRule) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName, loadBalancerName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/interfaceipconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/interfaceipconfigurations.go new file mode 100644 index 000000000000..ca0359f09006 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/interfaceipconfigurations.go @@ -0,0 +1,240 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// InterfaceIPConfigurationsClient is the network Client +type InterfaceIPConfigurationsClient struct { + ManagementClient +} + +// NewInterfaceIPConfigurationsClient creates an instance of the InterfaceIPConfigurationsClient client. +func NewInterfaceIPConfigurationsClient(subscriptionID string) InterfaceIPConfigurationsClient { + return NewInterfaceIPConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewInterfaceIPConfigurationsClientWithBaseURI creates an instance of the InterfaceIPConfigurationsClient client. +func NewInterfaceIPConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) InterfaceIPConfigurationsClient { + return InterfaceIPConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets the specified network interface ip configuration. +// +// resourceGroupName is the name of the resource group. networkInterfaceName is the name of the network interface. +// IPConfigurationName is the name of the ip configuration name. +func (client InterfaceIPConfigurationsClient) Get(resourceGroupName string, networkInterfaceName string, IPConfigurationName string) (result InterfaceIPConfiguration, err error) { + req, err := client.GetPreparer(resourceGroupName, networkInterfaceName, IPConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client InterfaceIPConfigurationsClient) GetPreparer(resourceGroupName string, networkInterfaceName string, IPConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ipConfigurationName": autorest.Encode("path", IPConfigurationName), + "networkInterfaceName": autorest.Encode("path", networkInterfaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations/{ipConfigurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client InterfaceIPConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client InterfaceIPConfigurationsClient) GetResponder(resp *http.Response) (result InterfaceIPConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List get all ip configurations in a network interface +// +// resourceGroupName is the name of the resource group. networkInterfaceName is the name of the network interface. +func (client InterfaceIPConfigurationsClient) List(resourceGroupName string, networkInterfaceName string) (result InterfaceIPConfigurationListResult, err error) { + req, err := client.ListPreparer(resourceGroupName, networkInterfaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client InterfaceIPConfigurationsClient) ListPreparer(resourceGroupName string, networkInterfaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkInterfaceName": autorest.Encode("path", networkInterfaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/ipConfigurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client InterfaceIPConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client InterfaceIPConfigurationsClient) ListResponder(resp *http.Response) (result InterfaceIPConfigurationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client InterfaceIPConfigurationsClient) ListNextResults(lastResults InterfaceIPConfigurationListResult) (result InterfaceIPConfigurationListResult, err error) { + req, err := lastResults.InterfaceIPConfigurationListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfaceIPConfigurationsClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListComplete gets all elements from the list without paging. +func (client InterfaceIPConfigurationsClient) ListComplete(resourceGroupName string, networkInterfaceName string, cancel <-chan struct{}) (<-chan InterfaceIPConfiguration, <-chan error) { + resultChan := make(chan InterfaceIPConfiguration) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName, networkInterfaceName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/interfaceloadbalancers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/interfaceloadbalancers.go new file mode 100644 index 000000000000..c7b7d272f729 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/interfaceloadbalancers.go @@ -0,0 +1,173 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// InterfaceLoadBalancersClient is the network Client +type InterfaceLoadBalancersClient struct { + ManagementClient +} + +// NewInterfaceLoadBalancersClient creates an instance of the InterfaceLoadBalancersClient client. +func NewInterfaceLoadBalancersClient(subscriptionID string) InterfaceLoadBalancersClient { + return NewInterfaceLoadBalancersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewInterfaceLoadBalancersClientWithBaseURI creates an instance of the InterfaceLoadBalancersClient client. +func NewInterfaceLoadBalancersClientWithBaseURI(baseURI string, subscriptionID string) InterfaceLoadBalancersClient { + return InterfaceLoadBalancersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List list all load balancers in a network interface. +// +// resourceGroupName is the name of the resource group. networkInterfaceName is the name of the network interface. +func (client InterfaceLoadBalancersClient) List(resourceGroupName string, networkInterfaceName string) (result InterfaceLoadBalancerListResult, err error) { + req, err := client.ListPreparer(resourceGroupName, networkInterfaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client InterfaceLoadBalancersClient) ListPreparer(resourceGroupName string, networkInterfaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkInterfaceName": autorest.Encode("path", networkInterfaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/loadBalancers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client InterfaceLoadBalancersClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client InterfaceLoadBalancersClient) ListResponder(resp *http.Response) (result InterfaceLoadBalancerListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client InterfaceLoadBalancersClient) ListNextResults(lastResults InterfaceLoadBalancerListResult) (result InterfaceLoadBalancerListResult, err error) { + req, err := lastResults.InterfaceLoadBalancerListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.InterfaceLoadBalancersClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListComplete gets all elements from the list without paging. +func (client InterfaceLoadBalancersClient) ListComplete(resourceGroupName string, networkInterfaceName string, cancel <-chan struct{}) (<-chan LoadBalancer, <-chan error) { + resultChan := make(chan LoadBalancer) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName, networkInterfaceName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/interfaces.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/interfaces.go index 8918c08b4b70..c2fdb3e901b7 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/interfaces.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/interfaces.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,7 +23,7 @@ import ( "net/http" ) -// InterfacesClient is the composite Swagger for Network Client +// InterfacesClient is the network Client type InterfacesClient struct { ManagementClient } @@ -34,20 +33,17 @@ func NewInterfacesClient(subscriptionID string) InterfacesClient { return NewInterfacesClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewInterfacesClientWithBaseURI creates an instance of the InterfacesClient -// client. +// NewInterfacesClientWithBaseURI creates an instance of the InterfacesClient client. func NewInterfacesClientWithBaseURI(baseURI string, subscriptionID string) InterfacesClient { return InterfacesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a network interface. This method may poll -// for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// CreateOrUpdate creates or updates a network interface. This method may poll for completion. Polling can be canceled +// by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. // -// resourceGroupName is the name of the resource group. networkInterfaceName is -// the name of the network interface. parameters is parameters supplied to the -// create or update network interface operation. +// resourceGroupName is the name of the resource group. networkInterfaceName is the name of the network interface. +// parameters is parameters supplied to the create or update network interface operation. func (client InterfacesClient) CreateOrUpdate(resourceGroupName string, networkInterfaceName string, parameters Interface, cancel <-chan struct{}) (<-chan Interface, <-chan error) { resultChan := make(chan Interface, 1) errChan := make(chan error, 1) @@ -55,8 +51,10 @@ func (client InterfacesClient) CreateOrUpdate(resourceGroupName string, networkI var err error var result Interface defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -89,7 +87,7 @@ func (client InterfacesClient) CreateOrUpdatePreparer(resourceGroupName string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -125,13 +123,10 @@ func (client InterfacesClient) CreateOrUpdateResponder(resp *http.Response) (res return } -// Delete deletes the specified network interface. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// Delete deletes the specified network interface. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. networkInterfaceName is -// the name of the network interface. +// resourceGroupName is the name of the resource group. networkInterfaceName is the name of the network interface. func (client InterfacesClient) Delete(resourceGroupName string, networkInterfaceName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -139,8 +134,10 @@ func (client InterfacesClient) Delete(resourceGroupName string, networkInterface var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -173,7 +170,7 @@ func (client InterfacesClient) DeletePreparer(resourceGroupName string, networkI "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -208,8 +205,8 @@ func (client InterfacesClient) DeleteResponder(resp *http.Response) (result auto // Get gets information about the specified network interface. // -// resourceGroupName is the name of the resource group. networkInterfaceName is -// the name of the network interface. expand is expands referenced resources. +// resourceGroupName is the name of the resource group. networkInterfaceName is the name of the network interface. +// expand is expands referenced resources. func (client InterfacesClient) Get(resourceGroupName string, networkInterfaceName string, expand string) (result Interface, err error) { req, err := client.GetPreparer(resourceGroupName, networkInterfaceName, expand) if err != nil { @@ -240,7 +237,7 @@ func (client InterfacesClient) GetPreparer(resourceGroupName string, networkInte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -275,13 +272,11 @@ func (client InterfacesClient) GetResponder(resp *http.Response) (result Interfa return } -// GetEffectiveRouteTable gets all route tables applied to a network interface. -// This method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and any +// GetEffectiveRouteTable gets all route tables applied to a network interface. This method may poll for completion. +// Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any // outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. networkInterfaceName is -// the name of the network interface. +// resourceGroupName is the name of the resource group. networkInterfaceName is the name of the network interface. func (client InterfacesClient) GetEffectiveRouteTable(resourceGroupName string, networkInterfaceName string, cancel <-chan struct{}) (<-chan EffectiveRouteListResult, <-chan error) { resultChan := make(chan EffectiveRouteListResult, 1) errChan := make(chan error, 1) @@ -289,8 +284,10 @@ func (client InterfacesClient) GetEffectiveRouteTable(resourceGroupName string, var err error var result EffectiveRouteListResult defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -323,7 +320,7 @@ func (client InterfacesClient) GetEffectiveRouteTablePreparer(resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -357,13 +354,11 @@ func (client InterfacesClient) GetEffectiveRouteTableResponder(resp *http.Respon return } -// GetVirtualMachineScaleSetNetworkInterface get the specified network -// interface in a virtual machine scale set. +// GetVirtualMachineScaleSetNetworkInterface get the specified network interface in a virtual machine scale set. // -// resourceGroupName is the name of the resource group. -// virtualMachineScaleSetName is the name of the virtual machine scale set. -// virtualmachineIndex is the virtual machine index. networkInterfaceName is -// the name of the network interface. expand is expands referenced resources. +// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual machine +// scale set. virtualmachineIndex is the virtual machine index. networkInterfaceName is the name of the network +// interface. expand is expands referenced resources. func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterface(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (result Interface, err error) { req, err := client.GetVirtualMachineScaleSetNetworkInterfacePreparer(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) if err != nil { @@ -396,7 +391,7 @@ func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfacePreparer "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2016-09-01" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -463,7 +458,7 @@ func (client InterfacesClient) ListPreparer(resourceGroupName string) (*http.Req "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -519,6 +514,51 @@ func (client InterfacesClient) ListNextResults(lastResults InterfaceListResult) return } +// ListComplete gets all elements from the list without paging. +func (client InterfacesClient) ListComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan Interface, <-chan error) { + resultChan := make(chan Interface) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + // ListAll gets all network interfaces in a subscription. func (client InterfacesClient) ListAll() (result InterfaceListResult, err error) { req, err := client.ListAllPreparer() @@ -548,7 +588,7 @@ func (client InterfacesClient) ListAllPreparer() (*http.Request, error) { "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -604,13 +644,56 @@ func (client InterfacesClient) ListAllNextResults(lastResults InterfaceListResul return } -// ListEffectiveNetworkSecurityGroups gets all network security groups applied -// to a network interface. This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used to +// ListAllComplete gets all elements from the list without paging. +func (client InterfacesClient) ListAllComplete(cancel <-chan struct{}) (<-chan Interface, <-chan error) { + resultChan := make(chan Interface) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListAll() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListAllNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListEffectiveNetworkSecurityGroups gets all network security groups applied to a network interface. This method may +// poll for completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to // cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. networkInterfaceName is -// the name of the network interface. +// resourceGroupName is the name of the resource group. networkInterfaceName is the name of the network interface. func (client InterfacesClient) ListEffectiveNetworkSecurityGroups(resourceGroupName string, networkInterfaceName string, cancel <-chan struct{}) (<-chan EffectiveNetworkSecurityGroupListResult, <-chan error) { resultChan := make(chan EffectiveNetworkSecurityGroupListResult, 1) errChan := make(chan error, 1) @@ -618,8 +701,10 @@ func (client InterfacesClient) ListEffectiveNetworkSecurityGroups(resourceGroupN var err error var result EffectiveNetworkSecurityGroupListResult defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -652,7 +737,7 @@ func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsPreparer(resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -686,11 +771,10 @@ func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsResponder(resp return } -// ListVirtualMachineScaleSetNetworkInterfaces gets all network interfaces in a -// virtual machine scale set. +// ListVirtualMachineScaleSetNetworkInterfaces gets all network interfaces in a virtual machine scale set. // -// resourceGroupName is the name of the resource group. -// virtualMachineScaleSetName is the name of the virtual machine scale set. +// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual machine +// scale set. func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfaces(resourceGroupName string, virtualMachineScaleSetName string) (result InterfaceListResult, err error) { req, err := client.ListVirtualMachineScaleSetNetworkInterfacesPreparer(resourceGroupName, virtualMachineScaleSetName) if err != nil { @@ -721,7 +805,7 @@ func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesPrepar "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2016-09-01" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -777,12 +861,56 @@ func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesNextRe return } -// ListVirtualMachineScaleSetVMNetworkInterfaces gets information about all -// network interfaces in a virtual machine in a virtual machine scale set. +// ListVirtualMachineScaleSetNetworkInterfacesComplete gets all elements from the list without paging. +func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesComplete(resourceGroupName string, virtualMachineScaleSetName string, cancel <-chan struct{}) (<-chan Interface, <-chan error) { + resultChan := make(chan Interface) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListVirtualMachineScaleSetNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListVirtualMachineScaleSetNetworkInterfacesNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListVirtualMachineScaleSetVMNetworkInterfaces gets information about all network interfaces in a virtual machine in +// a virtual machine scale set. // -// resourceGroupName is the name of the resource group. -// virtualMachineScaleSetName is the name of the virtual machine scale set. -// virtualmachineIndex is the virtual machine index. +// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual machine +// scale set. virtualmachineIndex is the virtual machine index. func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string) (result InterfaceListResult, err error) { req, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesPreparer(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) if err != nil { @@ -814,7 +942,7 @@ func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesPrep "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), } - const APIVersion = "2016-09-01" + const APIVersion = "2017-03-30" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -869,3 +997,48 @@ func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesNext return } + +// ListVirtualMachineScaleSetVMNetworkInterfacesComplete gets all elements from the list without paging. +func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesComplete(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, cancel <-chan struct{}) (<-chan Interface, <-chan error) { + resultChan := make(chan Interface) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListVirtualMachineScaleSetVMNetworkInterfaces(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListVirtualMachineScaleSetVMNetworkInterfacesNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancerbackendaddresspools.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancerbackendaddresspools.go new file mode 100644 index 000000000000..de14c3556084 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancerbackendaddresspools.go @@ -0,0 +1,241 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// LoadBalancerBackendAddressPoolsClient is the network Client +type LoadBalancerBackendAddressPoolsClient struct { + ManagementClient +} + +// NewLoadBalancerBackendAddressPoolsClient creates an instance of the LoadBalancerBackendAddressPoolsClient client. +func NewLoadBalancerBackendAddressPoolsClient(subscriptionID string) LoadBalancerBackendAddressPoolsClient { + return NewLoadBalancerBackendAddressPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLoadBalancerBackendAddressPoolsClientWithBaseURI creates an instance of the LoadBalancerBackendAddressPoolsClient +// client. +func NewLoadBalancerBackendAddressPoolsClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancerBackendAddressPoolsClient { + return LoadBalancerBackendAddressPoolsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets load balancer backend address pool. +// +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. +// backendAddressPoolName is the name of the backend address pool. +func (client LoadBalancerBackendAddressPoolsClient) Get(resourceGroupName string, loadBalancerName string, backendAddressPoolName string) (result BackendAddressPool, err error) { + req, err := client.GetPreparer(resourceGroupName, loadBalancerName, backendAddressPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client LoadBalancerBackendAddressPoolsClient) GetPreparer(resourceGroupName string, loadBalancerName string, backendAddressPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backendAddressPoolName": autorest.Encode("path", backendAddressPoolName), + "loadBalancerName": autorest.Encode("path", loadBalancerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client LoadBalancerBackendAddressPoolsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client LoadBalancerBackendAddressPoolsClient) GetResponder(resp *http.Response) (result BackendAddressPool, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets all the load balancer backed address pools. +// +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. +func (client LoadBalancerBackendAddressPoolsClient) List(resourceGroupName string, loadBalancerName string) (result LoadBalancerBackendAddressPoolListResult, err error) { + req, err := client.ListPreparer(resourceGroupName, loadBalancerName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client LoadBalancerBackendAddressPoolsClient) ListPreparer(resourceGroupName string, loadBalancerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "loadBalancerName": autorest.Encode("path", loadBalancerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client LoadBalancerBackendAddressPoolsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client LoadBalancerBackendAddressPoolsClient) ListResponder(resp *http.Response) (result LoadBalancerBackendAddressPoolListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client LoadBalancerBackendAddressPoolsClient) ListNextResults(lastResults LoadBalancerBackendAddressPoolListResult) (result LoadBalancerBackendAddressPoolListResult, err error) { + req, err := lastResults.LoadBalancerBackendAddressPoolListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerBackendAddressPoolsClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListComplete gets all elements from the list without paging. +func (client LoadBalancerBackendAddressPoolsClient) ListComplete(resourceGroupName string, loadBalancerName string, cancel <-chan struct{}) (<-chan BackendAddressPool, <-chan error) { + resultChan := make(chan BackendAddressPool) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName, loadBalancerName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancerfrontendipconfigurations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancerfrontendipconfigurations.go new file mode 100644 index 000000000000..515b875a1831 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancerfrontendipconfigurations.go @@ -0,0 +1,242 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// LoadBalancerFrontendIPConfigurationsClient is the network Client +type LoadBalancerFrontendIPConfigurationsClient struct { + ManagementClient +} + +// NewLoadBalancerFrontendIPConfigurationsClient creates an instance of the LoadBalancerFrontendIPConfigurationsClient +// client. +func NewLoadBalancerFrontendIPConfigurationsClient(subscriptionID string) LoadBalancerFrontendIPConfigurationsClient { + return NewLoadBalancerFrontendIPConfigurationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLoadBalancerFrontendIPConfigurationsClientWithBaseURI creates an instance of the +// LoadBalancerFrontendIPConfigurationsClient client. +func NewLoadBalancerFrontendIPConfigurationsClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancerFrontendIPConfigurationsClient { + return LoadBalancerFrontendIPConfigurationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets load balancer frontend IP configuration. +// +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. +// frontendIPConfigurationName is the name of the frontend IP configuration. +func (client LoadBalancerFrontendIPConfigurationsClient) Get(resourceGroupName string, loadBalancerName string, frontendIPConfigurationName string) (result FrontendIPConfiguration, err error) { + req, err := client.GetPreparer(resourceGroupName, loadBalancerName, frontendIPConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client LoadBalancerFrontendIPConfigurationsClient) GetPreparer(resourceGroupName string, loadBalancerName string, frontendIPConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontendIPConfigurationName": autorest.Encode("path", frontendIPConfigurationName), + "loadBalancerName": autorest.Encode("path", loadBalancerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations/{frontendIPConfigurationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client LoadBalancerFrontendIPConfigurationsClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client LoadBalancerFrontendIPConfigurationsClient) GetResponder(resp *http.Response) (result FrontendIPConfiguration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets all the load balancer frontend IP configurations. +// +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. +func (client LoadBalancerFrontendIPConfigurationsClient) List(resourceGroupName string, loadBalancerName string) (result LoadBalancerFrontendIPConfigurationListResult, err error) { + req, err := client.ListPreparer(resourceGroupName, loadBalancerName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client LoadBalancerFrontendIPConfigurationsClient) ListPreparer(resourceGroupName string, loadBalancerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "loadBalancerName": autorest.Encode("path", loadBalancerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/frontendIPConfigurations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client LoadBalancerFrontendIPConfigurationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client LoadBalancerFrontendIPConfigurationsClient) ListResponder(resp *http.Response) (result LoadBalancerFrontendIPConfigurationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client LoadBalancerFrontendIPConfigurationsClient) ListNextResults(lastResults LoadBalancerFrontendIPConfigurationListResult) (result LoadBalancerFrontendIPConfigurationListResult, err error) { + req, err := lastResults.LoadBalancerFrontendIPConfigurationListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerFrontendIPConfigurationsClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListComplete gets all elements from the list without paging. +func (client LoadBalancerFrontendIPConfigurationsClient) ListComplete(resourceGroupName string, loadBalancerName string, cancel <-chan struct{}) (<-chan FrontendIPConfiguration, <-chan error) { + resultChan := make(chan FrontendIPConfiguration) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName, loadBalancerName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancerloadbalancingrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancerloadbalancingrules.go new file mode 100644 index 000000000000..2ecd6be0d4f0 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancerloadbalancingrules.go @@ -0,0 +1,241 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// LoadBalancerLoadBalancingRulesClient is the network Client +type LoadBalancerLoadBalancingRulesClient struct { + ManagementClient +} + +// NewLoadBalancerLoadBalancingRulesClient creates an instance of the LoadBalancerLoadBalancingRulesClient client. +func NewLoadBalancerLoadBalancingRulesClient(subscriptionID string) LoadBalancerLoadBalancingRulesClient { + return NewLoadBalancerLoadBalancingRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLoadBalancerLoadBalancingRulesClientWithBaseURI creates an instance of the LoadBalancerLoadBalancingRulesClient +// client. +func NewLoadBalancerLoadBalancingRulesClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancerLoadBalancingRulesClient { + return LoadBalancerLoadBalancingRulesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets the specified load balancer load balancing rule. +// +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. +// loadBalancingRuleName is the name of the load balancing rule. +func (client LoadBalancerLoadBalancingRulesClient) Get(resourceGroupName string, loadBalancerName string, loadBalancingRuleName string) (result LoadBalancingRule, err error) { + req, err := client.GetPreparer(resourceGroupName, loadBalancerName, loadBalancingRuleName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client LoadBalancerLoadBalancingRulesClient) GetPreparer(resourceGroupName string, loadBalancerName string, loadBalancingRuleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "loadBalancerName": autorest.Encode("path", loadBalancerName), + "loadBalancingRuleName": autorest.Encode("path", loadBalancingRuleName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules/{loadBalancingRuleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client LoadBalancerLoadBalancingRulesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client LoadBalancerLoadBalancingRulesClient) GetResponder(resp *http.Response) (result LoadBalancingRule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets all the load balancing rules in a load balancer. +// +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. +func (client LoadBalancerLoadBalancingRulesClient) List(resourceGroupName string, loadBalancerName string) (result LoadBalancerLoadBalancingRuleListResult, err error) { + req, err := client.ListPreparer(resourceGroupName, loadBalancerName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client LoadBalancerLoadBalancingRulesClient) ListPreparer(resourceGroupName string, loadBalancerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "loadBalancerName": autorest.Encode("path", loadBalancerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/loadBalancingRules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client LoadBalancerLoadBalancingRulesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client LoadBalancerLoadBalancingRulesClient) ListResponder(resp *http.Response) (result LoadBalancerLoadBalancingRuleListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client LoadBalancerLoadBalancingRulesClient) ListNextResults(lastResults LoadBalancerLoadBalancingRuleListResult) (result LoadBalancerLoadBalancingRuleListResult, err error) { + req, err := lastResults.LoadBalancerLoadBalancingRuleListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerLoadBalancingRulesClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListComplete gets all elements from the list without paging. +func (client LoadBalancerLoadBalancingRulesClient) ListComplete(resourceGroupName string, loadBalancerName string, cancel <-chan struct{}) (<-chan LoadBalancingRule, <-chan error) { + resultChan := make(chan LoadBalancingRule) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName, loadBalancerName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancernetworkinterfaces.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancernetworkinterfaces.go new file mode 100644 index 000000000000..35650354255b --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancernetworkinterfaces.go @@ -0,0 +1,174 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// LoadBalancerNetworkInterfacesClient is the network Client +type LoadBalancerNetworkInterfacesClient struct { + ManagementClient +} + +// NewLoadBalancerNetworkInterfacesClient creates an instance of the LoadBalancerNetworkInterfacesClient client. +func NewLoadBalancerNetworkInterfacesClient(subscriptionID string) LoadBalancerNetworkInterfacesClient { + return NewLoadBalancerNetworkInterfacesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLoadBalancerNetworkInterfacesClientWithBaseURI creates an instance of the LoadBalancerNetworkInterfacesClient +// client. +func NewLoadBalancerNetworkInterfacesClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancerNetworkInterfacesClient { + return LoadBalancerNetworkInterfacesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List gets associated load balancer network interfaces. +// +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. +func (client LoadBalancerNetworkInterfacesClient) List(resourceGroupName string, loadBalancerName string) (result InterfaceListResult, err error) { + req, err := client.ListPreparer(resourceGroupName, loadBalancerName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client LoadBalancerNetworkInterfacesClient) ListPreparer(resourceGroupName string, loadBalancerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "loadBalancerName": autorest.Encode("path", loadBalancerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/networkInterfaces", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client LoadBalancerNetworkInterfacesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client LoadBalancerNetworkInterfacesClient) ListResponder(resp *http.Response) (result InterfaceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client LoadBalancerNetworkInterfacesClient) ListNextResults(lastResults InterfaceListResult) (result InterfaceListResult, err error) { + req, err := lastResults.InterfaceListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerNetworkInterfacesClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListComplete gets all elements from the list without paging. +func (client LoadBalancerNetworkInterfacesClient) ListComplete(resourceGroupName string, loadBalancerName string, cancel <-chan struct{}) (<-chan Interface, <-chan error) { + resultChan := make(chan Interface) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName, loadBalancerName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancerprobes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancerprobes.go new file mode 100644 index 000000000000..daee51e0f355 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancerprobes.go @@ -0,0 +1,240 @@ +package network + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// LoadBalancerProbesClient is the network Client +type LoadBalancerProbesClient struct { + ManagementClient +} + +// NewLoadBalancerProbesClient creates an instance of the LoadBalancerProbesClient client. +func NewLoadBalancerProbesClient(subscriptionID string) LoadBalancerProbesClient { + return NewLoadBalancerProbesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLoadBalancerProbesClientWithBaseURI creates an instance of the LoadBalancerProbesClient client. +func NewLoadBalancerProbesClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancerProbesClient { + return LoadBalancerProbesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets load balancer probe. +// +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. probeName is +// the name of the probe. +func (client LoadBalancerProbesClient) Get(resourceGroupName string, loadBalancerName string, probeName string) (result Probe, err error) { + req, err := client.GetPreparer(resourceGroupName, loadBalancerName, probeName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client LoadBalancerProbesClient) GetPreparer(resourceGroupName string, loadBalancerName string, probeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "loadBalancerName": autorest.Encode("path", loadBalancerName), + "probeName": autorest.Encode("path", probeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes/{probeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client LoadBalancerProbesClient) GetSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client LoadBalancerProbesClient) GetResponder(resp *http.Response) (result Probe, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets all the load balancer probes. +// +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. +func (client LoadBalancerProbesClient) List(resourceGroupName string, loadBalancerName string) (result LoadBalancerProbeListResult, err error) { + req, err := client.ListPreparer(resourceGroupName, loadBalancerName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client LoadBalancerProbesClient) ListPreparer(resourceGroupName string, loadBalancerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "loadBalancerName": autorest.Encode("path", loadBalancerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/probes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client LoadBalancerProbesClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client LoadBalancerProbesClient) ListResponder(resp *http.Response) (result LoadBalancerProbeListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNextResults retrieves the next set of results, if any. +func (client LoadBalancerProbesClient) ListNextResults(lastResults LoadBalancerProbeListResult) (result LoadBalancerProbeListResult, err error) { + req, err := lastResults.LoadBalancerProbeListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "List", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "List", resp, "Failure sending next results request") + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.LoadBalancerProbesClient", "List", resp, "Failure responding to next results request") + } + + return +} + +// ListComplete gets all elements from the list without paging. +func (client LoadBalancerProbesClient) ListComplete(resourceGroupName string, loadBalancerName string, cancel <-chan struct{}) (<-chan Probe, <-chan error) { + resultChan := make(chan Probe) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName, loadBalancerName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancers.go index 11d649b270a0..3a2528d85f4b 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancers.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/loadbalancers.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,31 +23,26 @@ import ( "net/http" ) -// LoadBalancersClient is the composite Swagger for Network Client +// LoadBalancersClient is the network Client type LoadBalancersClient struct { ManagementClient } -// NewLoadBalancersClient creates an instance of the LoadBalancersClient -// client. +// NewLoadBalancersClient creates an instance of the LoadBalancersClient client. func NewLoadBalancersClient(subscriptionID string) LoadBalancersClient { return NewLoadBalancersClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewLoadBalancersClientWithBaseURI creates an instance of the -// LoadBalancersClient client. +// NewLoadBalancersClientWithBaseURI creates an instance of the LoadBalancersClient client. func NewLoadBalancersClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancersClient { return LoadBalancersClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a load balancer. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// CreateOrUpdate creates or updates a load balancer. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. loadBalancerName is the -// name of the load balancer. parameters is parameters supplied to the create -// or update load balancer operation. +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. parameters +// is parameters supplied to the create or update load balancer operation. func (client LoadBalancersClient) CreateOrUpdate(resourceGroupName string, loadBalancerName string, parameters LoadBalancer, cancel <-chan struct{}) (<-chan LoadBalancer, <-chan error) { resultChan := make(chan LoadBalancer, 1) errChan := make(chan error, 1) @@ -56,8 +50,10 @@ func (client LoadBalancersClient) CreateOrUpdate(resourceGroupName string, loadB var err error var result LoadBalancer defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -90,7 +86,7 @@ func (client LoadBalancersClient) CreateOrUpdatePreparer(resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -126,13 +122,10 @@ func (client LoadBalancersClient) CreateOrUpdateResponder(resp *http.Response) ( return } -// Delete deletes the specified load balancer. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// Delete deletes the specified load balancer. This method may poll for completion. Polling can be canceled by passing +// the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. loadBalancerName is the -// name of the load balancer. +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. func (client LoadBalancersClient) Delete(resourceGroupName string, loadBalancerName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -140,8 +133,10 @@ func (client LoadBalancersClient) Delete(resourceGroupName string, loadBalancerN var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -174,7 +169,7 @@ func (client LoadBalancersClient) DeletePreparer(resourceGroupName string, loadB "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -209,8 +204,8 @@ func (client LoadBalancersClient) DeleteResponder(resp *http.Response) (result a // Get gets the specified load balancer. // -// resourceGroupName is the name of the resource group. loadBalancerName is the -// name of the load balancer. expand is expands referenced resources. +// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. expand is +// expands referenced resources. func (client LoadBalancersClient) Get(resourceGroupName string, loadBalancerName string, expand string) (result LoadBalancer, err error) { req, err := client.GetPreparer(resourceGroupName, loadBalancerName, expand) if err != nil { @@ -241,7 +236,7 @@ func (client LoadBalancersClient) GetPreparer(resourceGroupName string, loadBala "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -308,7 +303,7 @@ func (client LoadBalancersClient) ListPreparer(resourceGroupName string) (*http. "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -364,6 +359,51 @@ func (client LoadBalancersClient) ListNextResults(lastResults LoadBalancerListRe return } +// ListComplete gets all elements from the list without paging. +func (client LoadBalancersClient) ListComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan LoadBalancer, <-chan error) { + resultChan := make(chan LoadBalancer) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + // ListAll gets all the load balancers in a subscription. func (client LoadBalancersClient) ListAll() (result LoadBalancerListResult, err error) { req, err := client.ListAllPreparer() @@ -393,7 +433,7 @@ func (client LoadBalancersClient) ListAllPreparer() (*http.Request, error) { "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -448,3 +488,48 @@ func (client LoadBalancersClient) ListAllNextResults(lastResults LoadBalancerLis return } + +// ListAllComplete gets all elements from the list without paging. +func (client LoadBalancersClient) ListAllComplete(cancel <-chan struct{}) (<-chan LoadBalancer, <-chan error) { + resultChan := make(chan LoadBalancer) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListAll() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListAllNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/localnetworkgateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/localnetworkgateways.go index c1e66076e198..64cdea20a72b 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/localnetworkgateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/localnetworkgateways.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -25,31 +24,27 @@ import ( "net/http" ) -// LocalNetworkGatewaysClient is the composite Swagger for Network Client +// LocalNetworkGatewaysClient is the network Client type LocalNetworkGatewaysClient struct { ManagementClient } -// NewLocalNetworkGatewaysClient creates an instance of the -// LocalNetworkGatewaysClient client. +// NewLocalNetworkGatewaysClient creates an instance of the LocalNetworkGatewaysClient client. func NewLocalNetworkGatewaysClient(subscriptionID string) LocalNetworkGatewaysClient { return NewLocalNetworkGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewLocalNetworkGatewaysClientWithBaseURI creates an instance of the -// LocalNetworkGatewaysClient client. +// NewLocalNetworkGatewaysClientWithBaseURI creates an instance of the LocalNetworkGatewaysClient client. func NewLocalNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID string) LocalNetworkGatewaysClient { return LocalNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a local network gateway in the specified -// resource group. This method may poll for completion. Polling can be canceled -// by passing the cancel channel argument. The channel will be used to cancel +// CreateOrUpdate creates or updates a local network gateway in the specified resource group. This method may poll for +// completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel // polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. localNetworkGatewayName -// is the name of the local network gateway. parameters is parameters supplied -// to the create or update local network gateway operation. +// resourceGroupName is the name of the resource group. localNetworkGatewayName is the name of the local network +// gateway. parameters is parameters supplied to the create or update local network gateway operation. func (client LocalNetworkGatewaysClient) CreateOrUpdate(resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway, cancel <-chan struct{}) (<-chan LocalNetworkGateway, <-chan error) { resultChan := make(chan LocalNetworkGateway, 1) errChan := make(chan error, 1) @@ -68,8 +63,10 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdate(resourceGroupName string var err error var result LocalNetworkGateway defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -102,7 +99,7 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdatePreparer(resourceGroupNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -138,13 +135,11 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Resp return } -// Delete deletes the specified local network gateway. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// Delete deletes the specified local network gateway. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. localNetworkGatewayName -// is the name of the local network gateway. +// resourceGroupName is the name of the resource group. localNetworkGatewayName is the name of the local network +// gateway. func (client LocalNetworkGatewaysClient) Delete(resourceGroupName string, localNetworkGatewayName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -161,8 +156,10 @@ func (client LocalNetworkGatewaysClient) Delete(resourceGroupName string, localN var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -195,7 +192,7 @@ func (client LocalNetworkGatewaysClient) DeletePreparer(resourceGroupName string "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -230,8 +227,8 @@ func (client LocalNetworkGatewaysClient) DeleteResponder(resp *http.Response) (r // Get gets the specified local network gateway in a resource group. // -// resourceGroupName is the name of the resource group. localNetworkGatewayName -// is the name of the local network gateway. +// resourceGroupName is the name of the resource group. localNetworkGatewayName is the name of the local network +// gateway. func (client LocalNetworkGatewaysClient) Get(resourceGroupName string, localNetworkGatewayName string) (result LocalNetworkGateway, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: localNetworkGatewayName, @@ -268,7 +265,7 @@ func (client LocalNetworkGatewaysClient) GetPreparer(resourceGroupName string, l "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -332,7 +329,7 @@ func (client LocalNetworkGatewaysClient) ListPreparer(resourceGroupName string) "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -387,3 +384,48 @@ func (client LocalNetworkGatewaysClient) ListNextResults(lastResults LocalNetwor return } + +// ListComplete gets all elements from the list without paging. +func (client LocalNetworkGatewaysClient) ListComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan LocalNetworkGateway, <-chan error) { + resultChan := make(chan LocalNetworkGateway) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/models.go index 505691db01b3..8e083f3669c6 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/models.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/models.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -35,75 +34,58 @@ const ( Deny Access = "Deny" ) -// ApplicationGatewayBackendHealthServerHealth enumerates the values for -// application gateway backend health server health. +// ApplicationGatewayBackendHealthServerHealth enumerates the values for application gateway backend health server +// health. type ApplicationGatewayBackendHealthServerHealth string const ( - // Down specifies the down state for application gateway backend health - // server health. + // Down specifies the down state for application gateway backend health server health. Down ApplicationGatewayBackendHealthServerHealth = "Down" - // Draining specifies the draining state for application gateway backend - // health server health. + // Draining specifies the draining state for application gateway backend health server health. Draining ApplicationGatewayBackendHealthServerHealth = "Draining" - // Partial specifies the partial state for application gateway backend - // health server health. + // Partial specifies the partial state for application gateway backend health server health. Partial ApplicationGatewayBackendHealthServerHealth = "Partial" - // Unknown specifies the unknown state for application gateway backend - // health server health. + // Unknown specifies the unknown state for application gateway backend health server health. Unknown ApplicationGatewayBackendHealthServerHealth = "Unknown" - // Up specifies the up state for application gateway backend health server - // health. + // Up specifies the up state for application gateway backend health server health. Up ApplicationGatewayBackendHealthServerHealth = "Up" ) -// ApplicationGatewayCookieBasedAffinity enumerates the values for application -// gateway cookie based affinity. +// ApplicationGatewayCookieBasedAffinity enumerates the values for application gateway cookie based affinity. type ApplicationGatewayCookieBasedAffinity string const ( - // Disabled specifies the disabled state for application gateway cookie - // based affinity. + // Disabled specifies the disabled state for application gateway cookie based affinity. Disabled ApplicationGatewayCookieBasedAffinity = "Disabled" - // Enabled specifies the enabled state for application gateway cookie based - // affinity. + // Enabled specifies the enabled state for application gateway cookie based affinity. Enabled ApplicationGatewayCookieBasedAffinity = "Enabled" ) -// ApplicationGatewayFirewallMode enumerates the values for application gateway -// firewall mode. +// ApplicationGatewayFirewallMode enumerates the values for application gateway firewall mode. type ApplicationGatewayFirewallMode string const ( - // Detection specifies the detection state for application gateway firewall - // mode. + // Detection specifies the detection state for application gateway firewall mode. Detection ApplicationGatewayFirewallMode = "Detection" - // Prevention specifies the prevention state for application gateway - // firewall mode. + // Prevention specifies the prevention state for application gateway firewall mode. Prevention ApplicationGatewayFirewallMode = "Prevention" ) -// ApplicationGatewayOperationalState enumerates the values for application -// gateway operational state. +// ApplicationGatewayOperationalState enumerates the values for application gateway operational state. type ApplicationGatewayOperationalState string const ( - // Running specifies the running state for application gateway operational - // state. + // Running specifies the running state for application gateway operational state. Running ApplicationGatewayOperationalState = "Running" - // Starting specifies the starting state for application gateway - // operational state. + // Starting specifies the starting state for application gateway operational state. Starting ApplicationGatewayOperationalState = "Starting" - // Stopped specifies the stopped state for application gateway operational - // state. + // Stopped specifies the stopped state for application gateway operational state. Stopped ApplicationGatewayOperationalState = "Stopped" - // Stopping specifies the stopping state for application gateway - // operational state. + // Stopping specifies the stopping state for application gateway operational state. Stopping ApplicationGatewayOperationalState = "Stopping" ) -// ApplicationGatewayProtocol enumerates the values for application gateway -// protocol. +// ApplicationGatewayProtocol enumerates the values for application gateway protocol. type ApplicationGatewayProtocol string const ( @@ -113,53 +95,147 @@ const ( HTTPS ApplicationGatewayProtocol = "Https" ) -// ApplicationGatewayRequestRoutingRuleType enumerates the values for -// application gateway request routing rule type. +// ApplicationGatewayRedirectType enumerates the values for application gateway redirect type. +type ApplicationGatewayRedirectType string + +const ( + // Found specifies the found state for application gateway redirect type. + Found ApplicationGatewayRedirectType = "Found" + // Permanent specifies the permanent state for application gateway redirect type. + Permanent ApplicationGatewayRedirectType = "Permanent" + // SeeOther specifies the see other state for application gateway redirect type. + SeeOther ApplicationGatewayRedirectType = "SeeOther" + // Temporary specifies the temporary state for application gateway redirect type. + Temporary ApplicationGatewayRedirectType = "Temporary" +) + +// ApplicationGatewayRequestRoutingRuleType enumerates the values for application gateway request routing rule type. type ApplicationGatewayRequestRoutingRuleType string const ( - // Basic specifies the basic state for application gateway request routing - // rule type. + // Basic specifies the basic state for application gateway request routing rule type. Basic ApplicationGatewayRequestRoutingRuleType = "Basic" - // PathBasedRouting specifies the path based routing state for application - // gateway request routing rule type. + // PathBasedRouting specifies the path based routing state for application gateway request routing rule type. PathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" ) -// ApplicationGatewaySkuName enumerates the values for application gateway sku -// name. +// ApplicationGatewaySkuName enumerates the values for application gateway sku name. type ApplicationGatewaySkuName string const ( - // StandardLarge specifies the standard large state for application gateway - // sku name. + // StandardLarge specifies the standard large state for application gateway sku name. StandardLarge ApplicationGatewaySkuName = "Standard_Large" - // StandardMedium specifies the standard medium state for application - // gateway sku name. + // StandardMedium specifies the standard medium state for application gateway sku name. StandardMedium ApplicationGatewaySkuName = "Standard_Medium" - // StandardSmall specifies the standard small state for application gateway - // sku name. + // StandardSmall specifies the standard small state for application gateway sku name. StandardSmall ApplicationGatewaySkuName = "Standard_Small" // WAFLarge specifies the waf large state for application gateway sku name. WAFLarge ApplicationGatewaySkuName = "WAF_Large" - // WAFMedium specifies the waf medium state for application gateway sku - // name. + // WAFMedium specifies the waf medium state for application gateway sku name. WAFMedium ApplicationGatewaySkuName = "WAF_Medium" ) -// ApplicationGatewaySslProtocol enumerates the values for application gateway -// ssl protocol. +// ApplicationGatewaySslCipherSuite enumerates the values for application gateway ssl cipher suite. +type ApplicationGatewaySslCipherSuite string + +const ( + // TLSDHEDSSWITHAES128CBCSHA specifies the tlsdhedsswithaes128cbcsha state for application gateway ssl cipher suite. + TLSDHEDSSWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" + // TLSDHEDSSWITHAES128CBCSHA256 specifies the tlsdhedsswithaes128cbcsha256 state for application gateway ssl cipher + // suite. + TLSDHEDSSWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" + // TLSDHEDSSWITHAES256CBCSHA specifies the tlsdhedsswithaes256cbcsha state for application gateway ssl cipher suite. + TLSDHEDSSWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" + // TLSDHEDSSWITHAES256CBCSHA256 specifies the tlsdhedsswithaes256cbcsha256 state for application gateway ssl cipher + // suite. + TLSDHEDSSWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" + // TLSDHERSAWITHAES128CBCSHA specifies the tlsdhersawithaes128cbcsha state for application gateway ssl cipher suite. + TLSDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" + // TLSDHERSAWITHAES128GCMSHA256 specifies the tlsdhersawithaes128gcmsha256 state for application gateway ssl cipher + // suite. + TLSDHERSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" + // TLSDHERSAWITHAES256CBCSHA specifies the tlsdhersawithaes256cbcsha state for application gateway ssl cipher suite. + TLSDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" + // TLSDHERSAWITHAES256GCMSHA384 specifies the tlsdhersawithaes256gcmsha384 state for application gateway ssl cipher + // suite. + TLSDHERSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" + // TLSECDHEECDSAWITHAES128CBCSHA specifies the tlsecdheecdsawithaes128cbcsha state for application gateway ssl cipher + // suite. + TLSECDHEECDSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" + // TLSECDHEECDSAWITHAES128CBCSHA256 specifies the tlsecdheecdsawithaes128cbcsha256 state for application gateway ssl + // cipher suite. + TLSECDHEECDSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" + // TLSECDHEECDSAWITHAES128GCMSHA256 specifies the tlsecdheecdsawithaes128gcmsha256 state for application gateway ssl + // cipher suite. + TLSECDHEECDSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" + // TLSECDHEECDSAWITHAES256CBCSHA specifies the tlsecdheecdsawithaes256cbcsha state for application gateway ssl cipher + // suite. + TLSECDHEECDSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" + // TLSECDHEECDSAWITHAES256CBCSHA384 specifies the tlsecdheecdsawithaes256cbcsha384 state for application gateway ssl + // cipher suite. + TLSECDHEECDSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" + // TLSECDHEECDSAWITHAES256GCMSHA384 specifies the tlsecdheecdsawithaes256gcmsha384 state for application gateway ssl + // cipher suite. + TLSECDHEECDSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" + // TLSECDHERSAWITHAES128CBCSHA specifies the tlsecdhersawithaes128cbcsha state for application gateway ssl cipher + // suite. + TLSECDHERSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" + // TLSECDHERSAWITHAES128CBCSHA256 specifies the tlsecdhersawithaes128cbcsha256 state for application gateway ssl cipher + // suite. + TLSECDHERSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" + // TLSECDHERSAWITHAES256CBCSHA specifies the tlsecdhersawithaes256cbcsha state for application gateway ssl cipher + // suite. + TLSECDHERSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" + // TLSECDHERSAWITHAES256CBCSHA384 specifies the tlsecdhersawithaes256cbcsha384 state for application gateway ssl cipher + // suite. + TLSECDHERSAWITHAES256CBCSHA384 ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" + // TLSRSAWITH3DESEDECBCSHA specifies the tlsrsawith3desedecbcsha state for application gateway ssl cipher suite. + TLSRSAWITH3DESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" + // TLSRSAWITHAES128CBCSHA specifies the tlsrsawithaes128cbcsha state for application gateway ssl cipher suite. + TLSRSAWITHAES128CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" + // TLSRSAWITHAES128CBCSHA256 specifies the tlsrsawithaes128cbcsha256 state for application gateway ssl cipher suite. + TLSRSAWITHAES128CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" + // TLSRSAWITHAES128GCMSHA256 specifies the tlsrsawithaes128gcmsha256 state for application gateway ssl cipher suite. + TLSRSAWITHAES128GCMSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" + // TLSRSAWITHAES256CBCSHA specifies the tlsrsawithaes256cbcsha state for application gateway ssl cipher suite. + TLSRSAWITHAES256CBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" + // TLSRSAWITHAES256CBCSHA256 specifies the tlsrsawithaes256cbcsha256 state for application gateway ssl cipher suite. + TLSRSAWITHAES256CBCSHA256 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" + // TLSRSAWITHAES256GCMSHA384 specifies the tlsrsawithaes256gcmsha384 state for application gateway ssl cipher suite. + TLSRSAWITHAES256GCMSHA384 ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" +) + +// ApplicationGatewaySslPolicyName enumerates the values for application gateway ssl policy name. +type ApplicationGatewaySslPolicyName string + +const ( + // AppGwSslPolicy20150501 specifies the app gw ssl policy 20150501 state for application gateway ssl policy name. + AppGwSslPolicy20150501 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20150501" + // AppGwSslPolicy20170401 specifies the app gw ssl policy 20170401 state for application gateway ssl policy name. + AppGwSslPolicy20170401 ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401" + // AppGwSslPolicy20170401S specifies the app gw ssl policy 20170401s state for application gateway ssl policy name. + AppGwSslPolicy20170401S ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" +) + +// ApplicationGatewaySslPolicyType enumerates the values for application gateway ssl policy type. +type ApplicationGatewaySslPolicyType string + +const ( + // Custom specifies the custom state for application gateway ssl policy type. + Custom ApplicationGatewaySslPolicyType = "Custom" + // Predefined specifies the predefined state for application gateway ssl policy type. + Predefined ApplicationGatewaySslPolicyType = "Predefined" +) + +// ApplicationGatewaySslProtocol enumerates the values for application gateway ssl protocol. type ApplicationGatewaySslProtocol string const ( - // TLSv10 specifies the tl sv 10 state for application gateway ssl - // protocol. + // TLSv10 specifies the tl sv 10 state for application gateway ssl protocol. TLSv10 ApplicationGatewaySslProtocol = "TLSv1_0" - // TLSv11 specifies the tl sv 11 state for application gateway ssl - // protocol. + // TLSv11 specifies the tl sv 11 state for application gateway ssl protocol. TLSv11 ApplicationGatewaySslProtocol = "TLSv1_1" - // TLSv12 specifies the tl sv 12 state for application gateway ssl - // protocol. + // TLSv12 specifies the tl sv 12 state for application gateway ssl protocol. TLSv12 ApplicationGatewaySslProtocol = "TLSv1_2" ) @@ -183,6 +259,16 @@ const ( Contains AssociationType = "Contains" ) +// AuthenticationMethod enumerates the values for authentication method. +type AuthenticationMethod string + +const ( + // EAPMSCHAPv2 specifies the eapmscha pv 2 state for authentication method. + EAPMSCHAPv2 AuthenticationMethod = "EAPMSCHAPv2" + // EAPTLS specifies the eaptls state for authentication method. + EAPTLS AuthenticationMethod = "EAPTLS" +) + // AuthorizationUseStatus enumerates the values for authorization use status. type AuthorizationUseStatus string @@ -197,23 +283,32 @@ const ( type BgpPeerState string const ( - // BgpPeerStateConnected specifies the bgp peer state connected state for - // bgp peer state. + // BgpPeerStateConnected specifies the bgp peer state connected state for bgp peer state. BgpPeerStateConnected BgpPeerState = "Connected" - // BgpPeerStateConnecting specifies the bgp peer state connecting state for - // bgp peer state. + // BgpPeerStateConnecting specifies the bgp peer state connecting state for bgp peer state. BgpPeerStateConnecting BgpPeerState = "Connecting" - // BgpPeerStateIdle specifies the bgp peer state idle state for bgp peer - // state. + // BgpPeerStateIdle specifies the bgp peer state idle state for bgp peer state. BgpPeerStateIdle BgpPeerState = "Idle" - // BgpPeerStateStopped specifies the bgp peer state stopped state for bgp - // peer state. + // BgpPeerStateStopped specifies the bgp peer state stopped state for bgp peer state. BgpPeerStateStopped BgpPeerState = "Stopped" - // BgpPeerStateUnknown specifies the bgp peer state unknown state for bgp - // peer state. + // BgpPeerStateUnknown specifies the bgp peer state unknown state for bgp peer state. BgpPeerStateUnknown BgpPeerState = "Unknown" ) +// ConnectionStatus enumerates the values for connection status. +type ConnectionStatus string + +const ( + // ConnectionStatusConnected specifies the connection status connected state for connection status. + ConnectionStatusConnected ConnectionStatus = "Connected" + // ConnectionStatusDegraded specifies the connection status degraded state for connection status. + ConnectionStatusDegraded ConnectionStatus = "Degraded" + // ConnectionStatusDisconnected specifies the connection status disconnected state for connection status. + ConnectionStatusDisconnected ConnectionStatus = "Disconnected" + // ConnectionStatusUnknown specifies the connection status unknown state for connection status. + ConnectionStatusUnknown ConnectionStatus = "Unknown" +) + // DhGroup enumerates the values for dh group. type DhGroup string @@ -250,17 +345,14 @@ const ( type EffectiveRouteSource string const ( - // EffectiveRouteSourceDefault specifies the effective route source default - // state for effective route source. + // EffectiveRouteSourceDefault specifies the effective route source default state for effective route source. EffectiveRouteSourceDefault EffectiveRouteSource = "Default" - // EffectiveRouteSourceUnknown specifies the effective route source unknown - // state for effective route source. + // EffectiveRouteSourceUnknown specifies the effective route source unknown state for effective route source. EffectiveRouteSourceUnknown EffectiveRouteSource = "Unknown" - // EffectiveRouteSourceUser specifies the effective route source user state - // for effective route source. + // EffectiveRouteSourceUser specifies the effective route source user state for effective route source. EffectiveRouteSourceUser EffectiveRouteSource = "User" - // EffectiveRouteSourceVirtualNetworkGateway specifies the effective route - // source virtual network gateway state for effective route source. + // EffectiveRouteSourceVirtualNetworkGateway specifies the effective route source virtual network gateway state for + // effective route source. EffectiveRouteSourceVirtualNetworkGateway EffectiveRouteSource = "VirtualNetworkGateway" ) @@ -274,79 +366,77 @@ const ( Invalid EffectiveRouteState = "Invalid" ) -// ExpressRouteCircuitPeeringAdvertisedPublicPrefixState enumerates the values -// for express route circuit peering advertised public prefix state. +// EffectiveSecurityRuleProtocol enumerates the values for effective security rule protocol. +type EffectiveSecurityRuleProtocol string + +const ( + // All specifies the all state for effective security rule protocol. + All EffectiveSecurityRuleProtocol = "All" + // TCP specifies the tcp state for effective security rule protocol. + TCP EffectiveSecurityRuleProtocol = "Tcp" + // UDP specifies the udp state for effective security rule protocol. + UDP EffectiveSecurityRuleProtocol = "Udp" +) + +// ExpressRouteCircuitPeeringAdvertisedPublicPrefixState enumerates the values for express route circuit peering +// advertised public prefix state. type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string const ( - // Configured specifies the configured state for express route circuit - // peering advertised public prefix state. + // Configured specifies the configured state for express route circuit peering advertised public prefix state. Configured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" - // Configuring specifies the configuring state for express route circuit - // peering advertised public prefix state. + // Configuring specifies the configuring state for express route circuit peering advertised public prefix state. Configuring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" - // NotConfigured specifies the not configured state for express route - // circuit peering advertised public prefix state. + // NotConfigured specifies the not configured state for express route circuit peering advertised public prefix state. NotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" - // ValidationNeeded specifies the validation needed state for express route - // circuit peering advertised public prefix state. + // ValidationNeeded specifies the validation needed state for express route circuit peering advertised public prefix + // state. ValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" ) -// ExpressRouteCircuitPeeringState enumerates the values for express route -// circuit peering state. +// ExpressRouteCircuitPeeringState enumerates the values for express route circuit peering state. type ExpressRouteCircuitPeeringState string const ( - // ExpressRouteCircuitPeeringStateDisabled specifies the express route - // circuit peering state disabled state for express route circuit peering - // state. + // ExpressRouteCircuitPeeringStateDisabled specifies the express route circuit peering state disabled state for express + // route circuit peering state. ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" - // ExpressRouteCircuitPeeringStateEnabled specifies the express route - // circuit peering state enabled state for express route circuit peering - // state. + // ExpressRouteCircuitPeeringStateEnabled specifies the express route circuit peering state enabled state for express + // route circuit peering state. ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" ) -// ExpressRouteCircuitPeeringType enumerates the values for express route -// circuit peering type. +// ExpressRouteCircuitPeeringType enumerates the values for express route circuit peering type. type ExpressRouteCircuitPeeringType string const ( - // AzurePrivatePeering specifies the azure private peering state for - // express route circuit peering type. + // AzurePrivatePeering specifies the azure private peering state for express route circuit peering type. AzurePrivatePeering ExpressRouteCircuitPeeringType = "AzurePrivatePeering" - // AzurePublicPeering specifies the azure public peering state for express - // route circuit peering type. + // AzurePublicPeering specifies the azure public peering state for express route circuit peering type. AzurePublicPeering ExpressRouteCircuitPeeringType = "AzurePublicPeering" - // MicrosoftPeering specifies the microsoft peering state for express route - // circuit peering type. + // MicrosoftPeering specifies the microsoft peering state for express route circuit peering type. MicrosoftPeering ExpressRouteCircuitPeeringType = "MicrosoftPeering" ) -// ExpressRouteCircuitSkuFamily enumerates the values for express route circuit -// sku family. +// ExpressRouteCircuitSkuFamily enumerates the values for express route circuit sku family. type ExpressRouteCircuitSkuFamily string const ( - // MeteredData specifies the metered data state for express route circuit - // sku family. + // MeteredData specifies the metered data state for express route circuit sku family. MeteredData ExpressRouteCircuitSkuFamily = "MeteredData" - // UnlimitedData specifies the unlimited data state for express route - // circuit sku family. + // UnlimitedData specifies the unlimited data state for express route circuit sku family. UnlimitedData ExpressRouteCircuitSkuFamily = "UnlimitedData" ) -// ExpressRouteCircuitSkuTier enumerates the values for express route circuit -// sku tier. +// ExpressRouteCircuitSkuTier enumerates the values for express route circuit sku tier. type ExpressRouteCircuitSkuTier string const ( - // ExpressRouteCircuitSkuTierPremium specifies the express route circuit - // sku tier premium state for express route circuit sku tier. + // ExpressRouteCircuitSkuTierPremium specifies the express route circuit sku tier premium state for express route + // circuit sku tier. ExpressRouteCircuitSkuTierPremium ExpressRouteCircuitSkuTier = "Premium" - // ExpressRouteCircuitSkuTierStandard specifies the express route circuit - // sku tier standard state for express route circuit sku tier. + // ExpressRouteCircuitSkuTierStandard specifies the express route circuit sku tier standard state for express route + // circuit sku tier. ExpressRouteCircuitSkuTierStandard ExpressRouteCircuitSkuTier = "Standard" ) @@ -394,32 +484,23 @@ const ( type IpsecEncryption string const ( - // IpsecEncryptionAES128 specifies the ipsec encryption aes128 state for - // ipsec encryption. + // IpsecEncryptionAES128 specifies the ipsec encryption aes128 state for ipsec encryption. IpsecEncryptionAES128 IpsecEncryption = "AES128" - // IpsecEncryptionAES192 specifies the ipsec encryption aes192 state for - // ipsec encryption. + // IpsecEncryptionAES192 specifies the ipsec encryption aes192 state for ipsec encryption. IpsecEncryptionAES192 IpsecEncryption = "AES192" - // IpsecEncryptionAES256 specifies the ipsec encryption aes256 state for - // ipsec encryption. + // IpsecEncryptionAES256 specifies the ipsec encryption aes256 state for ipsec encryption. IpsecEncryptionAES256 IpsecEncryption = "AES256" - // IpsecEncryptionDES specifies the ipsec encryption des state for ipsec - // encryption. + // IpsecEncryptionDES specifies the ipsec encryption des state for ipsec encryption. IpsecEncryptionDES IpsecEncryption = "DES" - // IpsecEncryptionDES3 specifies the ipsec encryption des3 state for ipsec - // encryption. + // IpsecEncryptionDES3 specifies the ipsec encryption des3 state for ipsec encryption. IpsecEncryptionDES3 IpsecEncryption = "DES3" - // IpsecEncryptionGCMAES128 specifies the ipsec encryption gcmaes128 state - // for ipsec encryption. + // IpsecEncryptionGCMAES128 specifies the ipsec encryption gcmaes128 state for ipsec encryption. IpsecEncryptionGCMAES128 IpsecEncryption = "GCMAES128" - // IpsecEncryptionGCMAES192 specifies the ipsec encryption gcmaes192 state - // for ipsec encryption. + // IpsecEncryptionGCMAES192 specifies the ipsec encryption gcmaes192 state for ipsec encryption. IpsecEncryptionGCMAES192 IpsecEncryption = "GCMAES192" - // IpsecEncryptionGCMAES256 specifies the ipsec encryption gcmaes256 state - // for ipsec encryption. + // IpsecEncryptionGCMAES256 specifies the ipsec encryption gcmaes256 state for ipsec encryption. IpsecEncryptionGCMAES256 IpsecEncryption = "GCMAES256" - // IpsecEncryptionNone specifies the ipsec encryption none state for ipsec - // encryption. + // IpsecEncryptionNone specifies the ipsec encryption none state for ipsec encryption. IpsecEncryptionNone IpsecEncryption = "None" ) @@ -427,23 +508,17 @@ const ( type IpsecIntegrity string const ( - // IpsecIntegrityGCMAES128 specifies the ipsec integrity gcmaes128 state - // for ipsec integrity. + // IpsecIntegrityGCMAES128 specifies the ipsec integrity gcmaes128 state for ipsec integrity. IpsecIntegrityGCMAES128 IpsecIntegrity = "GCMAES128" - // IpsecIntegrityGCMAES192 specifies the ipsec integrity gcmaes192 state - // for ipsec integrity. + // IpsecIntegrityGCMAES192 specifies the ipsec integrity gcmaes192 state for ipsec integrity. IpsecIntegrityGCMAES192 IpsecIntegrity = "GCMAES192" - // IpsecIntegrityGCMAES256 specifies the ipsec integrity gcmaes256 state - // for ipsec integrity. + // IpsecIntegrityGCMAES256 specifies the ipsec integrity gcmaes256 state for ipsec integrity. IpsecIntegrityGCMAES256 IpsecIntegrity = "GCMAES256" - // IpsecIntegrityMD5 specifies the ipsec integrity md5 state for ipsec - // integrity. + // IpsecIntegrityMD5 specifies the ipsec integrity md5 state for ipsec integrity. IpsecIntegrityMD5 IpsecIntegrity = "MD5" - // IpsecIntegritySHA1 specifies the ipsec integrity sha1 state for ipsec - // integrity. + // IpsecIntegritySHA1 specifies the ipsec integrity sha1 state for ipsec integrity. IpsecIntegritySHA1 IpsecIntegrity = "SHA1" - // IpsecIntegritySHA256 specifies the ipsec integrity sha256 state for - // ipsec integrity. + // IpsecIntegritySHA256 specifies the ipsec integrity sha256 state for ipsec integrity. IpsecIntegritySHA256 IpsecIntegrity = "SHA256" ) @@ -457,6 +532,40 @@ const ( IPv6 IPVersion = "IPv6" ) +// IssueType enumerates the values for issue type. +type IssueType string + +const ( + // IssueTypeAgentStopped specifies the issue type agent stopped state for issue type. + IssueTypeAgentStopped IssueType = "AgentStopped" + // IssueTypeDNSResolution specifies the issue type dns resolution state for issue type. + IssueTypeDNSResolution IssueType = "DnsResolution" + // IssueTypeGuestFirewall specifies the issue type guest firewall state for issue type. + IssueTypeGuestFirewall IssueType = "GuestFirewall" + // IssueTypeNetworkSecurityRule specifies the issue type network security rule state for issue type. + IssueTypeNetworkSecurityRule IssueType = "NetworkSecurityRule" + // IssueTypePlatform specifies the issue type platform state for issue type. + IssueTypePlatform IssueType = "Platform" + // IssueTypePortThrottled specifies the issue type port throttled state for issue type. + IssueTypePortThrottled IssueType = "PortThrottled" + // IssueTypeSocketBind specifies the issue type socket bind state for issue type. + IssueTypeSocketBind IssueType = "SocketBind" + // IssueTypeUnknown specifies the issue type unknown state for issue type. + IssueTypeUnknown IssueType = "Unknown" + // IssueTypeUserDefinedRoute specifies the issue type user defined route state for issue type. + IssueTypeUserDefinedRoute IssueType = "UserDefinedRoute" +) + +// LoadBalancerSkuName enumerates the values for load balancer sku name. +type LoadBalancerSkuName string + +const ( + // LoadBalancerSkuNameBasic specifies the load balancer sku name basic state for load balancer sku name. + LoadBalancerSkuNameBasic LoadBalancerSkuName = "Basic" + // LoadBalancerSkuNameStandard specifies the load balancer sku name standard state for load balancer sku name. + LoadBalancerSkuNameStandard LoadBalancerSkuName = "Standard" +) + // LoadDistribution enumerates the values for load distribution. type LoadDistribution string @@ -465,8 +574,7 @@ const ( Default LoadDistribution = "Default" // SourceIP specifies the source ip state for load distribution. SourceIP LoadDistribution = "SourceIP" - // SourceIPProtocol specifies the source ip protocol state for load - // distribution. + // SourceIPProtocol specifies the source ip protocol state for load distribution. SourceIPProtocol LoadDistribution = "SourceIPProtocol" ) @@ -474,23 +582,17 @@ const ( type NextHopType string const ( - // NextHopTypeHyperNetGateway specifies the next hop type hyper net gateway - // state for next hop type. + // NextHopTypeHyperNetGateway specifies the next hop type hyper net gateway state for next hop type. NextHopTypeHyperNetGateway NextHopType = "HyperNetGateway" - // NextHopTypeInternet specifies the next hop type internet state for next - // hop type. + // NextHopTypeInternet specifies the next hop type internet state for next hop type. NextHopTypeInternet NextHopType = "Internet" - // NextHopTypeNone specifies the next hop type none state for next hop - // type. + // NextHopTypeNone specifies the next hop type none state for next hop type. NextHopTypeNone NextHopType = "None" - // NextHopTypeVirtualAppliance specifies the next hop type virtual - // appliance state for next hop type. + // NextHopTypeVirtualAppliance specifies the next hop type virtual appliance state for next hop type. NextHopTypeVirtualAppliance NextHopType = "VirtualAppliance" - // NextHopTypeVirtualNetworkGateway specifies the next hop type virtual - // network gateway state for next hop type. + // NextHopTypeVirtualNetworkGateway specifies the next hop type virtual network gateway state for next hop type. NextHopTypeVirtualNetworkGateway NextHopType = "VirtualNetworkGateway" - // NextHopTypeVnetLocal specifies the next hop type vnet local state for - // next hop type. + // NextHopTypeVnetLocal specifies the next hop type vnet local state for next hop type. NextHopTypeVnetLocal NextHopType = "VnetLocal" ) @@ -506,6 +608,18 @@ const ( Succeeded OperationStatus = "Succeeded" ) +// Origin enumerates the values for origin. +type Origin string + +const ( + // OriginInbound specifies the origin inbound state for origin. + OriginInbound Origin = "Inbound" + // OriginLocal specifies the origin local state for origin. + OriginLocal Origin = "Local" + // OriginOutbound specifies the origin outbound state for origin. + OriginOutbound Origin = "Outbound" +) + // PcError enumerates the values for pc error. type PcError string @@ -526,12 +640,12 @@ const ( type PcProtocol string const ( - // Any specifies the any state for pc protocol. - Any PcProtocol = "Any" - // TCP specifies the tcp state for pc protocol. - TCP PcProtocol = "TCP" - // UDP specifies the udp state for pc protocol. - UDP PcProtocol = "UDP" + // PcProtocolAny specifies the pc protocol any state for pc protocol. + PcProtocolAny PcProtocol = "Any" + // PcProtocolTCP specifies the pc protocol tcp state for pc protocol. + PcProtocolTCP PcProtocol = "TCP" + // PcProtocolUDP specifies the pc protocol udp state for pc protocol. + PcProtocolUDP PcProtocol = "UDP" ) // PcStatus enumerates the values for pc status. @@ -540,8 +654,7 @@ type PcStatus string const ( // PcStatusError specifies the pc status error state for pc status. PcStatusError PcStatus = "Error" - // PcStatusNotStarted specifies the pc status not started state for pc - // status. + // PcStatusNotStarted specifies the pc status not started state for pc status. PcStatusNotStarted PcStatus = "NotStarted" // PcStatusRunning specifies the pc status running state for pc status. PcStatusRunning PcStatus = "Running" @@ -575,11 +688,9 @@ const ( type ProbeProtocol string const ( - // ProbeProtocolHTTP specifies the probe protocol http state for probe - // protocol. + // ProbeProtocolHTTP specifies the probe protocol http state for probe protocol. ProbeProtocolHTTP ProbeProtocol = "Http" - // ProbeProtocolTCP specifies the probe protocol tcp state for probe - // protocol. + // ProbeProtocolTCP specifies the probe protocol tcp state for probe protocol. ProbeProtocolTCP ProbeProtocol = "Tcp" ) @@ -607,38 +718,41 @@ const ( type ProvisioningState string const ( - // ProvisioningStateDeleting specifies the provisioning state deleting - // state for provisioning state. + // ProvisioningStateDeleting specifies the provisioning state deleting state for provisioning state. ProvisioningStateDeleting ProvisioningState = "Deleting" - // ProvisioningStateFailed specifies the provisioning state failed state - // for provisioning state. + // ProvisioningStateFailed specifies the provisioning state failed state for provisioning state. ProvisioningStateFailed ProvisioningState = "Failed" - // ProvisioningStateSucceeded specifies the provisioning state succeeded - // state for provisioning state. + // ProvisioningStateSucceeded specifies the provisioning state succeeded state for provisioning state. ProvisioningStateSucceeded ProvisioningState = "Succeeded" - // ProvisioningStateUpdating specifies the provisioning state updating - // state for provisioning state. + // ProvisioningStateUpdating specifies the provisioning state updating state for provisioning state. ProvisioningStateUpdating ProvisioningState = "Updating" ) +// PublicIPAddressSkuName enumerates the values for public ip address sku name. +type PublicIPAddressSkuName string + +const ( + // PublicIPAddressSkuNameBasic specifies the public ip address sku name basic state for public ip address sku name. + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + // PublicIPAddressSkuNameStandard specifies the public ip address sku name standard state for public ip address sku + // name. + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + // RouteNextHopType enumerates the values for route next hop type. type RouteNextHopType string const ( - // RouteNextHopTypeInternet specifies the route next hop type internet - // state for route next hop type. + // RouteNextHopTypeInternet specifies the route next hop type internet state for route next hop type. RouteNextHopTypeInternet RouteNextHopType = "Internet" - // RouteNextHopTypeNone specifies the route next hop type none state for - // route next hop type. + // RouteNextHopTypeNone specifies the route next hop type none state for route next hop type. RouteNextHopTypeNone RouteNextHopType = "None" - // RouteNextHopTypeVirtualAppliance specifies the route next hop type - // virtual appliance state for route next hop type. + // RouteNextHopTypeVirtualAppliance specifies the route next hop type virtual appliance state for route next hop type. RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - // RouteNextHopTypeVirtualNetworkGateway specifies the route next hop type - // virtual network gateway state for route next hop type. + // RouteNextHopTypeVirtualNetworkGateway specifies the route next hop type virtual network gateway state for route next + // hop type. RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - // RouteNextHopTypeVnetLocal specifies the route next hop type vnet local - // state for route next hop type. + // RouteNextHopTypeVnetLocal specifies the route next hop type vnet local state for route next hop type. RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" ) @@ -646,11 +760,9 @@ const ( type SecurityRuleAccess string const ( - // SecurityRuleAccessAllow specifies the security rule access allow state - // for security rule access. + // SecurityRuleAccessAllow specifies the security rule access allow state for security rule access. SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - // SecurityRuleAccessDeny specifies the security rule access deny state for - // security rule access. + // SecurityRuleAccessDeny specifies the security rule access deny state for security rule access. SecurityRuleAccessDeny SecurityRuleAccess = "Deny" ) @@ -658,11 +770,9 @@ const ( type SecurityRuleDirection string const ( - // SecurityRuleDirectionInbound specifies the security rule direction - // inbound state for security rule direction. + // SecurityRuleDirectionInbound specifies the security rule direction inbound state for security rule direction. SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - // SecurityRuleDirectionOutbound specifies the security rule direction - // outbound state for security rule direction. + // SecurityRuleDirectionOutbound specifies the security rule direction outbound state for security rule direction. SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" ) @@ -670,179 +780,169 @@ const ( type SecurityRuleProtocol string const ( - // SecurityRuleProtocolAsterisk specifies the security rule protocol - // asterisk state for security rule protocol. + // SecurityRuleProtocolAsterisk specifies the security rule protocol asterisk state for security rule protocol. SecurityRuleProtocolAsterisk SecurityRuleProtocol = "*" - // SecurityRuleProtocolTCP specifies the security rule protocol tcp state - // for security rule protocol. + // SecurityRuleProtocolTCP specifies the security rule protocol tcp state for security rule protocol. SecurityRuleProtocolTCP SecurityRuleProtocol = "Tcp" - // SecurityRuleProtocolUDP specifies the security rule protocol udp state - // for security rule protocol. + // SecurityRuleProtocolUDP specifies the security rule protocol udp state for security rule protocol. SecurityRuleProtocolUDP SecurityRuleProtocol = "Udp" ) -// ServiceProviderProvisioningState enumerates the values for service provider -// provisioning state. +// ServiceProviderProvisioningState enumerates the values for service provider provisioning state. type ServiceProviderProvisioningState string const ( - // Deprovisioning specifies the deprovisioning state for service provider - // provisioning state. + // Deprovisioning specifies the deprovisioning state for service provider provisioning state. Deprovisioning ServiceProviderProvisioningState = "Deprovisioning" - // NotProvisioned specifies the not provisioned state for service provider - // provisioning state. + // NotProvisioned specifies the not provisioned state for service provider provisioning state. NotProvisioned ServiceProviderProvisioningState = "NotProvisioned" - // Provisioned specifies the provisioned state for service provider - // provisioning state. + // Provisioned specifies the provisioned state for service provider provisioning state. Provisioned ServiceProviderProvisioningState = "Provisioned" - // Provisioning specifies the provisioning state for service provider - // provisioning state. + // Provisioning specifies the provisioning state for service provider provisioning state. Provisioning ServiceProviderProvisioningState = "Provisioning" ) +// Severity enumerates the values for severity. +type Severity string + +const ( + // SeverityError specifies the severity error state for severity. + SeverityError Severity = "Error" + // SeverityWarning specifies the severity warning state for severity. + SeverityWarning Severity = "Warning" +) + // TransportProtocol enumerates the values for transport protocol. type TransportProtocol string const ( - // TransportProtocolTCP specifies the transport protocol tcp state for - // transport protocol. + // TransportProtocolAll specifies the transport protocol all state for transport protocol. + TransportProtocolAll TransportProtocol = "All" + // TransportProtocolTCP specifies the transport protocol tcp state for transport protocol. TransportProtocolTCP TransportProtocol = "Tcp" - // TransportProtocolUDP specifies the transport protocol udp state for - // transport protocol. + // TransportProtocolUDP specifies the transport protocol udp state for transport protocol. TransportProtocolUDP TransportProtocol = "Udp" ) -// VirtualNetworkGatewayConnectionStatus enumerates the values for virtual -// network gateway connection status. +// VirtualNetworkGatewayConnectionStatus enumerates the values for virtual network gateway connection status. type VirtualNetworkGatewayConnectionStatus string const ( - // VirtualNetworkGatewayConnectionStatusConnected specifies the virtual - // network gateway connection status connected state for virtual network - // gateway connection status. + // VirtualNetworkGatewayConnectionStatusConnected specifies the virtual network gateway connection status connected + // state for virtual network gateway connection status. VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" - // VirtualNetworkGatewayConnectionStatusConnecting specifies the virtual - // network gateway connection status connecting state for virtual network - // gateway connection status. + // VirtualNetworkGatewayConnectionStatusConnecting specifies the virtual network gateway connection status connecting + // state for virtual network gateway connection status. VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" - // VirtualNetworkGatewayConnectionStatusNotConnected specifies the virtual - // network gateway connection status not connected state for virtual - // network gateway connection status. + // VirtualNetworkGatewayConnectionStatusNotConnected specifies the virtual network gateway connection status not + // connected state for virtual network gateway connection status. VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" - // VirtualNetworkGatewayConnectionStatusUnknown specifies the virtual - // network gateway connection status unknown state for virtual network - // gateway connection status. + // VirtualNetworkGatewayConnectionStatusUnknown specifies the virtual network gateway connection status unknown state + // for virtual network gateway connection status. VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" ) -// VirtualNetworkGatewayConnectionType enumerates the values for virtual -// network gateway connection type. +// VirtualNetworkGatewayConnectionType enumerates the values for virtual network gateway connection type. type VirtualNetworkGatewayConnectionType string const ( - // ExpressRoute specifies the express route state for virtual network - // gateway connection type. + // ExpressRoute specifies the express route state for virtual network gateway connection type. ExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" - // IPsec specifies the i psec state for virtual network gateway connection - // type. + // IPsec specifies the i psec state for virtual network gateway connection type. IPsec VirtualNetworkGatewayConnectionType = "IPsec" - // Vnet2Vnet specifies the vnet 2 vnet state for virtual network gateway - // connection type. + // Vnet2Vnet specifies the vnet 2 vnet state for virtual network gateway connection type. Vnet2Vnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" - // VPNClient specifies the vpn client state for virtual network gateway - // connection type. + // VPNClient specifies the vpn client state for virtual network gateway connection type. VPNClient VirtualNetworkGatewayConnectionType = "VPNClient" ) -// VirtualNetworkGatewaySkuName enumerates the values for virtual network -// gateway sku name. +// VirtualNetworkGatewaySkuName enumerates the values for virtual network gateway sku name. type VirtualNetworkGatewaySkuName string const ( - // VirtualNetworkGatewaySkuNameBasic specifies the virtual network gateway - // sku name basic state for virtual network gateway sku name. - VirtualNetworkGatewaySkuNameBasic VirtualNetworkGatewaySkuName = "Basic" - // VirtualNetworkGatewaySkuNameHighPerformance specifies the virtual - // network gateway sku name high performance state for virtual network + // VirtualNetworkGatewaySkuNameBasic specifies the virtual network gateway sku name basic state for virtual network // gateway sku name. + VirtualNetworkGatewaySkuNameBasic VirtualNetworkGatewaySkuName = "Basic" + // VirtualNetworkGatewaySkuNameHighPerformance specifies the virtual network gateway sku name high performance state + // for virtual network gateway sku name. VirtualNetworkGatewaySkuNameHighPerformance VirtualNetworkGatewaySkuName = "HighPerformance" - // VirtualNetworkGatewaySkuNameStandard specifies the virtual network - // gateway sku name standard state for virtual network gateway sku name. + // VirtualNetworkGatewaySkuNameStandard specifies the virtual network gateway sku name standard state for virtual + // network gateway sku name. VirtualNetworkGatewaySkuNameStandard VirtualNetworkGatewaySkuName = "Standard" - // VirtualNetworkGatewaySkuNameUltraPerformance specifies the virtual - // network gateway sku name ultra performance state for virtual network - // gateway sku name. + // VirtualNetworkGatewaySkuNameUltraPerformance specifies the virtual network gateway sku name ultra performance state + // for virtual network gateway sku name. VirtualNetworkGatewaySkuNameUltraPerformance VirtualNetworkGatewaySkuName = "UltraPerformance" - // VirtualNetworkGatewaySkuNameVpnGw1 specifies the virtual network gateway - // sku name vpn gw 1 state for virtual network gateway sku name. + // VirtualNetworkGatewaySkuNameVpnGw1 specifies the virtual network gateway sku name vpn gw 1 state for virtual network + // gateway sku name. VirtualNetworkGatewaySkuNameVpnGw1 VirtualNetworkGatewaySkuName = "VpnGw1" - // VirtualNetworkGatewaySkuNameVpnGw2 specifies the virtual network gateway - // sku name vpn gw 2 state for virtual network gateway sku name. + // VirtualNetworkGatewaySkuNameVpnGw2 specifies the virtual network gateway sku name vpn gw 2 state for virtual network + // gateway sku name. VirtualNetworkGatewaySkuNameVpnGw2 VirtualNetworkGatewaySkuName = "VpnGw2" - // VirtualNetworkGatewaySkuNameVpnGw3 specifies the virtual network gateway - // sku name vpn gw 3 state for virtual network gateway sku name. + // VirtualNetworkGatewaySkuNameVpnGw3 specifies the virtual network gateway sku name vpn gw 3 state for virtual network + // gateway sku name. VirtualNetworkGatewaySkuNameVpnGw3 VirtualNetworkGatewaySkuName = "VpnGw3" ) -// VirtualNetworkGatewaySkuTier enumerates the values for virtual network -// gateway sku tier. +// VirtualNetworkGatewaySkuTier enumerates the values for virtual network gateway sku tier. type VirtualNetworkGatewaySkuTier string const ( - // VirtualNetworkGatewaySkuTierBasic specifies the virtual network gateway - // sku tier basic state for virtual network gateway sku tier. - VirtualNetworkGatewaySkuTierBasic VirtualNetworkGatewaySkuTier = "Basic" - // VirtualNetworkGatewaySkuTierHighPerformance specifies the virtual - // network gateway sku tier high performance state for virtual network + // VirtualNetworkGatewaySkuTierBasic specifies the virtual network gateway sku tier basic state for virtual network // gateway sku tier. + VirtualNetworkGatewaySkuTierBasic VirtualNetworkGatewaySkuTier = "Basic" + // VirtualNetworkGatewaySkuTierHighPerformance specifies the virtual network gateway sku tier high performance state + // for virtual network gateway sku tier. VirtualNetworkGatewaySkuTierHighPerformance VirtualNetworkGatewaySkuTier = "HighPerformance" - // VirtualNetworkGatewaySkuTierStandard specifies the virtual network - // gateway sku tier standard state for virtual network gateway sku tier. + // VirtualNetworkGatewaySkuTierStandard specifies the virtual network gateway sku tier standard state for virtual + // network gateway sku tier. VirtualNetworkGatewaySkuTierStandard VirtualNetworkGatewaySkuTier = "Standard" - // VirtualNetworkGatewaySkuTierUltraPerformance specifies the virtual - // network gateway sku tier ultra performance state for virtual network - // gateway sku tier. + // VirtualNetworkGatewaySkuTierUltraPerformance specifies the virtual network gateway sku tier ultra performance state + // for virtual network gateway sku tier. VirtualNetworkGatewaySkuTierUltraPerformance VirtualNetworkGatewaySkuTier = "UltraPerformance" - // VirtualNetworkGatewaySkuTierVpnGw1 specifies the virtual network gateway - // sku tier vpn gw 1 state for virtual network gateway sku tier. + // VirtualNetworkGatewaySkuTierVpnGw1 specifies the virtual network gateway sku tier vpn gw 1 state for virtual network + // gateway sku tier. VirtualNetworkGatewaySkuTierVpnGw1 VirtualNetworkGatewaySkuTier = "VpnGw1" - // VirtualNetworkGatewaySkuTierVpnGw2 specifies the virtual network gateway - // sku tier vpn gw 2 state for virtual network gateway sku tier. + // VirtualNetworkGatewaySkuTierVpnGw2 specifies the virtual network gateway sku tier vpn gw 2 state for virtual network + // gateway sku tier. VirtualNetworkGatewaySkuTierVpnGw2 VirtualNetworkGatewaySkuTier = "VpnGw2" - // VirtualNetworkGatewaySkuTierVpnGw3 specifies the virtual network gateway - // sku tier vpn gw 3 state for virtual network gateway sku tier. + // VirtualNetworkGatewaySkuTierVpnGw3 specifies the virtual network gateway sku tier vpn gw 3 state for virtual network + // gateway sku tier. VirtualNetworkGatewaySkuTierVpnGw3 VirtualNetworkGatewaySkuTier = "VpnGw3" ) -// VirtualNetworkGatewayType enumerates the values for virtual network gateway -// type. +// VirtualNetworkGatewayType enumerates the values for virtual network gateway type. type VirtualNetworkGatewayType string const ( - // VirtualNetworkGatewayTypeExpressRoute specifies the virtual network - // gateway type express route state for virtual network gateway type. + // VirtualNetworkGatewayTypeExpressRoute specifies the virtual network gateway type express route state for virtual + // network gateway type. VirtualNetworkGatewayTypeExpressRoute VirtualNetworkGatewayType = "ExpressRoute" - // VirtualNetworkGatewayTypeVpn specifies the virtual network gateway type - // vpn state for virtual network gateway type. + // VirtualNetworkGatewayTypeVpn specifies the virtual network gateway type vpn state for virtual network gateway type. VirtualNetworkGatewayTypeVpn VirtualNetworkGatewayType = "Vpn" ) -// VirtualNetworkPeeringState enumerates the values for virtual network peering -// state. +// VirtualNetworkPeeringState enumerates the values for virtual network peering state. type VirtualNetworkPeeringState string const ( - // Connected specifies the connected state for virtual network peering - // state. + // Connected specifies the connected state for virtual network peering state. Connected VirtualNetworkPeeringState = "Connected" - // Disconnected specifies the disconnected state for virtual network - // peering state. + // Disconnected specifies the disconnected state for virtual network peering state. Disconnected VirtualNetworkPeeringState = "Disconnected" - // Initiated specifies the initiated state for virtual network peering - // state. + // Initiated specifies the initiated state for virtual network peering state. Initiated VirtualNetworkPeeringState = "Initiated" ) +// VpnClientProtocol enumerates the values for vpn client protocol. +type VpnClientProtocol string + +const ( + // IkeV2 specifies the ike v2 state for vpn client protocol. + IkeV2 VpnClientProtocol = "IkeV2" + // SSTP specifies the sstp state for vpn client protocol. + SSTP VpnClientProtocol = "SSTP" +) + // VpnType enumerates the values for vpn type. type VpnType string @@ -853,8 +953,8 @@ const ( RouteBased VpnType = "RouteBased" ) -// AddressSpace is addressSpace contains an array of IP address ranges that can -// be used by subnets of the virtual network. +// AddressSpace is addressSpace contains an array of IP address ranges that can be used by subnets of the virtual +// network. type AddressSpace struct { AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` } @@ -871,114 +971,151 @@ type ApplicationGateway struct { Etag *string `json:"etag,omitempty"` } -// ApplicationGatewayAuthenticationCertificate is authentication certificates -// of an application gateway. +// ApplicationGatewayAuthenticationCertificate is authentication certificates of an application gateway. type ApplicationGatewayAuthenticationCertificate struct { ID *string `json:"id,omitempty"` *ApplicationGatewayAuthenticationCertificatePropertiesFormat `json:"properties,omitempty"` Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` + Type *string `json:"type,omitempty"` } -// ApplicationGatewayAuthenticationCertificatePropertiesFormat is -// authentication certificates properties of an application gateway. +// ApplicationGatewayAuthenticationCertificatePropertiesFormat is authentication certificates properties of an +// application gateway. type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { Data *string `json:"data,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewayAvailableWafRuleSetsResult is response for -// ApplicationGatewayAvailableWafRuleSets API service call. +// ApplicationGatewayAvailableSslOptions is response for ApplicationGatewayAvailableSslOptions API service call. +type ApplicationGatewayAvailableSslOptions struct { + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *ApplicationGatewayAvailableSslOptionsPropertiesFormat `json:"properties,omitempty"` +} + +// ApplicationGatewayAvailableSslOptionsPropertiesFormat is properties of ApplicationGatewayAvailableSslOptions +type ApplicationGatewayAvailableSslOptionsPropertiesFormat struct { + PredefinedPolicies *[]SubResource `json:"predefinedPolicies,omitempty"` + DefaultPolicy ApplicationGatewaySslPolicyName `json:"defaultPolicy,omitempty"` + AvailableCipherSuites *[]ApplicationGatewaySslCipherSuite `json:"availableCipherSuites,omitempty"` + AvailableProtocols *[]ApplicationGatewaySslProtocol `json:"availableProtocols,omitempty"` +} + +// ApplicationGatewayAvailableSslPredefinedPolicies is response for ApplicationGatewayAvailableSslOptions API service +// call. +type ApplicationGatewayAvailableSslPredefinedPolicies struct { + autorest.Response `json:"-"` + Value *[]ApplicationGatewaySslPredefinedPolicy `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// ApplicationGatewayAvailableSslPredefinedPoliciesPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client ApplicationGatewayAvailableSslPredefinedPolicies) ApplicationGatewayAvailableSslPredefinedPoliciesPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// ApplicationGatewayAvailableWafRuleSetsResult is response for ApplicationGatewayAvailableWafRuleSets API service +// call. type ApplicationGatewayAvailableWafRuleSetsResult struct { autorest.Response `json:"-"` Value *[]ApplicationGatewayFirewallRuleSet `json:"value,omitempty"` } -// ApplicationGatewayBackendAddress is backend address of an application -// gateway. +// ApplicationGatewayBackendAddress is backend address of an application gateway. type ApplicationGatewayBackendAddress struct { Fqdn *string `json:"fqdn,omitempty"` IPAddress *string `json:"ipAddress,omitempty"` } -// ApplicationGatewayBackendAddressPool is backend Address Pool of an -// application gateway. +// ApplicationGatewayBackendAddressPool is backend Address Pool of an application gateway. type ApplicationGatewayBackendAddressPool struct { ID *string `json:"id,omitempty"` *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` + Type *string `json:"type,omitempty"` } -// ApplicationGatewayBackendAddressPoolPropertiesFormat is properties of -// Backend Address Pool of an application gateway. +// ApplicationGatewayBackendAddressPoolPropertiesFormat is properties of Backend Address Pool of an application +// gateway. type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewayBackendHealth is list of -// ApplicationGatewayBackendHealthPool resources. +// ApplicationGatewayBackendHealth is list of ApplicationGatewayBackendHealthPool resources. type ApplicationGatewayBackendHealth struct { autorest.Response `json:"-"` BackendAddressPools *[]ApplicationGatewayBackendHealthPool `json:"backendAddressPools,omitempty"` } -// ApplicationGatewayBackendHealthHTTPSettings is application gateway -// BackendHealthHttp settings. +// ApplicationGatewayBackendHealthHTTPSettings is application gateway BackendHealthHttp settings. type ApplicationGatewayBackendHealthHTTPSettings struct { BackendHTTPSettings *ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettings,omitempty"` Servers *[]ApplicationGatewayBackendHealthServer `json:"servers,omitempty"` } -// ApplicationGatewayBackendHealthPool is application gateway BackendHealth -// pool. +// ApplicationGatewayBackendHealthPool is application gateway BackendHealth pool. type ApplicationGatewayBackendHealthPool struct { BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"` BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHealthHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` } -// ApplicationGatewayBackendHealthServer is application gateway backendhealth -// http settings. +// ApplicationGatewayBackendHealthServer is application gateway backendhealth http settings. type ApplicationGatewayBackendHealthServer struct { Address *string `json:"address,omitempty"` - IPConfiguration *SubResource `json:"ipConfiguration,omitempty"` + IPConfiguration *InterfaceIPConfiguration `json:"ipConfiguration,omitempty"` Health ApplicationGatewayBackendHealthServerHealth `json:"health,omitempty"` } -// ApplicationGatewayBackendHTTPSettings is backend address pool settings of an -// application gateway. +// ApplicationGatewayBackendHTTPSettings is backend address pool settings of an application gateway. type ApplicationGatewayBackendHTTPSettings struct { ID *string `json:"id,omitempty"` *ApplicationGatewayBackendHTTPSettingsPropertiesFormat `json:"properties,omitempty"` Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` + Type *string `json:"type,omitempty"` } -// ApplicationGatewayBackendHTTPSettingsPropertiesFormat is properties of -// Backend address pool settings of an application gateway. +// ApplicationGatewayBackendHTTPSettingsPropertiesFormat is properties of Backend address pool settings of an +// application gateway. type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { - Port *int32 `json:"port,omitempty"` - Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` - CookieBasedAffinity ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"` - RequestTimeout *int32 `json:"requestTimeout,omitempty"` - Probe *SubResource `json:"probe,omitempty"` - AuthenticationCertificates *[]SubResource `json:"authenticationCertificates,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - ConnectionDraining *ApplicationGatewayConnectionDraining `json:"connectionDraining,omitempty"` + Port *int32 `json:"port,omitempty"` + Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` + CookieBasedAffinity ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"` + RequestTimeout *int32 `json:"requestTimeout,omitempty"` + Probe *SubResource `json:"probe,omitempty"` + AuthenticationCertificates *[]SubResource `json:"authenticationCertificates,omitempty"` + ConnectionDraining *ApplicationGatewayConnectionDraining `json:"connectionDraining,omitempty"` + HostName *string `json:"hostName,omitempty"` + PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` + AffinityCookieName *string `json:"affinityCookieName,omitempty"` + ProbeEnabled *bool `json:"probeEnabled,omitempty"` + Path *string `json:"path,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewayConnectionDraining is connection draining allows open -// connections to a backend server to be active for a specified time after the -// backend server got removed from the configuration. +// ApplicationGatewayConnectionDraining is connection draining allows open connections to a backend server to be active +// for a specified time after the backend server got removed from the configuration. type ApplicationGatewayConnectionDraining struct { Enabled *bool `json:"enabled,omitempty"` DrainTimeoutInSec *int32 `json:"drainTimeoutInSec,omitempty"` } -// ApplicationGatewayFirewallDisabledRuleGroup is allows to disable rules -// within a rule group or an entire rule group. +// ApplicationGatewayFirewallDisabledRuleGroup is allows to disable rules within a rule group or an entire rule group. type ApplicationGatewayFirewallDisabledRuleGroup struct { RuleGroupName *string `json:"ruleGroupName,omitempty"` Rules *[]int32 `json:"rules,omitempty"` @@ -990,8 +1127,7 @@ type ApplicationGatewayFirewallRule struct { Description *string `json:"description,omitempty"` } -// ApplicationGatewayFirewallRuleGroup is a web application firewall rule -// group. +// ApplicationGatewayFirewallRuleGroup is a web application firewall rule group. type ApplicationGatewayFirewallRuleGroup struct { RuleGroupName *string `json:"ruleGroupName,omitempty"` Description *string `json:"description,omitempty"` @@ -1008,8 +1144,7 @@ type ApplicationGatewayFirewallRuleSet struct { *ApplicationGatewayFirewallRuleSetPropertiesFormat `json:"properties,omitempty"` } -// ApplicationGatewayFirewallRuleSetPropertiesFormat is properties of the web -// application firewall rule set. +// ApplicationGatewayFirewallRuleSetPropertiesFormat is properties of the web application firewall rule set. type ApplicationGatewayFirewallRuleSetPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` RuleSetType *string `json:"ruleSetType,omitempty"` @@ -1017,17 +1152,17 @@ type ApplicationGatewayFirewallRuleSetPropertiesFormat struct { RuleGroups *[]ApplicationGatewayFirewallRuleGroup `json:"ruleGroups,omitempty"` } -// ApplicationGatewayFrontendIPConfiguration is frontend IP configuration of an -// application gateway. +// ApplicationGatewayFrontendIPConfiguration is frontend IP configuration of an application gateway. type ApplicationGatewayFrontendIPConfiguration struct { ID *string `json:"id,omitempty"` *ApplicationGatewayFrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` + Type *string `json:"type,omitempty"` } -// ApplicationGatewayFrontendIPConfigurationPropertiesFormat is properties of -// Frontend IP configuration of an application gateway. +// ApplicationGatewayFrontendIPConfigurationPropertiesFormat is properties of Frontend IP configuration of an +// application gateway. type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { PrivateIPAddress *string `json:"privateIPAddress,omitempty"` PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` @@ -1042,10 +1177,10 @@ type ApplicationGatewayFrontendPort struct { *ApplicationGatewayFrontendPortPropertiesFormat `json:"properties,omitempty"` Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` + Type *string `json:"type,omitempty"` } -// ApplicationGatewayFrontendPortPropertiesFormat is properties of Frontend -// port of an application gateway. +// ApplicationGatewayFrontendPortPropertiesFormat is properties of Frontend port of an application gateway. type ApplicationGatewayFrontendPortPropertiesFormat struct { Port *int32 `json:"port,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` @@ -1057,10 +1192,10 @@ type ApplicationGatewayHTTPListener struct { *ApplicationGatewayHTTPListenerPropertiesFormat `json:"properties,omitempty"` Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` + Type *string `json:"type,omitempty"` } -// ApplicationGatewayHTTPListenerPropertiesFormat is properties of HTTP -// listener of an application gateway. +// ApplicationGatewayHTTPListenerPropertiesFormat is properties of HTTP listener of an application gateway. type ApplicationGatewayHTTPListenerPropertiesFormat struct { FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` FrontendPort *SubResource `json:"frontendPort,omitempty"` @@ -1071,24 +1206,23 @@ type ApplicationGatewayHTTPListenerPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewayIPConfiguration is iP configuration of an application -// gateway. Currently 1 public and 1 private IP configuration is allowed. +// ApplicationGatewayIPConfiguration is IP configuration of an application gateway. Currently 1 public and 1 private IP +// configuration is allowed. type ApplicationGatewayIPConfiguration struct { ID *string `json:"id,omitempty"` *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` + Type *string `json:"type,omitempty"` } -// ApplicationGatewayIPConfigurationPropertiesFormat is properties of IP -// configuration of an application gateway. +// ApplicationGatewayIPConfigurationPropertiesFormat is properties of IP configuration of an application gateway. type ApplicationGatewayIPConfigurationPropertiesFormat struct { Subnet *SubResource `json:"subnet,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewayListResult is response for ListApplicationGateways API -// service call. +// ApplicationGatewayListResult is response for ListApplicationGateways API service call. type ApplicationGatewayListResult struct { autorest.Response `json:"-"` Value *[]ApplicationGateway `json:"value,omitempty"` @@ -1107,22 +1241,22 @@ func (client ApplicationGatewayListResult) ApplicationGatewayListResultPreparer( autorest.WithBaseURL(to.String(client.NextLink))) } -// ApplicationGatewayPathRule is path rule of URL path map of an application -// gateway. +// ApplicationGatewayPathRule is path rule of URL path map of an application gateway. type ApplicationGatewayPathRule struct { ID *string `json:"id,omitempty"` *ApplicationGatewayPathRulePropertiesFormat `json:"properties,omitempty"` Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` + Type *string `json:"type,omitempty"` } -// ApplicationGatewayPathRulePropertiesFormat is properties of probe of an -// application gateway. +// ApplicationGatewayPathRulePropertiesFormat is properties of path rule of an application gateway. type ApplicationGatewayPathRulePropertiesFormat struct { - Paths *[]string `json:"paths,omitempty"` - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` + Paths *[]string `json:"paths,omitempty"` + BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` + BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` + RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` } // ApplicationGatewayProbe is probe of the application gateway. @@ -1131,18 +1265,27 @@ type ApplicationGatewayProbe struct { *ApplicationGatewayProbePropertiesFormat `json:"properties,omitempty"` Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` + Type *string `json:"type,omitempty"` } -// ApplicationGatewayProbePropertiesFormat is properties of probe of an -// application gateway. +// ApplicationGatewayProbeHealthResponseMatch is application gateway probe health response match +type ApplicationGatewayProbeHealthResponseMatch struct { + Body *string `json:"body,omitempty"` + StatusCodes *[]string `json:"statusCodes,omitempty"` +} + +// ApplicationGatewayProbePropertiesFormat is properties of probe of an application gateway. type ApplicationGatewayProbePropertiesFormat struct { - Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` - Host *string `json:"host,omitempty"` - Path *string `json:"path,omitempty"` - Interval *int32 `json:"interval,omitempty"` - Timeout *int32 `json:"timeout,omitempty"` - UnhealthyThreshold *int32 `json:"unhealthyThreshold,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` + Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"` + Host *string `json:"host,omitempty"` + Path *string `json:"path,omitempty"` + Interval *int32 `json:"interval,omitempty"` + Timeout *int32 `json:"timeout,omitempty"` + UnhealthyThreshold *int32 `json:"unhealthyThreshold,omitempty"` + PickHostNameFromBackendHTTPSettings *bool `json:"pickHostNameFromBackendHttpSettings,omitempty"` + MinServers *int32 `json:"minServers,omitempty"` + Match *ApplicationGatewayProbeHealthResponseMatch `json:"match,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` } // ApplicationGatewayPropertiesFormat is properties of the application gateway. @@ -1161,49 +1304,72 @@ type ApplicationGatewayPropertiesFormat struct { HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"` URLPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"` RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"` + RedirectConfigurations *[]ApplicationGatewayRedirectConfiguration `json:"redirectConfigurations,omitempty"` WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` ResourceGUID *string `json:"resourceGuid,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewayRequestRoutingRule is request routing rule of an -// application gateway. +// ApplicationGatewayRedirectConfiguration is redirect configuration of an application gateway. +type ApplicationGatewayRedirectConfiguration struct { + ID *string `json:"id,omitempty"` + *ApplicationGatewayRedirectConfigurationPropertiesFormat `json:"properties,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` + Type *string `json:"type,omitempty"` +} + +// ApplicationGatewayRedirectConfigurationPropertiesFormat is properties of redirect configuration of the application +// gateway. +type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { + RedirectType ApplicationGatewayRedirectType `json:"redirectType,omitempty"` + TargetListener *SubResource `json:"targetListener,omitempty"` + TargetURL *string `json:"targetUrl,omitempty"` + IncludePath *bool `json:"includePath,omitempty"` + IncludeQueryString *bool `json:"includeQueryString,omitempty"` + RequestRoutingRules *[]SubResource `json:"requestRoutingRules,omitempty"` + URLPathMaps *[]SubResource `json:"urlPathMaps,omitempty"` + PathRules *[]SubResource `json:"pathRules,omitempty"` +} + +// ApplicationGatewayRequestRoutingRule is request routing rule of an application gateway. type ApplicationGatewayRequestRoutingRule struct { ID *string `json:"id,omitempty"` *ApplicationGatewayRequestRoutingRulePropertiesFormat `json:"properties,omitempty"` Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` + Type *string `json:"type,omitempty"` } -// ApplicationGatewayRequestRoutingRulePropertiesFormat is properties of -// request routing rule of the application gateway. +// ApplicationGatewayRequestRoutingRulePropertiesFormat is properties of request routing rule of the application +// gateway. type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { - RuleType ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` - HTTPListener *SubResource `json:"httpListener,omitempty"` - URLPathMap *SubResource `json:"urlPathMap,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` + RuleType ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` + BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` + BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` + HTTPListener *SubResource `json:"httpListener,omitempty"` + URLPathMap *SubResource `json:"urlPathMap,omitempty"` + RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewaySku is sKU of an application gateway +// ApplicationGatewaySku is SKU of an application gateway type ApplicationGatewaySku struct { Name ApplicationGatewaySkuName `json:"name,omitempty"` Tier ApplicationGatewayTier `json:"tier,omitempty"` Capacity *int32 `json:"capacity,omitempty"` } -// ApplicationGatewaySslCertificate is sSL certificates of an application -// gateway. +// ApplicationGatewaySslCertificate is SSL certificates of an application gateway. type ApplicationGatewaySslCertificate struct { ID *string `json:"id,omitempty"` *ApplicationGatewaySslCertificatePropertiesFormat `json:"properties,omitempty"` Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` + Type *string `json:"type,omitempty"` } -// ApplicationGatewaySslCertificatePropertiesFormat is properties of SSL -// certificates of an application gateway. +// ApplicationGatewaySslCertificatePropertiesFormat is properties of SSL certificates of an application gateway. type ApplicationGatewaySslCertificatePropertiesFormat struct { Data *string `json:"data,omitempty"` Password *string `json:"password,omitempty"` @@ -1211,31 +1377,48 @@ type ApplicationGatewaySslCertificatePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewaySslPolicy is application gateway SSL policy. +// ApplicationGatewaySslPolicy is application Gateway Ssl policy. type ApplicationGatewaySslPolicy struct { - DisabledSslProtocols *[]ApplicationGatewaySslProtocol `json:"disabledSslProtocols,omitempty"` + DisabledSslProtocols *[]ApplicationGatewaySslProtocol `json:"disabledSslProtocols,omitempty"` + PolicyType ApplicationGatewaySslPolicyType `json:"policyType,omitempty"` + PolicyName ApplicationGatewaySslPolicyName `json:"policyName,omitempty"` + CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"` + MinProtocolVersion ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` } -// ApplicationGatewayURLPathMap is urlPathMaps give a url path to the backend -// mapping information for PathBasedRouting. +// ApplicationGatewaySslPredefinedPolicy is an Ssl predefined policy +type ApplicationGatewaySslPredefinedPolicy struct { + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + *ApplicationGatewaySslPredefinedPolicyPropertiesFormat `json:"properties,omitempty"` +} + +// ApplicationGatewaySslPredefinedPolicyPropertiesFormat is properties of ApplicationGatewaySslPredefinedPolicy +type ApplicationGatewaySslPredefinedPolicyPropertiesFormat struct { + CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"` + MinProtocolVersion ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` +} + +// ApplicationGatewayURLPathMap is urlPathMaps give a url path to the backend mapping information for PathBasedRouting. type ApplicationGatewayURLPathMap struct { ID *string `json:"id,omitempty"` *ApplicationGatewayURLPathMapPropertiesFormat `json:"properties,omitempty"` Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` + Type *string `json:"type,omitempty"` } -// ApplicationGatewayURLPathMapPropertiesFormat is properties of UrlPathMap of -// the application gateway. +// ApplicationGatewayURLPathMapPropertiesFormat is properties of UrlPathMap of the application gateway. type ApplicationGatewayURLPathMapPropertiesFormat struct { - DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` - DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` - PathRules *[]ApplicationGatewayPathRule `json:"pathRules,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` + DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` + DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` + DefaultRedirectConfiguration *SubResource `json:"defaultRedirectConfiguration,omitempty"` + PathRules *[]ApplicationGatewayPathRule `json:"pathRules,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` } -// ApplicationGatewayWebApplicationFirewallConfiguration is application gateway -// web application firewall configuration. +// ApplicationGatewayWebApplicationFirewallConfiguration is application gateway web application firewall configuration. type ApplicationGatewayWebApplicationFirewallConfiguration struct { Enabled *bool `json:"enabled,omitempty"` FirewallMode ApplicationGatewayFirewallMode `json:"firewallMode,omitempty"` @@ -1244,8 +1427,45 @@ type ApplicationGatewayWebApplicationFirewallConfiguration struct { DisabledRuleGroups *[]ApplicationGatewayFirewallDisabledRuleGroup `json:"disabledRuleGroups,omitempty"` } -// AuthorizationListResult is response for ListAuthorizations API service call -// retrieves all authorizations that belongs to an ExpressRouteCircuit. +// ApplicationSecurityGroup is an application security group in a resource group. +type ApplicationSecurityGroup struct { + autorest.Response `json:"-"` + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` + Etag *string `json:"etag,omitempty"` +} + +// ApplicationSecurityGroupListResult is a list of application security groups. +type ApplicationSecurityGroupListResult struct { + autorest.Response `json:"-"` + Value *[]ApplicationSecurityGroup `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// ApplicationSecurityGroupListResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client ApplicationSecurityGroupListResult) ApplicationSecurityGroupListResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// ApplicationSecurityGroupPropertiesFormat is application security group properties. +type ApplicationSecurityGroupPropertiesFormat struct { + ResourceGUID *string `json:"resourceGuid,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// AuthorizationListResult is response for ListAuthorizations API service call retrieves all authorizations that +// belongs to an ExpressRouteCircuit. type AuthorizationListResult struct { autorest.Response `json:"-"` Value *[]ExpressRouteCircuitAuthorization `json:"value,omitempty"` @@ -1271,29 +1491,97 @@ type AuthorizationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// AzureAsyncOperationResult is the response body contains the status of the -// specified asynchronous operation, indicating whether it has succeeded, is in -// progress, or has failed. Note that this status is distinct from the HTTP -// status code returned for the Get Operation Status operation itself. If the -// asynchronous operation succeeded, the response body includes the HTTP status -// code for the successful request. If the asynchronous operation failed, the -// response body includes the HTTP status code for the failed request and error -// information regarding the failure. +// AvailableProvidersList is list of available countries with details. +type AvailableProvidersList struct { + autorest.Response `json:"-"` + Countries *[]AvailableProvidersListCountry `json:"countries,omitempty"` +} + +// AvailableProvidersListCity is city or town details. +type AvailableProvidersListCity struct { + CityName *string `json:"cityName,omitempty"` + Providers *[]string `json:"providers,omitempty"` +} + +// AvailableProvidersListCountry is country details. +type AvailableProvidersListCountry struct { + CountryName *string `json:"countryName,omitempty"` + Providers *[]string `json:"providers,omitempty"` + States *[]AvailableProvidersListState `json:"states,omitempty"` +} + +// AvailableProvidersListParameters is constraints that determine the list of available Internet service providers. +type AvailableProvidersListParameters struct { + AzureLocations *[]string `json:"azureLocations,omitempty"` + Country *string `json:"country,omitempty"` + State *string `json:"state,omitempty"` + City *string `json:"city,omitempty"` +} + +// AvailableProvidersListState is state details. +type AvailableProvidersListState struct { + StateName *string `json:"stateName,omitempty"` + Providers *[]string `json:"providers,omitempty"` + Cities *[]AvailableProvidersListCity `json:"cities,omitempty"` +} + +// AzureAsyncOperationResult is the response body contains the status of the specified asynchronous operation, +// indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct from the HTTP +// status code returned for the Get Operation Status operation itself. If the asynchronous operation succeeded, the +// response body includes the HTTP status code for the successful request. If the asynchronous operation failed, the +// response body includes the HTTP status code for the failed request and error information regarding the failure. type AzureAsyncOperationResult struct { Status OperationStatus `json:"status,omitempty"` Error *Error `json:"error,omitempty"` } +// AzureReachabilityReport is azure reachability report details. +type AzureReachabilityReport struct { + autorest.Response `json:"-"` + AggregationLevel *string `json:"aggregationLevel,omitempty"` + ProviderLocation *AzureReachabilityReportLocation `json:"providerLocation,omitempty"` + ReachabilityReport *[]AzureReachabilityReportItem `json:"reachabilityReport,omitempty"` +} + +// AzureReachabilityReportItem is azure reachability report details for a given provider location. +type AzureReachabilityReportItem struct { + Provider *string `json:"provider,omitempty"` + AzureLocation *string `json:"azureLocation,omitempty"` + Latencies *[]AzureReachabilityReportLatencyInfo `json:"latencies,omitempty"` +} + +// AzureReachabilityReportLatencyInfo is details on latency for a time series. +type AzureReachabilityReportLatencyInfo struct { + TimeStamp *date.Time `json:"timeStamp,omitempty"` + Score *int32 `json:"score,omitempty"` +} + +// AzureReachabilityReportLocation is parameters that define a geographic location. +type AzureReachabilityReportLocation struct { + Country *string `json:"country,omitempty"` + State *string `json:"state,omitempty"` + City *string `json:"city,omitempty"` +} + +// AzureReachabilityReportParameters is geographic and time constraints for Azure reachability report. +type AzureReachabilityReportParameters struct { + ProviderLocation *AzureReachabilityReportLocation `json:"providerLocation,omitempty"` + Providers *[]string `json:"providers,omitempty"` + AzureLocations *[]string `json:"azureLocations,omitempty"` + StartTime *date.Time `json:"startTime,omitempty"` + EndTime *date.Time `json:"endTime,omitempty"` +} + // BackendAddressPool is pool of backend IP addresses. type BackendAddressPool struct { + autorest.Response `json:"-"` ID *string `json:"id,omitempty"` *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` } -// BackendAddressPoolPropertiesFormat is properties of the backend address -// pool. +// BackendAddressPoolPropertiesFormat is properties of the backend address pool. type BackendAddressPoolPropertiesFormat struct { BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` @@ -1301,16 +1589,17 @@ type BackendAddressPoolPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// BGPCommunity is contains bgp community information offered in Service -// Community resources. +// BGPCommunity is contains bgp community information offered in Service Community resources. type BGPCommunity struct { ServiceSupportedRegion *string `json:"serviceSupportedRegion,omitempty"` CommunityName *string `json:"communityName,omitempty"` CommunityValue *string `json:"communityValue,omitempty"` CommunityPrefixes *[]string `json:"communityPrefixes,omitempty"` + IsAuthorizedToUse *bool `json:"isAuthorizedToUse,omitempty"` + ServiceGroup *string `json:"serviceGroup,omitempty"` } -// BgpPeerStatus is bGP peer status details +// BgpPeerStatus is BGP peer status details type BgpPeerStatus struct { LocalAddress *string `json:"localAddress,omitempty"` Neighbor *string `json:"neighbor,omitempty"` @@ -1322,8 +1611,7 @@ type BgpPeerStatus struct { MessagesReceived *int64 `json:"messagesReceived,omitempty"` } -// BgpPeerStatusListResult is response for list BGP peer status API service -// call +// BgpPeerStatusListResult is response for list BGP peer status API service call type BgpPeerStatusListResult struct { autorest.Response `json:"-"` Value *[]BgpPeerStatus `json:"value,omitempty"` @@ -1339,8 +1627,7 @@ type BgpServiceCommunity struct { *BgpServiceCommunityPropertiesFormat `json:"properties,omitempty"` } -// BgpServiceCommunityListResult is response for the ListServiceCommunity API -// service call. +// BgpServiceCommunityListResult is response for the ListServiceCommunity API service call. type BgpServiceCommunityListResult struct { autorest.Response `json:"-"` Value *[]BgpServiceCommunity `json:"value,omitempty"` @@ -1365,7 +1652,7 @@ type BgpServiceCommunityPropertiesFormat struct { BgpCommunities *[]BGPCommunity `json:"bgpCommunities,omitempty"` } -// BgpSettings is bGP settings details +// BgpSettings is BGP settings details type BgpSettings struct { Asn *int64 `json:"asn,omitempty"` BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` @@ -1384,15 +1671,62 @@ type ConnectionSharedKey struct { Value *string `json:"value,omitempty"` } -// DhcpOptions is dhcpOptions contains an array of DNS servers available to VMs -// deployed in the virtual network. Standard DHCP option for a subnet overrides -// VNET DHCP options. +// ConnectivityDestination is parameters that define destination of connection. +type ConnectivityDestination struct { + ResourceID *string `json:"resourceId,omitempty"` + Address *string `json:"address,omitempty"` + Port *int32 `json:"port,omitempty"` +} + +// ConnectivityHop is information about a hop between the source and the destination. +type ConnectivityHop struct { + Type *string `json:"type,omitempty"` + ID *string `json:"id,omitempty"` + Address *string `json:"address,omitempty"` + ResourceID *string `json:"resourceId,omitempty"` + NextHopIds *[]string `json:"nextHopIds,omitempty"` + Issues *[]ConnectivityIssue `json:"issues,omitempty"` +} + +// ConnectivityInformation is information on the connectivity status. +type ConnectivityInformation struct { + autorest.Response `json:"-"` + Hops *[]ConnectivityHop `json:"hops,omitempty"` + ConnectionStatus ConnectionStatus `json:"connectionStatus,omitempty"` + AvgLatencyInMs *int32 `json:"avgLatencyInMs,omitempty"` + MinLatencyInMs *int32 `json:"minLatencyInMs,omitempty"` + MaxLatencyInMs *int32 `json:"maxLatencyInMs,omitempty"` + ProbesSent *int32 `json:"probesSent,omitempty"` + ProbesFailed *int32 `json:"probesFailed,omitempty"` +} + +// ConnectivityIssue is information about an issue encountered in the process of checking for connectivity. +type ConnectivityIssue struct { + Origin Origin `json:"origin,omitempty"` + Severity Severity `json:"severity,omitempty"` + Type IssueType `json:"type,omitempty"` + Context *[]map[string]*string `json:"context,omitempty"` +} + +// ConnectivityParameters is parameters that determine how the connectivity check will be performed. +type ConnectivityParameters struct { + Source *ConnectivitySource `json:"source,omitempty"` + Destination *ConnectivityDestination `json:"destination,omitempty"` +} + +// ConnectivitySource is parameters that define the source of the connection. +type ConnectivitySource struct { + ResourceID *string `json:"resourceId,omitempty"` + Port *int32 `json:"port,omitempty"` +} + +// DhcpOptions is dhcpOptions contains an array of DNS servers available to VMs deployed in the virtual network. +// Standard DHCP option for a subnet overrides VNET DHCP options. type DhcpOptions struct { DNSServers *[]string `json:"dnsServers,omitempty"` } -// DNSNameAvailabilityResult is response for the CheckDnsNameAvailability API -// service call. +// DNSNameAvailabilityResult is response for the CheckDnsNameAvailability API service call. type DNSNameAvailabilityResult struct { autorest.Response `json:"-"` Available *bool `json:"available,omitempty"` @@ -1403,17 +1737,16 @@ type EffectiveNetworkSecurityGroup struct { NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` Association *EffectiveNetworkSecurityGroupAssociation `json:"association,omitempty"` EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` + TagMap *map[string][]string `json:"tagMap,omitempty"` } -// EffectiveNetworkSecurityGroupAssociation is the effective network security -// group association. +// EffectiveNetworkSecurityGroupAssociation is the effective network security group association. type EffectiveNetworkSecurityGroupAssociation struct { Subnet *SubResource `json:"subnet,omitempty"` NetworkInterface *SubResource `json:"networkInterface,omitempty"` } -// EffectiveNetworkSecurityGroupListResult is response for list effective -// network security groups API service call. +// EffectiveNetworkSecurityGroupListResult is response for list effective network security groups API service call. type EffectiveNetworkSecurityGroupListResult struct { autorest.Response `json:"-"` Value *[]EffectiveNetworkSecurityGroup `json:"value,omitempty"` @@ -1422,17 +1755,21 @@ type EffectiveNetworkSecurityGroupListResult struct { // EffectiveNetworkSecurityRule is effective network security rules. type EffectiveNetworkSecurityRule struct { - Name *string `json:"name,omitempty"` - Protocol SecurityRuleProtocol `json:"protocol,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - ExpandedSourceAddressPrefix *[]string `json:"expandedSourceAddressPrefix,omitempty"` - ExpandedDestinationAddressPrefix *[]string `json:"expandedDestinationAddressPrefix,omitempty"` - Access SecurityRuleAccess `json:"access,omitempty"` - Priority *int32 `json:"priority,omitempty"` - Direction SecurityRuleDirection `json:"direction,omitempty"` + Name *string `json:"name,omitempty"` + Protocol EffectiveSecurityRuleProtocol `json:"protocol,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + ExpandedSourceAddressPrefix *[]string `json:"expandedSourceAddressPrefix,omitempty"` + ExpandedDestinationAddressPrefix *[]string `json:"expandedDestinationAddressPrefix,omitempty"` + Access SecurityRuleAccess `json:"access,omitempty"` + Priority *int32 `json:"priority,omitempty"` + Direction SecurityRuleDirection `json:"direction,omitempty"` } // EffectiveRoute is effective Route @@ -1445,14 +1782,39 @@ type EffectiveRoute struct { NextHopType RouteNextHopType `json:"nextHopType,omitempty"` } -// EffectiveRouteListResult is response for list effective route API service -// call. +// EffectiveRouteListResult is response for list effective route API service call. type EffectiveRouteListResult struct { autorest.Response `json:"-"` Value *[]EffectiveRoute `json:"value,omitempty"` NextLink *string `json:"nextLink,omitempty"` } +// EndpointServiceResult is endpoint service. +type EndpointServiceResult struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} + +// EndpointServicesListResult is response for the ListAvailableEndpointServices API service call. +type EndpointServicesListResult struct { + autorest.Response `json:"-"` + Value *[]EndpointServiceResult `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// EndpointServicesListResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client EndpointServicesListResult) EndpointServicesListResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + // Error is type Error struct { Code *string `json:"code,omitempty"` @@ -1482,8 +1844,7 @@ type ExpressRouteCircuit struct { Etag *string `json:"etag,omitempty"` } -// ExpressRouteCircuitArpTable is the ARP table associated with the -// ExpressRouteCircuit. +// ExpressRouteCircuitArpTable is the ARP table associated with the ExpressRouteCircuit. type ExpressRouteCircuitArpTable struct { Age *int32 `json:"age,omitempty"` Interface *string `json:"interface,omitempty"` @@ -1491,8 +1852,7 @@ type ExpressRouteCircuitArpTable struct { MacAddress *string `json:"macAddress,omitempty"` } -// ExpressRouteCircuitAuthorization is authorization in an ExpressRouteCircuit -// resource. +// ExpressRouteCircuitAuthorization is authorization in an ExpressRouteCircuit resource. type ExpressRouteCircuitAuthorization struct { autorest.Response `json:"-"` ID *string `json:"id,omitempty"` @@ -1501,8 +1861,7 @@ type ExpressRouteCircuitAuthorization struct { Etag *string `json:"etag,omitempty"` } -// ExpressRouteCircuitListResult is response for ListExpressRouteCircuit API -// service call. +// ExpressRouteCircuitListResult is response for ListExpressRouteCircuit API service call. type ExpressRouteCircuitListResult struct { autorest.Response `json:"-"` Value *[]ExpressRouteCircuit `json:"value,omitempty"` @@ -1533,13 +1892,15 @@ type ExpressRouteCircuitPeering struct { // ExpressRouteCircuitPeeringConfig is specifies the peering configuration. type ExpressRouteCircuitPeeringConfig struct { AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` + AdvertisedCommunities *[]string `json:"advertisedCommunities,omitempty"` AdvertisedPublicPrefixesState ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` + LegacyMode *int32 `json:"legacyMode,omitempty"` CustomerASN *int32 `json:"customerASN,omitempty"` RoutingRegistryName *string `json:"routingRegistryName,omitempty"` } -// ExpressRouteCircuitPeeringListResult is response for ListPeering API service -// call retrieves all peerings that belong to an ExpressRouteCircuit. +// ExpressRouteCircuitPeeringListResult is response for ListPeering API service call retrieves all peerings that belong +// to an ExpressRouteCircuit. type ExpressRouteCircuitPeeringListResult struct { autorest.Response `json:"-"` Value *[]ExpressRouteCircuitPeering `json:"value,omitempty"` @@ -1560,22 +1921,23 @@ func (client ExpressRouteCircuitPeeringListResult) ExpressRouteCircuitPeeringLis // ExpressRouteCircuitPeeringPropertiesFormat is type ExpressRouteCircuitPeeringPropertiesFormat struct { - PeeringType ExpressRouteCircuitPeeringType `json:"peeringType,omitempty"` - State ExpressRouteCircuitPeeringState `json:"state,omitempty"` - AzureASN *int32 `json:"azureASN,omitempty"` - PeerASN *int32 `json:"peerASN,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - VlanID *int32 `json:"vlanId,omitempty"` - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - Stats *ExpressRouteCircuitStats `json:"stats,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - RouteFilter *RouteFilter `json:"routeFilter,omitempty"` + PeeringType ExpressRouteCircuitPeeringType `json:"peeringType,omitempty"` + State ExpressRouteCircuitPeeringState `json:"state,omitempty"` + AzureASN *int32 `json:"azureASN,omitempty"` + PeerASN *int32 `json:"peerASN,omitempty"` + PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` + SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` + PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` + SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` + SharedKey *string `json:"sharedKey,omitempty"` + VlanID *int32 `json:"vlanId,omitempty"` + MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` + Stats *ExpressRouteCircuitStats `json:"stats,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + RouteFilter *RouteFilter `json:"routeFilter,omitempty"` + Ipv6PeeringConfig *Ipv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` } // ExpressRouteCircuitPropertiesFormat is properties of ExpressRouteCircuit. @@ -1592,8 +1954,7 @@ type ExpressRouteCircuitPropertiesFormat struct { GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` } -// ExpressRouteCircuitRoutesTable is the routes table associated with the -// ExpressRouteCircuit +// ExpressRouteCircuitRoutesTable is the routes table associated with the ExpressRouteCircuit type ExpressRouteCircuitRoutesTable struct { NetworkProperty *string `json:"network,omitempty"` NextHop *string `json:"nextHop,omitempty"` @@ -1602,8 +1963,7 @@ type ExpressRouteCircuitRoutesTable struct { Path *string `json:"path,omitempty"` } -// ExpressRouteCircuitRoutesTableSummary is the routes table associated with -// the ExpressRouteCircuit. +// ExpressRouteCircuitRoutesTableSummary is the routes table associated with the ExpressRouteCircuit. type ExpressRouteCircuitRoutesTableSummary struct { Neighbor *string `json:"neighbor,omitempty"` V *int32 `json:"v,omitempty"` @@ -1612,16 +1972,14 @@ type ExpressRouteCircuitRoutesTableSummary struct { StatePfxRcd *string `json:"statePfxRcd,omitempty"` } -// ExpressRouteCircuitsArpTableListResult is response for ListArpTable -// associated with the Express Route Circuits API. +// ExpressRouteCircuitsArpTableListResult is response for ListArpTable associated with the Express Route Circuits API. type ExpressRouteCircuitsArpTableListResult struct { autorest.Response `json:"-"` Value *[]ExpressRouteCircuitArpTable `json:"value,omitempty"` NextLink *string `json:"nextLink,omitempty"` } -// ExpressRouteCircuitServiceProviderProperties is contains -// ServiceProviderProperties in an ExpressRouteCircuit. +// ExpressRouteCircuitServiceProviderProperties is contains ServiceProviderProperties in an ExpressRouteCircuit. type ExpressRouteCircuitServiceProviderProperties struct { ServiceProviderName *string `json:"serviceProviderName,omitempty"` PeeringLocation *string `json:"peeringLocation,omitempty"` @@ -1635,16 +1993,16 @@ type ExpressRouteCircuitSku struct { Family ExpressRouteCircuitSkuFamily `json:"family,omitempty"` } -// ExpressRouteCircuitsRoutesTableListResult is response for ListRoutesTable -// associated with the Express Route Circuits API. +// ExpressRouteCircuitsRoutesTableListResult is response for ListRoutesTable associated with the Express Route Circuits +// API. type ExpressRouteCircuitsRoutesTableListResult struct { autorest.Response `json:"-"` Value *[]ExpressRouteCircuitRoutesTable `json:"value,omitempty"` NextLink *string `json:"nextLink,omitempty"` } -// ExpressRouteCircuitsRoutesTableSummaryListResult is response for -// ListRoutesTable associated with the Express Route Circuits API. +// ExpressRouteCircuitsRoutesTableSummaryListResult is response for ListRoutesTable associated with the Express Route +// Circuits API. type ExpressRouteCircuitsRoutesTableSummaryListResult struct { autorest.Response `json:"-"` Value *[]ExpressRouteCircuitRoutesTableSummary `json:"value,omitempty"` @@ -1670,15 +2028,14 @@ type ExpressRouteServiceProvider struct { *ExpressRouteServiceProviderPropertiesFormat `json:"properties,omitempty"` } -// ExpressRouteServiceProviderBandwidthsOffered is contains bandwidths offered -// in ExpressRouteServiceProvider resources. +// ExpressRouteServiceProviderBandwidthsOffered is contains bandwidths offered in ExpressRouteServiceProvider +// resources. type ExpressRouteServiceProviderBandwidthsOffered struct { OfferName *string `json:"offerName,omitempty"` ValueInMbps *int32 `json:"valueInMbps,omitempty"` } -// ExpressRouteServiceProviderListResult is response for the -// ListExpressRouteServiceProvider API service call. +// ExpressRouteServiceProviderListResult is response for the ListExpressRouteServiceProvider API service call. type ExpressRouteServiceProviderListResult struct { autorest.Response `json:"-"` Value *[]ExpressRouteServiceProvider `json:"value,omitempty"` @@ -1697,8 +2054,7 @@ func (client ExpressRouteServiceProviderListResult) ExpressRouteServiceProviderL autorest.WithBaseURL(to.String(client.NextLink))) } -// ExpressRouteServiceProviderPropertiesFormat is properties of -// ExpressRouteServiceProvider. +// ExpressRouteServiceProviderPropertiesFormat is properties of ExpressRouteServiceProvider. type ExpressRouteServiceProviderPropertiesFormat struct { PeeringLocations *[]string `json:"peeringLocations,omitempty"` BandwidthsOffered *[]ExpressRouteServiceProviderBandwidthsOffered `json:"bandwidthsOffered,omitempty"` @@ -1719,22 +2075,22 @@ type FlowLogProperties struct { RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` } -// FlowLogStatusParameters is parameters that define a resource to query flow -// log status. +// FlowLogStatusParameters is parameters that define a resource to query flow log status. type FlowLogStatusParameters struct { TargetResourceID *string `json:"targetResourceId,omitempty"` } // FrontendIPConfiguration is frontend IP address of the load balancer. type FrontendIPConfiguration struct { + autorest.Response `json:"-"` ID *string `json:"id,omitempty"` *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Name *string `json:"name,omitempty"` - Etag *string `json:"etag,omitempty"` + Name *string `json:"name,omitempty"` + Etag *string `json:"etag,omitempty"` + Zones *[]string `json:"zones,omitempty"` } -// FrontendIPConfigurationPropertiesFormat is properties of Frontend IP -// Configuration of the load balancer. +// FrontendIPConfigurationPropertiesFormat is properties of Frontend IP Configuration of the load balancer. type FrontendIPConfigurationPropertiesFormat struct { InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` @@ -1784,12 +2140,32 @@ type InboundNatPoolPropertiesFormat struct { // InboundNatRule is inbound NAT rule of the load balancer. type InboundNatRule struct { + autorest.Response `json:"-"` ID *string `json:"id,omitempty"` *InboundNatRulePropertiesFormat `json:"properties,omitempty"` Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` } +// InboundNatRuleListResult is response for ListInboundNatRule API service call. +type InboundNatRuleListResult struct { + autorest.Response `json:"-"` + Value *[]InboundNatRule `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// InboundNatRuleListResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client InboundNatRuleListResult) InboundNatRuleListResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + // InboundNatRulePropertiesFormat is properties of the inbound NAT rule. type InboundNatRulePropertiesFormat struct { FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` @@ -1820,7 +2196,7 @@ type InterfaceAssociation struct { SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` } -// InterfaceDNSSettings is dNS settings of a network interface. +// InterfaceDNSSettings is DNS settings of a network interface. type InterfaceDNSSettings struct { DNSServers *[]string `json:"dnsServers,omitempty"` AppliedDNSServers *[]string `json:"appliedDnsServers,omitempty"` @@ -1831,12 +2207,32 @@ type InterfaceDNSSettings struct { // InterfaceIPConfiguration is iPConfiguration in a network interface. type InterfaceIPConfiguration struct { + autorest.Response `json:"-"` ID *string `json:"id,omitempty"` *InterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` } +// InterfaceIPConfigurationListResult is response for list ip configurations API service call. +type InterfaceIPConfigurationListResult struct { + autorest.Response `json:"-"` + Value *[]InterfaceIPConfiguration `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// InterfaceIPConfigurationListResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client InterfaceIPConfigurationListResult) InterfaceIPConfigurationListResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + // InterfaceIPConfigurationPropertiesFormat is properties of IP configuration. type InterfaceIPConfigurationPropertiesFormat struct { ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` @@ -1848,11 +2244,11 @@ type InterfaceIPConfigurationPropertiesFormat struct { Subnet *Subnet `json:"subnet,omitempty"` Primary *bool `json:"primary,omitempty"` PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` + ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` } -// InterfaceListResult is response for the ListNetworkInterface API service -// call. +// InterfaceListResult is response for the ListNetworkInterface API service call. type InterfaceListResult struct { autorest.Response `json:"-"` Value *[]Interface `json:"value,omitempty"` @@ -1871,6 +2267,25 @@ func (client InterfaceListResult) InterfaceListResultPreparer() (*http.Request, autorest.WithBaseURL(to.String(client.NextLink))) } +// InterfaceLoadBalancerListResult is response for list ip configurations API service call. +type InterfaceLoadBalancerListResult struct { + autorest.Response `json:"-"` + Value *[]LoadBalancer `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// InterfaceLoadBalancerListResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client InterfaceLoadBalancerListResult) InterfaceLoadBalancerListResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + // InterfacePropertiesFormat is networkInterface properties. type InterfacePropertiesFormat struct { VirtualMachine *SubResource `json:"virtualMachine,omitempty"` @@ -1885,15 +2300,14 @@ type InterfacePropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// IPAddressAvailabilityResult is response for CheckIPAddressAvailability API -// service call +// IPAddressAvailabilityResult is response for CheckIPAddressAvailability API service call type IPAddressAvailabilityResult struct { autorest.Response `json:"-"` Available *bool `json:"available,omitempty"` AvailableIPAddresses *[]string `json:"availableIPAddresses,omitempty"` } -// IPConfiguration is iPConfiguration +// IPConfiguration is IP configuration type IPConfiguration struct { ID *string `json:"id,omitempty"` *IPConfigurationPropertiesFormat `json:"properties,omitempty"` @@ -1910,8 +2324,7 @@ type IPConfigurationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// IpsecPolicy is an IPSec Policy configuration for a virtual network gateway -// connection +// IpsecPolicy is an IPSec Policy configuration for a virtual network gateway connection type IpsecPolicy struct { SaLifeTimeSeconds *int32 `json:"saLifeTimeSeconds,omitempty"` SaDataSizeKilobytes *int32 `json:"saDataSizeKilobytes,omitempty"` @@ -1923,6 +2336,15 @@ type IpsecPolicy struct { PfsGroup PfsGroup `json:"pfsGroup,omitempty"` } +// Ipv6ExpressRouteCircuitPeeringConfig is contains IPv6 peering config. +type Ipv6ExpressRouteCircuitPeeringConfig struct { + PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` + SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` + MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` + RouteFilter *RouteFilter `json:"routeFilter,omitempty"` + State ExpressRouteCircuitPeeringState `json:"state,omitempty"` +} + // LoadBalancer is loadBalancer resource type LoadBalancer struct { autorest.Response `json:"-"` @@ -1931,10 +2353,49 @@ type LoadBalancer struct { Type *string `json:"type,omitempty"` Location *string `json:"location,omitempty"` Tags *map[string]*string `json:"tags,omitempty"` + Sku *LoadBalancerSku `json:"sku,omitempty"` *LoadBalancerPropertiesFormat `json:"properties,omitempty"` Etag *string `json:"etag,omitempty"` } +// LoadBalancerBackendAddressPoolListResult is response for ListBackendAddressPool API service call. +type LoadBalancerBackendAddressPoolListResult struct { + autorest.Response `json:"-"` + Value *[]BackendAddressPool `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// LoadBalancerBackendAddressPoolListResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client LoadBalancerBackendAddressPoolListResult) LoadBalancerBackendAddressPoolListResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// LoadBalancerFrontendIPConfigurationListResult is response for ListFrontendIPConfiguration API service call. +type LoadBalancerFrontendIPConfigurationListResult struct { + autorest.Response `json:"-"` + Value *[]FrontendIPConfiguration `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// LoadBalancerFrontendIPConfigurationListResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client LoadBalancerFrontendIPConfigurationListResult) LoadBalancerFrontendIPConfigurationListResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + // LoadBalancerListResult is response for ListLoadBalancers API service call. type LoadBalancerListResult struct { autorest.Response `json:"-"` @@ -1954,6 +2415,44 @@ func (client LoadBalancerListResult) LoadBalancerListResultPreparer() (*http.Req autorest.WithBaseURL(to.String(client.NextLink))) } +// LoadBalancerLoadBalancingRuleListResult is response for ListLoadBalancingRule API service call. +type LoadBalancerLoadBalancingRuleListResult struct { + autorest.Response `json:"-"` + Value *[]LoadBalancingRule `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// LoadBalancerLoadBalancingRuleListResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client LoadBalancerLoadBalancingRuleListResult) LoadBalancerLoadBalancingRuleListResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// LoadBalancerProbeListResult is response for ListProbe API service call. +type LoadBalancerProbeListResult struct { + autorest.Response `json:"-"` + Value *[]Probe `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// LoadBalancerProbeListResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client LoadBalancerProbeListResult) LoadBalancerProbeListResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + // LoadBalancerPropertiesFormat is properties of the load balancer. type LoadBalancerPropertiesFormat struct { FrontendIPConfigurations *[]FrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` @@ -1967,8 +2466,14 @@ type LoadBalancerPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// LoadBalancingRule is a loag balancing rule for a load balancer. +// LoadBalancerSku is SKU of a load balancer +type LoadBalancerSku struct { + Name LoadBalancerSkuName `json:"name,omitempty"` +} + +// LoadBalancingRule is a load balancing rule for a load balancer. type LoadBalancingRule struct { + autorest.Response `json:"-"` ID *string `json:"id,omitempty"` *LoadBalancingRulePropertiesFormat `json:"properties,omitempty"` Name *string `json:"name,omitempty"` @@ -1986,6 +2491,7 @@ type LoadBalancingRulePropertiesFormat struct { BackendPort *int32 `json:"backendPort,omitempty"` IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` + DisableOutboundSnat *bool `json:"disableOutboundSnat,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` } @@ -2001,8 +2507,7 @@ type LocalNetworkGateway struct { Etag *string `json:"etag,omitempty"` } -// LocalNetworkGatewayListResult is response for ListLocalNetworkGateways API -// service call. +// LocalNetworkGatewayListResult is response for ListLocalNetworkGateways API service call. type LocalNetworkGatewayListResult struct { autorest.Response `json:"-"` Value *[]LocalNetworkGateway `json:"value,omitempty"` @@ -2030,8 +2535,7 @@ type LocalNetworkGatewayPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// NextHopParameters is parameters that define the source and destination -// endpoint. +// NextHopParameters is parameters that define the source and destination endpoint. type NextHopParameters struct { TargetResourceID *string `json:"targetResourceId,omitempty"` SourceIPAddress *string `json:"sourceIPAddress,omitempty"` @@ -2068,8 +2572,7 @@ type PacketCapture struct { *PacketCaptureParameters `json:"properties,omitempty"` } -// PacketCaptureFilter is filter that is applied to packet capture request. -// Multiple filters can be applied. +// PacketCaptureFilter is filter that is applied to packet capture request. Multiple filters can be applied. type PacketCaptureFilter struct { Protocol PcProtocol `json:"protocol,omitempty"` LocalIPAddress *string `json:"localIPAddress,omitempty"` @@ -2084,8 +2587,7 @@ type PacketCaptureListResult struct { Value *[]PacketCaptureResult `json:"value,omitempty"` } -// PacketCaptureParameters is parameters that define the create packet capture -// operation. +// PacketCaptureParameters is parameters that define the create packet capture operation. type PacketCaptureParameters struct { Target *string `json:"target,omitempty"` BytesToCapturePerPacket *int32 `json:"bytesToCapturePerPacket,omitempty"` @@ -2115,8 +2617,7 @@ type PacketCaptureResult struct { *PacketCaptureResultProperties `json:"properties,omitempty"` } -// PacketCaptureResultProperties is describes the properties of a packet -// capture session. +// PacketCaptureResultProperties is describes the properties of a packet capture session. type PacketCaptureResultProperties struct { Target *string `json:"target,omitempty"` BytesToCapturePerPacket *int32 `json:"bytesToCapturePerPacket,omitempty"` @@ -2127,8 +2628,7 @@ type PacketCaptureResultProperties struct { ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` } -// PacketCaptureStorageLocation is describes the storage location for a packet -// capture session. +// PacketCaptureStorageLocation is describes the storage location for a packet capture session. type PacketCaptureStorageLocation struct { StorageID *string `json:"storageId,omitempty"` StoragePath *string `json:"storagePath,omitempty"` @@ -2156,13 +2656,14 @@ type PatchRouteFilterRule struct { // Probe is a load balancer probe. type Probe struct { + autorest.Response `json:"-"` ID *string `json:"id,omitempty"` *ProbePropertiesFormat `json:"properties,omitempty"` Name *string `json:"name,omitempty"` Etag *string `json:"etag,omitempty"` } -// ProbePropertiesFormat is +// ProbePropertiesFormat is load balancer probe resource. type ProbePropertiesFormat struct { LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` Protocol ProbeProtocol `json:"protocol,omitempty"` @@ -2181,20 +2682,20 @@ type PublicIPAddress struct { Type *string `json:"type,omitempty"` Location *string `json:"location,omitempty"` Tags *map[string]*string `json:"tags,omitempty"` + Sku *PublicIPAddressSku `json:"sku,omitempty"` *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Etag *string `json:"etag,omitempty"` + Etag *string `json:"etag,omitempty"` + Zones *[]string `json:"zones,omitempty"` } -// PublicIPAddressDNSSettings is contains FQDN of the DNS record associated -// with the public IP address +// PublicIPAddressDNSSettings is contains FQDN of the DNS record associated with the public IP address type PublicIPAddressDNSSettings struct { DomainNameLabel *string `json:"domainNameLabel,omitempty"` Fqdn *string `json:"fqdn,omitempty"` ReverseFqdn *string `json:"reverseFqdn,omitempty"` } -// PublicIPAddressListResult is response for ListPublicIpAddresses API service -// call. +// PublicIPAddressListResult is response for ListPublicIpAddresses API service call. type PublicIPAddressListResult struct { autorest.Response `json:"-"` Value *[]PublicIPAddress `json:"value,omitempty"` @@ -2225,13 +2726,17 @@ type PublicIPAddressPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// QueryTroubleshootingParameters is parameters that define the resource to -// query the troubleshooting result. +// PublicIPAddressSku is SKU of a public IP address +type PublicIPAddressSku struct { + Name PublicIPAddressSkuName `json:"name,omitempty"` +} + +// QueryTroubleshootingParameters is parameters that define the resource to query the troubleshooting result. type QueryTroubleshootingParameters struct { TargetResourceID *string `json:"targetResourceId,omitempty"` } -// Resource is +// Resource is common resource representation. type Resource struct { ID *string `json:"id,omitempty"` Name *string `json:"name,omitempty"` @@ -2255,8 +2760,7 @@ type ResourceNavigationLinkFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// RetentionPolicyParameters is parameters that define the retention policy for -// flow log. +// RetentionPolicyParameters is parameters that define the retention policy for flow log. type RetentionPolicyParameters struct { Days *int32 `json:"days,omitempty"` Enabled *bool `json:"enabled,omitempty"` @@ -2320,8 +2824,7 @@ type RouteFilterRule struct { Tags *map[string]*string `json:"tags,omitempty"` } -// RouteFilterRuleListResult is response for the ListRouteFilterRules API -// service call +// RouteFilterRuleListResult is response for the ListRouteFilterRules API service call type RouteFilterRuleListResult struct { autorest.Response `json:"-"` Value *[]RouteFilterRule `json:"value,omitempty"` @@ -2425,8 +2928,7 @@ type SecurityGroup struct { Etag *string `json:"etag,omitempty"` } -// SecurityGroupListResult is response for ListNetworkSecurityGroups API -// service call. +// SecurityGroupListResult is response for ListNetworkSecurityGroups API service call. type SecurityGroupListResult struct { autorest.Response `json:"-"` Value *[]SecurityGroup `json:"value,omitempty"` @@ -2445,8 +2947,7 @@ func (client SecurityGroupListResult) SecurityGroupListResultPreparer() (*http.R autorest.WithBaseURL(to.String(client.NextLink))) } -// SecurityGroupNetworkInterface is network interface and all its associated -// security rules. +// SecurityGroupNetworkInterface is network interface and all its associated security rules. type SecurityGroupNetworkInterface struct { ID *string `json:"id,omitempty"` SecurityRuleAssociations *SecurityRuleAssociations `json:"securityRuleAssociations,omitempty"` @@ -2462,14 +2963,12 @@ type SecurityGroupPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// SecurityGroupViewParameters is parameters that define the VM to check -// security groups for. +// SecurityGroupViewParameters is parameters that define the VM to check security groups for. type SecurityGroupViewParameters struct { TargetResourceID *string `json:"targetResourceId,omitempty"` } -// SecurityGroupViewResult is the information about security rules applied to -// the specified VM. +// SecurityGroupViewResult is the information about security rules applied to the specified VM. type SecurityGroupViewResult struct { autorest.Response `json:"-"` NetworkInterfaces *[]SecurityGroupNetworkInterface `json:"networkInterfaces,omitempty"` @@ -2484,8 +2983,7 @@ type SecurityRule struct { Etag *string `json:"etag,omitempty"` } -// SecurityRuleAssociations is all security rules associated with the network -// interface. +// SecurityRuleAssociations is all security rules associated with the network interface. type SecurityRuleAssociations struct { NetworkInterfaceAssociation *InterfaceAssociation `json:"networkInterfaceAssociation,omitempty"` SubnetAssociation *SubnetAssociation `json:"subnetAssociation,omitempty"` @@ -2493,8 +2991,8 @@ type SecurityRuleAssociations struct { EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` } -// SecurityRuleListResult is response for ListSecurityRule API service call. -// Retrieves all security rules that belongs to a network security group. +// SecurityRuleListResult is response for ListSecurityRule API service call. Retrieves all security rules that belongs +// to a network security group. type SecurityRuleListResult struct { autorest.Response `json:"-"` Value *[]SecurityRule `json:"value,omitempty"` @@ -2513,18 +3011,31 @@ func (client SecurityRuleListResult) SecurityRuleListResultPreparer() (*http.Req autorest.WithBaseURL(to.String(client.NextLink))) } -// SecurityRulePropertiesFormat is +// SecurityRulePropertiesFormat is security rule resource. type SecurityRulePropertiesFormat struct { - Description *string `json:"description,omitempty"` - Protocol SecurityRuleProtocol `json:"protocol,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - Access SecurityRuleAccess `json:"access,omitempty"` - Priority *int32 `json:"priority,omitempty"` - Direction SecurityRuleDirection `json:"direction,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` + Description *string `json:"description,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Access SecurityRuleAccess `json:"access,omitempty"` + Priority *int32 `json:"priority,omitempty"` + Direction SecurityRuleDirection `json:"direction,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// ServiceEndpointPropertiesFormat is the service endpoint properties. +type ServiceEndpointPropertiesFormat struct { + Service *string `json:"service,omitempty"` + Locations *[]string `json:"locations,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` } // String is @@ -2548,8 +3059,7 @@ type SubnetAssociation struct { SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` } -// SubnetListResult is response for ListSubnets API service callRetrieves all -// subnet that belongs to a virtual network +// SubnetListResult is response for ListSubnets API service callRetrieves all subnet that belongs to a virtual network type SubnetListResult struct { autorest.Response `json:"-"` Value *[]Subnet `json:"value,omitempty"` @@ -2568,17 +3078,18 @@ func (client SubnetListResult) SubnetListResultPreparer() (*http.Request, error) autorest.WithBaseURL(to.String(client.NextLink))) } -// SubnetPropertiesFormat is +// SubnetPropertiesFormat is properties of the subnet. type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` + AddressPrefix *string `json:"addressPrefix,omitempty"` + NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` } -// SubResource is +// SubResource is reference to another subresource. type SubResource struct { ID *string `json:"id,omitempty"` } @@ -2592,8 +3103,7 @@ type Topology struct { Resources *[]TopologyResource `json:"resources,omitempty"` } -// TopologyAssociation is resources that have an association with the parent -// resource. +// TopologyAssociation is resources that have an association with the parent resource. type TopologyAssociation struct { Name *string `json:"name,omitempty"` ResourceID *string `json:"resourceId,omitempty"` @@ -2605,8 +3115,7 @@ type TopologyParameters struct { TargetResourceGroupName *string `json:"targetResourceGroupName,omitempty"` } -// TopologyResource is the network resource topology information for the given -// resource group. +// TopologyResource is the network resource topology information for the given resource group. type TopologyResource struct { Name *string `json:"name,omitempty"` ID *string `json:"id,omitempty"` @@ -2614,8 +3123,7 @@ type TopologyResource struct { Associations *[]TopologyAssociation `json:"associations,omitempty"` } -// TroubleshootingDetails is information gained from troubleshooting of -// specified resource. +// TroubleshootingDetails is information gained from troubleshooting of specified resource. type TroubleshootingDetails struct { ID *string `json:"id,omitempty"` ReasonType *string `json:"reasonType,omitempty"` @@ -2624,8 +3132,7 @@ type TroubleshootingDetails struct { RecommendedActions *[]TroubleshootingRecommendedActions `json:"recommendedActions,omitempty"` } -// TroubleshootingParameters is parameters that define the resource to -// troubleshoot. +// TroubleshootingParameters is parameters that define the resource to troubleshoot. type TroubleshootingParameters struct { TargetResourceID *string `json:"targetResourceId,omitempty"` *TroubleshootingProperties `json:"properties,omitempty"` @@ -2637,8 +3144,7 @@ type TroubleshootingProperties struct { StoragePath *string `json:"storagePath,omitempty"` } -// TroubleshootingRecommendedActions is recommended actions based on discovered -// issues. +// TroubleshootingRecommendedActions is recommended actions based on discovered issues. type TroubleshootingRecommendedActions struct { ActionID *string `json:"actionId,omitempty"` ActionText *string `json:"actionText,omitempty"` @@ -2646,8 +3152,7 @@ type TroubleshootingRecommendedActions struct { ActionURIText *string `json:"actionUriText,omitempty"` } -// TroubleshootingResult is troubleshooting information gained from specified -// resource. +// TroubleshootingResult is troubleshooting information gained from specified resource. type TroubleshootingResult struct { autorest.Response `json:"-"` StartTime *date.Time `json:"startTime,omitempty"` @@ -2667,6 +3172,7 @@ type TunnelConnectionHealth struct { // Usage is describes network resource usage. type Usage struct { + ID *string `json:"id,omitempty"` Unit *string `json:"unit,omitempty"` CurrentValue *int64 `json:"currentValue,omitempty"` Limit *int64 `json:"limit,omitempty"` @@ -2698,8 +3204,7 @@ func (client UsagesListResult) UsagesListResultPreparer() (*http.Request, error) autorest.WithBaseURL(to.String(client.NextLink))) } -// VerificationIPFlowParameters is parameters that define the IP flow to be -// verified. +// VerificationIPFlowParameters is parameters that define the IP flow to be verified. type VerificationIPFlowParameters struct { TargetResourceID *string `json:"targetResourceId,omitempty"` Direction Direction `json:"direction,omitempty"` @@ -2711,8 +3216,7 @@ type VerificationIPFlowParameters struct { TargetNicResourceID *string `json:"targetNicResourceId,omitempty"` } -// VerificationIPFlowResult is results of IP flow verification on the target -// resource. +// VerificationIPFlowResult is results of IP flow verification on the target resource. type VerificationIPFlowResult struct { autorest.Response `json:"-"` Access Access `json:"access,omitempty"` @@ -2731,6 +3235,11 @@ type VirtualNetwork struct { Etag *string `json:"etag,omitempty"` } +// VirtualNetworkConnectionGatewayReference is a reference to VirtualNetworkGateway or LocalNetworkGateway resource. +type VirtualNetworkConnectionGatewayReference struct { + ID *string `json:"id,omitempty"` +} + // VirtualNetworkGateway is a common class for general resource information type VirtualNetworkGateway struct { autorest.Response `json:"-"` @@ -2743,8 +3252,7 @@ type VirtualNetworkGateway struct { Etag *string `json:"etag,omitempty"` } -// VirtualNetworkGatewayConnection is a common class for general resource -// information +// VirtualNetworkGatewayConnection is a common class for general resource information type VirtualNetworkGatewayConnection struct { autorest.Response `json:"-"` ID *string `json:"id,omitempty"` @@ -2756,8 +3264,39 @@ type VirtualNetworkGatewayConnection struct { Etag *string `json:"etag,omitempty"` } -// VirtualNetworkGatewayConnectionListResult is response for the -// ListVirtualNetworkGatewayConnections API service call +// VirtualNetworkGatewayConnectionListEntity is a common class for general resource information +type VirtualNetworkGatewayConnectionListEntity struct { + ID *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + Location *string `json:"location,omitempty"` + Tags *map[string]*string `json:"tags,omitempty"` + *VirtualNetworkGatewayConnectionListEntityPropertiesFormat `json:"properties,omitempty"` + Etag *string `json:"etag,omitempty"` +} + +// VirtualNetworkGatewayConnectionListEntityPropertiesFormat is virtualNetworkGatewayConnection properties +type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct { + AuthorizationKey *string `json:"authorizationKey,omitempty"` + VirtualNetworkGateway1 *VirtualNetworkConnectionGatewayReference `json:"virtualNetworkGateway1,omitempty"` + VirtualNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"virtualNetworkGateway2,omitempty"` + LocalNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"localNetworkGateway2,omitempty"` + ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType,omitempty"` + RoutingWeight *int32 `json:"routingWeight,omitempty"` + SharedKey *string `json:"sharedKey,omitempty"` + ConnectionStatus VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` + TunnelConnectionStatus *[]TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty"` + EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` + IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` + Peer *SubResource `json:"peer,omitempty"` + EnableBgp *bool `json:"enableBgp,omitempty"` + UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` + IpsecPolicies *[]IpsecPolicy `json:"ipsecPolicies,omitempty"` + ResourceGUID *string `json:"resourceGuid,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// VirtualNetworkGatewayConnectionListResult is response for the ListVirtualNetworkGatewayConnections API service call type VirtualNetworkGatewayConnectionListResult struct { autorest.Response `json:"-"` Value *[]VirtualNetworkGatewayConnection `json:"value,omitempty"` @@ -2776,8 +3315,7 @@ func (client VirtualNetworkGatewayConnectionListResult) VirtualNetworkGatewayCon autorest.WithBaseURL(to.String(client.NextLink))) } -// VirtualNetworkGatewayConnectionPropertiesFormat is -// virtualNetworkGatewayConnection properties +// VirtualNetworkGatewayConnectionPropertiesFormat is virtualNetworkGatewayConnection properties type VirtualNetworkGatewayConnectionPropertiesFormat struct { AuthorizationKey *string `json:"authorizationKey,omitempty"` VirtualNetworkGateway1 *VirtualNetworkGateway `json:"virtualNetworkGateway1,omitempty"` @@ -2798,8 +3336,7 @@ type VirtualNetworkGatewayConnectionPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// VirtualNetworkGatewayIPConfiguration is iP configuration for virtual network -// gateway +// VirtualNetworkGatewayIPConfiguration is IP configuration for virtual network gateway type VirtualNetworkGatewayIPConfiguration struct { ID *string `json:"id,omitempty"` *VirtualNetworkGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` @@ -2807,8 +3344,7 @@ type VirtualNetworkGatewayIPConfiguration struct { Etag *string `json:"etag,omitempty"` } -// VirtualNetworkGatewayIPConfigurationPropertiesFormat is properties of -// VirtualNetworkGatewayIPConfiguration +// VirtualNetworkGatewayIPConfigurationPropertiesFormat is properties of VirtualNetworkGatewayIPConfiguration type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` Subnet *SubResource `json:"subnet,omitempty"` @@ -2816,8 +3352,26 @@ type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// VirtualNetworkGatewayListResult is response for the -// ListVirtualNetworkGateways API service call. +// VirtualNetworkGatewayListConnectionsResult is response for the VirtualNetworkGatewayListConnections API service call +type VirtualNetworkGatewayListConnectionsResult struct { + autorest.Response `json:"-"` + Value *[]VirtualNetworkGatewayConnectionListEntity `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// VirtualNetworkGatewayListConnectionsResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client VirtualNetworkGatewayListConnectionsResult) VirtualNetworkGatewayListConnectionsResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + +// VirtualNetworkGatewayListResult is response for the ListVirtualNetworkGateways API service call. type VirtualNetworkGatewayListResult struct { autorest.Response `json:"-"` Value *[]VirtualNetworkGateway `json:"value,omitempty"` @@ -2858,8 +3412,7 @@ type VirtualNetworkGatewaySku struct { Capacity *int32 `json:"capacity,omitempty"` } -// VirtualNetworkListResult is response for the ListVirtualNetworks API service -// call. +// VirtualNetworkListResult is response for the ListVirtualNetworks API service call. type VirtualNetworkListResult struct { autorest.Response `json:"-"` Value *[]VirtualNetwork `json:"value,omitempty"` @@ -2878,6 +3431,25 @@ func (client VirtualNetworkListResult) VirtualNetworkListResultPreparer() (*http autorest.WithBaseURL(to.String(client.NextLink))) } +// VirtualNetworkListUsageResult is response for the virtual networks GetUsage API service call. +type VirtualNetworkListUsageResult struct { + autorest.Response `json:"-"` + Value *[]VirtualNetworkUsage `json:"value,omitempty"` + NextLink *string `json:"nextLink,omitempty"` +} + +// VirtualNetworkListUsageResultPreparer prepares a request to retrieve the next set of results. It returns +// nil if no more results exist. +func (client VirtualNetworkListUsageResult) VirtualNetworkListUsageResultPreparer() (*http.Request, error) { + if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 { + return nil, nil + } + return autorest.Prepare(&http.Request{}, + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(client.NextLink))) +} + // VirtualNetworkPeering is peerings in a virtual network resource. type VirtualNetworkPeering struct { autorest.Response `json:"-"` @@ -2887,8 +3459,8 @@ type VirtualNetworkPeering struct { Etag *string `json:"etag,omitempty"` } -// VirtualNetworkPeeringListResult is response for ListSubnets API service -// call. Retrieves all subnets that belong to a virtual network. +// VirtualNetworkPeeringListResult is response for ListSubnets API service call. Retrieves all subnets that belong to a +// virtual network. type VirtualNetworkPeeringListResult struct { autorest.Response `json:"-"` Value *[]VirtualNetworkPeering `json:"value,omitempty"` @@ -2907,7 +3479,7 @@ func (client VirtualNetworkPeeringListResult) VirtualNetworkPeeringListResultPre autorest.WithBaseURL(to.String(client.NextLink))) } -// VirtualNetworkPeeringPropertiesFormat is +// VirtualNetworkPeeringPropertiesFormat is properties of the virtual network peering. type VirtualNetworkPeeringPropertiesFormat struct { AllowVirtualNetworkAccess *bool `json:"allowVirtualNetworkAccess,omitempty"` AllowForwardedTraffic *bool `json:"allowForwardedTraffic,omitempty"` @@ -2918,7 +3490,7 @@ type VirtualNetworkPeeringPropertiesFormat struct { ProvisioningState *string `json:"provisioningState,omitempty"` } -// VirtualNetworkPropertiesFormat is +// VirtualNetworkPropertiesFormat is properties of the virtual network. type VirtualNetworkPropertiesFormat struct { AddressSpace *AddressSpace `json:"addressSpace,omitempty"` DhcpOptions *DhcpOptions `json:"dhcpOptions,omitempty"` @@ -2926,6 +3498,23 @@ type VirtualNetworkPropertiesFormat struct { VirtualNetworkPeerings *[]VirtualNetworkPeering `json:"virtualNetworkPeerings,omitempty"` ResourceGUID *string `json:"resourceGuid,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` + EnableDdosProtection *bool `json:"enableDdosProtection,omitempty"` + EnableVMProtection *bool `json:"enableVmProtection,omitempty"` +} + +// VirtualNetworkUsage is usage details for subnet. +type VirtualNetworkUsage struct { + CurrentValue *float64 `json:"currentValue,omitempty"` + ID *string `json:"id,omitempty"` + Limit *float64 `json:"limit,omitempty"` + Name *VirtualNetworkUsageName `json:"name,omitempty"` + Unit *string `json:"unit,omitempty"` +} + +// VirtualNetworkUsageName is usage strings container. +type VirtualNetworkUsageName struct { + LocalizedValue *string `json:"localizedValue,omitempty"` + Value *string `json:"value,omitempty"` } // VpnClientConfiguration is vpnClientConfiguration for P2S client. @@ -2933,15 +3522,20 @@ type VpnClientConfiguration struct { VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` VpnClientRootCertificates *[]VpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` VpnClientRevokedCertificates *[]VpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` + VpnClientProtocols *[]VpnClientProtocol `json:"vpnClientProtocols,omitempty"` + RadiusServerAddress *string `json:"radiusServerAddress,omitempty"` + RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` } // VpnClientParameters is vpn Client Parameters for package generation type VpnClientParameters struct { - ProcessorArchitecture ProcessorArchitecture `json:"processorArchitecture,omitempty"` + ProcessorArchitecture ProcessorArchitecture `json:"processorArchitecture,omitempty"` + AuthenticationMethod AuthenticationMethod `json:"authenticationMethod,omitempty"` + RadiusServerAuthCertificate *string `json:"radiusServerAuthCertificate,omitempty"` + ClientRootCertificates *[]string `json:"clientRootCertificates,omitempty"` } -// VpnClientRevokedCertificate is vPN client revoked certificate of virtual -// network gateway. +// VpnClientRevokedCertificate is VPN client revoked certificate of virtual network gateway. type VpnClientRevokedCertificate struct { ID *string `json:"id,omitempty"` *VpnClientRevokedCertificatePropertiesFormat `json:"properties,omitempty"` @@ -2949,15 +3543,14 @@ type VpnClientRevokedCertificate struct { Etag *string `json:"etag,omitempty"` } -// VpnClientRevokedCertificatePropertiesFormat is properties of the revoked VPN -// client certificate of virtual network gateway. +// VpnClientRevokedCertificatePropertiesFormat is properties of the revoked VPN client certificate of virtual network +// gateway. type VpnClientRevokedCertificatePropertiesFormat struct { Thumbprint *string `json:"thumbprint,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` } -// VpnClientRootCertificate is vPN client root certificate of virtual network -// gateway +// VpnClientRootCertificate is VPN client root certificate of virtual network gateway type VpnClientRootCertificate struct { ID *string `json:"id,omitempty"` *VpnClientRootCertificatePropertiesFormat `json:"properties,omitempty"` @@ -2965,13 +3558,19 @@ type VpnClientRootCertificate struct { Etag *string `json:"etag,omitempty"` } -// VpnClientRootCertificatePropertiesFormat is properties of SSL certificates -// of application gateway +// VpnClientRootCertificatePropertiesFormat is properties of SSL certificates of application gateway type VpnClientRootCertificatePropertiesFormat struct { PublicCertData *string `json:"publicCertData,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"` } +// VpnDeviceScriptParameters is vpn device configuration script generation parameters +type VpnDeviceScriptParameters struct { + Vendor *string `json:"vendor,omitempty"` + DeviceFamily *string `json:"deviceFamily,omitempty"` + FirmwareVersion *string `json:"firmwareVersion,omitempty"` +} + // Watcher is network watcher in a resource group. type Watcher struct { autorest.Response `json:"-"` diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/packetcaptures.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/packetcaptures.go index fbeb0d9ef4b1..1ad97a5e2aa1 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/packetcaptures.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/packetcaptures.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -25,31 +24,27 @@ import ( "net/http" ) -// PacketCapturesClient is the composite Swagger for Network Client +// PacketCapturesClient is the network Client type PacketCapturesClient struct { ManagementClient } -// NewPacketCapturesClient creates an instance of the PacketCapturesClient -// client. +// NewPacketCapturesClient creates an instance of the PacketCapturesClient client. func NewPacketCapturesClient(subscriptionID string) PacketCapturesClient { return NewPacketCapturesClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewPacketCapturesClientWithBaseURI creates an instance of the -// PacketCapturesClient client. +// NewPacketCapturesClientWithBaseURI creates an instance of the PacketCapturesClient client. func NewPacketCapturesClientWithBaseURI(baseURI string, subscriptionID string) PacketCapturesClient { return PacketCapturesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// Create create and start a packet capture on the specified VM. This method -// may poll for completion. Polling can be canceled by passing the cancel -// channel argument. The channel will be used to cancel polling and any -// outstanding HTTP requests. +// Create create and start a packet capture on the specified VM. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. // -// resourceGroupName is the name of the resource group. networkWatcherName is -// the name of the network watcher. packetCaptureName is the name of the packet -// capture session. parameters is parameters that define the create packet +// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher. +// packetCaptureName is the name of the packet capture session. parameters is parameters that define the create packet // capture operation. func (client PacketCapturesClient) Create(resourceGroupName string, networkWatcherName string, packetCaptureName string, parameters PacketCapture, cancel <-chan struct{}) (<-chan PacketCaptureResult, <-chan error) { resultChan := make(chan PacketCaptureResult, 1) @@ -70,8 +65,10 @@ func (client PacketCapturesClient) Create(resourceGroupName string, networkWatch var err error var result PacketCaptureResult defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -105,7 +102,7 @@ func (client PacketCapturesClient) CreatePreparer(resourceGroupName string, netw "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -141,14 +138,11 @@ func (client PacketCapturesClient) CreateResponder(resp *http.Response) (result return } -// Delete deletes the specified packet capture session. This method may poll -// for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// Delete deletes the specified packet capture session. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. networkWatcherName is -// the name of the network watcher. packetCaptureName is the name of the packet -// capture session. +// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher. +// packetCaptureName is the name of the packet capture session. func (client PacketCapturesClient) Delete(resourceGroupName string, networkWatcherName string, packetCaptureName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -156,8 +150,10 @@ func (client PacketCapturesClient) Delete(resourceGroupName string, networkWatch var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -191,7 +187,7 @@ func (client PacketCapturesClient) DeletePreparer(resourceGroupName string, netw "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -226,9 +222,8 @@ func (client PacketCapturesClient) DeleteResponder(resp *http.Response) (result // Get gets a packet capture session by name. // -// resourceGroupName is the name of the resource group. networkWatcherName is -// the name of the network watcher. packetCaptureName is the name of the packet -// capture session. +// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher. +// packetCaptureName is the name of the packet capture session. func (client PacketCapturesClient) Get(resourceGroupName string, networkWatcherName string, packetCaptureName string) (result PacketCaptureResult, err error) { req, err := client.GetPreparer(resourceGroupName, networkWatcherName, packetCaptureName) if err != nil { @@ -260,7 +255,7 @@ func (client PacketCapturesClient) GetPreparer(resourceGroupName string, network "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -292,14 +287,12 @@ func (client PacketCapturesClient) GetResponder(resp *http.Response) (result Pac return } -// GetStatus query the status of a running packet capture session. This method -// may poll for completion. Polling can be canceled by passing the cancel -// channel argument. The channel will be used to cancel polling and any -// outstanding HTTP requests. +// GetStatus query the status of a running packet capture session. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. // -// resourceGroupName is the name of the resource group. networkWatcherName is -// the name of the Network Watcher resource. packetCaptureName is the name -// given to the packet capture session. +// resourceGroupName is the name of the resource group. networkWatcherName is the name of the Network Watcher resource. +// packetCaptureName is the name given to the packet capture session. func (client PacketCapturesClient) GetStatus(resourceGroupName string, networkWatcherName string, packetCaptureName string, cancel <-chan struct{}) (<-chan PacketCaptureQueryStatusResult, <-chan error) { resultChan := make(chan PacketCaptureQueryStatusResult, 1) errChan := make(chan error, 1) @@ -307,8 +300,10 @@ func (client PacketCapturesClient) GetStatus(resourceGroupName string, networkWa var err error var result PacketCaptureQueryStatusResult defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -342,7 +337,7 @@ func (client PacketCapturesClient) GetStatusPreparer(resourceGroupName string, n "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -378,8 +373,7 @@ func (client PacketCapturesClient) GetStatusResponder(resp *http.Response) (resu // List lists all packet capture sessions within the specified resource group. // -// resourceGroupName is the name of the resource group. networkWatcherName is -// the name of the Network Watcher resource. +// resourceGroupName is the name of the resource group. networkWatcherName is the name of the Network Watcher resource. func (client PacketCapturesClient) List(resourceGroupName string, networkWatcherName string) (result PacketCaptureListResult, err error) { req, err := client.ListPreparer(resourceGroupName, networkWatcherName) if err != nil { @@ -410,7 +404,7 @@ func (client PacketCapturesClient) ListPreparer(resourceGroupName string, networ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -442,14 +436,11 @@ func (client PacketCapturesClient) ListResponder(resp *http.Response) (result Pa return } -// Stop stops a specified packet capture session. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// Stop stops a specified packet capture session. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. networkWatcherName is -// the name of the network watcher. packetCaptureName is the name of the packet -// capture session. +// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher. +// packetCaptureName is the name of the packet capture session. func (client PacketCapturesClient) Stop(resourceGroupName string, networkWatcherName string, packetCaptureName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -457,8 +448,10 @@ func (client PacketCapturesClient) Stop(resourceGroupName string, networkWatcher var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -492,7 +485,7 @@ func (client PacketCapturesClient) StopPreparer(resourceGroupName string, networ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/publicipaddresses.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/publicipaddresses.go index 896bc817d91e..af7e7ec85b66 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/publicipaddresses.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/publicipaddresses.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -25,31 +24,27 @@ import ( "net/http" ) -// PublicIPAddressesClient is the composite Swagger for Network Client +// PublicIPAddressesClient is the network Client type PublicIPAddressesClient struct { ManagementClient } -// NewPublicIPAddressesClient creates an instance of the -// PublicIPAddressesClient client. +// NewPublicIPAddressesClient creates an instance of the PublicIPAddressesClient client. func NewPublicIPAddressesClient(subscriptionID string) PublicIPAddressesClient { return NewPublicIPAddressesClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewPublicIPAddressesClientWithBaseURI creates an instance of the -// PublicIPAddressesClient client. +// NewPublicIPAddressesClientWithBaseURI creates an instance of the PublicIPAddressesClient client. func NewPublicIPAddressesClientWithBaseURI(baseURI string, subscriptionID string) PublicIPAddressesClient { return PublicIPAddressesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a static or dynamic public IP address. -// This method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and any +// CreateOrUpdate creates or updates a static or dynamic public IP address. This method may poll for completion. +// Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any // outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. publicIPAddressName is -// the name of the public IP address. parameters is parameters supplied to the -// create or update public IP address operation. +// resourceGroupName is the name of the resource group. publicIPAddressName is the name of the public IP address. +// parameters is parameters supplied to the create or update public IP address operation. func (client PublicIPAddressesClient) CreateOrUpdate(resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress, cancel <-chan struct{}) (<-chan PublicIPAddress, <-chan error) { resultChan := make(chan PublicIPAddress, 1) errChan := make(chan error, 1) @@ -71,8 +66,10 @@ func (client PublicIPAddressesClient) CreateOrUpdate(resourceGroupName string, p var err error var result PublicIPAddress defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -105,7 +102,7 @@ func (client PublicIPAddressesClient) CreateOrUpdatePreparer(resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -141,13 +138,10 @@ func (client PublicIPAddressesClient) CreateOrUpdateResponder(resp *http.Respons return } -// Delete deletes the specified public IP address. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// Delete deletes the specified public IP address. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. publicIPAddressName is -// the name of the subnet. +// resourceGroupName is the name of the resource group. publicIPAddressName is the name of the subnet. func (client PublicIPAddressesClient) Delete(resourceGroupName string, publicIPAddressName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -155,8 +149,10 @@ func (client PublicIPAddressesClient) Delete(resourceGroupName string, publicIPA var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -189,7 +185,7 @@ func (client PublicIPAddressesClient) DeletePreparer(resourceGroupName string, p "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -224,8 +220,8 @@ func (client PublicIPAddressesClient) DeleteResponder(resp *http.Response) (resu // Get gets the specified public IP address in a specified resource group. // -// resourceGroupName is the name of the resource group. publicIPAddressName is -// the name of the subnet. expand is expands referenced resources. +// resourceGroupName is the name of the resource group. publicIPAddressName is the name of the subnet. expand is +// expands referenced resources. func (client PublicIPAddressesClient) Get(resourceGroupName string, publicIPAddressName string, expand string) (result PublicIPAddress, err error) { req, err := client.GetPreparer(resourceGroupName, publicIPAddressName, expand) if err != nil { @@ -256,7 +252,7 @@ func (client PublicIPAddressesClient) GetPreparer(resourceGroupName string, publ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -291,6 +287,81 @@ func (client PublicIPAddressesClient) GetResponder(resp *http.Response) (result return } +// GetVirtualMachineScaleSetPublicIPAddress get the specified public IP address in a virtual machine scale set. +// +// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual machine +// scale set. virtualmachineIndex is the virtual machine index. networkInterfaceName is the name of the network +// interface. IPConfigurationName is the name of the IP configuration. publicIPAddressName is the name of the public IP +// Address. expand is expands referenced resources. +func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddress(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string, publicIPAddressName string, expand string) (result PublicIPAddress, err error) { + req, err := client.GetVirtualMachineScaleSetPublicIPAddressPreparer(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, IPConfigurationName, publicIPAddressName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "GetVirtualMachineScaleSetPublicIPAddress", nil, "Failure preparing request") + return + } + + resp, err := client.GetVirtualMachineScaleSetPublicIPAddressSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "GetVirtualMachineScaleSetPublicIPAddress", resp, "Failure sending request") + return + } + + result, err = client.GetVirtualMachineScaleSetPublicIPAddressResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "GetVirtualMachineScaleSetPublicIPAddress", resp, "Failure responding to request") + } + + return +} + +// GetVirtualMachineScaleSetPublicIPAddressPreparer prepares the GetVirtualMachineScaleSetPublicIPAddress request. +func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddressPreparer(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string, publicIPAddressName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ipConfigurationName": autorest.Encode("path", IPConfigurationName), + "networkInterfaceName": autorest.Encode("path", networkInterfaceName), + "publicIpAddressName": autorest.Encode("path", publicIPAddressName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualmachineIndex": autorest.Encode("path", virtualmachineIndex), + "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses/{publicIpAddressName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// GetVirtualMachineScaleSetPublicIPAddressSender sends the GetVirtualMachineScaleSetPublicIPAddress request. The method will close the +// http.Response Body if it receives an error. +func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddressSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// GetVirtualMachineScaleSetPublicIPAddressResponder handles the response to the GetVirtualMachineScaleSetPublicIPAddress request. The method always +// closes the http.Response Body. +func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddressResponder(resp *http.Response) (result PublicIPAddress, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // List gets all public IP addresses in a resource group. // // resourceGroupName is the name of the resource group. @@ -323,7 +394,7 @@ func (client PublicIPAddressesClient) ListPreparer(resourceGroupName string) (*h "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -379,6 +450,51 @@ func (client PublicIPAddressesClient) ListNextResults(lastResults PublicIPAddres return } +// ListComplete gets all elements from the list without paging. +func (client PublicIPAddressesClient) ListComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan PublicIPAddress, <-chan error) { + resultChan := make(chan PublicIPAddress) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + // ListAll gets all the public IP addresses in a subscription. func (client PublicIPAddressesClient) ListAll() (result PublicIPAddressListResult, err error) { req, err := client.ListAllPreparer() @@ -408,7 +524,7 @@ func (client PublicIPAddressesClient) ListAllPreparer() (*http.Request, error) { "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -463,3 +579,324 @@ func (client PublicIPAddressesClient) ListAllNextResults(lastResults PublicIPAdd return } + +// ListAllComplete gets all elements from the list without paging. +func (client PublicIPAddressesClient) ListAllComplete(cancel <-chan struct{}) (<-chan PublicIPAddress, <-chan error) { + resultChan := make(chan PublicIPAddress) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListAll() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListAllNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListVirtualMachineScaleSetPublicIPAddresses gets information about all public IP addresses on a virtual machine +// scale set level. +// +// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual machine +// scale set. +func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddresses(resourceGroupName string, virtualMachineScaleSetName string) (result PublicIPAddressListResult, err error) { + req, err := client.ListVirtualMachineScaleSetPublicIPAddressesPreparer(resourceGroupName, virtualMachineScaleSetName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetPublicIPAddresses", nil, "Failure preparing request") + return + } + + resp, err := client.ListVirtualMachineScaleSetPublicIPAddressesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetPublicIPAddresses", resp, "Failure sending request") + return + } + + result, err = client.ListVirtualMachineScaleSetPublicIPAddressesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetPublicIPAddresses", resp, "Failure responding to request") + } + + return +} + +// ListVirtualMachineScaleSetPublicIPAddressesPreparer prepares the ListVirtualMachineScaleSetPublicIPAddresses request. +func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddressesPreparer(resourceGroupName string, virtualMachineScaleSetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/publicipaddresses", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListVirtualMachineScaleSetPublicIPAddressesSender sends the ListVirtualMachineScaleSetPublicIPAddresses request. The method will close the +// http.Response Body if it receives an error. +func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddressesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListVirtualMachineScaleSetPublicIPAddressesResponder handles the response to the ListVirtualMachineScaleSetPublicIPAddresses request. The method always +// closes the http.Response Body. +func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddressesResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListVirtualMachineScaleSetPublicIPAddressesNextResults retrieves the next set of results, if any. +func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddressesNextResults(lastResults PublicIPAddressListResult) (result PublicIPAddressListResult, err error) { + req, err := lastResults.PublicIPAddressListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetPublicIPAddresses", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListVirtualMachineScaleSetPublicIPAddressesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetPublicIPAddresses", resp, "Failure sending next results request") + } + + result, err = client.ListVirtualMachineScaleSetPublicIPAddressesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetPublicIPAddresses", resp, "Failure responding to next results request") + } + + return +} + +// ListVirtualMachineScaleSetPublicIPAddressesComplete gets all elements from the list without paging. +func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddressesComplete(resourceGroupName string, virtualMachineScaleSetName string, cancel <-chan struct{}) (<-chan PublicIPAddress, <-chan error) { + resultChan := make(chan PublicIPAddress) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListVirtualMachineScaleSetPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListVirtualMachineScaleSetPublicIPAddressesNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListVirtualMachineScaleSetVMPublicIPAddresses gets information about all public IP addresses in a virtual machine IP +// configuration in a virtual machine scale set. +// +// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual machine +// scale set. virtualmachineIndex is the virtual machine index. networkInterfaceName is the network interface name. +// IPConfigurationName is the IP configuration name. +func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string) (result PublicIPAddressListResult, err error) { + req, err := client.ListVirtualMachineScaleSetVMPublicIPAddressesPreparer(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, IPConfigurationName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetVMPublicIPAddresses", nil, "Failure preparing request") + return + } + + resp, err := client.ListVirtualMachineScaleSetVMPublicIPAddressesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetVMPublicIPAddresses", resp, "Failure sending request") + return + } + + result, err = client.ListVirtualMachineScaleSetVMPublicIPAddressesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetVMPublicIPAddresses", resp, "Failure responding to request") + } + + return +} + +// ListVirtualMachineScaleSetVMPublicIPAddressesPreparer prepares the ListVirtualMachineScaleSetVMPublicIPAddresses request. +func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddressesPreparer(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "ipConfigurationName": autorest.Encode("path", IPConfigurationName), + "networkInterfaceName": autorest.Encode("path", networkInterfaceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualmachineIndex": autorest.Encode("path", virtualmachineIndex), + "virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName), + } + + const APIVersion = "2017-03-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}/ipconfigurations/{ipConfigurationName}/publicipaddresses", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListVirtualMachineScaleSetVMPublicIPAddressesSender sends the ListVirtualMachineScaleSetVMPublicIPAddresses request. The method will close the +// http.Response Body if it receives an error. +func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddressesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListVirtualMachineScaleSetVMPublicIPAddressesResponder handles the response to the ListVirtualMachineScaleSetVMPublicIPAddresses request. The method always +// closes the http.Response Body. +func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddressesResponder(resp *http.Response) (result PublicIPAddressListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListVirtualMachineScaleSetVMPublicIPAddressesNextResults retrieves the next set of results, if any. +func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddressesNextResults(lastResults PublicIPAddressListResult) (result PublicIPAddressListResult, err error) { + req, err := lastResults.PublicIPAddressListResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetVMPublicIPAddresses", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListVirtualMachineScaleSetVMPublicIPAddressesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetVMPublicIPAddresses", resp, "Failure sending next results request") + } + + result, err = client.ListVirtualMachineScaleSetVMPublicIPAddressesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.PublicIPAddressesClient", "ListVirtualMachineScaleSetVMPublicIPAddresses", resp, "Failure responding to next results request") + } + + return +} + +// ListVirtualMachineScaleSetVMPublicIPAddressesComplete gets all elements from the list without paging. +func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddressesComplete(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string, cancel <-chan struct{}) (<-chan PublicIPAddress, <-chan error) { + resultChan := make(chan PublicIPAddress) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListVirtualMachineScaleSetVMPublicIPAddresses(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, IPConfigurationName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListVirtualMachineScaleSetVMPublicIPAddressesNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routefilterrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routefilterrules.go index 378a75bb2f12..7c0ab17904c8 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routefilterrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routefilterrules.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -25,32 +24,28 @@ import ( "net/http" ) -// RouteFilterRulesClient is the composite Swagger for Network Client +// RouteFilterRulesClient is the network Client type RouteFilterRulesClient struct { ManagementClient } -// NewRouteFilterRulesClient creates an instance of the RouteFilterRulesClient -// client. +// NewRouteFilterRulesClient creates an instance of the RouteFilterRulesClient client. func NewRouteFilterRulesClient(subscriptionID string) RouteFilterRulesClient { return NewRouteFilterRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewRouteFilterRulesClientWithBaseURI creates an instance of the -// RouteFilterRulesClient client. +// NewRouteFilterRulesClientWithBaseURI creates an instance of the RouteFilterRulesClient client. func NewRouteFilterRulesClientWithBaseURI(baseURI string, subscriptionID string) RouteFilterRulesClient { return RouteFilterRulesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a route in the specified route filter. -// This method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and any +// CreateOrUpdate creates or updates a route in the specified route filter. This method may poll for completion. +// Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any // outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. routeFilterName is the -// name of the route filter. ruleName is the name of the route filter rule. -// routeFilterRuleParameters is parameters supplied to the create or update -// route filter rule operation. +// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. ruleName is +// the name of the route filter rule. routeFilterRuleParameters is parameters supplied to the create or update route +// filter rule operation. func (client RouteFilterRulesClient) CreateOrUpdate(resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters RouteFilterRule, cancel <-chan struct{}) (<-chan RouteFilterRule, <-chan error) { resultChan := make(chan RouteFilterRule, 1) errChan := make(chan error, 1) @@ -70,8 +65,10 @@ func (client RouteFilterRulesClient) CreateOrUpdate(resourceGroupName string, ro var err error var result RouteFilterRule defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -105,7 +102,7 @@ func (client RouteFilterRulesClient) CreateOrUpdatePreparer(resourceGroupName st "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -141,13 +138,12 @@ func (client RouteFilterRulesClient) CreateOrUpdateResponder(resp *http.Response return } -// Delete deletes the specified rule from a route filter. This method may poll -// for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// Delete deletes the specified rule from a route filter. This method may poll for completion. Polling can be canceled +// by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. // -// resourceGroupName is the name of the resource group. routeFilterName is the -// name of the route filter. ruleName is the name of the rule. +// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. ruleName is +// the name of the rule. func (client RouteFilterRulesClient) Delete(resourceGroupName string, routeFilterName string, ruleName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -155,8 +151,10 @@ func (client RouteFilterRulesClient) Delete(resourceGroupName string, routeFilte var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -190,7 +188,7 @@ func (client RouteFilterRulesClient) DeletePreparer(resourceGroupName string, ro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -225,8 +223,8 @@ func (client RouteFilterRulesClient) DeleteResponder(resp *http.Response) (resul // Get gets the specified rule from a route filter. // -// resourceGroupName is the name of the resource group. routeFilterName is the -// name of the route filter. ruleName is the name of the rule. +// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. ruleName is +// the name of the rule. func (client RouteFilterRulesClient) Get(resourceGroupName string, routeFilterName string, ruleName string) (result RouteFilterRule, err error) { req, err := client.GetPreparer(resourceGroupName, routeFilterName, ruleName) if err != nil { @@ -258,7 +256,7 @@ func (client RouteFilterRulesClient) GetPreparer(resourceGroupName string, route "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -292,8 +290,7 @@ func (client RouteFilterRulesClient) GetResponder(resp *http.Response) (result R // ListByRouteFilter gets all RouteFilterRules in a route filter. // -// resourceGroupName is the name of the resource group. routeFilterName is the -// name of the route filter. +// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. func (client RouteFilterRulesClient) ListByRouteFilter(resourceGroupName string, routeFilterName string) (result RouteFilterRuleListResult, err error) { req, err := client.ListByRouteFilterPreparer(resourceGroupName, routeFilterName) if err != nil { @@ -324,7 +321,7 @@ func (client RouteFilterRulesClient) ListByRouteFilterPreparer(resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -380,15 +377,58 @@ func (client RouteFilterRulesClient) ListByRouteFilterNextResults(lastResults Ro return } -// Update updates a route in the specified route filter. This method may poll -// for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// ListByRouteFilterComplete gets all elements from the list without paging. +func (client RouteFilterRulesClient) ListByRouteFilterComplete(resourceGroupName string, routeFilterName string, cancel <-chan struct{}) (<-chan RouteFilterRule, <-chan error) { + resultChan := make(chan RouteFilterRule) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListByRouteFilter(resourceGroupName, routeFilterName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListByRouteFilterNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// Update updates a route in the specified route filter. This method may poll for completion. Polling can be canceled +// by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. // -// resourceGroupName is the name of the resource group. routeFilterName is the -// name of the route filter. ruleName is the name of the route filter rule. -// routeFilterRuleParameters is parameters supplied to the update route filter -// rule operation. +// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. ruleName is +// the name of the route filter rule. routeFilterRuleParameters is parameters supplied to the update route filter rule +// operation. func (client RouteFilterRulesClient) Update(resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters PatchRouteFilterRule, cancel <-chan struct{}) (<-chan RouteFilterRule, <-chan error) { resultChan := make(chan RouteFilterRule, 1) errChan := make(chan error, 1) @@ -396,8 +436,10 @@ func (client RouteFilterRulesClient) Update(resourceGroupName string, routeFilte var err error var result RouteFilterRule defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -431,7 +473,7 @@ func (client RouteFilterRulesClient) UpdatePreparer(resourceGroupName string, ro "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routefilters.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routefilters.go index 860ccae5c394..711e58fc9c98 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routefilters.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routefilters.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,7 +23,7 @@ import ( "net/http" ) -// RouteFiltersClient is the composite Swagger for Network Client +// RouteFiltersClient is the network Client type RouteFiltersClient struct { ManagementClient } @@ -34,20 +33,17 @@ func NewRouteFiltersClient(subscriptionID string) RouteFiltersClient { return NewRouteFiltersClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewRouteFiltersClientWithBaseURI creates an instance of the -// RouteFiltersClient client. +// NewRouteFiltersClientWithBaseURI creates an instance of the RouteFiltersClient client. func NewRouteFiltersClientWithBaseURI(baseURI string, subscriptionID string) RouteFiltersClient { return RouteFiltersClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a route filter in a specified resource -// group. This method may poll for completion. Polling can be canceled by -// passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// CreateOrUpdate creates or updates a route filter in a specified resource group. This method may poll for completion. +// Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any +// outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. routeFilterName is the -// name of the route filter. routeFilterParameters is parameters supplied to -// the create or update route filter operation. +// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. +// routeFilterParameters is parameters supplied to the create or update route filter operation. func (client RouteFiltersClient) CreateOrUpdate(resourceGroupName string, routeFilterName string, routeFilterParameters RouteFilter, cancel <-chan struct{}) (<-chan RouteFilter, <-chan error) { resultChan := make(chan RouteFilter, 1) errChan := make(chan error, 1) @@ -55,8 +51,10 @@ func (client RouteFiltersClient) CreateOrUpdate(resourceGroupName string, routeF var err error var result RouteFilter defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -89,7 +87,7 @@ func (client RouteFiltersClient) CreateOrUpdatePreparer(resourceGroupName string "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -125,13 +123,10 @@ func (client RouteFiltersClient) CreateOrUpdateResponder(resp *http.Response) (r return } -// Delete deletes the specified route filter. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// Delete deletes the specified route filter. This method may poll for completion. Polling can be canceled by passing +// the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. routeFilterName is the -// name of the route filter. +// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. func (client RouteFiltersClient) Delete(resourceGroupName string, routeFilterName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -139,8 +134,10 @@ func (client RouteFiltersClient) Delete(resourceGroupName string, routeFilterNam var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -173,7 +170,7 @@ func (client RouteFiltersClient) DeletePreparer(resourceGroupName string, routeF "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -208,9 +205,8 @@ func (client RouteFiltersClient) DeleteResponder(resp *http.Response) (result au // Get gets the specified route filter. // -// resourceGroupName is the name of the resource group. routeFilterName is the -// name of the route filter. expand is expands referenced express route bgp -// peering resources. +// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. expand is +// expands referenced express route bgp peering resources. func (client RouteFiltersClient) Get(resourceGroupName string, routeFilterName string, expand string) (result RouteFilter, err error) { req, err := client.GetPreparer(resourceGroupName, routeFilterName, expand) if err != nil { @@ -241,7 +237,7 @@ func (client RouteFiltersClient) GetPreparer(resourceGroupName string, routeFilt "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -305,7 +301,7 @@ func (client RouteFiltersClient) ListPreparer() (*http.Request, error) { "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -361,6 +357,51 @@ func (client RouteFiltersClient) ListNextResults(lastResults RouteFilterListResu return } +// ListComplete gets all elements from the list without paging. +func (client RouteFiltersClient) ListComplete(cancel <-chan struct{}) (<-chan RouteFilter, <-chan error) { + resultChan := make(chan RouteFilter) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + // ListByResourceGroup gets all route filters in a resource group. // // resourceGroupName is the name of the resource group. @@ -393,7 +434,7 @@ func (client RouteFiltersClient) ListByResourceGroupPreparer(resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -449,14 +490,57 @@ func (client RouteFiltersClient) ListByResourceGroupNextResults(lastResults Rout return } -// Update updates a route filter in a specified resource group. This method may -// poll for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// ListByResourceGroupComplete gets all elements from the list without paging. +func (client RouteFiltersClient) ListByResourceGroupComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan RouteFilter, <-chan error) { + resultChan := make(chan RouteFilter) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListByResourceGroup(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListByResourceGroupNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// Update updates a route filter in a specified resource group. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. // -// resourceGroupName is the name of the resource group. routeFilterName is the -// name of the route filter. routeFilterParameters is parameters supplied to -// the update route filter operation. +// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. +// routeFilterParameters is parameters supplied to the update route filter operation. func (client RouteFiltersClient) Update(resourceGroupName string, routeFilterName string, routeFilterParameters PatchRouteFilter, cancel <-chan struct{}) (<-chan RouteFilter, <-chan error) { resultChan := make(chan RouteFilter, 1) errChan := make(chan error, 1) @@ -464,8 +548,10 @@ func (client RouteFiltersClient) Update(resourceGroupName string, routeFilterNam var err error var result RouteFilter defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -498,7 +584,7 @@ func (client RouteFiltersClient) UpdatePreparer(resourceGroupName string, routeF "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routes.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routes.go index 1366d3c14472..0dcde6fa01d0 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routes.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routes.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,7 +23,7 @@ import ( "net/http" ) -// RoutesClient is the composite Swagger for Network Client +// RoutesClient is the network Client type RoutesClient struct { ManagementClient } @@ -39,14 +38,12 @@ func NewRoutesClientWithBaseURI(baseURI string, subscriptionID string) RoutesCli return RoutesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a route in the specified route table. This -// method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and any +// CreateOrUpdate creates or updates a route in the specified route table. This method may poll for completion. Polling +// can be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any // outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. routeTableName is the -// name of the route table. routeName is the name of the route. routeParameters -// is parameters supplied to the create or update route operation. +// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. routeName is the +// name of the route. routeParameters is parameters supplied to the create or update route operation. func (client RoutesClient) CreateOrUpdate(resourceGroupName string, routeTableName string, routeName string, routeParameters Route, cancel <-chan struct{}) (<-chan Route, <-chan error) { resultChan := make(chan Route, 1) errChan := make(chan error, 1) @@ -54,8 +51,10 @@ func (client RoutesClient) CreateOrUpdate(resourceGroupName string, routeTableNa var err error var result Route defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -89,7 +88,7 @@ func (client RoutesClient) CreateOrUpdatePreparer(resourceGroupName string, rout "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -125,13 +124,12 @@ func (client RoutesClient) CreateOrUpdateResponder(resp *http.Response) (result return } -// Delete deletes the specified route from a route table. This method may poll -// for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// Delete deletes the specified route from a route table. This method may poll for completion. Polling can be canceled +// by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. // -// resourceGroupName is the name of the resource group. routeTableName is the -// name of the route table. routeName is the name of the route. +// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. routeName is the +// name of the route. func (client RoutesClient) Delete(resourceGroupName string, routeTableName string, routeName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -139,8 +137,10 @@ func (client RoutesClient) Delete(resourceGroupName string, routeTableName strin var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -174,7 +174,7 @@ func (client RoutesClient) DeletePreparer(resourceGroupName string, routeTableNa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -209,8 +209,8 @@ func (client RoutesClient) DeleteResponder(resp *http.Response) (result autorest // Get gets the specified route from a route table. // -// resourceGroupName is the name of the resource group. routeTableName is the -// name of the route table. routeName is the name of the route. +// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. routeName is the +// name of the route. func (client RoutesClient) Get(resourceGroupName string, routeTableName string, routeName string) (result Route, err error) { req, err := client.GetPreparer(resourceGroupName, routeTableName, routeName) if err != nil { @@ -242,7 +242,7 @@ func (client RoutesClient) GetPreparer(resourceGroupName string, routeTableName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -276,8 +276,7 @@ func (client RoutesClient) GetResponder(resp *http.Response) (result Route, err // List gets all routes in a route table. // -// resourceGroupName is the name of the resource group. routeTableName is the -// name of the route table. +// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. func (client RoutesClient) List(resourceGroupName string, routeTableName string) (result RouteListResult, err error) { req, err := client.ListPreparer(resourceGroupName, routeTableName) if err != nil { @@ -308,7 +307,7 @@ func (client RoutesClient) ListPreparer(resourceGroupName string, routeTableName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -363,3 +362,48 @@ func (client RoutesClient) ListNextResults(lastResults RouteListResult) (result return } + +// ListComplete gets all elements from the list without paging. +func (client RoutesClient) ListComplete(resourceGroupName string, routeTableName string, cancel <-chan struct{}) (<-chan Route, <-chan error) { + resultChan := make(chan Route) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName, routeTableName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routetables.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routetables.go index 80339f207869..e9b557bc0b37 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routetables.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/routetables.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,7 +23,7 @@ import ( "net/http" ) -// RouteTablesClient is the composite Swagger for Network Client +// RouteTablesClient is the network Client type RouteTablesClient struct { ManagementClient } @@ -34,20 +33,17 @@ func NewRouteTablesClient(subscriptionID string) RouteTablesClient { return NewRouteTablesClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewRouteTablesClientWithBaseURI creates an instance of the RouteTablesClient -// client. +// NewRouteTablesClientWithBaseURI creates an instance of the RouteTablesClient client. func NewRouteTablesClientWithBaseURI(baseURI string, subscriptionID string) RouteTablesClient { return RouteTablesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate create or updates a route table in a specified resource -// group. This method may poll for completion. Polling can be canceled by -// passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// CreateOrUpdate create or updates a route table in a specified resource group. This method may poll for completion. +// Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any +// outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. routeTableName is the -// name of the route table. parameters is parameters supplied to the create or -// update route table operation. +// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. parameters is +// parameters supplied to the create or update route table operation. func (client RouteTablesClient) CreateOrUpdate(resourceGroupName string, routeTableName string, parameters RouteTable, cancel <-chan struct{}) (<-chan RouteTable, <-chan error) { resultChan := make(chan RouteTable, 1) errChan := make(chan error, 1) @@ -55,8 +51,10 @@ func (client RouteTablesClient) CreateOrUpdate(resourceGroupName string, routeTa var err error var result RouteTable defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -89,7 +87,7 @@ func (client RouteTablesClient) CreateOrUpdatePreparer(resourceGroupName string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -125,13 +123,10 @@ func (client RouteTablesClient) CreateOrUpdateResponder(resp *http.Response) (re return } -// Delete deletes the specified route table. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// Delete deletes the specified route table. This method may poll for completion. Polling can be canceled by passing +// the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. routeTableName is the -// name of the route table. +// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. func (client RouteTablesClient) Delete(resourceGroupName string, routeTableName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -139,8 +134,10 @@ func (client RouteTablesClient) Delete(resourceGroupName string, routeTableName var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -173,7 +170,7 @@ func (client RouteTablesClient) DeletePreparer(resourceGroupName string, routeTa "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -208,8 +205,8 @@ func (client RouteTablesClient) DeleteResponder(resp *http.Response) (result aut // Get gets the specified route table. // -// resourceGroupName is the name of the resource group. routeTableName is the -// name of the route table. expand is expands referenced resources. +// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. expand is +// expands referenced resources. func (client RouteTablesClient) Get(resourceGroupName string, routeTableName string, expand string) (result RouteTable, err error) { req, err := client.GetPreparer(resourceGroupName, routeTableName, expand) if err != nil { @@ -240,7 +237,7 @@ func (client RouteTablesClient) GetPreparer(resourceGroupName string, routeTable "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -307,7 +304,7 @@ func (client RouteTablesClient) ListPreparer(resourceGroupName string) (*http.Re "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -363,6 +360,51 @@ func (client RouteTablesClient) ListNextResults(lastResults RouteTableListResult return } +// ListComplete gets all elements from the list without paging. +func (client RouteTablesClient) ListComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan RouteTable, <-chan error) { + resultChan := make(chan RouteTable) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + // ListAll gets all route tables in a subscription. func (client RouteTablesClient) ListAll() (result RouteTableListResult, err error) { req, err := client.ListAllPreparer() @@ -392,7 +434,7 @@ func (client RouteTablesClient) ListAllPreparer() (*http.Request, error) { "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -447,3 +489,48 @@ func (client RouteTablesClient) ListAllNextResults(lastResults RouteTableListRes return } + +// ListAllComplete gets all elements from the list without paging. +func (client RouteTablesClient) ListAllComplete(cancel <-chan struct{}) (<-chan RouteTable, <-chan error) { + resultChan := make(chan RouteTable) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListAll() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListAllNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/securitygroups.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/securitygroups.go index 3faaf007fffe..b1a5ae4a6e29 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/securitygroups.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/securitygroups.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,32 +23,27 @@ import ( "net/http" ) -// SecurityGroupsClient is the composite Swagger for Network Client +// SecurityGroupsClient is the network Client type SecurityGroupsClient struct { ManagementClient } -// NewSecurityGroupsClient creates an instance of the SecurityGroupsClient -// client. +// NewSecurityGroupsClient creates an instance of the SecurityGroupsClient client. func NewSecurityGroupsClient(subscriptionID string) SecurityGroupsClient { return NewSecurityGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewSecurityGroupsClientWithBaseURI creates an instance of the -// SecurityGroupsClient client. +// NewSecurityGroupsClientWithBaseURI creates an instance of the SecurityGroupsClient client. func NewSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string) SecurityGroupsClient { return SecurityGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a network security group in the specified -// resource group. This method may poll for completion. Polling can be canceled -// by passing the cancel channel argument. The channel will be used to cancel +// CreateOrUpdate creates or updates a network security group in the specified resource group. This method may poll for +// completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel // polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. -// networkSecurityGroupName is the name of the network security group. -// parameters is parameters supplied to the create or update network security -// group operation. +// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network security +// group. parameters is parameters supplied to the create or update network security group operation. func (client SecurityGroupsClient) CreateOrUpdate(resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup, cancel <-chan struct{}) (<-chan SecurityGroup, <-chan error) { resultChan := make(chan SecurityGroup, 1) errChan := make(chan error, 1) @@ -57,8 +51,10 @@ func (client SecurityGroupsClient) CreateOrUpdate(resourceGroupName string, netw var err error var result SecurityGroup defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -91,7 +87,7 @@ func (client SecurityGroupsClient) CreateOrUpdatePreparer(resourceGroupName stri "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -127,13 +123,11 @@ func (client SecurityGroupsClient) CreateOrUpdateResponder(resp *http.Response) return } -// Delete deletes the specified network security group. This method may poll -// for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// Delete deletes the specified network security group. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. -// networkSecurityGroupName is the name of the network security group. +// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network security +// group. func (client SecurityGroupsClient) Delete(resourceGroupName string, networkSecurityGroupName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -141,8 +135,10 @@ func (client SecurityGroupsClient) Delete(resourceGroupName string, networkSecur var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -175,7 +171,7 @@ func (client SecurityGroupsClient) DeletePreparer(resourceGroupName string, netw "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -210,9 +206,8 @@ func (client SecurityGroupsClient) DeleteResponder(resp *http.Response) (result // Get gets the specified network security group. // -// resourceGroupName is the name of the resource group. -// networkSecurityGroupName is the name of the network security group. expand -// is expands referenced resources. +// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network security +// group. expand is expands referenced resources. func (client SecurityGroupsClient) Get(resourceGroupName string, networkSecurityGroupName string, expand string) (result SecurityGroup, err error) { req, err := client.GetPreparer(resourceGroupName, networkSecurityGroupName, expand) if err != nil { @@ -243,7 +238,7 @@ func (client SecurityGroupsClient) GetPreparer(resourceGroupName string, network "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -310,7 +305,7 @@ func (client SecurityGroupsClient) ListPreparer(resourceGroupName string) (*http "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -366,6 +361,51 @@ func (client SecurityGroupsClient) ListNextResults(lastResults SecurityGroupList return } +// ListComplete gets all elements from the list without paging. +func (client SecurityGroupsClient) ListComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan SecurityGroup, <-chan error) { + resultChan := make(chan SecurityGroup) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + // ListAll gets all network security groups in a subscription. func (client SecurityGroupsClient) ListAll() (result SecurityGroupListResult, err error) { req, err := client.ListAllPreparer() @@ -395,7 +435,7 @@ func (client SecurityGroupsClient) ListAllPreparer() (*http.Request, error) { "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -450,3 +490,48 @@ func (client SecurityGroupsClient) ListAllNextResults(lastResults SecurityGroupL return } + +// ListAllComplete gets all elements from the list without paging. +func (client SecurityGroupsClient) ListAllComplete(cancel <-chan struct{}) (<-chan SecurityGroup, <-chan error) { + resultChan := make(chan SecurityGroup) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListAll() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListAllNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/securityrules.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/securityrules.go index 2e2738605f83..9c76ef54e8b9 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/securityrules.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/securityrules.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -25,32 +24,28 @@ import ( "net/http" ) -// SecurityRulesClient is the composite Swagger for Network Client +// SecurityRulesClient is the network Client type SecurityRulesClient struct { ManagementClient } -// NewSecurityRulesClient creates an instance of the SecurityRulesClient -// client. +// NewSecurityRulesClient creates an instance of the SecurityRulesClient client. func NewSecurityRulesClient(subscriptionID string) SecurityRulesClient { return NewSecurityRulesClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewSecurityRulesClientWithBaseURI creates an instance of the -// SecurityRulesClient client. +// NewSecurityRulesClientWithBaseURI creates an instance of the SecurityRulesClient client. func NewSecurityRulesClientWithBaseURI(baseURI string, subscriptionID string) SecurityRulesClient { return SecurityRulesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a security rule in the specified network -// security group. This method may poll for completion. Polling can be canceled -// by passing the cancel channel argument. The channel will be used to cancel +// CreateOrUpdate creates or updates a security rule in the specified network security group. This method may poll for +// completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel // polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. -// networkSecurityGroupName is the name of the network security group. -// securityRuleName is the name of the security rule. securityRuleParameters is -// parameters supplied to the create or update network security rule operation. +// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network security +// group. securityRuleName is the name of the security rule. securityRuleParameters is parameters supplied to the +// create or update network security rule operation. func (client SecurityRulesClient) CreateOrUpdate(resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule, cancel <-chan struct{}) (<-chan SecurityRule, <-chan error) { resultChan := make(chan SecurityRule, 1) errChan := make(chan error, 1) @@ -70,8 +65,10 @@ func (client SecurityRulesClient) CreateOrUpdate(resourceGroupName string, netwo var err error var result SecurityRule defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -105,7 +102,7 @@ func (client SecurityRulesClient) CreateOrUpdatePreparer(resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -141,14 +138,11 @@ func (client SecurityRulesClient) CreateOrUpdateResponder(resp *http.Response) ( return } -// Delete deletes the specified network security rule. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// Delete deletes the specified network security rule. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. -// networkSecurityGroupName is the name of the network security group. -// securityRuleName is the name of the security rule. +// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network security +// group. securityRuleName is the name of the security rule. func (client SecurityRulesClient) Delete(resourceGroupName string, networkSecurityGroupName string, securityRuleName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -156,8 +150,10 @@ func (client SecurityRulesClient) Delete(resourceGroupName string, networkSecuri var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -191,7 +187,7 @@ func (client SecurityRulesClient) DeletePreparer(resourceGroupName string, netwo "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -226,9 +222,8 @@ func (client SecurityRulesClient) DeleteResponder(resp *http.Response) (result a // Get get the specified network security rule. // -// resourceGroupName is the name of the resource group. -// networkSecurityGroupName is the name of the network security group. -// securityRuleName is the name of the security rule. +// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network security +// group. securityRuleName is the name of the security rule. func (client SecurityRulesClient) Get(resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (result SecurityRule, err error) { req, err := client.GetPreparer(resourceGroupName, networkSecurityGroupName, securityRuleName) if err != nil { @@ -260,7 +255,7 @@ func (client SecurityRulesClient) GetPreparer(resourceGroupName string, networkS "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -294,8 +289,8 @@ func (client SecurityRulesClient) GetResponder(resp *http.Response) (result Secu // List gets all security rules in a network security group. // -// resourceGroupName is the name of the resource group. -// networkSecurityGroupName is the name of the network security group. +// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network security +// group. func (client SecurityRulesClient) List(resourceGroupName string, networkSecurityGroupName string) (result SecurityRuleListResult, err error) { req, err := client.ListPreparer(resourceGroupName, networkSecurityGroupName) if err != nil { @@ -326,7 +321,7 @@ func (client SecurityRulesClient) ListPreparer(resourceGroupName string, network "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -381,3 +376,48 @@ func (client SecurityRulesClient) ListNextResults(lastResults SecurityRuleListRe return } + +// ListComplete gets all elements from the list without paging. +func (client SecurityRulesClient) ListComplete(resourceGroupName string, networkSecurityGroupName string, cancel <-chan struct{}) (<-chan SecurityRule, <-chan error) { + resultChan := make(chan SecurityRule) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName, networkSecurityGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/subnets.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/subnets.go index 7d6ff882ae72..62a1789e591d 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/subnets.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/subnets.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,7 +23,7 @@ import ( "net/http" ) -// SubnetsClient is the composite Swagger for Network Client +// SubnetsClient is the network Client type SubnetsClient struct { ManagementClient } @@ -39,14 +38,12 @@ func NewSubnetsClientWithBaseURI(baseURI string, subscriptionID string) SubnetsC return SubnetsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a subnet in the specified virtual network. -// This method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and any +// CreateOrUpdate creates or updates a subnet in the specified virtual network. This method may poll for completion. +// Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any // outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. virtualNetworkName is -// the name of the virtual network. subnetName is the name of the subnet. -// subnetParameters is parameters supplied to the create or update subnet +// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. +// subnetName is the name of the subnet. subnetParameters is parameters supplied to the create or update subnet // operation. func (client SubnetsClient) CreateOrUpdate(resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet, cancel <-chan struct{}) (<-chan Subnet, <-chan error) { resultChan := make(chan Subnet, 1) @@ -55,8 +52,10 @@ func (client SubnetsClient) CreateOrUpdate(resourceGroupName string, virtualNetw var err error var result Subnet defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -90,7 +89,7 @@ func (client SubnetsClient) CreateOrUpdatePreparer(resourceGroupName string, vir "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -126,12 +125,11 @@ func (client SubnetsClient) CreateOrUpdateResponder(resp *http.Response) (result return } -// Delete deletes the specified subnet. This method may poll for completion. -// Polling can be canceled by passing the cancel channel argument. The channel -// will be used to cancel polling and any outstanding HTTP requests. +// Delete deletes the specified subnet. This method may poll for completion. Polling can be canceled by passing the +// cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. virtualNetworkName is -// the name of the virtual network. subnetName is the name of the subnet. +// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. +// subnetName is the name of the subnet. func (client SubnetsClient) Delete(resourceGroupName string, virtualNetworkName string, subnetName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -139,8 +137,10 @@ func (client SubnetsClient) Delete(resourceGroupName string, virtualNetworkName var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -174,7 +174,7 @@ func (client SubnetsClient) DeletePreparer(resourceGroupName string, virtualNetw "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -209,9 +209,8 @@ func (client SubnetsClient) DeleteResponder(resp *http.Response) (result autores // Get gets the specified subnet by virtual network and resource group. // -// resourceGroupName is the name of the resource group. virtualNetworkName is -// the name of the virtual network. subnetName is the name of the subnet. -// expand is expands referenced resources. +// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. +// subnetName is the name of the subnet. expand is expands referenced resources. func (client SubnetsClient) Get(resourceGroupName string, virtualNetworkName string, subnetName string, expand string) (result Subnet, err error) { req, err := client.GetPreparer(resourceGroupName, virtualNetworkName, subnetName, expand) if err != nil { @@ -243,7 +242,7 @@ func (client SubnetsClient) GetPreparer(resourceGroupName string, virtualNetwork "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -280,8 +279,7 @@ func (client SubnetsClient) GetResponder(resp *http.Response) (result Subnet, er // List gets all subnets in a virtual network. // -// resourceGroupName is the name of the resource group. virtualNetworkName is -// the name of the virtual network. +// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. func (client SubnetsClient) List(resourceGroupName string, virtualNetworkName string) (result SubnetListResult, err error) { req, err := client.ListPreparer(resourceGroupName, virtualNetworkName) if err != nil { @@ -312,7 +310,7 @@ func (client SubnetsClient) ListPreparer(resourceGroupName string, virtualNetwor "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -367,3 +365,48 @@ func (client SubnetsClient) ListNextResults(lastResults SubnetListResult) (resul return } + +// ListComplete gets all elements from the list without paging. +func (client SubnetsClient) ListComplete(resourceGroupName string, virtualNetworkName string, cancel <-chan struct{}) (<-chan Subnet, <-chan error) { + resultChan := make(chan Subnet) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName, virtualNetworkName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/usages.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/usages.go index 34fa0df4b428..85c220065404 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/usages.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/usages.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -25,7 +24,7 @@ import ( "net/http" ) -// UsagesClient is the composite Swagger for Network Client +// UsagesClient is the network Client type UsagesClient struct { ManagementClient } @@ -40,7 +39,7 @@ func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesCli return UsagesClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List lists compute usages for a subscription. +// List list network usages for a subscription. // // location is the location where resource usage is queried. func (client UsagesClient) List(location string) (result UsagesListResult, err error) { @@ -78,7 +77,7 @@ func (client UsagesClient) ListPreparer(location string) (*http.Request, error) "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -133,3 +132,48 @@ func (client UsagesClient) ListNextResults(lastResults UsagesListResult) (result return } + +// ListComplete gets all elements from the list without paging. +func (client UsagesClient) ListComplete(location string, cancel <-chan struct{}) (<-chan Usage, <-chan error) { + resultChan := make(chan Usage) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(location) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/version.go index 50b836179f85..7f510b4e4c6d 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/version.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/version.go @@ -14,16 +14,15 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v10.0.2-beta arm-network/" + return "Azure-SDK-For-Go/v11.0.0-beta arm-network/" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v10.0.2-beta" + return "v11.0.0-beta" } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgatewayconnections.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgatewayconnections.go index 13e1392d2853..7db4d5de6c38 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgatewayconnections.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgatewayconnections.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -25,33 +24,29 @@ import ( "net/http" ) -// VirtualNetworkGatewayConnectionsClient is the composite Swagger for Network -// Client +// VirtualNetworkGatewayConnectionsClient is the network Client type VirtualNetworkGatewayConnectionsClient struct { ManagementClient } -// NewVirtualNetworkGatewayConnectionsClient creates an instance of the -// VirtualNetworkGatewayConnectionsClient client. +// NewVirtualNetworkGatewayConnectionsClient creates an instance of the VirtualNetworkGatewayConnectionsClient client. func NewVirtualNetworkGatewayConnectionsClient(subscriptionID string) VirtualNetworkGatewayConnectionsClient { return NewVirtualNetworkGatewayConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewVirtualNetworkGatewayConnectionsClientWithBaseURI creates an instance of -// the VirtualNetworkGatewayConnectionsClient client. +// NewVirtualNetworkGatewayConnectionsClientWithBaseURI creates an instance of the +// VirtualNetworkGatewayConnectionsClient client. func NewVirtualNetworkGatewayConnectionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkGatewayConnectionsClient { return VirtualNetworkGatewayConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a virtual network gateway connection in -// the specified resource group. This method may poll for completion. Polling -// can be canceled by passing the cancel channel argument. The channel will be -// used to cancel polling and any outstanding HTTP requests. +// CreateOrUpdate creates or updates a virtual network gateway connection in the specified resource group. This method +// may poll for completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to +// cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. -// virtualNetworkGatewayConnectionName is the name of the virtual network -// gateway connection. parameters is parameters supplied to the create or -// update virtual network gateway connection operation. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the name of the virtual +// network gateway connection. parameters is parameters supplied to the create or update virtual network gateway +// connection operation. func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdate(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection, cancel <-chan struct{}) (<-chan VirtualNetworkGatewayConnection, <-chan error) { resultChan := make(chan VirtualNetworkGatewayConnection, 1) errChan := make(chan error, 1) @@ -75,8 +70,10 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdate(resourceGrou var err error var result VirtualNetworkGatewayConnection defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -109,7 +106,7 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdatePreparer(reso "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -145,14 +142,12 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdateResponder(res return } -// Delete deletes the specified virtual network Gateway connection. This method -// may poll for completion. Polling can be canceled by passing the cancel -// channel argument. The channel will be used to cancel polling and any -// outstanding HTTP requests. +// Delete deletes the specified virtual network Gateway connection. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. // -// resourceGroupName is the name of the resource group. -// virtualNetworkGatewayConnectionName is the name of the virtual network -// gateway connection. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the name of the virtual +// network gateway connection. func (client VirtualNetworkGatewayConnectionsClient) Delete(resourceGroupName string, virtualNetworkGatewayConnectionName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -160,8 +155,10 @@ func (client VirtualNetworkGatewayConnectionsClient) Delete(resourceGroupName st var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -194,7 +191,7 @@ func (client VirtualNetworkGatewayConnectionsClient) DeletePreparer(resourceGrou "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -229,9 +226,8 @@ func (client VirtualNetworkGatewayConnectionsClient) DeleteResponder(resp *http. // Get gets the specified virtual network gateway connection by resource group. // -// resourceGroupName is the name of the resource group. -// virtualNetworkGatewayConnectionName is the name of the virtual network -// gateway connection. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the name of the virtual +// network gateway connection. func (client VirtualNetworkGatewayConnectionsClient) Get(resourceGroupName string, virtualNetworkGatewayConnectionName string) (result VirtualNetworkGatewayConnection, err error) { req, err := client.GetPreparer(resourceGroupName, virtualNetworkGatewayConnectionName) if err != nil { @@ -262,7 +258,7 @@ func (client VirtualNetworkGatewayConnectionsClient) GetPreparer(resourceGroupNa "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -294,13 +290,11 @@ func (client VirtualNetworkGatewayConnectionsClient) GetResponder(resp *http.Res return } -// GetSharedKey the Get VirtualNetworkGatewayConnectionSharedKey operation -// retrieves information about the specified virtual network gateway connection -// shared key through Network resource provider. +// GetSharedKey the Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified +// virtual network gateway connection shared key through Network resource provider. // -// resourceGroupName is the name of the resource group. -// virtualNetworkGatewayConnectionName is the virtual network gateway -// connection shared key name. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the virtual network +// gateway connection shared key name. func (client VirtualNetworkGatewayConnectionsClient) GetSharedKey(resourceGroupName string, virtualNetworkGatewayConnectionName string) (result ConnectionSharedKey, err error) { req, err := client.GetSharedKeyPreparer(resourceGroupName, virtualNetworkGatewayConnectionName) if err != nil { @@ -331,7 +325,7 @@ func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyPreparer(resour "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -363,8 +357,8 @@ func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyResponder(resp return } -// List the List VirtualNetworkGatewayConnections operation retrieves all the -// virtual network gateways connections created. +// List the List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections +// created. // // resourceGroupName is the name of the resource group. func (client VirtualNetworkGatewayConnectionsClient) List(resourceGroupName string) (result VirtualNetworkGatewayConnectionListResult, err error) { @@ -396,7 +390,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ListPreparer(resourceGroupN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -452,18 +446,59 @@ func (client VirtualNetworkGatewayConnectionsClient) ListNextResults(lastResults return } -// ResetSharedKey the VirtualNetworkGatewayConnectionResetSharedKey operation -// resets the virtual network gateway connection shared key for passed virtual -// network gateway connection in the specified resource group through Network -// resource provider. This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used to -// cancel polling and any outstanding HTTP requests. +// ListComplete gets all elements from the list without paging. +func (client VirtualNetworkGatewayConnectionsClient) ListComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan VirtualNetworkGatewayConnection, <-chan error) { + resultChan := make(chan VirtualNetworkGatewayConnection) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ResetSharedKey the VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway +// connection shared key for passed virtual network gateway connection in the specified resource group through Network +// resource provider. This method may poll for completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. -// virtualNetworkGatewayConnectionName is the virtual network gateway -// connection reset shared key Name. parameters is parameters supplied to the -// begin reset virtual network gateway connection shared key operation through -// network resource provider. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the virtual network +// gateway connection reset shared key Name. parameters is parameters supplied to the begin reset virtual network +// gateway connection shared key operation through network resource provider. func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey, cancel <-chan struct{}) (<-chan ConnectionResetSharedKey, <-chan error) { resultChan := make(chan ConnectionResetSharedKey, 1) errChan := make(chan error, 1) @@ -483,8 +518,10 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(resourceGrou var err error var result ConnectionResetSharedKey defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -517,7 +554,7 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyPreparer(reso "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -553,18 +590,14 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyResponder(res return } -// SetSharedKey the Put VirtualNetworkGatewayConnectionSharedKey operation sets -// the virtual network gateway connection shared key for passed virtual network -// gateway connection in the specified resource group through Network resource -// provider. This method may poll for completion. Polling can be canceled by -// passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// SetSharedKey the Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection +// shared key for passed virtual network gateway connection in the specified resource group through Network resource +// provider. This method may poll for completion. Polling can be canceled by passing the cancel channel argument. The +// channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. -// virtualNetworkGatewayConnectionName is the virtual network gateway -// connection name. parameters is parameters supplied to the Begin Set Virtual -// Network Gateway connection Shared key operation throughNetwork resource -// provider. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the virtual network +// gateway connection name. parameters is parameters supplied to the Begin Set Virtual Network Gateway connection +// Shared key operation throughNetwork resource provider. func (client VirtualNetworkGatewayConnectionsClient) SetSharedKey(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey, cancel <-chan struct{}) (<-chan ConnectionSharedKey, <-chan error) { resultChan := make(chan ConnectionSharedKey, 1) errChan := make(chan error, 1) @@ -581,8 +614,10 @@ func (client VirtualNetworkGatewayConnectionsClient) SetSharedKey(resourceGroupN var err error var result ConnectionSharedKey defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -615,7 +650,7 @@ func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeyPreparer(resour "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgateways.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgateways.go index 720978e83ff8..5f56a204badf 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgateways.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkgateways.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -25,32 +24,27 @@ import ( "net/http" ) -// VirtualNetworkGatewaysClient is the composite Swagger for Network Client +// VirtualNetworkGatewaysClient is the network Client type VirtualNetworkGatewaysClient struct { ManagementClient } -// NewVirtualNetworkGatewaysClient creates an instance of the -// VirtualNetworkGatewaysClient client. +// NewVirtualNetworkGatewaysClient creates an instance of the VirtualNetworkGatewaysClient client. func NewVirtualNetworkGatewaysClient(subscriptionID string) VirtualNetworkGatewaysClient { return NewVirtualNetworkGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewVirtualNetworkGatewaysClientWithBaseURI creates an instance of the -// VirtualNetworkGatewaysClient client. +// NewVirtualNetworkGatewaysClientWithBaseURI creates an instance of the VirtualNetworkGatewaysClient client. func NewVirtualNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkGatewaysClient { return VirtualNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a virtual network gateway in the specified -// resource group. This method may poll for completion. Polling can be canceled -// by passing the cancel channel argument. The channel will be used to cancel +// CreateOrUpdate creates or updates a virtual network gateway in the specified resource group. This method may poll +// for completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel // polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. -// virtualNetworkGatewayName is the name of the virtual network gateway. -// parameters is parameters supplied to create or update virtual network -// gateway operation. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network +// gateway. parameters is parameters supplied to create or update virtual network gateway operation. func (client VirtualNetworkGatewaysClient) CreateOrUpdate(resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, cancel <-chan struct{}) (<-chan VirtualNetworkGateway, <-chan error) { resultChan := make(chan VirtualNetworkGateway, 1) errChan := make(chan error, 1) @@ -67,8 +61,10 @@ func (client VirtualNetworkGatewaysClient) CreateOrUpdate(resourceGroupName stri var err error var result VirtualNetworkGateway defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -101,7 +97,7 @@ func (client VirtualNetworkGatewaysClient) CreateOrUpdatePreparer(resourceGroupN "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -137,13 +133,12 @@ func (client VirtualNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Re return } -// Delete deletes the specified virtual network gateway. This method may poll -// for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// Delete deletes the specified virtual network gateway. This method may poll for completion. Polling can be canceled +// by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. // -// resourceGroupName is the name of the resource group. -// virtualNetworkGatewayName is the name of the virtual network gateway. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network +// gateway. func (client VirtualNetworkGatewaysClient) Delete(resourceGroupName string, virtualNetworkGatewayName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -151,8 +146,10 @@ func (client VirtualNetworkGatewaysClient) Delete(resourceGroupName string, virt var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -185,7 +182,7 @@ func (client VirtualNetworkGatewaysClient) DeletePreparer(resourceGroupName stri "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -218,44 +215,56 @@ func (client VirtualNetworkGatewaysClient) DeleteResponder(resp *http.Response) return } -// Generatevpnclientpackage generates VPN client package for P2S client of the -// virtual network gateway in the specified resource group. +// Generatevpnclientpackage generates VPN client package for P2S client of the virtual network gateway in the specified +// resource group. This method may poll for completion. Polling can be canceled by passing the cancel channel argument. +// The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. -// virtualNetworkGatewayName is the name of the virtual network gateway. -// parameters is parameters supplied to the generate virtual network gateway -// VPN client package operation. -func (client VirtualNetworkGatewaysClient) Generatevpnclientpackage(resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (result String, err error) { - req, err := client.GeneratevpnclientpackagePreparer(resourceGroupName, virtualNetworkGatewayName, parameters) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", nil, "Failure preparing request") - return - } - - resp, err := client.GeneratevpnclientpackageSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", resp, "Failure sending request") - return - } +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network +// gateway. parameters is parameters supplied to the generate virtual network gateway VPN client package operation. +func (client VirtualNetworkGatewaysClient) Generatevpnclientpackage(resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters, cancel <-chan struct{}) (<-chan String, <-chan error) { + resultChan := make(chan String, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result String + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.GeneratevpnclientpackagePreparer(resourceGroupName, virtualNetworkGatewayName, parameters, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", nil, "Failure preparing request") + return + } - result, err = client.GeneratevpnclientpackageResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", resp, "Failure responding to request") - } + resp, err := client.GeneratevpnclientpackageSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", resp, "Failure sending request") + return + } - return + result, err = client.GeneratevpnclientpackageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Generatevpnclientpackage", resp, "Failure responding to request") + } + }() + return resultChan, errChan } // GeneratevpnclientpackagePreparer prepares the Generatevpnclientpackage request. -func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackagePreparer(resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (*http.Request, error) { +func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackagePreparer(resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters, cancel <-chan struct{}) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -267,18 +276,106 @@ func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackagePreparer(reso autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage", pathParameters), autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare(&http.Request{}) + return preparer.Prepare(&http.Request{Cancel: cancel}) } // GeneratevpnclientpackageSender sends the Generatevpnclientpackage request. The method will close the // http.Response Body if it receives an error. func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageSender(req *http.Request) (*http.Response, error) { - return autorest.SendWithSender(client, req) + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) } // GeneratevpnclientpackageResponder handles the response to the Generatevpnclientpackage request. The method always // closes the http.Response Body. func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GenerateVpnProfile generates VPN profile for P2S client of the virtual network gateway in the specified resource +// group. Used for IKEV2 and radius based authentication. This method may poll for completion. Polling can be canceled +// by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. +// +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network +// gateway. parameters is parameters supplied to the generate virtual network gateway VPN client package operation. +func (client VirtualNetworkGatewaysClient) GenerateVpnProfile(resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters, cancel <-chan struct{}) (<-chan String, <-chan error) { + resultChan := make(chan String, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result String + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.GenerateVpnProfilePreparer(resourceGroupName, virtualNetworkGatewayName, parameters, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GenerateVpnProfile", nil, "Failure preparing request") + return + } + + resp, err := client.GenerateVpnProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GenerateVpnProfile", resp, "Failure sending request") + return + } + + result, err = client.GenerateVpnProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GenerateVpnProfile", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// GenerateVpnProfilePreparer prepares the GenerateVpnProfile request. +func (client VirtualNetworkGatewaysClient) GenerateVpnProfilePreparer(resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnprofile", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// GenerateVpnProfileSender sends the GenerateVpnProfile request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualNetworkGatewaysClient) GenerateVpnProfileSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// GenerateVpnProfileResponder handles the response to the GenerateVpnProfile request. The method always +// closes the http.Response Body. +func (client VirtualNetworkGatewaysClient) GenerateVpnProfileResponder(resp *http.Response) (result String, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -291,8 +388,8 @@ func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageResponder(res // Get gets the specified virtual network gateway by resource group. // -// resourceGroupName is the name of the resource group. -// virtualNetworkGatewayName is the name of the virtual network gateway. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network +// gateway. func (client VirtualNetworkGatewaysClient) Get(resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGateway, err error) { req, err := client.GetPreparer(resourceGroupName, virtualNetworkGatewayName) if err != nil { @@ -323,7 +420,7 @@ func (client VirtualNetworkGatewaysClient) GetPreparer(resourceGroupName string, "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -355,15 +452,12 @@ func (client VirtualNetworkGatewaysClient) GetResponder(resp *http.Response) (re return } -// GetAdvertisedRoutes this operation retrieves a list of routes the virtual -// network gateway is advertising to the specified peer. This method may poll -// for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// GetAdvertisedRoutes this operation retrieves a list of routes the virtual network gateway is advertising to the +// specified peer. This method may poll for completion. Polling can be canceled by passing the cancel channel argument. +// The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. -// virtualNetworkGatewayName is the name of the virtual network gateway. peer -// is the IP address of the peer +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network +// gateway. peer is the IP address of the peer func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutes(resourceGroupName string, virtualNetworkGatewayName string, peer string, cancel <-chan struct{}) (<-chan GatewayRouteListResult, <-chan error) { resultChan := make(chan GatewayRouteListResult, 1) errChan := make(chan error, 1) @@ -371,8 +465,10 @@ func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutes(resourceGroupName var err error var result GatewayRouteListResult defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -405,7 +501,7 @@ func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesPreparer(resourceG "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, "peer": autorest.Encode("query", peer), @@ -440,14 +536,12 @@ func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesResponder(resp *ht return } -// GetBgpPeerStatus the GetBgpPeerStatus operation retrieves the status of all -// BGP peers. This method may poll for completion. Polling can be canceled by -// passing the cancel channel argument. The channel will be used to cancel +// GetBgpPeerStatus the GetBgpPeerStatus operation retrieves the status of all BGP peers. This method may poll for +// completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel // polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. -// virtualNetworkGatewayName is the name of the virtual network gateway. peer -// is the IP address of the peer to retrieve the status of. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network +// gateway. peer is the IP address of the peer to retrieve the status of. func (client VirtualNetworkGatewaysClient) GetBgpPeerStatus(resourceGroupName string, virtualNetworkGatewayName string, peer string, cancel <-chan struct{}) (<-chan BgpPeerStatusListResult, <-chan error) { resultChan := make(chan BgpPeerStatusListResult, 1) errChan := make(chan error, 1) @@ -455,8 +549,10 @@ func (client VirtualNetworkGatewaysClient) GetBgpPeerStatus(resourceGroupName st var err error var result BgpPeerStatusListResult defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -489,7 +585,7 @@ func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusPreparer(resourceGrou "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -526,14 +622,12 @@ func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusResponder(resp *http. return } -// GetLearnedRoutes this operation retrieves a list of routes the virtual -// network gateway has learned, including routes learned from BGP peers. This -// method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and any -// outstanding HTTP requests. +// GetLearnedRoutes this operation retrieves a list of routes the virtual network gateway has learned, including routes +// learned from BGP peers. This method may poll for completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. -// virtualNetworkGatewayName is the name of the virtual network gateway. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network +// gateway. func (client VirtualNetworkGatewaysClient) GetLearnedRoutes(resourceGroupName string, virtualNetworkGatewayName string, cancel <-chan struct{}) (<-chan GatewayRouteListResult, <-chan error) { resultChan := make(chan GatewayRouteListResult, 1) errChan := make(chan error, 1) @@ -541,8 +635,10 @@ func (client VirtualNetworkGatewaysClient) GetLearnedRoutes(resourceGroupName st var err error var result GatewayRouteListResult defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -575,7 +671,7 @@ func (client VirtualNetworkGatewaysClient) GetLearnedRoutesPreparer(resourceGrou "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -609,6 +705,90 @@ func (client VirtualNetworkGatewaysClient) GetLearnedRoutesResponder(resp *http. return } +// GetVpnProfilePackageURL gets pre-generated VPN profile for P2S client of the virtual network gateway in the +// specified resource group. The profile needs to be generated first using generateVpnProfile. This method may poll for +// completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel +// polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network +// gateway. +func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURL(resourceGroupName string, virtualNetworkGatewayName string, cancel <-chan struct{}) (<-chan String, <-chan error) { + resultChan := make(chan String, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result String + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.GetVpnProfilePackageURLPreparer(resourceGroupName, virtualNetworkGatewayName, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnProfilePackageURL", nil, "Failure preparing request") + return + } + + resp, err := client.GetVpnProfilePackageURLSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnProfilePackageURL", resp, "Failure sending request") + return + } + + result, err = client.GetVpnProfilePackageURLResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "GetVpnProfilePackageURL", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// GetVpnProfilePackageURLPreparer prepares the GetVpnProfilePackageURL request. +func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLPreparer(resourceGroupName string, virtualNetworkGatewayName string, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/getvpnprofilepackageurl", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// GetVpnProfilePackageURLSender sends the GetVpnProfilePackageURL request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// GetVpnProfilePackageURLResponder handles the response to the GetVpnProfilePackageURL request. The method always +// closes the http.Response Body. +func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // List gets all virtual network gateways by resource group. // // resourceGroupName is the name of the resource group. @@ -641,7 +821,7 @@ func (client VirtualNetworkGatewaysClient) ListPreparer(resourceGroupName string "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -697,15 +877,193 @@ func (client VirtualNetworkGatewaysClient) ListNextResults(lastResults VirtualNe return } -// Reset resets the primary of the virtual network gateway in the specified -// resource group. This method may poll for completion. Polling can be canceled -// by passing the cancel channel argument. The channel will be used to cancel +// ListComplete gets all elements from the list without paging. +func (client VirtualNetworkGatewaysClient) ListComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan VirtualNetworkGateway, <-chan error) { + resultChan := make(chan VirtualNetworkGateway) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListConnections gets all the connections in a virtual network gateway. +// +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network +// gateway. +func (client VirtualNetworkGatewaysClient) ListConnections(resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewayListConnectionsResult, err error) { + req, err := client.ListConnectionsPreparer(resourceGroupName, virtualNetworkGatewayName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ListConnections", nil, "Failure preparing request") + return + } + + resp, err := client.ListConnectionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ListConnections", resp, "Failure sending request") + return + } + + result, err = client.ListConnectionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ListConnections", resp, "Failure responding to request") + } + + return +} + +// ListConnectionsPreparer prepares the ListConnections request. +func (client VirtualNetworkGatewaysClient) ListConnectionsPreparer(resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/connections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListConnectionsSender sends the ListConnections request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualNetworkGatewaysClient) ListConnectionsSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListConnectionsResponder handles the response to the ListConnections request. The method always +// closes the http.Response Body. +func (client VirtualNetworkGatewaysClient) ListConnectionsResponder(resp *http.Response) (result VirtualNetworkGatewayListConnectionsResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListConnectionsNextResults retrieves the next set of results, if any. +func (client VirtualNetworkGatewaysClient) ListConnectionsNextResults(lastResults VirtualNetworkGatewayListConnectionsResult) (result VirtualNetworkGatewayListConnectionsResult, err error) { + req, err := lastResults.VirtualNetworkGatewayListConnectionsResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ListConnections", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListConnectionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ListConnections", resp, "Failure sending next results request") + } + + result, err = client.ListConnectionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "ListConnections", resp, "Failure responding to next results request") + } + + return +} + +// ListConnectionsComplete gets all elements from the list without paging. +func (client VirtualNetworkGatewaysClient) ListConnectionsComplete(resourceGroupName string, virtualNetworkGatewayName string, cancel <-chan struct{}) (<-chan VirtualNetworkGatewayConnectionListEntity, <-chan error) { + resultChan := make(chan VirtualNetworkGatewayConnectionListEntity) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListConnections(resourceGroupName, virtualNetworkGatewayName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListConnectionsNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// Reset resets the primary of the virtual network gateway in the specified resource group. This method may poll for +// completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel // polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. -// virtualNetworkGatewayName is the name of the virtual network gateway. -// gatewayVip is virtual network gateway vip address supplied to the begin -// reset of the active-active feature enabled gateway. +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network +// gateway. gatewayVip is virtual network gateway vip address supplied to the begin reset of the active-active feature +// enabled gateway. func (client VirtualNetworkGatewaysClient) Reset(resourceGroupName string, virtualNetworkGatewayName string, gatewayVip string, cancel <-chan struct{}) (<-chan VirtualNetworkGateway, <-chan error) { resultChan := make(chan VirtualNetworkGateway, 1) errChan := make(chan error, 1) @@ -713,8 +1071,10 @@ func (client VirtualNetworkGatewaysClient) Reset(resourceGroupName string, virtu var err error var result VirtualNetworkGateway defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -747,7 +1107,7 @@ func (client VirtualNetworkGatewaysClient) ResetPreparer(resourceGroupName strin "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -783,3 +1143,138 @@ func (client VirtualNetworkGatewaysClient) ResetResponder(resp *http.Response) ( result.Response = autorest.Response{Response: resp} return } + +// SupportedVpnDevices gets a xml format representation for supported vpn devices. +// +// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual network +// gateway. +func (client VirtualNetworkGatewaysClient) SupportedVpnDevices(resourceGroupName string, virtualNetworkGatewayName string) (result String, err error) { + req, err := client.SupportedVpnDevicesPreparer(resourceGroupName, virtualNetworkGatewayName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "SupportedVpnDevices", nil, "Failure preparing request") + return + } + + resp, err := client.SupportedVpnDevicesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "SupportedVpnDevices", resp, "Failure sending request") + return + } + + result, err = client.SupportedVpnDevicesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "SupportedVpnDevices", resp, "Failure responding to request") + } + + return +} + +// SupportedVpnDevicesPreparer prepares the SupportedVpnDevices request. +func (client VirtualNetworkGatewaysClient) SupportedVpnDevicesPreparer(resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/supportedvpndevices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// SupportedVpnDevicesSender sends the SupportedVpnDevices request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualNetworkGatewaysClient) SupportedVpnDevicesSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// SupportedVpnDevicesResponder handles the response to the SupportedVpnDevices request. The method always +// closes the http.Response Body. +func (client VirtualNetworkGatewaysClient) SupportedVpnDevicesResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// VpnDeviceConfigurationScript gets a xml format representation for vpn device configuration script. +// +// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the name of the virtual +// network gateway connection for which the configuration script is generated. parameters is parameters supplied to the +// generate vpn device script operation. +func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScript(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VpnDeviceScriptParameters) (result String, err error) { + req, err := client.VpnDeviceConfigurationScriptPreparer(resourceGroupName, virtualNetworkGatewayConnectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "VpnDeviceConfigurationScript", nil, "Failure preparing request") + return + } + + resp, err := client.VpnDeviceConfigurationScriptSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "VpnDeviceConfigurationScript", resp, "Failure sending request") + return + } + + result, err = client.VpnDeviceConfigurationScriptResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "VpnDeviceConfigurationScript", resp, "Failure responding to request") + } + + return +} + +// VpnDeviceConfigurationScriptPreparer prepares the VpnDeviceConfigurationScript request. +func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScriptPreparer(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VpnDeviceScriptParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/vpndeviceconfigurationscript", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// VpnDeviceConfigurationScriptSender sends the VpnDeviceConfigurationScript request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScriptSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// VpnDeviceConfigurationScriptResponder handles the response to the VpnDeviceConfigurationScript request. The method always +// closes the http.Response Body. +func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScriptResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkpeerings.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkpeerings.go index 27fafdfd0a46..0a945c1bb8d7 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkpeerings.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworkpeerings.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,31 +23,27 @@ import ( "net/http" ) -// VirtualNetworkPeeringsClient is the composite Swagger for Network Client +// VirtualNetworkPeeringsClient is the network Client type VirtualNetworkPeeringsClient struct { ManagementClient } -// NewVirtualNetworkPeeringsClient creates an instance of the -// VirtualNetworkPeeringsClient client. +// NewVirtualNetworkPeeringsClient creates an instance of the VirtualNetworkPeeringsClient client. func NewVirtualNetworkPeeringsClient(subscriptionID string) VirtualNetworkPeeringsClient { return NewVirtualNetworkPeeringsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewVirtualNetworkPeeringsClientWithBaseURI creates an instance of the -// VirtualNetworkPeeringsClient client. +// NewVirtualNetworkPeeringsClientWithBaseURI creates an instance of the VirtualNetworkPeeringsClient client. func NewVirtualNetworkPeeringsClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkPeeringsClient { return VirtualNetworkPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a peering in the specified virtual -// network. This method may poll for completion. Polling can be canceled by -// passing the cancel channel argument. The channel will be used to cancel -// polling and any outstanding HTTP requests. +// CreateOrUpdate creates or updates a peering in the specified virtual network. This method may poll for completion. +// Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any +// outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. virtualNetworkName is -// the name of the virtual network. virtualNetworkPeeringName is the name of -// the peering. virtualNetworkPeeringParameters is parameters supplied to the +// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. +// virtualNetworkPeeringName is the name of the peering. virtualNetworkPeeringParameters is parameters supplied to the // create or update virtual network peering operation. func (client VirtualNetworkPeeringsClient) CreateOrUpdate(resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering, cancel <-chan struct{}) (<-chan VirtualNetworkPeering, <-chan error) { resultChan := make(chan VirtualNetworkPeering, 1) @@ -57,8 +52,10 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdate(resourceGroupName stri var err error var result VirtualNetworkPeering defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -92,7 +89,7 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdatePreparer(resourceGroupN "virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -128,14 +125,12 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdateResponder(resp *http.Re return } -// Delete deletes the specified virtual network peering. This method may poll -// for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// Delete deletes the specified virtual network peering. This method may poll for completion. Polling can be canceled +// by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. // -// resourceGroupName is the name of the resource group. virtualNetworkName is -// the name of the virtual network. virtualNetworkPeeringName is the name of -// the virtual network peering. +// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. +// virtualNetworkPeeringName is the name of the virtual network peering. func (client VirtualNetworkPeeringsClient) Delete(resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -143,8 +138,10 @@ func (client VirtualNetworkPeeringsClient) Delete(resourceGroupName string, virt var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -178,7 +175,7 @@ func (client VirtualNetworkPeeringsClient) DeletePreparer(resourceGroupName stri "virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -213,9 +210,8 @@ func (client VirtualNetworkPeeringsClient) DeleteResponder(resp *http.Response) // Get gets the specified virtual network peering. // -// resourceGroupName is the name of the resource group. virtualNetworkName is -// the name of the virtual network. virtualNetworkPeeringName is the name of -// the virtual network peering. +// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. +// virtualNetworkPeeringName is the name of the virtual network peering. func (client VirtualNetworkPeeringsClient) Get(resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string) (result VirtualNetworkPeering, err error) { req, err := client.GetPreparer(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName) if err != nil { @@ -247,7 +243,7 @@ func (client VirtualNetworkPeeringsClient) GetPreparer(resourceGroupName string, "virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -281,8 +277,7 @@ func (client VirtualNetworkPeeringsClient) GetResponder(resp *http.Response) (re // List gets all virtual network peerings in a virtual network. // -// resourceGroupName is the name of the resource group. virtualNetworkName is -// the name of the virtual network. +// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. func (client VirtualNetworkPeeringsClient) List(resourceGroupName string, virtualNetworkName string) (result VirtualNetworkPeeringListResult, err error) { req, err := client.ListPreparer(resourceGroupName, virtualNetworkName) if err != nil { @@ -313,7 +308,7 @@ func (client VirtualNetworkPeeringsClient) ListPreparer(resourceGroupName string "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -368,3 +363,48 @@ func (client VirtualNetworkPeeringsClient) ListNextResults(lastResults VirtualNe return } + +// ListComplete gets all elements from the list without paging. +func (client VirtualNetworkPeeringsClient) ListComplete(resourceGroupName string, virtualNetworkName string, cancel <-chan struct{}) (<-chan VirtualNetworkPeering, <-chan error) { + resultChan := make(chan VirtualNetworkPeering) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName, virtualNetworkName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworks.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworks.go index eab048c7252e..58ac8ab11229 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworks.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/virtualnetworks.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -24,29 +23,25 @@ import ( "net/http" ) -// VirtualNetworksClient is the composite Swagger for Network Client +// VirtualNetworksClient is the network Client type VirtualNetworksClient struct { ManagementClient } -// NewVirtualNetworksClient creates an instance of the VirtualNetworksClient -// client. +// NewVirtualNetworksClient creates an instance of the VirtualNetworksClient client. func NewVirtualNetworksClient(subscriptionID string) VirtualNetworksClient { return NewVirtualNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewVirtualNetworksClientWithBaseURI creates an instance of the -// VirtualNetworksClient client. +// NewVirtualNetworksClientWithBaseURI creates an instance of the VirtualNetworksClient client. func NewVirtualNetworksClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworksClient { return VirtualNetworksClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CheckIPAddressAvailability checks whether a private IP address is available -// for use. +// CheckIPAddressAvailability checks whether a private IP address is available for use. // -// resourceGroupName is the name of the resource group. virtualNetworkName is -// the name of the virtual network. IPAddress is the private IP address to be -// verified. +// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. +// IPAddress is the private IP address to be verified. func (client VirtualNetworksClient) CheckIPAddressAvailability(resourceGroupName string, virtualNetworkName string, IPAddress string) (result IPAddressAvailabilityResult, err error) { req, err := client.CheckIPAddressAvailabilityPreparer(resourceGroupName, virtualNetworkName, IPAddress) if err != nil { @@ -77,7 +72,7 @@ func (client VirtualNetworksClient) CheckIPAddressAvailabilityPreparer(resourceG "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -112,14 +107,12 @@ func (client VirtualNetworksClient) CheckIPAddressAvailabilityResponder(resp *ht return } -// CreateOrUpdate creates or updates a virtual network in the specified -// resource group. This method may poll for completion. Polling can be canceled -// by passing the cancel channel argument. The channel will be used to cancel +// CreateOrUpdate creates or updates a virtual network in the specified resource group. This method may poll for +// completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel // polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. virtualNetworkName is -// the name of the virtual network. parameters is parameters supplied to the -// create or update virtual network operation +// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. +// parameters is parameters supplied to the create or update virtual network operation func (client VirtualNetworksClient) CreateOrUpdate(resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork, cancel <-chan struct{}) (<-chan VirtualNetwork, <-chan error) { resultChan := make(chan VirtualNetwork, 1) errChan := make(chan error, 1) @@ -127,8 +120,10 @@ func (client VirtualNetworksClient) CreateOrUpdate(resourceGroupName string, vir var err error var result VirtualNetwork defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -161,7 +156,7 @@ func (client VirtualNetworksClient) CreateOrUpdatePreparer(resourceGroupName str "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -197,13 +192,10 @@ func (client VirtualNetworksClient) CreateOrUpdateResponder(resp *http.Response) return } -// Delete deletes the specified virtual network. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// Delete deletes the specified virtual network. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. virtualNetworkName is -// the name of the virtual network. +// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. func (client VirtualNetworksClient) Delete(resourceGroupName string, virtualNetworkName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -211,8 +203,10 @@ func (client VirtualNetworksClient) Delete(resourceGroupName string, virtualNetw var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -245,7 +239,7 @@ func (client VirtualNetworksClient) DeletePreparer(resourceGroupName string, vir "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -280,8 +274,8 @@ func (client VirtualNetworksClient) DeleteResponder(resp *http.Response) (result // Get gets the specified virtual network by resource group. // -// resourceGroupName is the name of the resource group. virtualNetworkName is -// the name of the virtual network. expand is expands referenced resources. +// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. expand +// is expands referenced resources. func (client VirtualNetworksClient) Get(resourceGroupName string, virtualNetworkName string, expand string) (result VirtualNetwork, err error) { req, err := client.GetPreparer(resourceGroupName, virtualNetworkName, expand) if err != nil { @@ -312,7 +306,7 @@ func (client VirtualNetworksClient) GetPreparer(resourceGroupName string, virtua "virtualNetworkName": autorest.Encode("path", virtualNetworkName), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -379,7 +373,7 @@ func (client VirtualNetworksClient) ListPreparer(resourceGroupName string) (*htt "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -435,6 +429,51 @@ func (client VirtualNetworksClient) ListNextResults(lastResults VirtualNetworkLi return } +// ListComplete gets all elements from the list without paging. +func (client VirtualNetworksClient) ListComplete(resourceGroupName string, cancel <-chan struct{}) (<-chan VirtualNetwork, <-chan error) { + resultChan := make(chan VirtualNetwork) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.List(resourceGroupName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + // ListAll gets all virtual networks in a subscription. func (client VirtualNetworksClient) ListAll() (result VirtualNetworkListResult, err error) { req, err := client.ListAllPreparer() @@ -464,7 +503,7 @@ func (client VirtualNetworksClient) ListAllPreparer() (*http.Request, error) { "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -519,3 +558,182 @@ func (client VirtualNetworksClient) ListAllNextResults(lastResults VirtualNetwor return } + +// ListAllComplete gets all elements from the list without paging. +func (client VirtualNetworksClient) ListAllComplete(cancel <-chan struct{}) (<-chan VirtualNetwork, <-chan error) { + resultChan := make(chan VirtualNetwork) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListAll() + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListAllNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} + +// ListUsage lists usage stats. +// +// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. +func (client VirtualNetworksClient) ListUsage(resourceGroupName string, virtualNetworkName string) (result VirtualNetworkListUsageResult, err error) { + req, err := client.ListUsagePreparer(resourceGroupName, virtualNetworkName) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListUsage", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsageSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListUsage", resp, "Failure sending request") + return + } + + result, err = client.ListUsageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListUsage", resp, "Failure responding to request") + } + + return +} + +// ListUsagePreparer prepares the ListUsage request. +func (client VirtualNetworksClient) ListUsagePreparer(resourceGroupName string, virtualNetworkName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualNetworkName": autorest.Encode("path", virtualNetworkName), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListUsageSender sends the ListUsage request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualNetworksClient) ListUsageSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListUsageResponder handles the response to the ListUsage request. The method always +// closes the http.Response Body. +func (client VirtualNetworksClient) ListUsageResponder(resp *http.Response) (result VirtualNetworkListUsageResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListUsageNextResults retrieves the next set of results, if any. +func (client VirtualNetworksClient) ListUsageNextResults(lastResults VirtualNetworkListUsageResult) (result VirtualNetworkListUsageResult, err error) { + req, err := lastResults.VirtualNetworkListUsageResultPreparer() + if err != nil { + return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListUsage", nil, "Failure preparing next results request") + } + if req == nil { + return + } + + resp, err := client.ListUsageSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListUsage", resp, "Failure sending next results request") + } + + result, err = client.ListUsageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "ListUsage", resp, "Failure responding to next results request") + } + + return +} + +// ListUsageComplete gets all elements from the list without paging. +func (client VirtualNetworksClient) ListUsageComplete(resourceGroupName string, virtualNetworkName string, cancel <-chan struct{}) (<-chan VirtualNetworkUsage, <-chan error) { + resultChan := make(chan VirtualNetworkUsage) + errChan := make(chan error, 1) + go func() { + defer func() { + close(resultChan) + close(errChan) + }() + list, err := client.ListUsage(resourceGroupName, virtualNetworkName) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + for list.NextLink != nil { + list, err = client.ListUsageNextResults(list) + if err != nil { + errChan <- err + return + } + if list.Value != nil { + for _, item := range *list.Value { + select { + case <-cancel: + return + case resultChan <- item: + // Intentionally left blank + } + } + } + } + }() + return resultChan, errChan +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/watchers.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/watchers.go index 28febf847484..798d8c1bb221 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/watchers.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/network/watchers.go @@ -14,9 +14,8 @@ package network // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -25,7 +24,7 @@ import ( "net/http" ) -// WatchersClient is the composite Swagger for Network Client +// WatchersClient is the network Client type WatchersClient struct { ManagementClient } @@ -35,18 +34,112 @@ func NewWatchersClient(subscriptionID string) WatchersClient { return NewWatchersClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewWatchersClientWithBaseURI creates an instance of the WatchersClient -// client. +// NewWatchersClientWithBaseURI creates an instance of the WatchersClient client. func NewWatchersClientWithBaseURI(baseURI string, subscriptionID string) WatchersClient { return WatchersClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CreateOrUpdate creates or updates a network watcher in the specified -// resource group. +// CheckConnectivity verifies the possibility of establishing a direct TCP connection from a virtual machine to a given +// endpoint including another VM or an arbitrary remote server. This method may poll for completion. Polling can be +// canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. +// +// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the network +// watcher resource. parameters is parameters that determine how the connectivity check will be performed. +func (client WatchersClient) CheckConnectivity(resourceGroupName string, networkWatcherName string, parameters ConnectivityParameters, cancel <-chan struct{}) (<-chan ConnectivityInformation, <-chan error) { + resultChan := make(chan ConnectivityInformation, 1) + errChan := make(chan error, 1) + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Source", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Source.ResourceID", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.Destination", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + errChan <- validation.NewErrorWithValidationError(err, "network.WatchersClient", "CheckConnectivity") + close(errChan) + close(resultChan) + return resultChan, errChan + } + + go func() { + var err error + var result ConnectivityInformation + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.CheckConnectivityPreparer(resourceGroupName, networkWatcherName, parameters, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersClient", "CheckConnectivity", nil, "Failure preparing request") + return + } + + resp, err := client.CheckConnectivitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.WatchersClient", "CheckConnectivity", resp, "Failure sending request") + return + } + + result, err = client.CheckConnectivityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersClient", "CheckConnectivity", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// CheckConnectivityPreparer prepares the CheckConnectivity request. +func (client WatchersClient) CheckConnectivityPreparer(resourceGroupName string, networkWatcherName string, parameters ConnectivityParameters, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkWatcherName": autorest.Encode("path", networkWatcherName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectivityCheck", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// CheckConnectivitySender sends the CheckConnectivity request. The method will close the +// http.Response Body if it receives an error. +func (client WatchersClient) CheckConnectivitySender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// CheckConnectivityResponder handles the response to the CheckConnectivity request. The method always +// closes the http.Response Body. +func (client WatchersClient) CheckConnectivityResponder(resp *http.Response) (result ConnectivityInformation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate creates or updates a network watcher in the specified resource group. // -// resourceGroupName is the name of the resource group. networkWatcherName is -// the name of the network watcher. parameters is parameters that define the -// network watcher resource. +// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher. +// parameters is parameters that define the network watcher resource. func (client WatchersClient) CreateOrUpdate(resourceGroupName string, networkWatcherName string, parameters Watcher) (result Watcher, err error) { req, err := client.CreateOrUpdatePreparer(resourceGroupName, networkWatcherName, parameters) if err != nil { @@ -77,7 +170,7 @@ func (client WatchersClient) CreateOrUpdatePreparer(resourceGroupName string, ne "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -111,13 +204,11 @@ func (client WatchersClient) CreateOrUpdateResponder(resp *http.Response) (resul return } -// Delete deletes the specified network watcher resource. This method may poll -// for completion. Polling can be canceled by passing the cancel channel -// argument. The channel will be used to cancel polling and any outstanding -// HTTP requests. +// Delete deletes the specified network watcher resource. This method may poll for completion. Polling can be canceled +// by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP +// requests. // -// resourceGroupName is the name of the resource group. networkWatcherName is -// the name of the network watcher. +// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher. func (client WatchersClient) Delete(resourceGroupName string, networkWatcherName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { resultChan := make(chan autorest.Response, 1) errChan := make(chan error, 1) @@ -125,8 +216,10 @@ func (client WatchersClient) Delete(resourceGroupName string, networkWatcherName var err error var result autorest.Response defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -159,7 +252,7 @@ func (client WatchersClient) DeletePreparer(resourceGroupName string, networkWat "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -194,8 +287,7 @@ func (client WatchersClient) DeleteResponder(resp *http.Response) (result autore // Get gets the specified network watcher by resource group. // -// resourceGroupName is the name of the resource group. networkWatcherName is -// the name of the network watcher. +// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher. func (client WatchersClient) Get(resourceGroupName string, networkWatcherName string) (result Watcher, err error) { req, err := client.GetPreparer(resourceGroupName, networkWatcherName) if err != nil { @@ -226,7 +318,7 @@ func (client WatchersClient) GetPreparer(resourceGroupName string, networkWatche "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -258,14 +350,109 @@ func (client WatchersClient) GetResponder(resp *http.Response) (result Watcher, return } -// GetFlowLogStatus queries status of flow log on a specified resource. This -// method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and any +// GetAzureReachabilityReport gets the relative latency score for internet service providers from a specified location +// to Azure regions. This method may poll for completion. Polling can be canceled by passing the cancel channel +// argument. The channel will be used to cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the network +// watcher resource. parameters is parameters that determine Azure reachability report configuration. +func (client WatchersClient) GetAzureReachabilityReport(resourceGroupName string, networkWatcherName string, parameters AzureReachabilityReportParameters, cancel <-chan struct{}) (<-chan AzureReachabilityReport, <-chan error) { + resultChan := make(chan AzureReachabilityReport, 1) + errChan := make(chan error, 1) + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ProviderLocation", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ProviderLocation.Country", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.StartTime", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.EndTime", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + errChan <- validation.NewErrorWithValidationError(err, "network.WatchersClient", "GetAzureReachabilityReport") + close(errChan) + close(resultChan) + return resultChan, errChan + } + + go func() { + var err error + var result AzureReachabilityReport + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.GetAzureReachabilityReportPreparer(resourceGroupName, networkWatcherName, parameters, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetAzureReachabilityReport", nil, "Failure preparing request") + return + } + + resp, err := client.GetAzureReachabilityReportSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetAzureReachabilityReport", resp, "Failure sending request") + return + } + + result, err = client.GetAzureReachabilityReportResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersClient", "GetAzureReachabilityReport", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// GetAzureReachabilityReportPreparer prepares the GetAzureReachabilityReport request. +func (client WatchersClient) GetAzureReachabilityReportPreparer(resourceGroupName string, networkWatcherName string, parameters AzureReachabilityReportParameters, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkWatcherName": autorest.Encode("path", networkWatcherName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/azureReachabilityReport", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// GetAzureReachabilityReportSender sends the GetAzureReachabilityReport request. The method will close the +// http.Response Body if it receives an error. +func (client WatchersClient) GetAzureReachabilityReportSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// GetAzureReachabilityReportResponder handles the response to the GetAzureReachabilityReport request. The method always +// closes the http.Response Body. +func (client WatchersClient) GetAzureReachabilityReportResponder(resp *http.Response) (result AzureReachabilityReport, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetFlowLogStatus queries status of flow log on a specified resource. This method may poll for completion. Polling +// can be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any // outstanding HTTP requests. // -// resourceGroupName is the name of the network watcher resource group. -// networkWatcherName is the name of the network watcher resource. parameters -// is parameters that define a resource to query flow log status. +// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the network +// watcher resource. parameters is parameters that define a resource to query flow log status. func (client WatchersClient) GetFlowLogStatus(resourceGroupName string, networkWatcherName string, parameters FlowLogStatusParameters, cancel <-chan struct{}) (<-chan FlowLogInformation, <-chan error) { resultChan := make(chan FlowLogInformation, 1) errChan := make(chan error, 1) @@ -282,8 +469,10 @@ func (client WatchersClient) GetFlowLogStatus(resourceGroupName string, networkW var err error var result FlowLogInformation defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -316,7 +505,7 @@ func (client WatchersClient) GetFlowLogStatusPreparer(resourceGroupName string, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -352,14 +541,11 @@ func (client WatchersClient) GetFlowLogStatusResponder(resp *http.Response) (res return } -// GetNextHop gets the next hop from the specified VM. This method may poll for -// completion. Polling can be canceled by passing the cancel channel argument. -// The channel will be used to cancel polling and any outstanding HTTP -// requests. +// GetNextHop gets the next hop from the specified VM. This method may poll for completion. Polling can be canceled by +// passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. networkWatcherName is -// the name of the network watcher. parameters is parameters that define the -// source and destination endpoint. +// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher. +// parameters is parameters that define the source and destination endpoint. func (client WatchersClient) GetNextHop(resourceGroupName string, networkWatcherName string, parameters NextHopParameters, cancel <-chan struct{}) (<-chan NextHopResult, <-chan error) { resultChan := make(chan NextHopResult, 1) errChan := make(chan error, 1) @@ -378,8 +564,10 @@ func (client WatchersClient) GetNextHop(resourceGroupName string, networkWatcher var err error var result NextHopResult defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -412,7 +600,7 @@ func (client WatchersClient) GetNextHopPreparer(resourceGroupName string, networ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -450,9 +638,8 @@ func (client WatchersClient) GetNextHopResponder(resp *http.Response) (result Ne // GetTopology gets the current network topology by resource group. // -// resourceGroupName is the name of the resource group. networkWatcherName is -// the name of the network watcher. parameters is parameters that define the -// representation of topology. +// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher. +// parameters is parameters that define the representation of topology. func (client WatchersClient) GetTopology(resourceGroupName string, networkWatcherName string, parameters TopologyParameters) (result Topology, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: parameters, @@ -489,7 +676,7 @@ func (client WatchersClient) GetTopologyPreparer(resourceGroupName string, netwo "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -523,14 +710,12 @@ func (client WatchersClient) GetTopologyResponder(resp *http.Response) (result T return } -// GetTroubleshooting initiate troubleshooting on a specified resource This -// method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and any -// outstanding HTTP requests. +// GetTroubleshooting initiate troubleshooting on a specified resource This method may poll for completion. Polling can +// be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding +// HTTP requests. // -// resourceGroupName is the name of the resource group. networkWatcherName is -// the name of the network watcher resource. parameters is parameters that -// define the resource to troubleshoot. +// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher resource. +// parameters is parameters that define the resource to troubleshoot. func (client WatchersClient) GetTroubleshooting(resourceGroupName string, networkWatcherName string, parameters TroubleshootingParameters, cancel <-chan struct{}) (<-chan TroubleshootingResult, <-chan error) { resultChan := make(chan TroubleshootingResult, 1) errChan := make(chan error, 1) @@ -551,8 +736,10 @@ func (client WatchersClient) GetTroubleshooting(resourceGroupName string, networ var err error var result TroubleshootingResult defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -585,7 +772,7 @@ func (client WatchersClient) GetTroubleshootingPreparer(resourceGroupName string "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -621,14 +808,12 @@ func (client WatchersClient) GetTroubleshootingResponder(resp *http.Response) (r return } -// GetTroubleshootingResult get the last completed troubleshooting result on a -// specified resource This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used to -// cancel polling and any outstanding HTTP requests. +// GetTroubleshootingResult get the last completed troubleshooting result on a specified resource This method may poll +// for completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel +// polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. networkWatcherName is -// the name of the network watcher resource. parameters is parameters that -// define the resource to query the troubleshooting result. +// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher resource. +// parameters is parameters that define the resource to query the troubleshooting result. func (client WatchersClient) GetTroubleshootingResult(resourceGroupName string, networkWatcherName string, parameters QueryTroubleshootingParameters, cancel <-chan struct{}) (<-chan TroubleshootingResult, <-chan error) { resultChan := make(chan TroubleshootingResult, 1) errChan := make(chan error, 1) @@ -645,8 +830,10 @@ func (client WatchersClient) GetTroubleshootingResult(resourceGroupName string, var err error var result TroubleshootingResult defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -679,7 +866,7 @@ func (client WatchersClient) GetTroubleshootingResultPreparer(resourceGroupName "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -715,14 +902,12 @@ func (client WatchersClient) GetTroubleshootingResultResponder(resp *http.Respon return } -// GetVMSecurityRules gets the configured and effective security group rules on -// the specified VM. This method may poll for completion. Polling can be -// canceled by passing the cancel channel argument. The channel will be used to -// cancel polling and any outstanding HTTP requests. +// GetVMSecurityRules gets the configured and effective security group rules on the specified VM. This method may poll +// for completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel +// polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. networkWatcherName is -// the name of the network watcher. parameters is parameters that define the VM -// to check security groups for. +// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher. +// parameters is parameters that define the VM to check security groups for. func (client WatchersClient) GetVMSecurityRules(resourceGroupName string, networkWatcherName string, parameters SecurityGroupViewParameters, cancel <-chan struct{}) (<-chan SecurityGroupViewResult, <-chan error) { resultChan := make(chan SecurityGroupViewResult, 1) errChan := make(chan error, 1) @@ -739,8 +924,10 @@ func (client WatchersClient) GetVMSecurityRules(resourceGroupName string, networ var err error var result SecurityGroupViewResult defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -773,7 +960,7 @@ func (client WatchersClient) GetVMSecurityRulesPreparer(resourceGroupName string "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -841,7 +1028,7 @@ func (client WatchersClient) ListPreparer(resourceGroupName string) (*http.Reque "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -902,7 +1089,7 @@ func (client WatchersClient) ListAllPreparer() (*http.Request, error) { "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -934,14 +1121,97 @@ func (client WatchersClient) ListAllResponder(resp *http.Response) (result Watch return } -// SetFlowLogConfiguration configures flow log on a specified resource. This -// method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and any +// ListAvailableProviders lists all available internet service providers for a specified Azure region. This method may +// poll for completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to +// cancel polling and any outstanding HTTP requests. +// +// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the network +// watcher resource. parameters is parameters that scope the list of available providers. +func (client WatchersClient) ListAvailableProviders(resourceGroupName string, networkWatcherName string, parameters AvailableProvidersListParameters, cancel <-chan struct{}) (<-chan AvailableProvidersList, <-chan error) { + resultChan := make(chan AvailableProvidersList, 1) + errChan := make(chan error, 1) + go func() { + var err error + var result AvailableProvidersList + defer func() { + if err != nil { + errChan <- err + } + resultChan <- result + close(resultChan) + close(errChan) + }() + req, err := client.ListAvailableProvidersPreparer(resourceGroupName, networkWatcherName, parameters, cancel) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersClient", "ListAvailableProviders", nil, "Failure preparing request") + return + } + + resp, err := client.ListAvailableProvidersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "network.WatchersClient", "ListAvailableProviders", resp, "Failure sending request") + return + } + + result, err = client.ListAvailableProvidersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "network.WatchersClient", "ListAvailableProviders", resp, "Failure responding to request") + } + }() + return resultChan, errChan +} + +// ListAvailableProvidersPreparer prepares the ListAvailableProviders request. +func (client WatchersClient) ListAvailableProvidersPreparer(resourceGroupName string, networkWatcherName string, parameters AvailableProvidersListParameters, cancel <-chan struct{}) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "networkWatcherName": autorest.Encode("path", networkWatcherName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsJSON(), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/availableProvidersList", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{Cancel: cancel}) +} + +// ListAvailableProvidersSender sends the ListAvailableProviders request. The method will close the +// http.Response Body if it receives an error. +func (client WatchersClient) ListAvailableProvidersSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, + req, + azure.DoPollForAsynchronous(client.PollingDelay)) +} + +// ListAvailableProvidersResponder handles the response to the ListAvailableProviders request. The method always +// closes the http.Response Body. +func (client WatchersClient) ListAvailableProvidersResponder(resp *http.Response) (result AvailableProvidersList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SetFlowLogConfiguration configures flow log on a specified resource. This method may poll for completion. Polling +// can be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any // outstanding HTTP requests. // -// resourceGroupName is the name of the network watcher resource group. -// networkWatcherName is the name of the network watcher resource. parameters -// is parameters that define the configuration of flow log. +// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the network +// watcher resource. parameters is parameters that define the configuration of flow log. func (client WatchersClient) SetFlowLogConfiguration(resourceGroupName string, networkWatcherName string, parameters FlowLogInformation, cancel <-chan struct{}) (<-chan FlowLogInformation, <-chan error) { resultChan := make(chan FlowLogInformation, 1) errChan := make(chan error, 1) @@ -962,8 +1232,10 @@ func (client WatchersClient) SetFlowLogConfiguration(resourceGroupName string, n var err error var result FlowLogInformation defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -996,7 +1268,7 @@ func (client WatchersClient) SetFlowLogConfigurationPreparer(resourceGroupName s "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1032,14 +1304,12 @@ func (client WatchersClient) SetFlowLogConfigurationResponder(resp *http.Respons return } -// VerifyIPFlow verify IP flow from the specified VM to a location given the -// currently configured NSG rules. This method may poll for completion. Polling -// can be canceled by passing the cancel channel argument. The channel will be +// VerifyIPFlow verify IP flow from the specified VM to a location given the currently configured NSG rules. This +// method may poll for completion. Polling can be canceled by passing the cancel channel argument. The channel will be // used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group. networkWatcherName is -// the name of the network watcher. parameters is parameters that define the IP -// flow to be verified. +// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher. +// parameters is parameters that define the IP flow to be verified. func (client WatchersClient) VerifyIPFlow(resourceGroupName string, networkWatcherName string, parameters VerificationIPFlowParameters, cancel <-chan struct{}) (<-chan VerificationIPFlowResult, <-chan error) { resultChan := make(chan VerificationIPFlowResult, 1) errChan := make(chan error, 1) @@ -1060,8 +1330,10 @@ func (client WatchersClient) VerifyIPFlow(resourceGroupName string, networkWatch var err error var result VerificationIPFlowResult defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -1094,7 +1366,7 @@ func (client WatchersClient) VerifyIPFlowPreparer(resourceGroupName string, netw "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2017-03-01" + const APIVersion = "2017-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/accounts.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/accounts.go index f0606ac133f3..0870a03ded6e 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/accounts.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/accounts.go @@ -14,9 +14,8 @@ package storage // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -35,18 +34,15 @@ func NewAccountsClient(subscriptionID string) AccountsClient { return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) } -// NewAccountsClientWithBaseURI creates an instance of the AccountsClient -// client. +// NewAccountsClientWithBaseURI creates an instance of the AccountsClient client. func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient { return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)} } -// CheckNameAvailability checks that the storage account name is valid and is -// not already in use. +// CheckNameAvailability checks that the storage account name is valid and is not already in use. // -// accountName is the name of the storage account within the specified resource -// group. Storage account names must be between 3 and 24 characters in length -// and use numbers and lower-case letters only. +// accountName is the name of the storage account within the specified resource group. Storage account names must be +// between 3 and 24 characters in length and use numbers and lower-case letters only. func (client AccountsClient) CheckNameAvailability(accountName AccountCheckNameAvailabilityParameters) (result CheckNameAvailabilityResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: accountName, @@ -82,7 +78,7 @@ func (client AccountsClient) CheckNameAvailabilityPreparer(accountName AccountCh "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-12-01" + const APIVersion = "2017-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -116,21 +112,16 @@ func (client AccountsClient) CheckNameAvailabilityResponder(resp *http.Response) return } -// Create asynchronously creates a new storage account with the specified -// parameters. If an account is already created and a subsequent create request -// is issued with different properties, the account properties will be updated. -// If an account is already created and a subsequent create or update request -// is issued with the exact same set of properties, the request will succeed. -// This method may poll for completion. Polling can be canceled by passing the -// cancel channel argument. The channel will be used to cancel polling and any -// outstanding HTTP requests. +// Create asynchronously creates a new storage account with the specified parameters. If an account is already created +// and a subsequent create request is issued with different properties, the account properties will be updated. If an +// account is already created and a subsequent create or update request is issued with the exact same set of +// properties, the request will succeed. This method may poll for completion. Polling can be canceled by passing the +// cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests. // -// resourceGroupName is the name of the resource group within the user's -// subscription. The name is case insensitive. accountName is the name of the -// storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case -// letters only. parameters is the parameters to provide for the created -// account. +// resourceGroupName is the name of the resource group within the user's subscription. The name is case insensitive. +// accountName is the name of the storage account within the specified resource group. Storage account names must be +// between 3 and 24 characters in length and use numbers and lower-case letters only. parameters is the parameters to +// provide for the created account. func (client AccountsClient) Create(resourceGroupName string, accountName string, parameters AccountCreateParameters, cancel <-chan struct{}) (<-chan Account, <-chan error) { resultChan := make(chan Account, 1) errChan := make(chan error, 1) @@ -145,11 +136,11 @@ func (client AccountsClient) Create(resourceGroupName string, accountName string {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.Location", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Identity", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Identity.Type", Name: validation.Null, Rule: true, Chain: nil}}}, {Target: "parameters.AccountPropertiesCreateParameters", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.CustomDomain", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.CustomDomain.Name", Name: validation.Null, Rule: true, Chain: nil}}}, - {Target: "parameters.AccountPropertiesCreateParameters.Encryption", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.AccountPropertiesCreateParameters.Encryption.KeySource", Name: validation.Null, Rule: true, Chain: nil}}}, }}}}}); err != nil { errChan <- validation.NewErrorWithValidationError(err, "storage.AccountsClient", "Create") close(errChan) @@ -161,8 +152,10 @@ func (client AccountsClient) Create(resourceGroupName string, accountName string var err error var result Account defer func() { + if err != nil { + errChan <- err + } resultChan <- result - errChan <- err close(resultChan) close(errChan) }() @@ -195,7 +188,7 @@ func (client AccountsClient) CreatePreparer(resourceGroupName string, accountNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-12-01" + const APIVersion = "2017-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -233,11 +226,9 @@ func (client AccountsClient) CreateResponder(resp *http.Response) (result Accoun // Delete deletes a storage account in Microsoft Azure. // -// resourceGroupName is the name of the resource group within the user's -// subscription. The name is case insensitive. accountName is the name of the -// storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case -// letters only. +// resourceGroupName is the name of the resource group within the user's subscription. The name is case insensitive. +// accountName is the name of the storage account within the specified resource group. Storage account names must be +// between 3 and 24 characters in length and use numbers and lower-case letters only. func (client AccountsClient) Delete(resourceGroupName string, accountName string) (result autorest.Response, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -279,7 +270,7 @@ func (client AccountsClient) DeletePreparer(resourceGroupName string, accountNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-12-01" + const APIVersion = "2017-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -310,15 +301,12 @@ func (client AccountsClient) DeleteResponder(resp *http.Response) (result autore return } -// GetProperties returns the properties for the specified storage account -// including but not limited to name, SKU name, location, and account status. -// The ListKeys operation should be used to retrieve storage keys. +// GetProperties returns the properties for the specified storage account including but not limited to name, SKU name, +// location, and account status. The ListKeys operation should be used to retrieve storage keys. // -// resourceGroupName is the name of the resource group within the user's -// subscription. The name is case insensitive. accountName is the name of the -// storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case -// letters only. +// resourceGroupName is the name of the resource group within the user's subscription. The name is case insensitive. +// accountName is the name of the storage account within the specified resource group. Storage account names must be +// between 3 and 24 characters in length and use numbers and lower-case letters only. func (client AccountsClient) GetProperties(resourceGroupName string, accountName string) (result Account, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -360,7 +348,7 @@ func (client AccountsClient) GetPropertiesPreparer(resourceGroupName string, acc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-12-01" + const APIVersion = "2017-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -392,8 +380,8 @@ func (client AccountsClient) GetPropertiesResponder(resp *http.Response) (result return } -// List lists all the storage accounts available under the subscription. Note -// that storage keys are not returned; use the ListKeys operation for this. +// List lists all the storage accounts available under the subscription. Note that storage keys are not returned; use +// the ListKeys operation for this. func (client AccountsClient) List() (result AccountListResult, err error) { req, err := client.ListPreparer() if err != nil { @@ -422,7 +410,7 @@ func (client AccountsClient) ListPreparer() (*http.Request, error) { "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-12-01" + const APIVersion = "2017-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -456,12 +444,10 @@ func (client AccountsClient) ListResponder(resp *http.Response) (result AccountL // ListAccountSAS list SAS credentials of a storage account. // -// resourceGroupName is the name of the resource group within the user's -// subscription. The name is case insensitive. accountName is the name of the -// storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case -// letters only. parameters is the parameters to provide to list SAS -// credentials for the storage account. +// resourceGroupName is the name of the resource group within the user's subscription. The name is case insensitive. +// accountName is the name of the storage account within the specified resource group. Storage account names must be +// between 3 and 24 characters in length and use numbers and lower-case letters only. parameters is the parameters to +// provide to list SAS credentials for the storage account. func (client AccountsClient) ListAccountSAS(resourceGroupName string, accountName string, parameters AccountSasParameters) (result ListAccountSasResponse, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -505,7 +491,7 @@ func (client AccountsClient) ListAccountSASPreparer(resourceGroupName string, ac "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-12-01" + const APIVersion = "2017-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -539,12 +525,10 @@ func (client AccountsClient) ListAccountSASResponder(resp *http.Response) (resul return } -// ListByResourceGroup lists all the storage accounts available under the given -// resource group. Note that storage keys are not returned; use the ListKeys -// operation for this. +// ListByResourceGroup lists all the storage accounts available under the given resource group. Note that storage keys +// are not returned; use the ListKeys operation for this. // -// resourceGroupName is the name of the resource group within the user's -// subscription. The name is case insensitive. +// resourceGroupName is the name of the resource group within the user's subscription. The name is case insensitive. func (client AccountsClient) ListByResourceGroup(resourceGroupName string) (result AccountListResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -582,7 +566,7 @@ func (client AccountsClient) ListByResourceGroupPreparer(resourceGroupName strin "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-12-01" + const APIVersion = "2017-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -616,11 +600,9 @@ func (client AccountsClient) ListByResourceGroupResponder(resp *http.Response) ( // ListKeys lists the access keys for the specified storage account. // -// resourceGroupName is the name of the resource group within the user's -// subscription. The name is case insensitive. accountName is the name of the -// storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case -// letters only. +// resourceGroupName is the name of the resource group within the user's subscription. The name is case insensitive. +// accountName is the name of the storage account within the specified resource group. Storage account names must be +// between 3 and 24 characters in length and use numbers and lower-case letters only. func (client AccountsClient) ListKeys(resourceGroupName string, accountName string) (result AccountListKeysResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -662,7 +644,7 @@ func (client AccountsClient) ListKeysPreparer(resourceGroupName string, accountN "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-12-01" + const APIVersion = "2017-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -696,12 +678,10 @@ func (client AccountsClient) ListKeysResponder(resp *http.Response) (result Acco // ListServiceSAS list service SAS credentials of a specific resource. // -// resourceGroupName is the name of the resource group within the user's -// subscription. The name is case insensitive. accountName is the name of the -// storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case -// letters only. parameters is the parameters to provide to list service SAS -// credentials. +// resourceGroupName is the name of the resource group within the user's subscription. The name is case insensitive. +// accountName is the name of the storage account within the specified resource group. Storage account names must be +// between 3 and 24 characters in length and use numbers and lower-case letters only. parameters is the parameters to +// provide to list service SAS credentials. func (client AccountsClient) ListServiceSAS(resourceGroupName string, accountName string, parameters ServiceSasParameters) (result ListServiceSasResponse, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -747,7 +727,7 @@ func (client AccountsClient) ListServiceSASPreparer(resourceGroupName string, ac "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-12-01" + const APIVersion = "2017-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -781,15 +761,12 @@ func (client AccountsClient) ListServiceSASResponder(resp *http.Response) (resul return } -// RegenerateKey regenerates one of the access keys for the specified storage -// account. +// RegenerateKey regenerates one of the access keys for the specified storage account. // -// resourceGroupName is the name of the resource group within the user's -// subscription. The name is case insensitive. accountName is the name of the -// storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case -// letters only. regenerateKey is specifies name of the key which should be -// regenerated -- key1 or key2. +// resourceGroupName is the name of the resource group within the user's subscription. The name is case insensitive. +// accountName is the name of the storage account within the specified resource group. Storage account names must be +// between 3 and 24 characters in length and use numbers and lower-case letters only. regenerateKey is specifies name +// of the key which should be regenerated -- key1 or key2. func (client AccountsClient) RegenerateKey(resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters) (result AccountListKeysResult, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -833,7 +810,7 @@ func (client AccountsClient) RegenerateKeyPreparer(resourceGroupName string, acc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-12-01" + const APIVersion = "2017-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -867,23 +844,17 @@ func (client AccountsClient) RegenerateKeyResponder(resp *http.Response) (result return } -// Update the update operation can be used to update the SKU, encryption, -// access tier, or tags for a storage account. It can also be used to map the -// account to a custom domain. Only one custom domain is supported per storage -// account; the replacement/change of custom domain is not supported. In order -// to replace an old custom domain, the old value must be cleared/unregistered -// before a new value can be set. The update of multiple properties is -// supported. This call does not change the storage keys for the account. If -// you want to change the storage account keys, use the regenerate keys -// operation. The location and name of the storage account cannot be changed -// after creation. +// Update the update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. +// It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; +// the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value +// must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This +// call does not change the storage keys for the account. If you want to change the storage account keys, use the +// regenerate keys operation. The location and name of the storage account cannot be changed after creation. // -// resourceGroupName is the name of the resource group within the user's -// subscription. The name is case insensitive. accountName is the name of the -// storage account within the specified resource group. Storage account names -// must be between 3 and 24 characters in length and use numbers and lower-case -// letters only. parameters is the parameters to provide for the updated -// account. +// resourceGroupName is the name of the resource group within the user's subscription. The name is case insensitive. +// accountName is the name of the storage account within the specified resource group. Storage account names must be +// between 3 and 24 characters in length and use numbers and lower-case letters only. parameters is the parameters to +// provide for the updated account. func (client AccountsClient) Update(resourceGroupName string, accountName string, parameters AccountUpdateParameters) (result Account, err error) { if err := validation.Validate([]validation.Validation{ {TargetValue: resourceGroupName, @@ -925,7 +896,7 @@ func (client AccountsClient) UpdatePreparer(resourceGroupName string, accountNam "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-12-01" + const APIVersion = "2017-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/client.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/client.go index a537bdd25ec0..133386ddbeb6 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/client.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/client.go @@ -1,5 +1,4 @@ -// Package storage implements the Azure ARM Storage service API version -// 2016-12-01. +// Package storage implements the Azure ARM Storage service API version 2017-06-01. // // The Azure Storage Management API. package storage @@ -18,9 +17,8 @@ package storage // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/models.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/models.go index 2e203018428e..37c1679ee845 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/models.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/models.go @@ -14,9 +14,8 @@ package storage // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -43,6 +42,38 @@ const ( Unavailable AccountStatus = "unavailable" ) +// Action enumerates the values for action. +type Action string + +const ( + // Allow specifies the allow state for action. + Allow Action = "Allow" +) + +// Bypass enumerates the values for bypass. +type Bypass string + +const ( + // AzureServices specifies the azure services state for bypass. + AzureServices Bypass = "AzureServices" + // Logging specifies the logging state for bypass. + Logging Bypass = "Logging" + // Metrics specifies the metrics state for bypass. + Metrics Bypass = "Metrics" + // None specifies the none state for bypass. + None Bypass = "None" +) + +// DefaultAction enumerates the values for default action. +type DefaultAction string + +const ( + // DefaultActionAllow specifies the default action allow state for default action. + DefaultActionAllow DefaultAction = "Allow" + // DefaultActionDeny specifies the default action deny state for default action. + DefaultActionDeny DefaultAction = "Deny" +) + // HTTPProtocol enumerates the values for http protocol. type HTTPProtocol string @@ -63,6 +94,16 @@ const ( Read KeyPermission = "Read" ) +// KeySource enumerates the values for key source. +type KeySource string + +const ( + // MicrosoftKeyvault specifies the microsoft keyvault state for key source. + MicrosoftKeyvault KeySource = "Microsoft.Keyvault" + // MicrosoftStorage specifies the microsoft storage state for key source. + MicrosoftStorage KeySource = "Microsoft.Storage" +) + // Kind enumerates the values for kind. type Kind string @@ -95,28 +136,6 @@ const ( W Permissions = "w" ) -// Permissions1 enumerates the values for permissions 1. -type Permissions1 string - -const ( - // Permissions1A specifies the permissions 1a state for permissions 1. - Permissions1A Permissions1 = "a" - // Permissions1C specifies the permissions 1c state for permissions 1. - Permissions1C Permissions1 = "c" - // Permissions1D specifies the permissions 1d state for permissions 1. - Permissions1D Permissions1 = "d" - // Permissions1L specifies the permissions 1l state for permissions 1. - Permissions1L Permissions1 = "l" - // Permissions1P specifies the permissions 1p state for permissions 1. - Permissions1P Permissions1 = "p" - // Permissions1R specifies the permissions 1r state for permissions 1. - Permissions1R Permissions1 = "r" - // Permissions1U specifies the permissions 1u state for permissions 1. - Permissions1U Permissions1 = "u" - // Permissions1W specifies the permissions 1w state for permissions 1. - Permissions1W Permissions1 = "w" -) - // ProvisioningState enumerates the values for provisioning state. type ProvisioningState string @@ -139,30 +158,14 @@ const ( AlreadyExists Reason = "AlreadyExists" ) -// ResourceEnum enumerates the values for resource enum. -type ResourceEnum string +// ReasonCode enumerates the values for reason code. +type ReasonCode string const ( - // ResourceEnumB specifies the resource enum b state for resource enum. - ResourceEnumB ResourceEnum = "b" - // ResourceEnumC specifies the resource enum c state for resource enum. - ResourceEnumC ResourceEnum = "c" - // ResourceEnumF specifies the resource enum f state for resource enum. - ResourceEnumF ResourceEnum = "f" - // ResourceEnumS specifies the resource enum s state for resource enum. - ResourceEnumS ResourceEnum = "s" -) - -// ResourceTypes enumerates the values for resource types. -type ResourceTypes string - -const ( - // ResourceTypesC specifies the resource types c state for resource types. - ResourceTypesC ResourceTypes = "c" - // ResourceTypesO specifies the resource types o state for resource types. - ResourceTypesO ResourceTypes = "o" - // ResourceTypesS specifies the resource types s state for resource types. - ResourceTypesS ResourceTypes = "s" + // NotAvailableForSubscription specifies the not available for subscription state for reason code. + NotAvailableForSubscription ReasonCode = "NotAvailableForSubscription" + // QuotaID specifies the quota id state for reason code. + QuotaID ReasonCode = "QuotaId" ) // Services enumerates the values for services. @@ -179,6 +182,32 @@ const ( T Services = "t" ) +// SignedResource enumerates the values for signed resource. +type SignedResource string + +const ( + // SignedResourceB specifies the signed resource b state for signed resource. + SignedResourceB SignedResource = "b" + // SignedResourceC specifies the signed resource c state for signed resource. + SignedResourceC SignedResource = "c" + // SignedResourceF specifies the signed resource f state for signed resource. + SignedResourceF SignedResource = "f" + // SignedResourceS specifies the signed resource s state for signed resource. + SignedResourceS SignedResource = "s" +) + +// SignedResourceTypes enumerates the values for signed resource types. +type SignedResourceTypes string + +const ( + // SignedResourceTypesC specifies the signed resource types c state for signed resource types. + SignedResourceTypesC SignedResourceTypes = "c" + // SignedResourceTypesO specifies the signed resource types o state for signed resource types. + SignedResourceTypesO SignedResourceTypes = "o" + // SignedResourceTypesS specifies the signed resource types s state for signed resource types. + SignedResourceTypesS SignedResourceTypes = "s" +) + // SkuName enumerates the values for sku name. type SkuName string @@ -205,6 +234,22 @@ const ( Standard SkuTier = "Standard" ) +// State enumerates the values for state. +type State string + +const ( + // StateDeprovisioning specifies the state deprovisioning state for state. + StateDeprovisioning State = "deprovisioning" + // StateFailed specifies the state failed state for state. + StateFailed State = "failed" + // StateNetworkSourceDeleted specifies the state network source deleted state for state. + StateNetworkSourceDeleted State = "networkSourceDeleted" + // StateProvisioning specifies the state provisioning state for state. + StateProvisioning State = "provisioning" + // StateSucceeded specifies the state succeeded state for state. + StateSucceeded State = "succeeded" +) + // UsageUnit enumerates the values for usage unit. type UsageUnit string @@ -233,23 +278,23 @@ type Account struct { Tags *map[string]*string `json:"tags,omitempty"` Sku *Sku `json:"sku,omitempty"` Kind Kind `json:"kind,omitempty"` + Identity *Identity `json:"identity,omitempty"` *AccountProperties `json:"properties,omitempty"` } -// AccountCheckNameAvailabilityParameters is the parameters used to check the -// availabity of the storage account name. +// AccountCheckNameAvailabilityParameters is the parameters used to check the availabity of the storage account name. type AccountCheckNameAvailabilityParameters struct { Name *string `json:"name,omitempty"` Type *string `json:"type,omitempty"` } -// AccountCreateParameters is the parameters used when creating a storage -// account. +// AccountCreateParameters is the parameters used when creating a storage account. type AccountCreateParameters struct { Sku *Sku `json:"sku,omitempty"` Kind Kind `json:"kind,omitempty"` Location *string `json:"location,omitempty"` Tags *map[string]*string `json:"tags,omitempty"` + Identity *Identity `json:"identity,omitempty"` *AccountPropertiesCreateParameters `json:"properties,omitempty"` } @@ -287,50 +332,49 @@ type AccountProperties struct { Encryption *Encryption `json:"encryption,omitempty"` AccessTier AccessTier `json:"accessTier,omitempty"` EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` + NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` } -// AccountPropertiesCreateParameters is the parameters used to create the -// storage account. +// AccountPropertiesCreateParameters is the parameters used to create the storage account. type AccountPropertiesCreateParameters struct { - CustomDomain *CustomDomain `json:"customDomain,omitempty"` - Encryption *Encryption `json:"encryption,omitempty"` - AccessTier AccessTier `json:"accessTier,omitempty"` - EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` + CustomDomain *CustomDomain `json:"customDomain,omitempty"` + Encryption *Encryption `json:"encryption,omitempty"` + NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` + AccessTier AccessTier `json:"accessTier,omitempty"` + EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` } -// AccountPropertiesUpdateParameters is the parameters used when updating a -// storage account. +// AccountPropertiesUpdateParameters is the parameters used when updating a storage account. type AccountPropertiesUpdateParameters struct { - CustomDomain *CustomDomain `json:"customDomain,omitempty"` - Encryption *Encryption `json:"encryption,omitempty"` - AccessTier AccessTier `json:"accessTier,omitempty"` - EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` + CustomDomain *CustomDomain `json:"customDomain,omitempty"` + Encryption *Encryption `json:"encryption,omitempty"` + AccessTier AccessTier `json:"accessTier,omitempty"` + EnableHTTPSTrafficOnly *bool `json:"supportsHttpsTrafficOnly,omitempty"` + NetworkRuleSet *NetworkRuleSet `json:"networkAcls,omitempty"` } -// AccountRegenerateKeyParameters is the parameters used to regenerate the -// storage account key. +// AccountRegenerateKeyParameters is the parameters used to regenerate the storage account key. type AccountRegenerateKeyParameters struct { KeyName *string `json:"keyName,omitempty"` } -// AccountSasParameters is the parameters to list SAS credentials of a storage -// account. +// AccountSasParameters is the parameters to list SAS credentials of a storage account. type AccountSasParameters struct { - Services Services `json:"signedServices,omitempty"` - ResourceTypes ResourceTypes `json:"signedResourceTypes,omitempty"` - Permissions Permissions `json:"signedPermission,omitempty"` - IPAddressOrRange *string `json:"signedIp,omitempty"` - Protocols HTTPProtocol `json:"signedProtocol,omitempty"` - SharedAccessStartTime *date.Time `json:"signedStart,omitempty"` - SharedAccessExpiryTime *date.Time `json:"signedExpiry,omitempty"` - KeyToSign *string `json:"keyToSign,omitempty"` -} - -// AccountUpdateParameters is the parameters that can be provided when updating -// the storage account properties. + Services Services `json:"signedServices,omitempty"` + ResourceTypes SignedResourceTypes `json:"signedResourceTypes,omitempty"` + Permissions Permissions `json:"signedPermission,omitempty"` + IPAddressOrRange *string `json:"signedIp,omitempty"` + Protocols HTTPProtocol `json:"signedProtocol,omitempty"` + SharedAccessStartTime *date.Time `json:"signedStart,omitempty"` + SharedAccessExpiryTime *date.Time `json:"signedExpiry,omitempty"` + KeyToSign *string `json:"keyToSign,omitempty"` +} + +// AccountUpdateParameters is the parameters that can be provided when updating the storage account properties. type AccountUpdateParameters struct { Sku *Sku `json:"sku,omitempty"` Tags *map[string]*string `json:"tags,omitempty"` + Identity *Identity `json:"identity,omitempty"` *AccountPropertiesUpdateParameters `json:"properties,omitempty"` } @@ -342,21 +386,26 @@ type CheckNameAvailabilityResult struct { Message *string `json:"message,omitempty"` } -// CustomDomain is the custom domain assigned to this storage account. This can -// be set via Update. +// CustomDomain is the custom domain assigned to this storage account. This can be set via Update. type CustomDomain struct { Name *string `json:"name,omitempty"` UseSubDomain *bool `json:"useSubDomain,omitempty"` } +// Dimension is dimension of blobs, possiblly be blob type or access tier. +type Dimension struct { + Name *string `json:"name,omitempty"` + DisplayName *string `json:"displayName,omitempty"` +} + // Encryption is the encryption settings on the storage account. type Encryption struct { - Services *EncryptionServices `json:"services,omitempty"` - KeySource *string `json:"keySource,omitempty"` + Services *EncryptionServices `json:"services,omitempty"` + KeySource KeySource `json:"keySource,omitempty"` + KeyVaultProperties *KeyVaultProperties `json:"keyvaultproperties,omitempty"` } -// EncryptionService is a service that allows server-side encryption to be -// used. +// EncryptionService is a service that allows server-side encryption to be used. type EncryptionService struct { Enabled *bool `json:"enabled,omitempty"` LastEnabledTime *date.Time `json:"lastEnabledTime,omitempty"` @@ -370,8 +419,7 @@ type EncryptionServices struct { Queue *EncryptionService `json:"queue,omitempty"` } -// Endpoints is the URIs that are used to perform a retrieval of a public blob, -// queue, or table object. +// Endpoints is the URIs that are used to perform a retrieval of a public blob, queue, or table object. type Endpoints struct { Blob *string `json:"blob,omitempty"` Queue *string `json:"queue,omitempty"` @@ -379,19 +427,86 @@ type Endpoints struct { File *string `json:"file,omitempty"` } +// Identity is identity for the resource. +type Identity struct { + PrincipalID *string `json:"principalId,omitempty"` + TenantID *string `json:"tenantId,omitempty"` + Type *string `json:"type,omitempty"` +} + +// IPRule is IP rule with specific IP or IP range in CIDR format. +type IPRule struct { + IPAddressOrRange *string `json:"value,omitempty"` + Action Action `json:"action,omitempty"` +} + +// KeyVaultProperties is properties of key vault. +type KeyVaultProperties struct { + KeyName *string `json:"keyname,omitempty"` + KeyVersion *string `json:"keyversion,omitempty"` + KeyVaultURI *string `json:"keyvaulturi,omitempty"` +} + // ListAccountSasResponse is the List SAS credentials operation response. type ListAccountSasResponse struct { autorest.Response `json:"-"` AccountSasToken *string `json:"accountSasToken,omitempty"` } -// ListServiceSasResponse is the List service SAS credentials operation -// response. +// ListServiceSasResponse is the List service SAS credentials operation response. type ListServiceSasResponse struct { autorest.Response `json:"-"` ServiceSasToken *string `json:"serviceSasToken,omitempty"` } +// MetricSpecification is metric specification of operation. +type MetricSpecification struct { + Name *string `json:"name,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DisplayDescription *string `json:"displayDescription,omitempty"` + Unit *string `json:"unit,omitempty"` + Dimensions *[]Dimension `json:"dimensions,omitempty"` + AggregationType *string `json:"aggregationType,omitempty"` + FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` + Category *string `json:"category,omitempty"` + ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` +} + +// NetworkRuleSet is network rule set +type NetworkRuleSet struct { + Bypass Bypass `json:"bypass,omitempty"` + VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` + IPRules *[]IPRule `json:"ipRules,omitempty"` + DefaultAction DefaultAction `json:"defaultAction,omitempty"` +} + +// Operation is storage REST API operation definition. +type Operation struct { + Name *string `json:"name,omitempty"` + Display *OperationDisplay `json:"display,omitempty"` + Origin *string `json:"origin,omitempty"` + *OperationProperties `json:"properties,omitempty"` +} + +// OperationDisplay is display metadata associated with the operation. +type OperationDisplay struct { + Provider *string `json:"provider,omitempty"` + Resource *string `json:"resource,omitempty"` + Operation *string `json:"operation,omitempty"` +} + +// OperationListResult is result of the request to list Storage operations. It contains a list of operations and a URL +// link to get the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + Value *[]Operation `json:"value,omitempty"` +} + +// OperationProperties is properties of operation, include metric specifications. +type OperationProperties struct { + ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` +} + // Resource is describes a storage resource. type Resource struct { ID *string `json:"id,omitempty"` @@ -401,33 +516,62 @@ type Resource struct { Tags *map[string]*string `json:"tags,omitempty"` } -// ServiceSasParameters is the parameters to list service SAS credentials of a -// speicific resource. +// Restriction is the restriction because of which SKU cannot be used. +type Restriction struct { + Type *string `json:"type,omitempty"` + Values *[]string `json:"values,omitempty"` + ReasonCode ReasonCode `json:"reasonCode,omitempty"` +} + +// ServiceSasParameters is the parameters to list service SAS credentials of a speicific resource. type ServiceSasParameters struct { - CanonicalizedResource *string `json:"canonicalizedResource,omitempty"` - Resource Resource `json:"signedResource,omitempty"` - Permissions Permissions `json:"signedPermission,omitempty"` - IPAddressOrRange *string `json:"signedIp,omitempty"` - Protocols HTTPProtocol `json:"signedProtocol,omitempty"` - SharedAccessStartTime *date.Time `json:"signedStart,omitempty"` - SharedAccessExpiryTime *date.Time `json:"signedExpiry,omitempty"` - Identifier *string `json:"signedIdentifier,omitempty"` - PartitionKeyStart *string `json:"startPk,omitempty"` - PartitionKeyEnd *string `json:"endPk,omitempty"` - RowKeyStart *string `json:"startRk,omitempty"` - RowKeyEnd *string `json:"endRk,omitempty"` - KeyToSign *string `json:"keyToSign,omitempty"` - CacheControl *string `json:"rscc,omitempty"` - ContentDisposition *string `json:"rscd,omitempty"` - ContentEncoding *string `json:"rsce,omitempty"` - ContentLanguage *string `json:"rscl,omitempty"` - ContentType *string `json:"rsct,omitempty"` + CanonicalizedResource *string `json:"canonicalizedResource,omitempty"` + Resource SignedResource `json:"signedResource,omitempty"` + Permissions Permissions `json:"signedPermission,omitempty"` + IPAddressOrRange *string `json:"signedIp,omitempty"` + Protocols HTTPProtocol `json:"signedProtocol,omitempty"` + SharedAccessStartTime *date.Time `json:"signedStart,omitempty"` + SharedAccessExpiryTime *date.Time `json:"signedExpiry,omitempty"` + Identifier *string `json:"signedIdentifier,omitempty"` + PartitionKeyStart *string `json:"startPk,omitempty"` + PartitionKeyEnd *string `json:"endPk,omitempty"` + RowKeyStart *string `json:"startRk,omitempty"` + RowKeyEnd *string `json:"endRk,omitempty"` + KeyToSign *string `json:"keyToSign,omitempty"` + CacheControl *string `json:"rscc,omitempty"` + ContentDisposition *string `json:"rscd,omitempty"` + ContentEncoding *string `json:"rsce,omitempty"` + ContentLanguage *string `json:"rscl,omitempty"` + ContentType *string `json:"rsct,omitempty"` +} + +// ServiceSpecification is one property of operation, include metric specifications. +type ServiceSpecification struct { + MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` } // Sku is the SKU of the storage account. type Sku struct { - Name SkuName `json:"name,omitempty"` - Tier SkuTier `json:"tier,omitempty"` + Name SkuName `json:"name,omitempty"` + Tier SkuTier `json:"tier,omitempty"` + ResourceType *string `json:"resourceType,omitempty"` + Kind Kind `json:"kind,omitempty"` + Locations *[]string `json:"locations,omitempty"` + Capabilities *[]SKUCapability `json:"capabilities,omitempty"` + Restrictions *[]Restriction `json:"restrictions,omitempty"` +} + +// SKUCapability is the capability information in the specified sku, including file encryption, network acls, change +// notification, etc. +type SKUCapability struct { + Name *string `json:"name,omitempty"` + Value *string `json:"value,omitempty"` +} + +// SkuListResult is the response from the List Storage SKUs operation. +type SkuListResult struct { + autorest.Response `json:"-"` + Value *[]Sku `json:"value,omitempty"` } // Usage is describes Storage Resource Usage. @@ -444,9 +588,15 @@ type UsageListResult struct { Value *[]Usage `json:"value,omitempty"` } -// UsageName is the usage names that can be used; currently limited to -// StorageAccount. +// UsageName is the usage names that can be used; currently limited to StorageAccount. type UsageName struct { Value *string `json:"value,omitempty"` LocalizedValue *string `json:"localizedValue,omitempty"` } + +// VirtualNetworkRule is virtual Network rule. +type VirtualNetworkRule struct { + VirtualNetworkResourceID *string `json:"id,omitempty"` + Action Action `json:"action,omitempty"` + State State `json:"state,omitempty"` +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/operations.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/operations.go new file mode 100644 index 000000000000..cc46c6997920 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/operations.go @@ -0,0 +1,96 @@ +package storage + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// OperationsClient is the the Azure Storage Management API. +type OperationsClient struct { + ManagementClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client. +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available Storage Rest API operations. +func (client OperationsClient) List() (result OperationListResult, err error) { + req, err := client.ListPreparer() + if err != nil { + err = autorest.NewErrorWithError(err, "storage.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storage.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer() (*http.Request, error) { + const APIVersion = "2017-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Storage/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/skus.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/skus.go new file mode 100644 index 000000000000..94d4d6f83ec5 --- /dev/null +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/skus.go @@ -0,0 +1,100 @@ +package storage + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "net/http" +) + +// SkusClient is the the Azure Storage Management API. +type SkusClient struct { + ManagementClient +} + +// NewSkusClient creates an instance of the SkusClient client. +func NewSkusClient(subscriptionID string) SkusClient { + return NewSkusClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSkusClientWithBaseURI creates an instance of the SkusClient client. +func NewSkusClientWithBaseURI(baseURI string, subscriptionID string) SkusClient { + return SkusClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists the available SKUs supported by Microsoft.Storage for given subscription. +func (client SkusClient) List() (result SkuListResult, err error) { + req, err := client.ListPreparer() + if err != nil { + err = autorest.NewErrorWithError(err, "storage.SkusClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storage.SkusClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.SkusClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SkusClient) ListPreparer() (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare(&http.Request{}) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SkusClient) ListSender(req *http.Request) (*http.Response, error) { + return autorest.SendWithSender(client, req) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SkusClient) ListResponder(resp *http.Response) (result SkuListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/usage.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/usage.go index b12a6d315fda..682e5c16c362 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/usage.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/usage.go @@ -14,9 +14,8 @@ package storage // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. import ( "github.com/Azure/go-autorest/autorest" @@ -39,8 +38,7 @@ func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClien return UsageClient{NewWithBaseURI(baseURI, subscriptionID)} } -// List gets the current usage count and the limit for the resources under the -// subscription. +// List gets the current usage count and the limit for the resources under the subscription. func (client UsageClient) List() (result UsageListResult, err error) { req, err := client.ListPreparer() if err != nil { @@ -69,7 +67,7 @@ func (client UsageClient) ListPreparer() (*http.Request, error) { "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2016-12-01" + const APIVersion = "2017-06-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/version.go b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/version.go index ac97c159fa6d..467102d59734 100755 --- a/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/version.go +++ b/cluster-autoscaler/vendor/github.com/Azure/azure-sdk-for-go/arm/storage/version.go @@ -14,16 +14,15 @@ package storage // See the License for the specific language governing permissions and // limitations under the License. // -// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 -// Changes may cause incorrect behavior and will be lost if the code is -// regenerated. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/v10.0.2-beta arm-storage/2016-12-01" + return "Azure-SDK-For-Go/v11.0.0-beta arm-storage/2017-06-01" } // Version returns the semantic version (see http://semver.org) of the client. func Version() string { - return "v10.0.2-beta" + return "v11.0.0-beta" }