Commit 14e134ce authored by Ivan Towlson's avatar Ivan Towlson

Rev Azure SDK to v11.1.1

parent 7efc6c83
...@@ -30,33 +30,33 @@ ...@@ -30,33 +30,33 @@
}, },
{ {
"ImportPath": "github.com/Azure/azure-sdk-for-go/arm/compute", "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/compute",
"Comment": "v10.0.4-beta-1-g786cc841", "Comment": "v11.1.1-beta",
"Rev": "786cc84138518bf7fd6d60e92fad1ac9d1a117ad" "Rev": "509eea43b93cec2f3f17acbe2578ef58703923f8"
}, },
{ {
"ImportPath": "github.com/Azure/azure-sdk-for-go/arm/containerregistry", "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/containerregistry",
"Comment": "v10.0.4-beta-1-g786cc841", "Comment": "v11.1.1-beta",
"Rev": "786cc84138518bf7fd6d60e92fad1ac9d1a117ad" "Rev": "509eea43b93cec2f3f17acbe2578ef58703923f8"
}, },
{ {
"ImportPath": "github.com/Azure/azure-sdk-for-go/arm/disk", "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/disk",
"Comment": "v10.0.4-beta-1-g786cc841", "Comment": "v11.1.1-beta",
"Rev": "786cc84138518bf7fd6d60e92fad1ac9d1a117ad" "Rev": "509eea43b93cec2f3f17acbe2578ef58703923f8"
}, },
{ {
"ImportPath": "github.com/Azure/azure-sdk-for-go/arm/network", "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/network",
"Comment": "v10.0.4-beta-1-g786cc841", "Comment": "v11.1.1-beta",
"Rev": "786cc84138518bf7fd6d60e92fad1ac9d1a117ad" "Rev": "509eea43b93cec2f3f17acbe2578ef58703923f8"
}, },
{ {
"ImportPath": "github.com/Azure/azure-sdk-for-go/arm/storage", "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/storage",
"Comment": "v10.0.4-beta-1-g786cc841", "Comment": "v11.1.1-beta",
"Rev": "786cc84138518bf7fd6d60e92fad1ac9d1a117ad" "Rev": "509eea43b93cec2f3f17acbe2578ef58703923f8"
}, },
{ {
"ImportPath": "github.com/Azure/azure-sdk-for-go/storage", "ImportPath": "github.com/Azure/azure-sdk-for-go/storage",
"Comment": "v10.0.4-beta-1-g786cc841", "Comment": "v11.1.1-beta",
"Rev": "786cc84138518bf7fd6d60e92fad1ac9d1a117ad" "Rev": "509eea43b93cec2f3f17acbe2578ef58703923f8"
}, },
{ {
"ImportPath": "github.com/Azure/go-ansiterm", "ImportPath": "github.com/Azure/go-ansiterm",
...@@ -68,33 +68,33 @@ ...@@ -68,33 +68,33 @@
}, },
{ {
"ImportPath": "github.com/Azure/go-autorest/autorest", "ImportPath": "github.com/Azure/go-autorest/autorest",
"Comment": "v8.0.0", "Comment": "v9.0.0",
"Rev": "58f6f26e200fa5dfb40c9cd1c83f3e2c860d779d" "Rev": "f6be1abbb5abd0517522f850dd785990d373da7e"
}, },
{ {
"ImportPath": "github.com/Azure/go-autorest/autorest/adal", "ImportPath": "github.com/Azure/go-autorest/autorest/adal",
"Comment": "v8.0.0", "Comment": "v9.0.0",
"Rev": "58f6f26e200fa5dfb40c9cd1c83f3e2c860d779d" "Rev": "f6be1abbb5abd0517522f850dd785990d373da7e"
}, },
{ {
"ImportPath": "github.com/Azure/go-autorest/autorest/azure", "ImportPath": "github.com/Azure/go-autorest/autorest/azure",
"Comment": "v8.0.0", "Comment": "v9.0.0",
"Rev": "58f6f26e200fa5dfb40c9cd1c83f3e2c860d779d" "Rev": "f6be1abbb5abd0517522f850dd785990d373da7e"
}, },
{ {
"ImportPath": "github.com/Azure/go-autorest/autorest/date", "ImportPath": "github.com/Azure/go-autorest/autorest/date",
"Comment": "v8.0.0", "Comment": "v9.0.0",
"Rev": "58f6f26e200fa5dfb40c9cd1c83f3e2c860d779d" "Rev": "f6be1abbb5abd0517522f850dd785990d373da7e"
}, },
{ {
"ImportPath": "github.com/Azure/go-autorest/autorest/to", "ImportPath": "github.com/Azure/go-autorest/autorest/to",
"Comment": "v8.0.0", "Comment": "v9.0.0",
"Rev": "58f6f26e200fa5dfb40c9cd1c83f3e2c860d779d" "Rev": "f6be1abbb5abd0517522f850dd785990d373da7e"
}, },
{ {
"ImportPath": "github.com/Azure/go-autorest/autorest/validation", "ImportPath": "github.com/Azure/go-autorest/autorest/validation",
"Comment": "v8.0.0", "Comment": "v9.0.0",
"Rev": "58f6f26e200fa5dfb40c9cd1c83f3e2c860d779d" "Rev": "f6be1abbb5abd0517522f850dd785990d373da7e"
}, },
{ {
"ImportPath": "github.com/MakeNowJust/heredoc", "ImportPath": "github.com/MakeNowJust/heredoc",
......
...@@ -166,8 +166,12 @@ func GetServicePrincipalToken(config *Config, env *azure.Environment) (*adal.Ser ...@@ -166,8 +166,12 @@ func GetServicePrincipalToken(config *Config, env *azure.Environment) (*adal.Ser
if config.UseManagedIdentityExtension { if config.UseManagedIdentityExtension {
glog.V(2).Infoln("azure: using managed identity extension to retrieve access token") glog.V(2).Infoln("azure: using managed identity extension to retrieve access token")
msiEndpoint, err := adal.GetMSIVMEndpoint()
if err != nil {
return nil, fmt.Errorf("Getting the managed service identity endpoint: %v", err)
}
return adal.NewServicePrincipalTokenFromMSI( return adal.NewServicePrincipalTokenFromMSI(
*oauthConfig, msiEndpoint,
env.ServiceManagementEndpoint) env.ServiceManagementEndpoint)
} }
......
Microsoft Azure-SDK-for-Go
Copyright 2014-2017 Microsoft
This product includes software developed at
the Microsoft Corporation (https://www.microsoft.com).
...@@ -5,14 +5,21 @@ go_library( ...@@ -5,14 +5,21 @@ go_library(
srcs = [ srcs = [
"availabilitysets.go", "availabilitysets.go",
"client.go", "client.go",
"containerservices.go",
"disks.go",
"images.go", "images.go",
"models.go", "models.go",
"resourceskus.go",
"snapshots.go",
"usage.go", "usage.go",
"version.go", "version.go",
"virtualmachineextensionimages.go", "virtualmachineextensionimages.go",
"virtualmachineextensions.go", "virtualmachineextensions.go",
"virtualmachineimages.go", "virtualmachineimages.go",
"virtualmachineruncommands.go",
"virtualmachines.go", "virtualmachines.go",
"virtualmachinescalesetextensions.go",
"virtualmachinescalesetrollingupgrades.go",
"virtualmachinescalesets.go", "virtualmachinescalesets.go",
"virtualmachinescalesetvms.go", "virtualmachinescalesetvms.go",
"virtualmachinesizes.go", "virtualmachinesizes.go",
......
...@@ -14,9 +14,8 @@ package compute ...@@ -14,9 +14,8 @@ package compute
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
...@@ -24,30 +23,27 @@ import ( ...@@ -24,30 +23,27 @@ import (
"net/http" "net/http"
) )
// AvailabilitySetsClient is the the Compute Management Client. // AvailabilitySetsClient is the compute Client
type AvailabilitySetsClient struct { type AvailabilitySetsClient struct {
ManagementClient ManagementClient
} }
// NewAvailabilitySetsClient creates an instance of the AvailabilitySetsClient // NewAvailabilitySetsClient creates an instance of the AvailabilitySetsClient client.
// client.
func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient { func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient {
return NewAvailabilitySetsClientWithBaseURI(DefaultBaseURI, subscriptionID) return NewAvailabilitySetsClientWithBaseURI(DefaultBaseURI, subscriptionID)
} }
// NewAvailabilitySetsClientWithBaseURI creates an instance of the // NewAvailabilitySetsClientWithBaseURI creates an instance of the AvailabilitySetsClient client.
// AvailabilitySetsClient client.
func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string) AvailabilitySetsClient { func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string) AvailabilitySetsClient {
return AvailabilitySetsClient{NewWithBaseURI(baseURI, subscriptionID)} return AvailabilitySetsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate create or update an availability set. // CreateOrUpdate create or update an availability set.
// //
// resourceGroupName is the name of the resource group. name is the name of the // resourceGroupName is the name of the resource group. availabilitySetName is the name of the availability set.
// availability set. parameters is parameters supplied to the Create // parameters is parameters supplied to the Create Availability Set operation.
// Availability Set operation. func (client AvailabilitySetsClient) CreateOrUpdate(resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (result AvailabilitySet, err error) {
func (client AvailabilitySetsClient) CreateOrUpdate(resourceGroupName string, name string, parameters AvailabilitySet) (result AvailabilitySet, err error) { req, err := client.CreateOrUpdatePreparer(resourceGroupName, availabilitySetName, parameters)
req, err := client.CreateOrUpdatePreparer(resourceGroupName, name, parameters)
if err != nil { if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", nil, "Failure preparing request") err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate", nil, "Failure preparing request")
return return
...@@ -69,14 +65,14 @@ func (client AvailabilitySetsClient) CreateOrUpdate(resourceGroupName string, na ...@@ -69,14 +65,14 @@ func (client AvailabilitySetsClient) CreateOrUpdate(resourceGroupName string, na
} }
// CreateOrUpdatePreparer prepares the CreateOrUpdate request. // 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{}{ pathParameters := map[string]interface{}{
"name": autorest.Encode("path", name), "availabilitySetName": autorest.Encode("path", availabilitySetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName), "resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -85,7 +81,7 @@ func (client AvailabilitySetsClient) CreateOrUpdatePreparer(resourceGroupName st ...@@ -85,7 +81,7 @@ func (client AvailabilitySetsClient) CreateOrUpdatePreparer(resourceGroupName st
autorest.AsJSON(), autorest.AsJSON(),
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), 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.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters)) autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{}) return preparer.Prepare(&http.Request{})
...@@ -112,8 +108,7 @@ func (client AvailabilitySetsClient) CreateOrUpdateResponder(resp *http.Response ...@@ -112,8 +108,7 @@ func (client AvailabilitySetsClient) CreateOrUpdateResponder(resp *http.Response
// Delete delete an availability set. // Delete delete an availability set.
// //
// resourceGroupName is the name of the resource group. availabilitySetName is // resourceGroupName is the name of the resource group. availabilitySetName is the name of the availability set.
// the name of the availability set.
func (client AvailabilitySetsClient) Delete(resourceGroupName string, availabilitySetName string) (result OperationStatusResponse, err error) { func (client AvailabilitySetsClient) Delete(resourceGroupName string, availabilitySetName string) (result OperationStatusResponse, err error) {
req, err := client.DeletePreparer(resourceGroupName, availabilitySetName) req, err := client.DeletePreparer(resourceGroupName, availabilitySetName)
if err != nil { if err != nil {
...@@ -144,7 +139,7 @@ func (client AvailabilitySetsClient) DeletePreparer(resourceGroupName string, av ...@@ -144,7 +139,7 @@ func (client AvailabilitySetsClient) DeletePreparer(resourceGroupName string, av
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -178,8 +173,7 @@ func (client AvailabilitySetsClient) DeleteResponder(resp *http.Response) (resul ...@@ -178,8 +173,7 @@ func (client AvailabilitySetsClient) DeleteResponder(resp *http.Response) (resul
// Get retrieves information about an availability set. // Get retrieves information about an availability set.
// //
// resourceGroupName is the name of the resource group. availabilitySetName is // resourceGroupName is the name of the resource group. availabilitySetName is the name of the availability set.
// the name of the availability set.
func (client AvailabilitySetsClient) Get(resourceGroupName string, availabilitySetName string) (result AvailabilitySet, err error) { func (client AvailabilitySetsClient) Get(resourceGroupName string, availabilitySetName string) (result AvailabilitySet, err error) {
req, err := client.GetPreparer(resourceGroupName, availabilitySetName) req, err := client.GetPreparer(resourceGroupName, availabilitySetName)
if err != nil { if err != nil {
...@@ -210,7 +204,7 @@ func (client AvailabilitySetsClient) GetPreparer(resourceGroupName string, avail ...@@ -210,7 +204,7 @@ func (client AvailabilitySetsClient) GetPreparer(resourceGroupName string, avail
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -274,7 +268,7 @@ func (client AvailabilitySetsClient) ListPreparer(resourceGroupName string) (*ht ...@@ -274,7 +268,7 @@ func (client AvailabilitySetsClient) ListPreparer(resourceGroupName string) (*ht
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -306,11 +300,10 @@ func (client AvailabilitySetsClient) ListResponder(resp *http.Response) (result ...@@ -306,11 +300,10 @@ func (client AvailabilitySetsClient) ListResponder(resp *http.Response) (result
return return
} }
// ListAvailableSizes lists all available virtual machine sizes that can be // ListAvailableSizes lists all available virtual machine sizes that can be used to create a new virtual machine in an
// used to create a new virtual machine in an existing availability set. // existing availability set.
// //
// resourceGroupName is the name of the resource group. availabilitySetName is // resourceGroupName is the name of the resource group. availabilitySetName is the name of the availability set.
// the name of the availability set.
func (client AvailabilitySetsClient) ListAvailableSizes(resourceGroupName string, availabilitySetName string) (result VirtualMachineSizeListResult, err error) { func (client AvailabilitySetsClient) ListAvailableSizes(resourceGroupName string, availabilitySetName string) (result VirtualMachineSizeListResult, err error) {
req, err := client.ListAvailableSizesPreparer(resourceGroupName, availabilitySetName) req, err := client.ListAvailableSizesPreparer(resourceGroupName, availabilitySetName)
if err != nil { if err != nil {
...@@ -341,7 +334,7 @@ func (client AvailabilitySetsClient) ListAvailableSizesPreparer(resourceGroupNam ...@@ -341,7 +334,7 @@ func (client AvailabilitySetsClient) ListAvailableSizesPreparer(resourceGroupNam
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
......
// Package compute implements the Azure ARM Compute service API version // Package compute implements the Azure ARM Compute service API version .
// 2016-04-30-preview.
// //
// The Compute Management Client. // Compute Client
package compute package compute
// Copyright (c) Microsoft and contributors. All rights reserved. // Copyright (c) Microsoft and contributors. All rights reserved.
...@@ -18,9 +17,8 @@ package compute ...@@ -18,9 +17,8 @@ package compute
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
......
...@@ -14,9 +14,8 @@ package compute ...@@ -14,9 +14,8 @@ package compute
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
...@@ -25,7 +24,7 @@ import ( ...@@ -25,7 +24,7 @@ import (
"net/http" "net/http"
) )
// ImagesClient is the the Compute Management Client. // ImagesClient is the compute Client
type ImagesClient struct { type ImagesClient struct {
ManagementClient ManagementClient
} }
...@@ -40,14 +39,11 @@ func NewImagesClientWithBaseURI(baseURI string, subscriptionID string) ImagesCli ...@@ -40,14 +39,11 @@ func NewImagesClientWithBaseURI(baseURI string, subscriptionID string) ImagesCli
return ImagesClient{NewWithBaseURI(baseURI, subscriptionID)} return ImagesClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate create or update an image. This method may poll for // CreateOrUpdate create or update an image. This method may poll for completion. Polling can be canceled by passing
// completion. Polling can be canceled by passing the cancel channel argument. // the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
// 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 // resourceGroupName is the name of the resource group. imageName is the name of the image. parameters is parameters
// of the image. parameters is parameters supplied to the Create Image // supplied to the Create Image operation.
// operation.
func (client ImagesClient) CreateOrUpdate(resourceGroupName string, imageName string, parameters Image, cancel <-chan struct{}) (<-chan Image, <-chan error) { func (client ImagesClient) CreateOrUpdate(resourceGroupName string, imageName string, parameters Image, cancel <-chan struct{}) (<-chan Image, <-chan error) {
resultChan := make(chan Image, 1) resultChan := make(chan Image, 1)
errChan := make(chan error, 1) errChan := make(chan error, 1)
...@@ -67,8 +63,10 @@ func (client ImagesClient) CreateOrUpdate(resourceGroupName string, imageName st ...@@ -67,8 +63,10 @@ func (client ImagesClient) CreateOrUpdate(resourceGroupName string, imageName st
var err error var err error
var result Image var result Image
defer func() { defer func() {
if err != nil {
errChan <- err
}
resultChan <- result resultChan <- result
errChan <- err
close(resultChan) close(resultChan)
close(errChan) close(errChan)
}() }()
...@@ -101,7 +99,7 @@ func (client ImagesClient) CreateOrUpdatePreparer(resourceGroupName string, imag ...@@ -101,7 +99,7 @@ func (client ImagesClient) CreateOrUpdatePreparer(resourceGroupName string, imag
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -137,12 +135,10 @@ func (client ImagesClient) CreateOrUpdateResponder(resp *http.Response) (result ...@@ -137,12 +135,10 @@ func (client ImagesClient) CreateOrUpdateResponder(resp *http.Response) (result
return return
} }
// Delete deletes an Image. This method may poll for completion. Polling can be // Delete deletes an Image. This method may poll for completion. Polling can be canceled by passing the cancel channel
// canceled by passing the cancel channel argument. The channel will be used to // argument. The channel will be used to cancel polling and any outstanding HTTP requests.
// cancel polling and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. imageName is the name // resourceGroupName is the name of the resource group. imageName is the name of the image.
// of the image.
func (client ImagesClient) Delete(resourceGroupName string, imageName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) { func (client ImagesClient) Delete(resourceGroupName string, imageName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) {
resultChan := make(chan OperationStatusResponse, 1) resultChan := make(chan OperationStatusResponse, 1)
errChan := make(chan error, 1) errChan := make(chan error, 1)
...@@ -150,8 +146,10 @@ func (client ImagesClient) Delete(resourceGroupName string, imageName string, ca ...@@ -150,8 +146,10 @@ func (client ImagesClient) Delete(resourceGroupName string, imageName string, ca
var err error var err error
var result OperationStatusResponse var result OperationStatusResponse
defer func() { defer func() {
if err != nil {
errChan <- err
}
resultChan <- result resultChan <- result
errChan <- err
close(resultChan) close(resultChan)
close(errChan) close(errChan)
}() }()
...@@ -184,7 +182,7 @@ func (client ImagesClient) DeletePreparer(resourceGroupName string, imageName st ...@@ -184,7 +182,7 @@ func (client ImagesClient) DeletePreparer(resourceGroupName string, imageName st
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -220,8 +218,8 @@ func (client ImagesClient) DeleteResponder(resp *http.Response) (result Operatio ...@@ -220,8 +218,8 @@ func (client ImagesClient) DeleteResponder(resp *http.Response) (result Operatio
// Get gets an image. // Get gets an image.
// //
// resourceGroupName is the name of the resource group. imageName is the name // resourceGroupName is the name of the resource group. imageName is the name of the image. expand is the expand
// of the image. expand is the expand expression to apply on the operation. // expression to apply on the operation.
func (client ImagesClient) Get(resourceGroupName string, imageName string, expand string) (result Image, err error) { func (client ImagesClient) Get(resourceGroupName string, imageName string, expand string) (result Image, err error) {
req, err := client.GetPreparer(resourceGroupName, imageName, expand) req, err := client.GetPreparer(resourceGroupName, imageName, expand)
if err != nil { if err != nil {
...@@ -252,7 +250,7 @@ func (client ImagesClient) GetPreparer(resourceGroupName string, imageName strin ...@@ -252,7 +250,7 @@ func (client ImagesClient) GetPreparer(resourceGroupName string, imageName strin
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -287,9 +285,8 @@ func (client ImagesClient) GetResponder(resp *http.Response) (result Image, err ...@@ -287,9 +285,8 @@ func (client ImagesClient) GetResponder(resp *http.Response) (result Image, err
return return
} }
// List gets the list of Images in the subscription. Use nextLink property in // List gets the list of Images in the subscription. Use nextLink property in the response to get the next page of
// the response to get the next page of Images. Do this till nextLink is not // Images. Do this till nextLink is not null to fetch all the Images.
// null to fetch all the Images.
func (client ImagesClient) List() (result ImageListResult, err error) { func (client ImagesClient) List() (result ImageListResult, err error) {
req, err := client.ListPreparer() req, err := client.ListPreparer()
if err != nil { if err != nil {
...@@ -318,7 +315,7 @@ func (client ImagesClient) ListPreparer() (*http.Request, error) { ...@@ -318,7 +315,7 @@ func (client ImagesClient) ListPreparer() (*http.Request, error) {
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -374,6 +371,51 @@ func (client ImagesClient) ListNextResults(lastResults ImageListResult) (result ...@@ -374,6 +371,51 @@ func (client ImagesClient) ListNextResults(lastResults ImageListResult) (result
return 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. // ListByResourceGroup gets the list of images under a resource group.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
...@@ -406,7 +448,7 @@ func (client ImagesClient) ListByResourceGroupPreparer(resourceGroupName string) ...@@ -406,7 +448,7 @@ func (client ImagesClient) ListByResourceGroupPreparer(resourceGroupName string)
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -461,3 +503,48 @@ func (client ImagesClient) ListByResourceGroupNextResults(lastResults ImageListR ...@@ -461,3 +503,48 @@ func (client ImagesClient) ListByResourceGroupNextResults(lastResults ImageListR
return 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
}
This source diff could not be displayed because it is too large. You can view the blob instead.
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
}
...@@ -14,9 +14,8 @@ package compute ...@@ -14,9 +14,8 @@ package compute
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
...@@ -25,7 +24,7 @@ import ( ...@@ -25,7 +24,7 @@ import (
"net/http" "net/http"
) )
// UsageClient is the the Compute Management Client. // UsageClient is the compute Client
type UsageClient struct { type UsageClient struct {
ManagementClient ManagementClient
} }
...@@ -40,9 +39,8 @@ func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClien ...@@ -40,9 +39,8 @@ func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClien
return UsageClient{NewWithBaseURI(baseURI, subscriptionID)} return UsageClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// List gets, for the specified location, the current compute resource usage // List gets, for the specified location, the current compute resource usage information as well as the limits for
// information as well as the limits for compute resources under the // compute resources under the subscription.
// subscription.
// //
// location is the location for which resource usage is queried. // location is the location for which resource usage is queried.
func (client UsageClient) List(location string) (result ListUsagesResult, err error) { func (client UsageClient) List(location string) (result ListUsagesResult, err error) {
...@@ -80,7 +78,7 @@ func (client UsageClient) ListPreparer(location string) (*http.Request, error) { ...@@ -80,7 +78,7 @@ func (client UsageClient) ListPreparer(location string) (*http.Request, error) {
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -135,3 +133,48 @@ func (client UsageClient) ListNextResults(lastResults ListUsagesResult) (result ...@@ -135,3 +133,48 @@ func (client UsageClient) ListNextResults(lastResults ListUsagesResult) (result
return 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
}
...@@ -14,16 +14,15 @@ package compute ...@@ -14,16 +14,15 @@ package compute
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
// UserAgent returns the UserAgent string to use when sending http.Requests. // UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string { 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. // Version returns the semantic version (see http://semver.org) of the client.
func Version() string { func Version() string {
return "v10.0.2-beta" return "v11.0.0-beta"
} }
...@@ -14,9 +14,8 @@ package compute ...@@ -14,9 +14,8 @@ package compute
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
...@@ -24,25 +23,25 @@ import ( ...@@ -24,25 +23,25 @@ import (
"net/http" "net/http"
) )
// VirtualMachineExtensionImagesClient is the the Compute Management Client. // VirtualMachineExtensionImagesClient is the compute Client
type VirtualMachineExtensionImagesClient struct { type VirtualMachineExtensionImagesClient struct {
ManagementClient ManagementClient
} }
// NewVirtualMachineExtensionImagesClient creates an instance of the // NewVirtualMachineExtensionImagesClient creates an instance of the VirtualMachineExtensionImagesClient client.
// VirtualMachineExtensionImagesClient client.
func NewVirtualMachineExtensionImagesClient(subscriptionID string) VirtualMachineExtensionImagesClient { func NewVirtualMachineExtensionImagesClient(subscriptionID string) VirtualMachineExtensionImagesClient {
return NewVirtualMachineExtensionImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) return NewVirtualMachineExtensionImagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
} }
// NewVirtualMachineExtensionImagesClientWithBaseURI creates an instance of the // NewVirtualMachineExtensionImagesClientWithBaseURI creates an instance of the VirtualMachineExtensionImagesClient
// VirtualMachineExtensionImagesClient client. // client.
func NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionImagesClient { func NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionImagesClient {
return VirtualMachineExtensionImagesClient{NewWithBaseURI(baseURI, subscriptionID)} return VirtualMachineExtensionImagesClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// Get gets a virtual machine extension image. // 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) { func (client VirtualMachineExtensionImagesClient) Get(location string, publisherName string, typeParameter string, version string) (result VirtualMachineExtensionImage, err error) {
req, err := client.GetPreparer(location, publisherName, typeParameter, version) req, err := client.GetPreparer(location, publisherName, typeParameter, version)
if err != nil { if err != nil {
...@@ -75,7 +74,7 @@ func (client VirtualMachineExtensionImagesClient) GetPreparer(location string, p ...@@ -75,7 +74,7 @@ func (client VirtualMachineExtensionImagesClient) GetPreparer(location string, p
"version": autorest.Encode("path", version), "version": autorest.Encode("path", version),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -109,6 +108,7 @@ func (client VirtualMachineExtensionImagesClient) GetResponder(resp *http.Respon ...@@ -109,6 +108,7 @@ func (client VirtualMachineExtensionImagesClient) GetResponder(resp *http.Respon
// ListTypes gets a list of virtual machine extension image types. // 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) { func (client VirtualMachineExtensionImagesClient) ListTypes(location string, publisherName string) (result ListVirtualMachineExtensionImage, err error) {
req, err := client.ListTypesPreparer(location, publisherName) req, err := client.ListTypesPreparer(location, publisherName)
if err != nil { if err != nil {
...@@ -139,7 +139,7 @@ func (client VirtualMachineExtensionImagesClient) ListTypesPreparer(location str ...@@ -139,7 +139,7 @@ func (client VirtualMachineExtensionImagesClient) ListTypesPreparer(location str
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -173,7 +173,7 @@ func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http. ...@@ -173,7 +173,7 @@ func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http.
// ListVersions gets a list of virtual machine extension image versions. // 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) { 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) req, err := client.ListVersionsPreparer(location, publisherName, typeParameter, filter, top, orderby)
if err != nil { if err != nil {
...@@ -205,7 +205,7 @@ func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(location ...@@ -205,7 +205,7 @@ func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(location
"type": autorest.Encode("path", typeParameter), "type": autorest.Encode("path", typeParameter),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
......
...@@ -14,9 +14,8 @@ package compute ...@@ -14,9 +14,8 @@ package compute
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
...@@ -24,33 +23,28 @@ import ( ...@@ -24,33 +23,28 @@ import (
"net/http" "net/http"
) )
// VirtualMachineExtensionsClient is the the Compute Management Client. // VirtualMachineExtensionsClient is the compute Client
type VirtualMachineExtensionsClient struct { type VirtualMachineExtensionsClient struct {
ManagementClient ManagementClient
} }
// NewVirtualMachineExtensionsClient creates an instance of the // NewVirtualMachineExtensionsClient creates an instance of the VirtualMachineExtensionsClient client.
// VirtualMachineExtensionsClient client.
func NewVirtualMachineExtensionsClient(subscriptionID string) VirtualMachineExtensionsClient { func NewVirtualMachineExtensionsClient(subscriptionID string) VirtualMachineExtensionsClient {
return NewVirtualMachineExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID) return NewVirtualMachineExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
} }
// NewVirtualMachineExtensionsClientWithBaseURI creates an instance of the // NewVirtualMachineExtensionsClientWithBaseURI creates an instance of the VirtualMachineExtensionsClient client.
// VirtualMachineExtensionsClient client.
func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionsClient { func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionsClient {
return VirtualMachineExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)} return VirtualMachineExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate the operation to create or update the extension. This method // CreateOrUpdate the operation to create or update the extension. This method may poll for completion. Polling can be
// may poll for completion. Polling can be canceled by passing the cancel // canceled by passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP
// channel argument. The channel will be used to cancel polling and any // requests.
// outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. VMName is the name of // resourceGroupName is the name of the resource group. VMName is the name of the virtual machine where the extension
// the virtual machine where the extension should be create or updated. // should be create or updated. VMExtensionName is the name of the virtual machine extension. extensionParameters is
// VMExtensionName is the name of the virtual machine extension. // parameters supplied to the Create Virtual Machine Extension operation.
// 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) { func (client VirtualMachineExtensionsClient) CreateOrUpdate(resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension, cancel <-chan struct{}) (<-chan VirtualMachineExtension, <-chan error) {
resultChan := make(chan VirtualMachineExtension, 1) resultChan := make(chan VirtualMachineExtension, 1)
errChan := make(chan error, 1) errChan := make(chan error, 1)
...@@ -58,8 +52,10 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdate(resourceGroupName st ...@@ -58,8 +52,10 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdate(resourceGroupName st
var err error var err error
var result VirtualMachineExtension var result VirtualMachineExtension
defer func() { defer func() {
if err != nil {
errChan <- err
}
resultChan <- result resultChan <- result
errChan <- err
close(resultChan) close(resultChan)
close(errChan) close(errChan)
}() }()
...@@ -93,7 +89,7 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(resourceGrou ...@@ -93,7 +89,7 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(resourceGrou
"vmName": autorest.Encode("path", VMName), "vmName": autorest.Encode("path", VMName),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -129,14 +125,11 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http. ...@@ -129,14 +125,11 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http.
return return
} }
// Delete the operation to delete the extension. This method may poll for // Delete the operation to delete the extension. This method may poll for completion. Polling can be canceled by
// completion. Polling can be canceled by passing the cancel channel argument. // passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
// 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 // resourceGroupName is the name of the resource group. VMName is the name of the virtual machine where the extension
// the virtual machine where the extension should be deleted. VMExtensionName // should be deleted. VMExtensionName is the name of the virtual machine extension.
// 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) { func (client VirtualMachineExtensionsClient) Delete(resourceGroupName string, VMName string, VMExtensionName string, cancel <-chan struct{}) (<-chan OperationStatusResponse, <-chan error) {
resultChan := make(chan OperationStatusResponse, 1) resultChan := make(chan OperationStatusResponse, 1)
errChan := make(chan error, 1) errChan := make(chan error, 1)
...@@ -144,8 +137,10 @@ func (client VirtualMachineExtensionsClient) Delete(resourceGroupName string, VM ...@@ -144,8 +137,10 @@ func (client VirtualMachineExtensionsClient) Delete(resourceGroupName string, VM
var err error var err error
var result OperationStatusResponse var result OperationStatusResponse
defer func() { defer func() {
if err != nil {
errChan <- err
}
resultChan <- result resultChan <- result
errChan <- err
close(resultChan) close(resultChan)
close(errChan) close(errChan)
}() }()
...@@ -179,7 +174,7 @@ func (client VirtualMachineExtensionsClient) DeletePreparer(resourceGroupName st ...@@ -179,7 +174,7 @@ func (client VirtualMachineExtensionsClient) DeletePreparer(resourceGroupName st
"vmName": autorest.Encode("path", VMName), "vmName": autorest.Encode("path", VMName),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -215,9 +210,8 @@ func (client VirtualMachineExtensionsClient) DeleteResponder(resp *http.Response ...@@ -215,9 +210,8 @@ func (client VirtualMachineExtensionsClient) DeleteResponder(resp *http.Response
// Get the operation to get the extension. // Get the operation to get the extension.
// //
// resourceGroupName is the name of the resource group. VMName is the name of // resourceGroupName is the name of the resource group. VMName is the name of the virtual machine containing the
// the virtual machine containing the extension. VMExtensionName is the name of // extension. VMExtensionName is the name of the virtual machine extension. expand is the expand expression to apply on
// the virtual machine extension. expand is the expand expression to apply on
// the operation. // the operation.
func (client VirtualMachineExtensionsClient) Get(resourceGroupName string, VMName string, VMExtensionName string, expand string) (result VirtualMachineExtension, err error) { func (client VirtualMachineExtensionsClient) Get(resourceGroupName string, VMName string, VMExtensionName string, expand string) (result VirtualMachineExtension, err error) {
req, err := client.GetPreparer(resourceGroupName, VMName, VMExtensionName, expand) req, err := client.GetPreparer(resourceGroupName, VMName, VMExtensionName, expand)
...@@ -250,7 +244,7 @@ func (client VirtualMachineExtensionsClient) GetPreparer(resourceGroupName strin ...@@ -250,7 +244,7 @@ func (client VirtualMachineExtensionsClient) GetPreparer(resourceGroupName strin
"vmName": autorest.Encode("path", VMName), "vmName": autorest.Encode("path", VMName),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
......
...@@ -14,9 +14,8 @@ package compute ...@@ -14,9 +14,8 @@ package compute
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
...@@ -24,28 +23,25 @@ import ( ...@@ -24,28 +23,25 @@ import (
"net/http" "net/http"
) )
// VirtualMachineImagesClient is the the Compute Management Client. // VirtualMachineImagesClient is the compute Client
type VirtualMachineImagesClient struct { type VirtualMachineImagesClient struct {
ManagementClient ManagementClient
} }
// NewVirtualMachineImagesClient creates an instance of the // NewVirtualMachineImagesClient creates an instance of the VirtualMachineImagesClient client.
// VirtualMachineImagesClient client.
func NewVirtualMachineImagesClient(subscriptionID string) VirtualMachineImagesClient { func NewVirtualMachineImagesClient(subscriptionID string) VirtualMachineImagesClient {
return NewVirtualMachineImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) return NewVirtualMachineImagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
} }
// NewVirtualMachineImagesClientWithBaseURI creates an instance of the // NewVirtualMachineImagesClientWithBaseURI creates an instance of the VirtualMachineImagesClient client.
// VirtualMachineImagesClient client.
func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineImagesClient { func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineImagesClient {
return VirtualMachineImagesClient{NewWithBaseURI(baseURI, subscriptionID)} return VirtualMachineImagesClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// Get gets a virtual machine image. // Get gets a virtual machine image.
// //
// location is the name of a supported Azure region. publisherName is a valid // location is the name of a supported Azure region. publisherName is a valid image publisher. offer is a valid image
// image publisher. offer is a valid image publisher offer. skus is a valid // publisher offer. skus is a valid image SKU. version is a valid image SKU version.
// 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) { 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) req, err := client.GetPreparer(location, publisherName, offer, skus, version)
if err != nil { if err != nil {
...@@ -79,7 +75,7 @@ func (client VirtualMachineImagesClient) GetPreparer(location string, publisherN ...@@ -79,7 +75,7 @@ func (client VirtualMachineImagesClient) GetPreparer(location string, publisherN
"version": autorest.Encode("path", version), "version": autorest.Encode("path", version),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -111,12 +107,10 @@ func (client VirtualMachineImagesClient) GetResponder(resp *http.Response) (resu ...@@ -111,12 +107,10 @@ func (client VirtualMachineImagesClient) GetResponder(resp *http.Response) (resu
return return
} }
// List gets a list of all virtual machine image versions for the specified // List gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU.
// location, publisher, offer, and SKU.
// //
// location is the name of a supported Azure region. publisherName is a valid // location is the name of a supported Azure region. publisherName is a valid image publisher. offer is a valid image
// image publisher. offer is a valid image publisher offer. skus is a valid // publisher offer. skus is a valid image SKU. filter is the filter to apply on the operation.
// 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) { 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) req, err := client.ListPreparer(location, publisherName, offer, skus, filter, top, orderby)
if err != nil { if err != nil {
...@@ -149,7 +143,7 @@ func (client VirtualMachineImagesClient) ListPreparer(location string, publisher ...@@ -149,7 +143,7 @@ func (client VirtualMachineImagesClient) ListPreparer(location string, publisher
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -190,11 +184,9 @@ func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (res ...@@ -190,11 +184,9 @@ func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (res
return return
} }
// ListOffers gets a list of virtual machine image offers for the specified // ListOffers gets a list of virtual machine image offers for the specified location and publisher.
// location and publisher.
// //
// location is the name of a supported Azure region. publisherName is a valid // location is the name of a supported Azure region. publisherName is a valid image publisher.
// image publisher.
func (client VirtualMachineImagesClient) ListOffers(location string, publisherName string) (result ListVirtualMachineImageResource, err error) { func (client VirtualMachineImagesClient) ListOffers(location string, publisherName string) (result ListVirtualMachineImageResource, err error) {
req, err := client.ListOffersPreparer(location, publisherName) req, err := client.ListOffersPreparer(location, publisherName)
if err != nil { if err != nil {
...@@ -225,7 +217,7 @@ func (client VirtualMachineImagesClient) ListOffersPreparer(location string, pub ...@@ -225,7 +217,7 @@ func (client VirtualMachineImagesClient) ListOffersPreparer(location string, pub
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -257,8 +249,7 @@ func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response ...@@ -257,8 +249,7 @@ func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response
return return
} }
// ListPublishers gets a list of virtual machine image publishers for the // ListPublishers gets a list of virtual machine image publishers for the specified Azure location.
// specified Azure location.
// //
// location is the name of a supported Azure region. // location is the name of a supported Azure region.
func (client VirtualMachineImagesClient) ListPublishers(location string) (result ListVirtualMachineImageResource, err error) { func (client VirtualMachineImagesClient) ListPublishers(location string) (result ListVirtualMachineImageResource, err error) {
...@@ -290,7 +281,7 @@ func (client VirtualMachineImagesClient) ListPublishersPreparer(location string) ...@@ -290,7 +281,7 @@ func (client VirtualMachineImagesClient) ListPublishersPreparer(location string)
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -322,11 +313,10 @@ func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Resp ...@@ -322,11 +313,10 @@ func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Resp
return return
} }
// ListSkus gets a list of virtual machine image SKUs for the specified // ListSkus gets a list of virtual machine image SKUs for the specified location, publisher, and offer.
// location, publisher, and offer.
// //
// location is the name of a supported Azure region. publisherName is a valid // location is the name of a supported Azure region. publisherName is a valid image publisher. offer is a valid image
// image publisher. offer is a valid image publisher offer. // publisher offer.
func (client VirtualMachineImagesClient) ListSkus(location string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) { func (client VirtualMachineImagesClient) ListSkus(location string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) {
req, err := client.ListSkusPreparer(location, publisherName, offer) req, err := client.ListSkusPreparer(location, publisherName, offer)
if err != nil { if err != nil {
...@@ -358,7 +348,7 @@ func (client VirtualMachineImagesClient) ListSkusPreparer(location string, publi ...@@ -358,7 +348,7 @@ func (client VirtualMachineImagesClient) ListSkusPreparer(location string, publi
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
......
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
}
...@@ -14,9 +14,8 @@ package compute ...@@ -14,9 +14,8 @@ package compute
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
...@@ -25,25 +24,22 @@ import ( ...@@ -25,25 +24,22 @@ import (
"net/http" "net/http"
) )
// VirtualMachineSizesClient is the the Compute Management Client. // VirtualMachineSizesClient is the compute Client
type VirtualMachineSizesClient struct { type VirtualMachineSizesClient struct {
ManagementClient ManagementClient
} }
// NewVirtualMachineSizesClient creates an instance of the // NewVirtualMachineSizesClient creates an instance of the VirtualMachineSizesClient client.
// VirtualMachineSizesClient client.
func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient { func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient {
return NewVirtualMachineSizesClientWithBaseURI(DefaultBaseURI, subscriptionID) return NewVirtualMachineSizesClientWithBaseURI(DefaultBaseURI, subscriptionID)
} }
// NewVirtualMachineSizesClientWithBaseURI creates an instance of the // NewVirtualMachineSizesClientWithBaseURI creates an instance of the VirtualMachineSizesClient client.
// VirtualMachineSizesClient client.
func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineSizesClient { func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineSizesClient {
return VirtualMachineSizesClient{NewWithBaseURI(baseURI, subscriptionID)} return VirtualMachineSizesClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// List lists all available virtual machine sizes for a subscription in a // List lists all available virtual machine sizes for a subscription in a location.
// location.
// //
// location is the location upon which virtual-machine-sizes is queried. // location is the location upon which virtual-machine-sizes is queried.
func (client VirtualMachineSizesClient) List(location string) (result VirtualMachineSizeListResult, err error) { func (client VirtualMachineSizesClient) List(location string) (result VirtualMachineSizeListResult, err error) {
...@@ -81,7 +77,7 @@ func (client VirtualMachineSizesClient) ListPreparer(location string) (*http.Req ...@@ -81,7 +77,7 @@ func (client VirtualMachineSizesClient) ListPreparer(location string) (*http.Req
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2016-04-30-preview" const APIVersion = "2017-03-30"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
......
...@@ -7,7 +7,9 @@ go_library( ...@@ -7,7 +7,9 @@ go_library(
"models.go", "models.go",
"operations.go", "operations.go",
"registries.go", "registries.go",
"replications.go",
"version.go", "version.go",
"webhooks.go",
], ],
importpath = "github.com/Azure/azure-sdk-for-go/arm/containerregistry", importpath = "github.com/Azure/azure-sdk-for-go/arm/containerregistry",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
......
// Package containerregistry implements the Azure ARM Containerregistry service // Package containerregistry implements the Azure ARM Containerregistry service API version 2017-10-01.
// API version 2017-03-01.
// //
// //
package containerregistry package containerregistry
...@@ -18,9 +17,8 @@ package containerregistry ...@@ -18,9 +17,8 @@ package containerregistry
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
......
...@@ -14,9 +14,8 @@ package containerregistry ...@@ -14,9 +14,8 @@ package containerregistry
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
...@@ -24,8 +23,7 @@ import ( ...@@ -24,8 +23,7 @@ import (
"net/http" "net/http"
) )
// OperationsClient is the client for the Operations methods of the // OperationsClient is the client for the Operations methods of the Containerregistry service.
// Containerregistry service.
type OperationsClient struct { type OperationsClient struct {
ManagementClient ManagementClient
} }
...@@ -35,14 +33,12 @@ func NewOperationsClient(subscriptionID string) OperationsClient { ...@@ -35,14 +33,12 @@ func NewOperationsClient(subscriptionID string) OperationsClient {
return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
} }
// NewOperationsClientWithBaseURI creates an instance of the OperationsClient // NewOperationsClientWithBaseURI creates an instance of the OperationsClient client.
// client.
func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// List lists all of the available Azure Container Registry REST API // List lists all of the available Azure Container Registry REST API operations.
// operations.
func (client OperationsClient) List() (result OperationListResult, err error) { func (client OperationsClient) List() (result OperationListResult, err error) {
req, err := client.ListPreparer() req, err := client.ListPreparer()
if err != nil { if err != nil {
...@@ -67,7 +63,7 @@ func (client OperationsClient) List() (result OperationListResult, err error) { ...@@ -67,7 +63,7 @@ func (client OperationsClient) List() (result OperationListResult, err error) {
// ListPreparer prepares the List request. // ListPreparer prepares the List request.
func (client OperationsClient) ListPreparer() (*http.Request, error) { func (client OperationsClient) ListPreparer() (*http.Request, error) {
const APIVersion = "2017-03-01" const APIVersion = "2017-10-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -122,3 +118,48 @@ func (client OperationsClient) ListNextResults(lastResults OperationListResult) ...@@ -122,3 +118,48 @@ func (client OperationsClient) ListNextResults(lastResults OperationListResult)
return 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
}
...@@ -14,16 +14,15 @@ package containerregistry ...@@ -14,16 +14,15 @@ package containerregistry
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
// UserAgent returns the UserAgent string to use when sending http.Requests. // UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string { 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. // Version returns the semantic version (see http://semver.org) of the client.
func Version() string { func Version() string {
return "v10.0.2-beta" return "v11.1.0-beta"
} }
...@@ -14,16 +14,15 @@ package disk ...@@ -14,16 +14,15 @@ package disk
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // 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 // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
// UserAgent returns the UserAgent string to use when sending http.Requests. // UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string { 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. // Version returns the semantic version (see http://semver.org) of the client.
func Version() string { func Version() string {
return "v10.0.2-beta" return "v10.2.0-beta"
} }
...@@ -4,13 +4,24 @@ go_library( ...@@ -4,13 +4,24 @@ go_library(
name = "go_default_library", name = "go_default_library",
srcs = [ srcs = [
"applicationgateways.go", "applicationgateways.go",
"applicationsecuritygroups.go",
"availableendpointservices.go",
"bgpservicecommunities.go", "bgpservicecommunities.go",
"client.go", "client.go",
"defaultsecurityrules.go",
"expressroutecircuitauthorizations.go", "expressroutecircuitauthorizations.go",
"expressroutecircuitpeerings.go", "expressroutecircuitpeerings.go",
"expressroutecircuits.go", "expressroutecircuits.go",
"expressrouteserviceproviders.go", "expressrouteserviceproviders.go",
"inboundnatrules.go",
"interfaceipconfigurations.go",
"interfaceloadbalancers.go",
"interfaces.go", "interfaces.go",
"loadbalancerbackendaddresspools.go",
"loadbalancerfrontendipconfigurations.go",
"loadbalancerloadbalancingrules.go",
"loadbalancernetworkinterfaces.go",
"loadbalancerprobes.go",
"loadbalancers.go", "loadbalancers.go",
"localnetworkgateways.go", "localnetworkgateways.go",
"models.go", "models.go",
......
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
}
...@@ -14,9 +14,8 @@ package network ...@@ -14,9 +14,8 @@ package network
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
...@@ -24,19 +23,17 @@ import ( ...@@ -24,19 +23,17 @@ import (
"net/http" "net/http"
) )
// BgpServiceCommunitiesClient is the composite Swagger for Network Client // BgpServiceCommunitiesClient is the network Client
type BgpServiceCommunitiesClient struct { type BgpServiceCommunitiesClient struct {
ManagementClient ManagementClient
} }
// NewBgpServiceCommunitiesClient creates an instance of the // NewBgpServiceCommunitiesClient creates an instance of the BgpServiceCommunitiesClient client.
// BgpServiceCommunitiesClient client.
func NewBgpServiceCommunitiesClient(subscriptionID string) BgpServiceCommunitiesClient { func NewBgpServiceCommunitiesClient(subscriptionID string) BgpServiceCommunitiesClient {
return NewBgpServiceCommunitiesClientWithBaseURI(DefaultBaseURI, subscriptionID) return NewBgpServiceCommunitiesClientWithBaseURI(DefaultBaseURI, subscriptionID)
} }
// NewBgpServiceCommunitiesClientWithBaseURI creates an instance of the // NewBgpServiceCommunitiesClientWithBaseURI creates an instance of the BgpServiceCommunitiesClient client.
// BgpServiceCommunitiesClient client.
func NewBgpServiceCommunitiesClientWithBaseURI(baseURI string, subscriptionID string) BgpServiceCommunitiesClient { func NewBgpServiceCommunitiesClientWithBaseURI(baseURI string, subscriptionID string) BgpServiceCommunitiesClient {
return BgpServiceCommunitiesClient{NewWithBaseURI(baseURI, subscriptionID)} return BgpServiceCommunitiesClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
...@@ -70,7 +67,7 @@ func (client BgpServiceCommunitiesClient) ListPreparer() (*http.Request, error) ...@@ -70,7 +67,7 @@ func (client BgpServiceCommunitiesClient) ListPreparer() (*http.Request, error)
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -125,3 +122,48 @@ func (client BgpServiceCommunitiesClient) ListNextResults(lastResults BgpService ...@@ -125,3 +122,48 @@ func (client BgpServiceCommunitiesClient) ListNextResults(lastResults BgpService
return 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
}
// Package network implements the Azure ARM Network service API version . // Package network implements the Azure ARM Network service API version .
// //
// Composite Swagger for Network Client // Network Client
package network package network
// Copyright (c) Microsoft and contributors. All rights reserved. // Copyright (c) Microsoft and contributors. All rights reserved.
...@@ -17,9 +17,8 @@ package network ...@@ -17,9 +17,8 @@ package network
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
...@@ -53,12 +52,10 @@ func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient { ...@@ -53,12 +52,10 @@ func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
} }
} }
// CheckDNSNameAvailability checks whether a domain name in the cloudapp.net // CheckDNSNameAvailability checks whether a domain name in the cloudapp.azure.com zone is available for use.
// zone is available for use.
// //
// location is the location of the domain name. domainNameLabel is the domain // location is the location of the domain name. domainNameLabel is the domain name to be verified. It must conform to
// name to be verified. It must conform to the following regular expression: // the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.
// ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.
func (client ManagementClient) CheckDNSNameAvailability(location string, domainNameLabel string) (result DNSNameAvailabilityResult, err error) { func (client ManagementClient) CheckDNSNameAvailability(location string, domainNameLabel string) (result DNSNameAvailabilityResult, err error) {
req, err := client.CheckDNSNameAvailabilityPreparer(location, domainNameLabel) req, err := client.CheckDNSNameAvailabilityPreparer(location, domainNameLabel)
if err != nil { if err != nil {
...@@ -88,12 +85,10 @@ func (client ManagementClient) CheckDNSNameAvailabilityPreparer(location string, ...@@ -88,12 +85,10 @@ func (client ManagementClient) CheckDNSNameAvailabilityPreparer(location string,
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} "domainNameLabel": autorest.Encode("query", domainNameLabel),
if len(domainNameLabel) > 0 {
queryParameters["domainNameLabel"] = autorest.Encode("query", domainNameLabel)
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
......
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
}
...@@ -14,9 +14,8 @@ package network ...@@ -14,9 +14,8 @@ package network
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
...@@ -24,33 +23,30 @@ import ( ...@@ -24,33 +23,30 @@ import (
"net/http" "net/http"
) )
// ExpressRouteCircuitAuthorizationsClient is the composite Swagger for Network // ExpressRouteCircuitAuthorizationsClient is the network Client
// Client
type ExpressRouteCircuitAuthorizationsClient struct { type ExpressRouteCircuitAuthorizationsClient struct {
ManagementClient ManagementClient
} }
// NewExpressRouteCircuitAuthorizationsClient creates an instance of the // NewExpressRouteCircuitAuthorizationsClient creates an instance of the ExpressRouteCircuitAuthorizationsClient
// ExpressRouteCircuitAuthorizationsClient client. // client.
func NewExpressRouteCircuitAuthorizationsClient(subscriptionID string) ExpressRouteCircuitAuthorizationsClient { func NewExpressRouteCircuitAuthorizationsClient(subscriptionID string) ExpressRouteCircuitAuthorizationsClient {
return NewExpressRouteCircuitAuthorizationsClientWithBaseURI(DefaultBaseURI, subscriptionID) return NewExpressRouteCircuitAuthorizationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
} }
// NewExpressRouteCircuitAuthorizationsClientWithBaseURI creates an instance of // NewExpressRouteCircuitAuthorizationsClientWithBaseURI creates an instance of the
// the ExpressRouteCircuitAuthorizationsClient client. // ExpressRouteCircuitAuthorizationsClient client.
func NewExpressRouteCircuitAuthorizationsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitAuthorizationsClient { func NewExpressRouteCircuitAuthorizationsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitAuthorizationsClient {
return ExpressRouteCircuitAuthorizationsClient{NewWithBaseURI(baseURI, subscriptionID)} return ExpressRouteCircuitAuthorizationsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate creates or updates an authorization in the specified express // CreateOrUpdate creates or updates an authorization in the specified express route circuit. This method may poll for
// route circuit. This method may poll for completion. Polling can be canceled // completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel
// by passing the cancel channel argument. The channel will be used to cancel
// polling and any outstanding HTTP requests. // polling and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. circuitName is the name // resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit.
// of the express route circuit. authorizationName is the name of the // authorizationName is the name of the authorization. authorizationParameters is parameters supplied to the create or
// authorization. authorizationParameters is parameters supplied to the create // update express route circuit authorization operation.
// 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) { func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization, cancel <-chan struct{}) (<-chan ExpressRouteCircuitAuthorization, <-chan error) {
resultChan := make(chan ExpressRouteCircuitAuthorization, 1) resultChan := make(chan ExpressRouteCircuitAuthorization, 1)
errChan := make(chan error, 1) errChan := make(chan error, 1)
...@@ -58,8 +54,10 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(resourceGro ...@@ -58,8 +54,10 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(resourceGro
var err error var err error
var result ExpressRouteCircuitAuthorization var result ExpressRouteCircuitAuthorization
defer func() { defer func() {
if err != nil {
errChan <- err
}
resultChan <- result resultChan <- result
errChan <- err
close(resultChan) close(resultChan)
close(errChan) close(errChan)
}() }()
...@@ -93,7 +91,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdatePreparer(res ...@@ -93,7 +91,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdatePreparer(res
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -129,14 +127,12 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateResponder(re ...@@ -129,14 +127,12 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateResponder(re
return return
} }
// Delete deletes the specified authorization from the specified express route // Delete deletes the specified authorization from the specified express route circuit. This method may poll for
// circuit. This method may poll for completion. Polling can be canceled by // completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel
// passing the cancel channel argument. The channel will be used to cancel
// polling and any outstanding HTTP requests. // polling and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. circuitName is the name // resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit.
// of the express route circuit. authorizationName is the name of the // authorizationName is the name of the authorization.
// authorization.
func (client ExpressRouteCircuitAuthorizationsClient) Delete(resourceGroupName string, circuitName string, authorizationName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { func (client ExpressRouteCircuitAuthorizationsClient) Delete(resourceGroupName string, circuitName string, authorizationName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
resultChan := make(chan autorest.Response, 1) resultChan := make(chan autorest.Response, 1)
errChan := make(chan error, 1) errChan := make(chan error, 1)
...@@ -144,8 +140,10 @@ func (client ExpressRouteCircuitAuthorizationsClient) Delete(resourceGroupName s ...@@ -144,8 +140,10 @@ func (client ExpressRouteCircuitAuthorizationsClient) Delete(resourceGroupName s
var err error var err error
var result autorest.Response var result autorest.Response
defer func() { defer func() {
if err != nil {
errChan <- err
}
resultChan <- result resultChan <- result
errChan <- err
close(resultChan) close(resultChan)
close(errChan) close(errChan)
}() }()
...@@ -179,7 +177,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) DeletePreparer(resourceGro ...@@ -179,7 +177,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) DeletePreparer(resourceGro
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -212,12 +210,10 @@ func (client ExpressRouteCircuitAuthorizationsClient) DeleteResponder(resp *http ...@@ -212,12 +210,10 @@ func (client ExpressRouteCircuitAuthorizationsClient) DeleteResponder(resp *http
return return
} }
// Get gets the specified authorization from the specified express route // Get gets the specified authorization from the specified express route circuit.
// circuit.
// //
// resourceGroupName is the name of the resource group. circuitName is the name // resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit.
// of the express route circuit. authorizationName is the name of the // authorizationName is the name of the authorization.
// authorization.
func (client ExpressRouteCircuitAuthorizationsClient) Get(resourceGroupName string, circuitName string, authorizationName string) (result ExpressRouteCircuitAuthorization, err error) { func (client ExpressRouteCircuitAuthorizationsClient) Get(resourceGroupName string, circuitName string, authorizationName string) (result ExpressRouteCircuitAuthorization, err error) {
req, err := client.GetPreparer(resourceGroupName, circuitName, authorizationName) req, err := client.GetPreparer(resourceGroupName, circuitName, authorizationName)
if err != nil { if err != nil {
...@@ -249,7 +245,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) GetPreparer(resourceGroupN ...@@ -249,7 +245,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) GetPreparer(resourceGroupN
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -283,8 +279,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) GetResponder(resp *http.Re ...@@ -283,8 +279,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) GetResponder(resp *http.Re
// List gets all authorizations in an express route circuit. // List gets all authorizations in an express route circuit.
// //
// resourceGroupName is the name of the resource group. circuitName is the name // resourceGroupName is the name of the resource group. circuitName is the name of the circuit.
// of the circuit.
func (client ExpressRouteCircuitAuthorizationsClient) List(resourceGroupName string, circuitName string) (result AuthorizationListResult, err error) { func (client ExpressRouteCircuitAuthorizationsClient) List(resourceGroupName string, circuitName string) (result AuthorizationListResult, err error) {
req, err := client.ListPreparer(resourceGroupName, circuitName) req, err := client.ListPreparer(resourceGroupName, circuitName)
if err != nil { if err != nil {
...@@ -315,7 +310,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) ListPreparer(resourceGroup ...@@ -315,7 +310,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) ListPreparer(resourceGroup
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -370,3 +365,48 @@ func (client ExpressRouteCircuitAuthorizationsClient) ListNextResults(lastResult ...@@ -370,3 +365,48 @@ func (client ExpressRouteCircuitAuthorizationsClient) ListNextResults(lastResult
return 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
}
...@@ -14,9 +14,8 @@ package network ...@@ -14,9 +14,8 @@ package network
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
...@@ -24,32 +23,27 @@ import ( ...@@ -24,32 +23,27 @@ import (
"net/http" "net/http"
) )
// ExpressRouteCircuitPeeringsClient is the composite Swagger for Network // ExpressRouteCircuitPeeringsClient is the network Client
// Client
type ExpressRouteCircuitPeeringsClient struct { type ExpressRouteCircuitPeeringsClient struct {
ManagementClient ManagementClient
} }
// NewExpressRouteCircuitPeeringsClient creates an instance of the // NewExpressRouteCircuitPeeringsClient creates an instance of the ExpressRouteCircuitPeeringsClient client.
// ExpressRouteCircuitPeeringsClient client.
func NewExpressRouteCircuitPeeringsClient(subscriptionID string) ExpressRouteCircuitPeeringsClient { func NewExpressRouteCircuitPeeringsClient(subscriptionID string) ExpressRouteCircuitPeeringsClient {
return NewExpressRouteCircuitPeeringsClientWithBaseURI(DefaultBaseURI, subscriptionID) return NewExpressRouteCircuitPeeringsClientWithBaseURI(DefaultBaseURI, subscriptionID)
} }
// NewExpressRouteCircuitPeeringsClientWithBaseURI creates an instance of the // NewExpressRouteCircuitPeeringsClientWithBaseURI creates an instance of the ExpressRouteCircuitPeeringsClient client.
// ExpressRouteCircuitPeeringsClient client.
func NewExpressRouteCircuitPeeringsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitPeeringsClient { func NewExpressRouteCircuitPeeringsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitPeeringsClient {
return ExpressRouteCircuitPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)} return ExpressRouteCircuitPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate creates or updates a peering in the specified express route // CreateOrUpdate creates or updates a peering in the specified express route circuits. This method may poll for
// circuits. This method may poll for completion. Polling can be canceled by // completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel
// passing the cancel channel argument. The channel will be used to cancel
// polling and any outstanding HTTP requests. // polling and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. circuitName is the name // resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit.
// of the express route circuit. peeringName is the name of the peering. // peeringName is the name of the peering. peeringParameters is parameters supplied to the create or update express
// peeringParameters is parameters supplied to the create or update express
// route circuit peering operation. // route circuit peering operation.
func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering, cancel <-chan struct{}) (<-chan ExpressRouteCircuitPeering, <-chan error) { func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering, cancel <-chan struct{}) (<-chan ExpressRouteCircuitPeering, <-chan error) {
resultChan := make(chan ExpressRouteCircuitPeering, 1) resultChan := make(chan ExpressRouteCircuitPeering, 1)
...@@ -58,8 +52,10 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(resourceGroupName ...@@ -58,8 +52,10 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(resourceGroupName
var err error var err error
var result ExpressRouteCircuitPeering var result ExpressRouteCircuitPeering
defer func() { defer func() {
if err != nil {
errChan <- err
}
resultChan <- result resultChan <- result
errChan <- err
close(resultChan) close(resultChan)
close(errChan) close(errChan)
}() }()
...@@ -93,7 +89,7 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdatePreparer(resourceG ...@@ -93,7 +89,7 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdatePreparer(resourceG
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -129,13 +125,12 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateResponder(resp *ht ...@@ -129,13 +125,12 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateResponder(resp *ht
return return
} }
// Delete deletes the specified peering from the specified express route // Delete deletes the specified peering from the specified express route circuit. This method may poll for completion.
// circuit. This method may poll for completion. Polling can be canceled by // Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel polling and any
// passing the cancel channel argument. The channel will be used to cancel // outstanding HTTP requests.
// polling and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. circuitName is the name // resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit.
// of the express route circuit. peeringName is the name of the peering. // 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) { func (client ExpressRouteCircuitPeeringsClient) Delete(resourceGroupName string, circuitName string, peeringName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
resultChan := make(chan autorest.Response, 1) resultChan := make(chan autorest.Response, 1)
errChan := make(chan error, 1) errChan := make(chan error, 1)
...@@ -143,8 +138,10 @@ func (client ExpressRouteCircuitPeeringsClient) Delete(resourceGroupName string, ...@@ -143,8 +138,10 @@ func (client ExpressRouteCircuitPeeringsClient) Delete(resourceGroupName string,
var err error var err error
var result autorest.Response var result autorest.Response
defer func() { defer func() {
if err != nil {
errChan <- err
}
resultChan <- result resultChan <- result
errChan <- err
close(resultChan) close(resultChan)
close(errChan) close(errChan)
}() }()
...@@ -178,7 +175,7 @@ func (client ExpressRouteCircuitPeeringsClient) DeletePreparer(resourceGroupName ...@@ -178,7 +175,7 @@ func (client ExpressRouteCircuitPeeringsClient) DeletePreparer(resourceGroupName
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -211,11 +208,10 @@ func (client ExpressRouteCircuitPeeringsClient) DeleteResponder(resp *http.Respo ...@@ -211,11 +208,10 @@ func (client ExpressRouteCircuitPeeringsClient) DeleteResponder(resp *http.Respo
return return
} }
// Get gets the specified authorization from the specified express route // Get gets the specified authorization from the specified express route circuit.
// circuit.
// //
// resourceGroupName is the name of the resource group. circuitName is the name // resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit.
// of the express route circuit. peeringName is the name of the peering. // peeringName is the name of the peering.
func (client ExpressRouteCircuitPeeringsClient) Get(resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitPeering, err error) { func (client ExpressRouteCircuitPeeringsClient) Get(resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitPeering, err error) {
req, err := client.GetPreparer(resourceGroupName, circuitName, peeringName) req, err := client.GetPreparer(resourceGroupName, circuitName, peeringName)
if err != nil { if err != nil {
...@@ -247,7 +243,7 @@ func (client ExpressRouteCircuitPeeringsClient) GetPreparer(resourceGroupName st ...@@ -247,7 +243,7 @@ func (client ExpressRouteCircuitPeeringsClient) GetPreparer(resourceGroupName st
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -281,8 +277,7 @@ func (client ExpressRouteCircuitPeeringsClient) GetResponder(resp *http.Response ...@@ -281,8 +277,7 @@ func (client ExpressRouteCircuitPeeringsClient) GetResponder(resp *http.Response
// List gets all peerings in a specified express route circuit. // List gets all peerings in a specified express route circuit.
// //
// resourceGroupName is the name of the resource group. circuitName is the name // resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit.
// of the express route circuit.
func (client ExpressRouteCircuitPeeringsClient) List(resourceGroupName string, circuitName string) (result ExpressRouteCircuitPeeringListResult, err error) { func (client ExpressRouteCircuitPeeringsClient) List(resourceGroupName string, circuitName string) (result ExpressRouteCircuitPeeringListResult, err error) {
req, err := client.ListPreparer(resourceGroupName, circuitName) req, err := client.ListPreparer(resourceGroupName, circuitName)
if err != nil { if err != nil {
...@@ -313,7 +308,7 @@ func (client ExpressRouteCircuitPeeringsClient) ListPreparer(resourceGroupName s ...@@ -313,7 +308,7 @@ func (client ExpressRouteCircuitPeeringsClient) ListPreparer(resourceGroupName s
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -368,3 +363,48 @@ func (client ExpressRouteCircuitPeeringsClient) ListNextResults(lastResults Expr ...@@ -368,3 +363,48 @@ func (client ExpressRouteCircuitPeeringsClient) ListNextResults(lastResults Expr
return 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
}
...@@ -14,9 +14,8 @@ package network ...@@ -14,9 +14,8 @@ package network
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
...@@ -24,20 +23,18 @@ import ( ...@@ -24,20 +23,18 @@ import (
"net/http" "net/http"
) )
// ExpressRouteServiceProvidersClient is the composite Swagger for Network // ExpressRouteServiceProvidersClient is the network Client
// Client
type ExpressRouteServiceProvidersClient struct { type ExpressRouteServiceProvidersClient struct {
ManagementClient ManagementClient
} }
// NewExpressRouteServiceProvidersClient creates an instance of the // NewExpressRouteServiceProvidersClient creates an instance of the ExpressRouteServiceProvidersClient client.
// ExpressRouteServiceProvidersClient client.
func NewExpressRouteServiceProvidersClient(subscriptionID string) ExpressRouteServiceProvidersClient { func NewExpressRouteServiceProvidersClient(subscriptionID string) ExpressRouteServiceProvidersClient {
return NewExpressRouteServiceProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID) return NewExpressRouteServiceProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID)
} }
// NewExpressRouteServiceProvidersClientWithBaseURI creates an instance of the // NewExpressRouteServiceProvidersClientWithBaseURI creates an instance of the ExpressRouteServiceProvidersClient
// ExpressRouteServiceProvidersClient client. // client.
func NewExpressRouteServiceProvidersClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteServiceProvidersClient { func NewExpressRouteServiceProvidersClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteServiceProvidersClient {
return ExpressRouteServiceProvidersClient{NewWithBaseURI(baseURI, subscriptionID)} return ExpressRouteServiceProvidersClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
...@@ -71,7 +68,7 @@ func (client ExpressRouteServiceProvidersClient) ListPreparer() (*http.Request, ...@@ -71,7 +68,7 @@ func (client ExpressRouteServiceProvidersClient) ListPreparer() (*http.Request,
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -126,3 +123,48 @@ func (client ExpressRouteServiceProvidersClient) ListNextResults(lastResults Exp ...@@ -126,3 +123,48 @@ func (client ExpressRouteServiceProvidersClient) ListNextResults(lastResults Exp
return 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
}
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
}
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
}
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
}
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
}
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
}
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
}
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
}
...@@ -14,9 +14,8 @@ package network ...@@ -14,9 +14,8 @@ package network
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
...@@ -24,31 +23,26 @@ import ( ...@@ -24,31 +23,26 @@ import (
"net/http" "net/http"
) )
// LoadBalancersClient is the composite Swagger for Network Client // LoadBalancersClient is the network Client
type LoadBalancersClient struct { type LoadBalancersClient struct {
ManagementClient ManagementClient
} }
// NewLoadBalancersClient creates an instance of the LoadBalancersClient // NewLoadBalancersClient creates an instance of the LoadBalancersClient client.
// client.
func NewLoadBalancersClient(subscriptionID string) LoadBalancersClient { func NewLoadBalancersClient(subscriptionID string) LoadBalancersClient {
return NewLoadBalancersClientWithBaseURI(DefaultBaseURI, subscriptionID) return NewLoadBalancersClientWithBaseURI(DefaultBaseURI, subscriptionID)
} }
// NewLoadBalancersClientWithBaseURI creates an instance of the // NewLoadBalancersClientWithBaseURI creates an instance of the LoadBalancersClient client.
// LoadBalancersClient client.
func NewLoadBalancersClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancersClient { func NewLoadBalancersClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancersClient {
return LoadBalancersClient{NewWithBaseURI(baseURI, subscriptionID)} return LoadBalancersClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate creates or updates a load balancer. This method may poll for // CreateOrUpdate creates or updates a load balancer. This method may poll for completion. Polling can be canceled by
// completion. Polling can be canceled by passing the cancel channel argument. // passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
// The channel will be used to cancel polling and any outstanding HTTP
// requests.
// //
// resourceGroupName is the name of the resource group. loadBalancerName is the // resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. parameters
// name of the load balancer. parameters is parameters supplied to the create // is parameters supplied to the create or update load balancer operation.
// or update load balancer operation.
func (client LoadBalancersClient) CreateOrUpdate(resourceGroupName string, loadBalancerName string, parameters LoadBalancer, cancel <-chan struct{}) (<-chan LoadBalancer, <-chan error) { func (client LoadBalancersClient) CreateOrUpdate(resourceGroupName string, loadBalancerName string, parameters LoadBalancer, cancel <-chan struct{}) (<-chan LoadBalancer, <-chan error) {
resultChan := make(chan LoadBalancer, 1) resultChan := make(chan LoadBalancer, 1)
errChan := make(chan error, 1) errChan := make(chan error, 1)
...@@ -56,8 +50,10 @@ func (client LoadBalancersClient) CreateOrUpdate(resourceGroupName string, loadB ...@@ -56,8 +50,10 @@ func (client LoadBalancersClient) CreateOrUpdate(resourceGroupName string, loadB
var err error var err error
var result LoadBalancer var result LoadBalancer
defer func() { defer func() {
if err != nil {
errChan <- err
}
resultChan <- result resultChan <- result
errChan <- err
close(resultChan) close(resultChan)
close(errChan) close(errChan)
}() }()
...@@ -90,7 +86,7 @@ func (client LoadBalancersClient) CreateOrUpdatePreparer(resourceGroupName strin ...@@ -90,7 +86,7 @@ func (client LoadBalancersClient) CreateOrUpdatePreparer(resourceGroupName strin
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -126,13 +122,10 @@ func (client LoadBalancersClient) CreateOrUpdateResponder(resp *http.Response) ( ...@@ -126,13 +122,10 @@ func (client LoadBalancersClient) CreateOrUpdateResponder(resp *http.Response) (
return return
} }
// Delete deletes the specified load balancer. This method may poll for // Delete deletes the specified load balancer. This method may poll for completion. Polling can be canceled by passing
// completion. Polling can be canceled by passing the cancel channel argument. // the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
// The channel will be used to cancel polling and any outstanding HTTP
// requests.
// //
// resourceGroupName is the name of the resource group. loadBalancerName is the // resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer.
// name of the load balancer.
func (client LoadBalancersClient) Delete(resourceGroupName string, loadBalancerName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { func (client LoadBalancersClient) Delete(resourceGroupName string, loadBalancerName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
resultChan := make(chan autorest.Response, 1) resultChan := make(chan autorest.Response, 1)
errChan := make(chan error, 1) errChan := make(chan error, 1)
...@@ -140,8 +133,10 @@ func (client LoadBalancersClient) Delete(resourceGroupName string, loadBalancerN ...@@ -140,8 +133,10 @@ func (client LoadBalancersClient) Delete(resourceGroupName string, loadBalancerN
var err error var err error
var result autorest.Response var result autorest.Response
defer func() { defer func() {
if err != nil {
errChan <- err
}
resultChan <- result resultChan <- result
errChan <- err
close(resultChan) close(resultChan)
close(errChan) close(errChan)
}() }()
...@@ -174,7 +169,7 @@ func (client LoadBalancersClient) DeletePreparer(resourceGroupName string, loadB ...@@ -174,7 +169,7 @@ func (client LoadBalancersClient) DeletePreparer(resourceGroupName string, loadB
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -209,8 +204,8 @@ func (client LoadBalancersClient) DeleteResponder(resp *http.Response) (result a ...@@ -209,8 +204,8 @@ func (client LoadBalancersClient) DeleteResponder(resp *http.Response) (result a
// Get gets the specified load balancer. // Get gets the specified load balancer.
// //
// resourceGroupName is the name of the resource group. loadBalancerName is the // resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. expand is
// name of the load balancer. expand is expands referenced resources. // expands referenced resources.
func (client LoadBalancersClient) Get(resourceGroupName string, loadBalancerName string, expand string) (result LoadBalancer, err error) { func (client LoadBalancersClient) Get(resourceGroupName string, loadBalancerName string, expand string) (result LoadBalancer, err error) {
req, err := client.GetPreparer(resourceGroupName, loadBalancerName, expand) req, err := client.GetPreparer(resourceGroupName, loadBalancerName, expand)
if err != nil { if err != nil {
...@@ -241,7 +236,7 @@ func (client LoadBalancersClient) GetPreparer(resourceGroupName string, loadBala ...@@ -241,7 +236,7 @@ func (client LoadBalancersClient) GetPreparer(resourceGroupName string, loadBala
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -308,7 +303,7 @@ func (client LoadBalancersClient) ListPreparer(resourceGroupName string) (*http. ...@@ -308,7 +303,7 @@ func (client LoadBalancersClient) ListPreparer(resourceGroupName string) (*http.
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -364,6 +359,51 @@ func (client LoadBalancersClient) ListNextResults(lastResults LoadBalancerListRe ...@@ -364,6 +359,51 @@ func (client LoadBalancersClient) ListNextResults(lastResults LoadBalancerListRe
return 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. // ListAll gets all the load balancers in a subscription.
func (client LoadBalancersClient) ListAll() (result LoadBalancerListResult, err error) { func (client LoadBalancersClient) ListAll() (result LoadBalancerListResult, err error) {
req, err := client.ListAllPreparer() req, err := client.ListAllPreparer()
...@@ -393,7 +433,7 @@ func (client LoadBalancersClient) ListAllPreparer() (*http.Request, error) { ...@@ -393,7 +433,7 @@ func (client LoadBalancersClient) ListAllPreparer() (*http.Request, error) {
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -448,3 +488,48 @@ func (client LoadBalancersClient) ListAllNextResults(lastResults LoadBalancerLis ...@@ -448,3 +488,48 @@ func (client LoadBalancersClient) ListAllNextResults(lastResults LoadBalancerLis
return 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
}
...@@ -14,9 +14,8 @@ package network ...@@ -14,9 +14,8 @@ package network
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0 // Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is // Changes may cause incorrect behavior and will be lost if the code is regenerated.
// regenerated.
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
...@@ -25,31 +24,27 @@ import ( ...@@ -25,31 +24,27 @@ import (
"net/http" "net/http"
) )
// LocalNetworkGatewaysClient is the composite Swagger for Network Client // LocalNetworkGatewaysClient is the network Client
type LocalNetworkGatewaysClient struct { type LocalNetworkGatewaysClient struct {
ManagementClient ManagementClient
} }
// NewLocalNetworkGatewaysClient creates an instance of the // NewLocalNetworkGatewaysClient creates an instance of the LocalNetworkGatewaysClient client.
// LocalNetworkGatewaysClient client.
func NewLocalNetworkGatewaysClient(subscriptionID string) LocalNetworkGatewaysClient { func NewLocalNetworkGatewaysClient(subscriptionID string) LocalNetworkGatewaysClient {
return NewLocalNetworkGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) return NewLocalNetworkGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID)
} }
// NewLocalNetworkGatewaysClientWithBaseURI creates an instance of the // NewLocalNetworkGatewaysClientWithBaseURI creates an instance of the LocalNetworkGatewaysClient client.
// LocalNetworkGatewaysClient client.
func NewLocalNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID string) LocalNetworkGatewaysClient { func NewLocalNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID string) LocalNetworkGatewaysClient {
return LocalNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} return LocalNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate creates or updates a local network gateway in the specified // CreateOrUpdate creates or updates a local network gateway in the specified resource group. This method may poll for
// resource group. This method may poll for completion. Polling can be canceled // completion. Polling can be canceled by passing the cancel channel argument. The channel will be used to cancel
// by passing the cancel channel argument. The channel will be used to cancel
// polling and any outstanding HTTP requests. // polling and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. localNetworkGatewayName // resourceGroupName is the name of the resource group. localNetworkGatewayName is the name of the local network
// is the name of the local network gateway. parameters is parameters supplied // gateway. parameters is parameters supplied to the create or update local network gateway operation.
// 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) { func (client LocalNetworkGatewaysClient) CreateOrUpdate(resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway, cancel <-chan struct{}) (<-chan LocalNetworkGateway, <-chan error) {
resultChan := make(chan LocalNetworkGateway, 1) resultChan := make(chan LocalNetworkGateway, 1)
errChan := make(chan error, 1) errChan := make(chan error, 1)
...@@ -68,8 +63,10 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdate(resourceGroupName string ...@@ -68,8 +63,10 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdate(resourceGroupName string
var err error var err error
var result LocalNetworkGateway var result LocalNetworkGateway
defer func() { defer func() {
if err != nil {
errChan <- err
}
resultChan <- result resultChan <- result
errChan <- err
close(resultChan) close(resultChan)
close(errChan) close(errChan)
}() }()
...@@ -102,7 +99,7 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdatePreparer(resourceGroupNam ...@@ -102,7 +99,7 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdatePreparer(resourceGroupNam
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -138,13 +135,11 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Resp ...@@ -138,13 +135,11 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Resp
return return
} }
// Delete deletes the specified local network gateway. This method may poll for // Delete deletes the specified local network gateway. This method may poll for completion. Polling can be canceled by
// completion. Polling can be canceled by passing the cancel channel argument. // passing the cancel channel argument. The channel will be used to cancel polling and any outstanding HTTP requests.
// The channel will be used to cancel polling and any outstanding HTTP
// requests.
// //
// resourceGroupName is the name of the resource group. localNetworkGatewayName // resourceGroupName is the name of the resource group. localNetworkGatewayName is the name of the local network
// is the name of the local network gateway. // gateway.
func (client LocalNetworkGatewaysClient) Delete(resourceGroupName string, localNetworkGatewayName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) { func (client LocalNetworkGatewaysClient) Delete(resourceGroupName string, localNetworkGatewayName string, cancel <-chan struct{}) (<-chan autorest.Response, <-chan error) {
resultChan := make(chan autorest.Response, 1) resultChan := make(chan autorest.Response, 1)
errChan := make(chan error, 1) errChan := make(chan error, 1)
...@@ -161,8 +156,10 @@ func (client LocalNetworkGatewaysClient) Delete(resourceGroupName string, localN ...@@ -161,8 +156,10 @@ func (client LocalNetworkGatewaysClient) Delete(resourceGroupName string, localN
var err error var err error
var result autorest.Response var result autorest.Response
defer func() { defer func() {
if err != nil {
errChan <- err
}
resultChan <- result resultChan <- result
errChan <- err
close(resultChan) close(resultChan)
close(errChan) close(errChan)
}() }()
...@@ -195,7 +192,7 @@ func (client LocalNetworkGatewaysClient) DeletePreparer(resourceGroupName string ...@@ -195,7 +192,7 @@ func (client LocalNetworkGatewaysClient) DeletePreparer(resourceGroupName string
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -230,8 +227,8 @@ func (client LocalNetworkGatewaysClient) DeleteResponder(resp *http.Response) (r ...@@ -230,8 +227,8 @@ func (client LocalNetworkGatewaysClient) DeleteResponder(resp *http.Response) (r
// Get gets the specified local network gateway in a resource group. // Get gets the specified local network gateway in a resource group.
// //
// resourceGroupName is the name of the resource group. localNetworkGatewayName // resourceGroupName is the name of the resource group. localNetworkGatewayName is the name of the local network
// is the name of the local network gateway. // gateway.
func (client LocalNetworkGatewaysClient) Get(resourceGroupName string, localNetworkGatewayName string) (result LocalNetworkGateway, err error) { func (client LocalNetworkGatewaysClient) Get(resourceGroupName string, localNetworkGatewayName string) (result LocalNetworkGateway, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: localNetworkGatewayName, {TargetValue: localNetworkGatewayName,
...@@ -268,7 +265,7 @@ func (client LocalNetworkGatewaysClient) GetPreparer(resourceGroupName string, l ...@@ -268,7 +265,7 @@ func (client LocalNetworkGatewaysClient) GetPreparer(resourceGroupName string, l
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -332,7 +329,7 @@ func (client LocalNetworkGatewaysClient) ListPreparer(resourceGroupName string) ...@@ -332,7 +329,7 @@ func (client LocalNetworkGatewaysClient) ListPreparer(resourceGroupName string)
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-03-01" const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -387,3 +384,48 @@ func (client LocalNetworkGatewaysClient) ListNextResults(lastResults LocalNetwor ...@@ -387,3 +384,48 @@ func (client LocalNetworkGatewaysClient) ListNextResults(lastResults LocalNetwor
return 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
}
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment