Commit af1875fc authored by Pengfei Ni's avatar Pengfei Ni

Update Azure Go SDK to v19.0.0

parent 5bf3b211
...@@ -15,7 +15,7 @@ filegroup( ...@@ -15,7 +15,7 @@ filegroup(
"//vendor/bitbucket.org/ww/goautoneg:all-srcs", "//vendor/bitbucket.org/ww/goautoneg:all-srcs",
"//vendor/cloud.google.com/go/compute/metadata:all-srcs", "//vendor/cloud.google.com/go/compute/metadata:all-srcs",
"//vendor/cloud.google.com/go/internal:all-srcs", "//vendor/cloud.google.com/go/internal:all-srcs",
"//vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute:all-srcs", "//vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute:all-srcs",
"//vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry:all-srcs", "//vendor/github.com/Azure/azure-sdk-for-go/services/containerregistry/mgmt/2017-10-01/containerregistry:all-srcs",
"//vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network:all-srcs", "//vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2017-09-01/network:all-srcs",
"//vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage:all-srcs", "//vendor/github.com/Azure/azure-sdk-for-go/services/storage/mgmt/2017-10-01/storage:all-srcs",
...@@ -23,6 +23,7 @@ filegroup( ...@@ -23,6 +23,7 @@ filegroup(
"//vendor/github.com/Azure/azure-sdk-for-go/version:all-srcs", "//vendor/github.com/Azure/azure-sdk-for-go/version:all-srcs",
"//vendor/github.com/Azure/go-ansiterm:all-srcs", "//vendor/github.com/Azure/go-ansiterm:all-srcs",
"//vendor/github.com/Azure/go-autorest/autorest:all-srcs", "//vendor/github.com/Azure/go-autorest/autorest:all-srcs",
"//vendor/github.com/Azure/go-autorest/version:all-srcs",
"//vendor/github.com/JeffAshton/win_pdh:all-srcs", "//vendor/github.com/JeffAshton/win_pdh:all-srcs",
"//vendor/github.com/MakeNowJust/heredoc:all-srcs", "//vendor/github.com/MakeNowJust/heredoc:all-srcs",
"//vendor/github.com/Microsoft/go-winio:all-srcs", "//vendor/github.com/Microsoft/go-winio:all-srcs",
......
...@@ -5,12 +5,11 @@ go_library( ...@@ -5,12 +5,11 @@ go_library(
srcs = [ srcs = [
"availabilitysets.go", "availabilitysets.go",
"client.go", "client.go",
"containerservices.go",
"disks.go", "disks.go",
"images.go", "images.go",
"loganalytics.go", "loganalytics.go",
"models.go", "models.go",
"resourceskus.go", "operations.go",
"snapshots.go", "snapshots.go",
"usage.go", "usage.go",
"version.go", "version.go",
...@@ -25,8 +24,8 @@ go_library( ...@@ -25,8 +24,8 @@ go_library(
"virtualmachinescalesetvms.go", "virtualmachinescalesetvms.go",
"virtualmachinesizes.go", "virtualmachinesizes.go",
], ],
importmap = "k8s.io/kubernetes/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute", importmap = "k8s.io/kubernetes/vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute",
importpath = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2017-12-01/compute", importpath = "github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"//vendor/github.com/Azure/azure-sdk-for-go/version:go_default_library", "//vendor/github.com/Azure/azure-sdk-for-go/version:go_default_library",
......
// Package compute implements the Azure ARM Compute service API version . // Package compute implements the Azure ARM Compute service API version 2018-04-01.
// //
// Compute Client // Compute Client
package compute package compute
......
...@@ -42,9 +42,9 @@ func NewLogAnalyticsClientWithBaseURI(baseURI string, subscriptionID string) Log ...@@ -42,9 +42,9 @@ func NewLogAnalyticsClientWithBaseURI(baseURI string, subscriptionID string) Log
// ExportRequestRateByInterval export logs that show Api requests made by this subscription in the given time window to // ExportRequestRateByInterval export logs that show Api requests made by this subscription in the given time window to
// show throttling activities. // show throttling activities.
// // Parameters:
// parameters is parameters supplied to the LogAnalytics getRequestRateByInterval Api. location is the location // parameters - parameters supplied to the LogAnalytics getRequestRateByInterval Api.
// upon which virtual-machine-sizes is queried. // location - the location upon which virtual-machine-sizes is queried.
func (client LogAnalyticsClient) ExportRequestRateByInterval(ctx context.Context, parameters RequestRateByIntervalInput, location string) (result LogAnalyticsExportRequestRateByIntervalFuture, err error) { func (client LogAnalyticsClient) ExportRequestRateByInterval(ctx context.Context, parameters RequestRateByIntervalInput, location string) (result LogAnalyticsExportRequestRateByIntervalFuture, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: location, {TargetValue: location,
...@@ -74,13 +74,13 @@ func (client LogAnalyticsClient) ExportRequestRateByIntervalPreparer(ctx context ...@@ -74,13 +74,13 @@ func (client LogAnalyticsClient) ExportRequestRateByIntervalPreparer(ctx context
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPost(), autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getRequestRateByInterval", pathParameters),
...@@ -92,15 +92,17 @@ func (client LogAnalyticsClient) ExportRequestRateByIntervalPreparer(ctx context ...@@ -92,15 +92,17 @@ func (client LogAnalyticsClient) ExportRequestRateByIntervalPreparer(ctx context
// ExportRequestRateByIntervalSender sends the ExportRequestRateByInterval request. The method will close the // ExportRequestRateByIntervalSender sends the ExportRequestRateByInterval request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client LogAnalyticsClient) ExportRequestRateByIntervalSender(req *http.Request) (future LogAnalyticsExportRequestRateByIntervalFuture, err error) { func (client LogAnalyticsClient) ExportRequestRateByIntervalSender(req *http.Request) (future LogAnalyticsExportRequestRateByIntervalFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
return return
} }
...@@ -119,9 +121,9 @@ func (client LogAnalyticsClient) ExportRequestRateByIntervalResponder(resp *http ...@@ -119,9 +121,9 @@ func (client LogAnalyticsClient) ExportRequestRateByIntervalResponder(resp *http
// ExportThrottledRequests export logs that show total throttled Api requests for this subscription in the given time // ExportThrottledRequests export logs that show total throttled Api requests for this subscription in the given time
// window. // window.
// // Parameters:
// parameters is parameters supplied to the LogAnalytics getThrottledRequests Api. location is the location upon // parameters - parameters supplied to the LogAnalytics getThrottledRequests Api.
// which virtual-machine-sizes is queried. // location - the location upon which virtual-machine-sizes is queried.
func (client LogAnalyticsClient) ExportThrottledRequests(ctx context.Context, parameters ThrottledRequestsInput, location string) (result LogAnalyticsExportThrottledRequestsFuture, err error) { func (client LogAnalyticsClient) ExportThrottledRequests(ctx context.Context, parameters ThrottledRequestsInput, location string) (result LogAnalyticsExportThrottledRequestsFuture, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: location, {TargetValue: location,
...@@ -151,13 +153,13 @@ func (client LogAnalyticsClient) ExportThrottledRequestsPreparer(ctx context.Con ...@@ -151,13 +153,13 @@ func (client LogAnalyticsClient) ExportThrottledRequestsPreparer(ctx context.Con
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPost(), autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/logAnalytics/apiAccess/getThrottledRequests", pathParameters),
...@@ -169,15 +171,17 @@ func (client LogAnalyticsClient) ExportThrottledRequestsPreparer(ctx context.Con ...@@ -169,15 +171,17 @@ func (client LogAnalyticsClient) ExportThrottledRequestsPreparer(ctx context.Con
// ExportThrottledRequestsSender sends the ExportThrottledRequests request. The method will close the // ExportThrottledRequestsSender sends the ExportThrottledRequests request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client LogAnalyticsClient) ExportThrottledRequestsSender(req *http.Request) (future LogAnalyticsExportThrottledRequestsFuture, err error) { func (client LogAnalyticsClient) ExportThrottledRequestsSender(req *http.Request) (future LogAnalyticsExportThrottledRequestsFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
return return
} }
......
...@@ -24,52 +24,47 @@ import ( ...@@ -24,52 +24,47 @@ import (
"net/http" "net/http"
) )
// ResourceSkusClient is the compute Client // OperationsClient is the compute Client
type ResourceSkusClient struct { type OperationsClient struct {
BaseClient BaseClient
} }
// NewResourceSkusClient creates an instance of the ResourceSkusClient client. // NewOperationsClient creates an instance of the OperationsClient client.
func NewResourceSkusClient(subscriptionID string) ResourceSkusClient { func NewOperationsClient(subscriptionID string) OperationsClient {
return NewResourceSkusClientWithBaseURI(DefaultBaseURI, subscriptionID) return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
} }
// NewResourceSkusClientWithBaseURI creates an instance of the ResourceSkusClient client. // NewOperationsClientWithBaseURI creates an instance of the OperationsClient client.
func NewResourceSkusClientWithBaseURI(baseURI string, subscriptionID string) ResourceSkusClient { func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
return ResourceSkusClient{NewWithBaseURI(baseURI, subscriptionID)} return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// List gets the list of Microsoft.Compute SKUs available for your Subscription. // List gets a list of compute operations.
func (client ResourceSkusClient) List(ctx context.Context) (result ResourceSkusResultPage, err error) { func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) {
result.fn = client.listNextResults
req, err := client.ListPreparer(ctx) req, err := client.ListPreparer(ctx)
if err != nil { if err != nil {
err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", nil, "Failure preparing request") err = autorest.NewErrorWithError(err, "compute.OperationsClient", "List", nil, "Failure preparing request")
return return
} }
resp, err := client.ListSender(req) resp, err := client.ListSender(req)
if err != nil { if err != nil {
result.rsr.Response = autorest.Response{Response: resp} result.Response = autorest.Response{Response: resp}
err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure sending request") err = autorest.NewErrorWithError(err, "compute.OperationsClient", "List", resp, "Failure sending request")
return return
} }
result.rsr, err = client.ListResponder(resp) result, err = client.ListResponder(resp)
if err != nil { if err != nil {
err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "List", resp, "Failure responding to request") err = autorest.NewErrorWithError(err, "compute.OperationsClient", "List", resp, "Failure responding to request")
} }
return return
} }
// ListPreparer prepares the List request. // ListPreparer prepares the List request.
func (client ResourceSkusClient) ListPreparer(ctx context.Context) (*http.Request, error) { func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) {
pathParameters := map[string]interface{}{ const APIVersion = "2018-04-01"
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
const APIVersion = "2017-09-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -77,21 +72,21 @@ func (client ResourceSkusClient) ListPreparer(ctx context.Context) (*http.Reques ...@@ -77,21 +72,21 @@ func (client ResourceSkusClient) ListPreparer(ctx context.Context) (*http.Reques
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsGet(), autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/skus", pathParameters), autorest.WithPath("/providers/Microsoft.Compute/operations"),
autorest.WithQueryParameters(queryParameters)) autorest.WithQueryParameters(queryParameters))
return preparer.Prepare((&http.Request{}).WithContext(ctx)) return preparer.Prepare((&http.Request{}).WithContext(ctx))
} }
// ListSender sends the List request. The method will close the // ListSender sends the List request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client ResourceSkusClient) ListSender(req *http.Request) (*http.Response, error) { func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req, return autorest.SendWithSender(client, req,
azure.DoRetryWithRegistration(client.Client)) autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
} }
// ListResponder handles the response to the List request. The method always // ListResponder handles the response to the List request. The method always
// closes the http.Response Body. // closes the http.Response Body.
func (client ResourceSkusClient) ListResponder(resp *http.Response) (result ResourceSkusResult, err error) { func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) {
err = autorest.Respond( err = autorest.Respond(
resp, resp,
client.ByInspecting(), client.ByInspecting(),
...@@ -101,30 +96,3 @@ func (client ResourceSkusClient) ListResponder(resp *http.Response) (result Reso ...@@ -101,30 +96,3 @@ func (client ResourceSkusClient) ListResponder(resp *http.Response) (result Reso
result.Response = autorest.Response{Response: resp} result.Response = autorest.Response{Response: resp}
return 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", "listNextResults", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "listNextResults", resp, "Failure sending next results request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.ResourceSkusClient", "listNextResults", resp, "Failure responding to next results request")
}
return
}
// ListComplete enumerates all values, automatically crossing page boundaries as required.
func (client ResourceSkusClient) ListComplete(ctx context.Context) (result ResourceSkusResultIterator, err error) {
result.page, err = client.List(ctx)
return
}
...@@ -42,8 +42,8 @@ func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClien ...@@ -42,8 +42,8 @@ func NewUsageClientWithBaseURI(baseURI string, subscriptionID string) UsageClien
// List gets, for the specified location, the current compute resource usage information as well as the limits for // List gets, for the specified location, the current compute resource usage information as well as the limits for
// compute resources under the subscription. // compute resources under the subscription.
// // Parameters:
// location is the location for which resource usage is queried. // location - the location for which resource usage is queried.
func (client UsageClient) List(ctx context.Context, location string) (result ListUsagesResultPage, err error) { func (client UsageClient) List(ctx context.Context, location string) (result ListUsagesResultPage, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: location, {TargetValue: location,
...@@ -80,7 +80,7 @@ func (client UsageClient) ListPreparer(ctx context.Context, location string) (*h ...@@ -80,7 +80,7 @@ func (client UsageClient) ListPreparer(ctx context.Context, location string) (*h
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
......
...@@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" ...@@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version"
// 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/" + version.Number + " compute/2017-12-01" return "Azure-SDK-For-Go/" + version.Number + " compute/2018-04-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.
......
...@@ -41,8 +41,8 @@ func NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI string, subscript ...@@ -41,8 +41,8 @@ func NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI string, subscript
} }
// Get gets a virtual machine extension image. // Get gets a virtual machine extension image.
// // Parameters:
// location is the name of a supported Azure region. // location - the name of a supported Azure region.
func (client VirtualMachineExtensionImagesClient) Get(ctx context.Context, location string, publisherName string, typeParameter string, version string) (result VirtualMachineExtensionImage, err error) { func (client VirtualMachineExtensionImagesClient) Get(ctx context.Context, location string, publisherName string, typeParameter string, version string) (result VirtualMachineExtensionImage, err error) {
req, err := client.GetPreparer(ctx, location, publisherName, typeParameter, version) req, err := client.GetPreparer(ctx, location, publisherName, typeParameter, version)
if err != nil { if err != nil {
...@@ -75,7 +75,7 @@ func (client VirtualMachineExtensionImagesClient) GetPreparer(ctx context.Contex ...@@ -75,7 +75,7 @@ func (client VirtualMachineExtensionImagesClient) GetPreparer(ctx context.Contex
"version": autorest.Encode("path", version), "version": autorest.Encode("path", version),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -109,8 +109,8 @@ func (client VirtualMachineExtensionImagesClient) GetResponder(resp *http.Respon ...@@ -109,8 +109,8 @@ 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.
// // Parameters:
// location is the name of a supported Azure region. // location - the name of a supported Azure region.
func (client VirtualMachineExtensionImagesClient) ListTypes(ctx context.Context, location string, publisherName string) (result ListVirtualMachineExtensionImage, err error) { func (client VirtualMachineExtensionImagesClient) ListTypes(ctx context.Context, location string, publisherName string) (result ListVirtualMachineExtensionImage, err error) {
req, err := client.ListTypesPreparer(ctx, location, publisherName) req, err := client.ListTypesPreparer(ctx, location, publisherName)
if err != nil { if err != nil {
...@@ -141,7 +141,7 @@ func (client VirtualMachineExtensionImagesClient) ListTypesPreparer(ctx context. ...@@ -141,7 +141,7 @@ func (client VirtualMachineExtensionImagesClient) ListTypesPreparer(ctx context.
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -175,8 +175,9 @@ func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http. ...@@ -175,8 +175,9 @@ 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.
// // Parameters:
// location is the name of a supported Azure region. filter is the filter to apply on the operation. // location - the name of a supported Azure region.
// filter - the filter to apply on the operation.
func (client VirtualMachineExtensionImagesClient) ListVersions(ctx context.Context, location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (result ListVirtualMachineExtensionImage, err error) { func (client VirtualMachineExtensionImagesClient) ListVersions(ctx context.Context, location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (result ListVirtualMachineExtensionImage, err error) {
req, err := client.ListVersionsPreparer(ctx, location, publisherName, typeParameter, filter, top, orderby) req, err := client.ListVersionsPreparer(ctx, location, publisherName, typeParameter, filter, top, orderby)
if err != nil { if err != nil {
...@@ -208,7 +209,7 @@ func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(ctx conte ...@@ -208,7 +209,7 @@ func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(ctx conte
"type": autorest.Encode("path", typeParameter), "type": autorest.Encode("path", typeParameter),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
......
...@@ -40,9 +40,12 @@ func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID str ...@@ -40,9 +40,12 @@ func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID str
} }
// Get gets a virtual machine image. // Get gets a virtual machine image.
// // Parameters:
// location is the name of a supported Azure region. publisherName is a valid image publisher. offer is a valid // location - the name of a supported Azure region.
// image publisher offer. skus is a valid image SKU. version is a valid image SKU version. // publisherName - a valid image publisher.
// offer - a valid image publisher offer.
// skus - a valid image SKU.
// version - a valid image SKU version.
func (client VirtualMachineImagesClient) Get(ctx context.Context, location string, publisherName string, offer string, skus string, version string) (result VirtualMachineImage, err error) { func (client VirtualMachineImagesClient) Get(ctx context.Context, location string, publisherName string, offer string, skus string, version string) (result VirtualMachineImage, err error) {
req, err := client.GetPreparer(ctx, location, publisherName, offer, skus, version) req, err := client.GetPreparer(ctx, location, publisherName, offer, skus, version)
if err != nil { if err != nil {
...@@ -76,7 +79,7 @@ func (client VirtualMachineImagesClient) GetPreparer(ctx context.Context, locati ...@@ -76,7 +79,7 @@ func (client VirtualMachineImagesClient) GetPreparer(ctx context.Context, locati
"version": autorest.Encode("path", version), "version": autorest.Encode("path", version),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -110,9 +113,12 @@ func (client VirtualMachineImagesClient) GetResponder(resp *http.Response) (resu ...@@ -110,9 +113,12 @@ func (client VirtualMachineImagesClient) GetResponder(resp *http.Response) (resu
} }
// List gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU. // List gets a list of all virtual machine image versions for the specified location, publisher, offer, and SKU.
// // Parameters:
// location is the name of a supported Azure region. publisherName is a valid image publisher. offer is a valid // location - the name of a supported Azure region.
// image publisher offer. skus is a valid image SKU. filter is the filter to apply on the operation. // publisherName - a valid image publisher.
// offer - a valid image publisher offer.
// skus - a valid image SKU.
// filter - the filter to apply on the operation.
func (client VirtualMachineImagesClient) List(ctx context.Context, location string, publisherName string, offer string, skus string, filter string, top *int32, orderby string) (result ListVirtualMachineImageResource, err error) { func (client VirtualMachineImagesClient) List(ctx context.Context, location string, publisherName string, offer string, skus string, filter string, top *int32, orderby string) (result ListVirtualMachineImageResource, err error) {
req, err := client.ListPreparer(ctx, location, publisherName, offer, skus, filter, top, orderby) req, err := client.ListPreparer(ctx, location, publisherName, offer, skus, filter, top, orderby)
if err != nil { if err != nil {
...@@ -145,7 +151,7 @@ func (client VirtualMachineImagesClient) ListPreparer(ctx context.Context, locat ...@@ -145,7 +151,7 @@ func (client VirtualMachineImagesClient) ListPreparer(ctx context.Context, locat
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -188,8 +194,9 @@ func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (res ...@@ -188,8 +194,9 @@ func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (res
} }
// ListOffers gets a list of virtual machine image offers for the specified location and publisher. // ListOffers gets a list of virtual machine image offers for the specified location and publisher.
// // Parameters:
// location is the name of a supported Azure region. publisherName is a valid image publisher. // location - the name of a supported Azure region.
// publisherName - a valid image publisher.
func (client VirtualMachineImagesClient) ListOffers(ctx context.Context, location string, publisherName string) (result ListVirtualMachineImageResource, err error) { func (client VirtualMachineImagesClient) ListOffers(ctx context.Context, location string, publisherName string) (result ListVirtualMachineImageResource, err error) {
req, err := client.ListOffersPreparer(ctx, location, publisherName) req, err := client.ListOffersPreparer(ctx, location, publisherName)
if err != nil { if err != nil {
...@@ -220,7 +227,7 @@ func (client VirtualMachineImagesClient) ListOffersPreparer(ctx context.Context, ...@@ -220,7 +227,7 @@ func (client VirtualMachineImagesClient) ListOffersPreparer(ctx context.Context,
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -254,8 +261,8 @@ func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response ...@@ -254,8 +261,8 @@ func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response
} }
// ListPublishers gets a list of virtual machine image publishers for the specified Azure location. // ListPublishers gets a list of virtual machine image publishers for the specified Azure location.
// // Parameters:
// location is the name of a supported Azure region. // location - the name of a supported Azure region.
func (client VirtualMachineImagesClient) ListPublishers(ctx context.Context, location string) (result ListVirtualMachineImageResource, err error) { func (client VirtualMachineImagesClient) ListPublishers(ctx context.Context, location string) (result ListVirtualMachineImageResource, err error) {
req, err := client.ListPublishersPreparer(ctx, location) req, err := client.ListPublishersPreparer(ctx, location)
if err != nil { if err != nil {
...@@ -285,7 +292,7 @@ func (client VirtualMachineImagesClient) ListPublishersPreparer(ctx context.Cont ...@@ -285,7 +292,7 @@ func (client VirtualMachineImagesClient) ListPublishersPreparer(ctx context.Cont
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -319,9 +326,10 @@ func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Resp ...@@ -319,9 +326,10 @@ func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Resp
} }
// ListSkus gets a list of virtual machine image SKUs for the specified location, publisher, and offer. // ListSkus gets a list of virtual machine image SKUs for the specified location, publisher, and offer.
// // Parameters:
// location is the name of a supported Azure region. publisherName is a valid image publisher. offer is a valid // location - the name of a supported Azure region.
// image publisher offer. // publisherName - a valid image publisher.
// offer - a valid image publisher offer.
func (client VirtualMachineImagesClient) ListSkus(ctx context.Context, location string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) { func (client VirtualMachineImagesClient) ListSkus(ctx context.Context, location string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) {
req, err := client.ListSkusPreparer(ctx, location, publisherName, offer) req, err := client.ListSkusPreparer(ctx, location, publisherName, offer)
if err != nil { if err != nil {
...@@ -353,7 +361,7 @@ func (client VirtualMachineImagesClient) ListSkusPreparer(ctx context.Context, l ...@@ -353,7 +361,7 @@ func (client VirtualMachineImagesClient) ListSkusPreparer(ctx context.Context, l
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
......
...@@ -41,8 +41,9 @@ func NewVirtualMachineRunCommandsClientWithBaseURI(baseURI string, subscriptionI ...@@ -41,8 +41,9 @@ func NewVirtualMachineRunCommandsClientWithBaseURI(baseURI string, subscriptionI
} }
// Get gets specific run command for a subscription in a location. // Get gets specific run command for a subscription in a location.
// // Parameters:
// location is the location upon which run commands is queried. commandID is the command id. // location - the location upon which run commands is queried.
// commandID - the command id.
func (client VirtualMachineRunCommandsClient) Get(ctx context.Context, location string, commandID string) (result RunCommandDocument, err error) { func (client VirtualMachineRunCommandsClient) Get(ctx context.Context, location string, commandID string) (result RunCommandDocument, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: location, {TargetValue: location,
...@@ -79,7 +80,7 @@ func (client VirtualMachineRunCommandsClient) GetPreparer(ctx context.Context, l ...@@ -79,7 +80,7 @@ func (client VirtualMachineRunCommandsClient) GetPreparer(ctx context.Context, l
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -113,8 +114,8 @@ func (client VirtualMachineRunCommandsClient) GetResponder(resp *http.Response) ...@@ -113,8 +114,8 @@ func (client VirtualMachineRunCommandsClient) GetResponder(resp *http.Response)
} }
// List lists all available run commands for a subscription in a location. // List lists all available run commands for a subscription in a location.
// // Parameters:
// location is the location upon which run commands is queried. // location - the location upon which run commands is queried.
func (client VirtualMachineRunCommandsClient) List(ctx context.Context, location string) (result RunCommandListResultPage, err error) { func (client VirtualMachineRunCommandsClient) List(ctx context.Context, location string) (result RunCommandListResultPage, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: location, {TargetValue: location,
...@@ -151,7 +152,7 @@ func (client VirtualMachineRunCommandsClient) ListPreparer(ctx context.Context, ...@@ -151,7 +152,7 @@ func (client VirtualMachineRunCommandsClient) ListPreparer(ctx context.Context,
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
......
...@@ -41,10 +41,11 @@ func NewVirtualMachineScaleSetExtensionsClientWithBaseURI(baseURI string, subscr ...@@ -41,10 +41,11 @@ func NewVirtualMachineScaleSetExtensionsClientWithBaseURI(baseURI string, subscr
} }
// CreateOrUpdate the operation to create or update an extension. // CreateOrUpdate the operation to create or update an extension.
// // Parameters:
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set where the // resourceGroupName - the name of the resource group.
// extension should be create or updated. vmssExtensionName is the name of the VM scale set extension. // VMScaleSetName - the name of the VM scale set where the extension should be create or updated.
// extensionParameters is parameters supplied to the Create VM scale set Extension operation. // vmssExtensionName - the name of the VM scale set extension.
// extensionParameters - parameters supplied to the Create VM scale set Extension operation.
func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension) (result VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) { func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, extensionParameters VirtualMachineScaleSetExtension) (result VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) {
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, extensionParameters) req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, extensionParameters)
if err != nil { if err != nil {
...@@ -70,13 +71,13 @@ func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdatePreparer(ctx ...@@ -70,13 +71,13 @@ func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdatePreparer(ctx
"vmssExtensionName": autorest.Encode("path", vmssExtensionName), "vmssExtensionName": autorest.Encode("path", vmssExtensionName),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/extensions/{vmssExtensionName}", pathParameters),
...@@ -88,15 +89,17 @@ func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdatePreparer(ctx ...@@ -88,15 +89,17 @@ func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdatePreparer(ctx
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) { func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetExtensionsCreateOrUpdateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender)
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated)) if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return return
} }
...@@ -114,9 +117,10 @@ func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateResponder(res ...@@ -114,9 +117,10 @@ func (client VirtualMachineScaleSetExtensionsClient) CreateOrUpdateResponder(res
} }
// Delete the operation to delete the extension. // Delete the operation to delete the extension.
// // Parameters:
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set where the // resourceGroupName - the name of the resource group.
// extension should be deleted. vmssExtensionName is the name of the VM scale set extension. // VMScaleSetName - the name of the VM scale set where the extension should be deleted.
// vmssExtensionName - the name of the VM scale set extension.
func (client VirtualMachineScaleSetExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string) (result VirtualMachineScaleSetExtensionsDeleteFuture, err error) { func (client VirtualMachineScaleSetExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string) (result VirtualMachineScaleSetExtensionsDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName) req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName)
if err != nil { if err != nil {
...@@ -142,7 +146,7 @@ func (client VirtualMachineScaleSetExtensionsClient) DeletePreparer(ctx context. ...@@ -142,7 +146,7 @@ func (client VirtualMachineScaleSetExtensionsClient) DeletePreparer(ctx context.
"vmssExtensionName": autorest.Encode("path", vmssExtensionName), "vmssExtensionName": autorest.Encode("path", vmssExtensionName),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -158,36 +162,38 @@ func (client VirtualMachineScaleSetExtensionsClient) DeletePreparer(ctx context. ...@@ -158,36 +162,38 @@ func (client VirtualMachineScaleSetExtensionsClient) DeletePreparer(ctx context.
// DeleteSender sends the Delete request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client VirtualMachineScaleSetExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetExtensionsDeleteFuture, err error) { func (client VirtualMachineScaleSetExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetExtensionsDeleteFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender)
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return return
} }
// DeleteResponder handles the response to the Delete request. The method always // DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body. // closes the http.Response Body.
func (client VirtualMachineScaleSetExtensionsClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) { func (client VirtualMachineScaleSetExtensionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond( err = autorest.Respond(
resp, resp,
client.ByInspecting(), client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing()) autorest.ByClosing())
result.Response = autorest.Response{Response: resp} result.Response = resp
return return
} }
// Get the operation to get the extension. // Get the operation to get the extension.
// // Parameters:
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set containing // resourceGroupName - the name of the resource group.
// the extension. vmssExtensionName is the name of the VM scale set extension. expand is the expand expression to // VMScaleSetName - the name of the VM scale set containing the extension.
// apply on the operation. // vmssExtensionName - the name of the VM scale set extension.
// expand - the expand expression to apply on the operation.
func (client VirtualMachineScaleSetExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (result VirtualMachineScaleSetExtension, err error) { func (client VirtualMachineScaleSetExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, vmssExtensionName string, expand string) (result VirtualMachineScaleSetExtension, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, expand) req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, vmssExtensionName, expand)
if err != nil { if err != nil {
...@@ -219,7 +225,7 @@ func (client VirtualMachineScaleSetExtensionsClient) GetPreparer(ctx context.Con ...@@ -219,7 +225,7 @@ func (client VirtualMachineScaleSetExtensionsClient) GetPreparer(ctx context.Con
"vmssExtensionName": autorest.Encode("path", vmssExtensionName), "vmssExtensionName": autorest.Encode("path", vmssExtensionName),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -256,9 +262,9 @@ func (client VirtualMachineScaleSetExtensionsClient) GetResponder(resp *http.Res ...@@ -256,9 +262,9 @@ func (client VirtualMachineScaleSetExtensionsClient) GetResponder(resp *http.Res
} }
// List gets a list of all extensions in a VM scale set. // List gets a list of all extensions in a VM scale set.
// // Parameters:
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set containing // resourceGroupName - the name of the resource group.
// the extension. // VMScaleSetName - the name of the VM scale set containing the extension.
func (client VirtualMachineScaleSetExtensionsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetExtensionListResultPage, err error) { func (client VirtualMachineScaleSetExtensionsClient) List(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetExtensionListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName) req, err := client.ListPreparer(ctx, resourceGroupName, VMScaleSetName)
...@@ -290,7 +296,7 @@ func (client VirtualMachineScaleSetExtensionsClient) ListPreparer(ctx context.Co ...@@ -290,7 +296,7 @@ func (client VirtualMachineScaleSetExtensionsClient) ListPreparer(ctx context.Co
"vmScaleSetName": autorest.Encode("path", VMScaleSetName), "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
......
...@@ -42,8 +42,9 @@ func NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI string, s ...@@ -42,8 +42,9 @@ func NewVirtualMachineScaleSetRollingUpgradesClientWithBaseURI(baseURI string, s
} }
// Cancel cancels the current virtual machine scale set rolling upgrade. // Cancel cancels the current virtual machine scale set rolling upgrade.
// // Parameters:
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. // resourceGroupName - the name of the resource group.
// VMScaleSetName - the name of the VM scale set.
func (client VirtualMachineScaleSetRollingUpgradesClient) Cancel(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesCancelFuture, err error) { func (client VirtualMachineScaleSetRollingUpgradesClient) Cancel(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesCancelFuture, err error) {
req, err := client.CancelPreparer(ctx, resourceGroupName, VMScaleSetName) req, err := client.CancelPreparer(ctx, resourceGroupName, VMScaleSetName)
if err != nil { if err != nil {
...@@ -68,7 +69,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) CancelPreparer(ctx con ...@@ -68,7 +69,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) CancelPreparer(ctx con
"vmScaleSetName": autorest.Encode("path", VMScaleSetName), "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -84,34 +85,36 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) CancelPreparer(ctx con ...@@ -84,34 +85,36 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) CancelPreparer(ctx con
// CancelSender sends the Cancel request. The method will close the // CancelSender sends the Cancel request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client VirtualMachineScaleSetRollingUpgradesClient) CancelSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesCancelFuture, err error) { func (client VirtualMachineScaleSetRollingUpgradesClient) CancelSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesCancelFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
return return
} }
// CancelResponder handles the response to the Cancel request. The method always // CancelResponder handles the response to the Cancel request. The method always
// closes the http.Response Body. // closes the http.Response Body.
func (client VirtualMachineScaleSetRollingUpgradesClient) CancelResponder(resp *http.Response) (result OperationStatusResponse, err error) { func (client VirtualMachineScaleSetRollingUpgradesClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond( err = autorest.Respond(
resp, resp,
client.ByInspecting(), client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing()) autorest.ByClosing())
result.Response = autorest.Response{Response: resp} result.Response = resp
return return
} }
// GetLatest gets the status of the latest virtual machine scale set rolling upgrade. // GetLatest gets the status of the latest virtual machine scale set rolling upgrade.
// // Parameters:
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. // resourceGroupName - the name of the resource group.
// VMScaleSetName - the name of the VM scale set.
func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatest(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result RollingUpgradeStatusInfo, err error) { func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatest(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result RollingUpgradeStatusInfo, err error) {
req, err := client.GetLatestPreparer(ctx, resourceGroupName, VMScaleSetName) req, err := client.GetLatestPreparer(ctx, resourceGroupName, VMScaleSetName)
if err != nil { if err != nil {
...@@ -142,7 +145,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestPreparer(ctx ...@@ -142,7 +145,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestPreparer(ctx
"vmScaleSetName": autorest.Encode("path", VMScaleSetName), "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -177,8 +180,9 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestResponder(res ...@@ -177,8 +180,9 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) GetLatestResponder(res
// StartOSUpgrade starts a rolling upgrade to move all virtual machine scale set instances to the latest available // StartOSUpgrade starts a rolling upgrade to move all virtual machine scale set instances to the latest available
// Platform Image OS version. Instances which are already running the latest available OS version are not affected. // Platform Image OS version. Instances which are already running the latest available OS version are not affected.
// // Parameters:
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. // resourceGroupName - the name of the resource group.
// VMScaleSetName - the name of the VM scale set.
func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgrade(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture, err error) { func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgrade(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture, err error) {
req, err := client.StartOSUpgradePreparer(ctx, resourceGroupName, VMScaleSetName) req, err := client.StartOSUpgradePreparer(ctx, resourceGroupName, VMScaleSetName)
if err != nil { if err != nil {
...@@ -203,7 +207,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradePreparer ...@@ -203,7 +207,7 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradePreparer
"vmScaleSetName": autorest.Encode("path", VMScaleSetName), "vmScaleSetName": autorest.Encode("path", VMScaleSetName),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
...@@ -219,27 +223,28 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradePreparer ...@@ -219,27 +223,28 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradePreparer
// StartOSUpgradeSender sends the StartOSUpgrade request. The method will close the // StartOSUpgradeSender sends the StartOSUpgrade request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture, err error) { func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeSender(req *http.Request) (future VirtualMachineScaleSetRollingUpgradesStartOSUpgradeFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender)
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted)) if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return return
} }
// StartOSUpgradeResponder handles the response to the StartOSUpgrade request. The method always // StartOSUpgradeResponder handles the response to the StartOSUpgrade request. The method always
// closes the http.Response Body. // closes the http.Response Body.
func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeResponder(resp *http.Response) (result OperationStatusResponse, err error) { func (client VirtualMachineScaleSetRollingUpgradesClient) StartOSUpgradeResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond( err = autorest.Respond(
resp, resp,
client.ByInspecting(), client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing()) autorest.ByClosing())
result.Response = autorest.Response{Response: resp} result.Response = resp
return return
} }
...@@ -41,8 +41,8 @@ func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID stri ...@@ -41,8 +41,8 @@ func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID stri
} }
// List lists all available virtual machine sizes for a subscription in a location. // List lists all available virtual machine sizes for a subscription in a location.
// // Parameters:
// location is the location upon which virtual-machine-sizes is queried. // location - the location upon which virtual-machine-sizes is queried.
func (client VirtualMachineSizesClient) List(ctx context.Context, location string) (result VirtualMachineSizeListResult, err error) { func (client VirtualMachineSizesClient) List(ctx context.Context, location string) (result VirtualMachineSizeListResult, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: location, {TargetValue: location,
...@@ -78,7 +78,7 @@ func (client VirtualMachineSizesClient) ListPreparer(ctx context.Context, locati ...@@ -78,7 +78,7 @@ func (client VirtualMachineSizesClient) ListPreparer(ctx context.Context, locati
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
} }
const APIVersion = "2017-12-01" const APIVersion = "2018-04-01"
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": APIVersion, "api-version": APIVersion,
} }
......
...@@ -41,10 +41,11 @@ func NewReplicationsClientWithBaseURI(baseURI string, subscriptionID string) Rep ...@@ -41,10 +41,11 @@ func NewReplicationsClientWithBaseURI(baseURI string, subscriptionID string) Rep
} }
// Create creates a replication for a container registry with the specified parameters. // Create creates a replication for a container registry with the specified parameters.
// // Parameters:
// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the // resourceGroupName - the name of the resource group to which the container registry belongs.
// name of the container registry. replicationName is the name of the replication. replication is the parameters // registryName - the name of the container registry.
// for creating a replication. // replicationName - the name of the replication.
// replication - the parameters for creating a replication.
func (client ReplicationsClient) Create(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replication Replication) (result ReplicationsCreateFuture, err error) { func (client ReplicationsClient) Create(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replication Replication) (result ReplicationsCreateFuture, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: registryName, {TargetValue: registryName,
...@@ -88,7 +89,7 @@ func (client ReplicationsClient) CreatePreparer(ctx context.Context, resourceGro ...@@ -88,7 +89,7 @@ func (client ReplicationsClient) CreatePreparer(ctx context.Context, resourceGro
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", pathParameters),
...@@ -100,15 +101,17 @@ func (client ReplicationsClient) CreatePreparer(ctx context.Context, resourceGro ...@@ -100,15 +101,17 @@ func (client ReplicationsClient) CreatePreparer(ctx context.Context, resourceGro
// CreateSender sends the Create request. The method will close the // CreateSender sends the Create request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client ReplicationsClient) CreateSender(req *http.Request) (future ReplicationsCreateFuture, err error) { func (client ReplicationsClient) CreateSender(req *http.Request) (future ReplicationsCreateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
return return
} }
...@@ -126,9 +129,10 @@ func (client ReplicationsClient) CreateResponder(resp *http.Response) (result Re ...@@ -126,9 +129,10 @@ func (client ReplicationsClient) CreateResponder(resp *http.Response) (result Re
} }
// Delete deletes a replication from a container registry. // Delete deletes a replication from a container registry.
// // Parameters:
// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the // resourceGroupName - the name of the resource group to which the container registry belongs.
// name of the container registry. replicationName is the name of the replication. // registryName - the name of the container registry.
// replicationName - the name of the replication.
func (client ReplicationsClient) Delete(ctx context.Context, resourceGroupName string, registryName string, replicationName string) (result ReplicationsDeleteFuture, err error) { func (client ReplicationsClient) Delete(ctx context.Context, resourceGroupName string, registryName string, replicationName string) (result ReplicationsDeleteFuture, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: registryName, {TargetValue: registryName,
...@@ -182,15 +186,17 @@ func (client ReplicationsClient) DeletePreparer(ctx context.Context, resourceGro ...@@ -182,15 +186,17 @@ func (client ReplicationsClient) DeletePreparer(ctx context.Context, resourceGro
// DeleteSender sends the Delete request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client ReplicationsClient) DeleteSender(req *http.Request) (future ReplicationsDeleteFuture, err error) { func (client ReplicationsClient) DeleteSender(req *http.Request) (future ReplicationsDeleteFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender)
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return return
} }
...@@ -207,9 +213,10 @@ func (client ReplicationsClient) DeleteResponder(resp *http.Response) (result au ...@@ -207,9 +213,10 @@ func (client ReplicationsClient) DeleteResponder(resp *http.Response) (result au
} }
// Get gets the properties of the specified replication. // Get gets the properties of the specified replication.
// // Parameters:
// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the // resourceGroupName - the name of the resource group to which the container registry belongs.
// name of the container registry. replicationName is the name of the replication. // registryName - the name of the container registry.
// replicationName - the name of the replication.
func (client ReplicationsClient) Get(ctx context.Context, resourceGroupName string, registryName string, replicationName string) (result Replication, err error) { func (client ReplicationsClient) Get(ctx context.Context, resourceGroupName string, registryName string, replicationName string) (result Replication, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: registryName, {TargetValue: registryName,
...@@ -287,9 +294,9 @@ func (client ReplicationsClient) GetResponder(resp *http.Response) (result Repli ...@@ -287,9 +294,9 @@ func (client ReplicationsClient) GetResponder(resp *http.Response) (result Repli
} }
// List lists all the replications for the specified container registry. // List lists all the replications for the specified container registry.
// // Parameters:
// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the // resourceGroupName - the name of the resource group to which the container registry belongs.
// name of the container registry. // registryName - the name of the container registry.
func (client ReplicationsClient) List(ctx context.Context, resourceGroupName string, registryName string) (result ReplicationListResultPage, err error) { func (client ReplicationsClient) List(ctx context.Context, resourceGroupName string, registryName string) (result ReplicationListResultPage, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: registryName, {TargetValue: registryName,
...@@ -390,10 +397,11 @@ func (client ReplicationsClient) ListComplete(ctx context.Context, resourceGroup ...@@ -390,10 +397,11 @@ func (client ReplicationsClient) ListComplete(ctx context.Context, resourceGroup
} }
// Update updates a replication for a container registry with the specified parameters. // Update updates a replication for a container registry with the specified parameters.
// // Parameters:
// resourceGroupName is the name of the resource group to which the container registry belongs. registryName is the // resourceGroupName - the name of the resource group to which the container registry belongs.
// name of the container registry. replicationName is the name of the replication. replicationUpdateParameters is // registryName - the name of the container registry.
// the parameters for updating a replication. // replicationName - the name of the replication.
// replicationUpdateParameters - the parameters for updating a replication.
func (client ReplicationsClient) Update(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replicationUpdateParameters ReplicationUpdateParameters) (result ReplicationsUpdateFuture, err error) { func (client ReplicationsClient) Update(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replicationUpdateParameters ReplicationUpdateParameters) (result ReplicationsUpdateFuture, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: registryName, {TargetValue: registryName,
...@@ -437,7 +445,7 @@ func (client ReplicationsClient) UpdatePreparer(ctx context.Context, resourceGro ...@@ -437,7 +445,7 @@ func (client ReplicationsClient) UpdatePreparer(ctx context.Context, resourceGro
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(), autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", pathParameters),
...@@ -449,15 +457,17 @@ func (client ReplicationsClient) UpdatePreparer(ctx context.Context, resourceGro ...@@ -449,15 +457,17 @@ func (client ReplicationsClient) UpdatePreparer(ctx context.Context, resourceGro
// UpdateSender sends the Update request. The method will close the // UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client ReplicationsClient) UpdateSender(req *http.Request) (future ReplicationsUpdateFuture, err error) { func (client ReplicationsClient) UpdateSender(req *http.Request) (future ReplicationsUpdateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
return return
} }
......
...@@ -40,9 +40,10 @@ func NewApplicationSecurityGroupsClientWithBaseURI(baseURI string, subscriptionI ...@@ -40,9 +40,10 @@ func NewApplicationSecurityGroupsClientWithBaseURI(baseURI string, subscriptionI
} }
// CreateOrUpdate creates or updates an application security group. // CreateOrUpdate creates or updates an application security group.
// // Parameters:
// resourceGroupName is the name of the resource group. applicationSecurityGroupName is the name of the application // resourceGroupName - the name of the resource group.
// security group. parameters is parameters supplied to the create or update ApplicationSecurityGroup operation. // applicationSecurityGroupName - the name of the application security group.
// parameters - parameters supplied to the create or update ApplicationSecurityGroup operation.
func (client ApplicationSecurityGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters ApplicationSecurityGroup) (result ApplicationSecurityGroupsCreateOrUpdateFuture, err error) { func (client ApplicationSecurityGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string, parameters ApplicationSecurityGroup) (result ApplicationSecurityGroupsCreateOrUpdateFuture, err error) {
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, applicationSecurityGroupName, parameters) req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, applicationSecurityGroupName, parameters)
if err != nil { if err != nil {
...@@ -73,7 +74,7 @@ func (client ApplicationSecurityGroupsClient) CreateOrUpdatePreparer(ctx context ...@@ -73,7 +74,7 @@ func (client ApplicationSecurityGroupsClient) CreateOrUpdatePreparer(ctx context
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationSecurityGroups/{applicationSecurityGroupName}", pathParameters),
...@@ -85,15 +86,17 @@ func (client ApplicationSecurityGroupsClient) CreateOrUpdatePreparer(ctx context ...@@ -85,15 +86,17 @@ func (client ApplicationSecurityGroupsClient) CreateOrUpdatePreparer(ctx context
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client ApplicationSecurityGroupsClient) CreateOrUpdateSender(req *http.Request) (future ApplicationSecurityGroupsCreateOrUpdateFuture, err error) { func (client ApplicationSecurityGroupsClient) CreateOrUpdateSender(req *http.Request) (future ApplicationSecurityGroupsCreateOrUpdateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
return return
} }
...@@ -111,9 +114,9 @@ func (client ApplicationSecurityGroupsClient) CreateOrUpdateResponder(resp *http ...@@ -111,9 +114,9 @@ func (client ApplicationSecurityGroupsClient) CreateOrUpdateResponder(resp *http
} }
// Delete deletes the specified application security group. // Delete deletes the specified application security group.
// // Parameters:
// resourceGroupName is the name of the resource group. applicationSecurityGroupName is the name of the application // resourceGroupName - the name of the resource group.
// security group. // applicationSecurityGroupName - the name of the application security group.
func (client ApplicationSecurityGroupsClient) Delete(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string) (result ApplicationSecurityGroupsDeleteFuture, err error) { func (client ApplicationSecurityGroupsClient) Delete(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string) (result ApplicationSecurityGroupsDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, applicationSecurityGroupName) req, err := client.DeletePreparer(ctx, resourceGroupName, applicationSecurityGroupName)
if err != nil { if err != nil {
...@@ -154,15 +157,17 @@ func (client ApplicationSecurityGroupsClient) DeletePreparer(ctx context.Context ...@@ -154,15 +157,17 @@ func (client ApplicationSecurityGroupsClient) DeletePreparer(ctx context.Context
// DeleteSender sends the Delete request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client ApplicationSecurityGroupsClient) DeleteSender(req *http.Request) (future ApplicationSecurityGroupsDeleteFuture, err error) { func (client ApplicationSecurityGroupsClient) DeleteSender(req *http.Request) (future ApplicationSecurityGroupsDeleteFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
return return
} }
...@@ -179,9 +184,9 @@ func (client ApplicationSecurityGroupsClient) DeleteResponder(resp *http.Respons ...@@ -179,9 +184,9 @@ func (client ApplicationSecurityGroupsClient) DeleteResponder(resp *http.Respons
} }
// Get gets information about the specified application security group. // Get gets information about the specified application security group.
// // Parameters:
// resourceGroupName is the name of the resource group. applicationSecurityGroupName is the name of the application // resourceGroupName - the name of the resource group.
// security group. // applicationSecurityGroupName - the name of the application security group.
func (client ApplicationSecurityGroupsClient) Get(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string) (result ApplicationSecurityGroup, err error) { func (client ApplicationSecurityGroupsClient) Get(ctx context.Context, resourceGroupName string, applicationSecurityGroupName string) (result ApplicationSecurityGroup, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, applicationSecurityGroupName) req, err := client.GetPreparer(ctx, resourceGroupName, applicationSecurityGroupName)
if err != nil { if err != nil {
...@@ -246,8 +251,8 @@ func (client ApplicationSecurityGroupsClient) GetResponder(resp *http.Response) ...@@ -246,8 +251,8 @@ func (client ApplicationSecurityGroupsClient) GetResponder(resp *http.Response)
} }
// List gets all the application security groups in a resource group. // List gets all the application security groups in a resource group.
// // Parameters:
// resourceGroupName is the name of the resource group. // resourceGroupName - the name of the resource group.
func (client ApplicationSecurityGroupsClient) List(ctx context.Context, resourceGroupName string) (result ApplicationSecurityGroupListResultPage, err error) { func (client ApplicationSecurityGroupsClient) List(ctx context.Context, resourceGroupName string) (result ApplicationSecurityGroupListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName) req, err := client.ListPreparer(ctx, resourceGroupName)
......
...@@ -40,8 +40,8 @@ func NewAvailableEndpointServicesClientWithBaseURI(baseURI string, subscriptionI ...@@ -40,8 +40,8 @@ func NewAvailableEndpointServicesClientWithBaseURI(baseURI string, subscriptionI
} }
// List list what values of endpoint services are available for use. // List list what values of endpoint services are available for use.
// // Parameters:
// location is the location to check available endpoint services. // location - the location to check available endpoint services.
func (client AvailableEndpointServicesClient) List(ctx context.Context, location string) (result EndpointServicesListResultPage, err error) { func (client AvailableEndpointServicesClient) List(ctx context.Context, location string) (result EndpointServicesListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, location) req, err := client.ListPreparer(ctx, location)
......
...@@ -54,9 +54,10 @@ func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { ...@@ -54,9 +54,10 @@ func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient {
} }
// CheckDNSNameAvailability checks whether a domain name in the cloudapp.azure.com zone is available for use. // CheckDNSNameAvailability checks whether a domain name in the cloudapp.azure.com zone is available for use.
// // Parameters:
// location is the location of the domain name. domainNameLabel is the domain name to be verified. It must conform // location - the location of the domain name.
// to the following regular expression: ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. // domainNameLabel - the domain name to be verified. It must conform to the following regular expression:
// ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.
func (client BaseClient) CheckDNSNameAvailability(ctx context.Context, location string, domainNameLabel string) (result DNSNameAvailabilityResult, err error) { func (client BaseClient) CheckDNSNameAvailability(ctx context.Context, location string, domainNameLabel string) (result DNSNameAvailabilityResult, err error) {
req, err := client.CheckDNSNameAvailabilityPreparer(ctx, location, domainNameLabel) req, err := client.CheckDNSNameAvailabilityPreparer(ctx, location, domainNameLabel)
if err != nil { if err != nil {
......
...@@ -40,9 +40,10 @@ func NewDefaultSecurityRulesClientWithBaseURI(baseURI string, subscriptionID str ...@@ -40,9 +40,10 @@ func NewDefaultSecurityRulesClientWithBaseURI(baseURI string, subscriptionID str
} }
// Get get the specified default network security rule. // Get get the specified default network security rule.
// // Parameters:
// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network // resourceGroupName - the name of the resource group.
// security group. defaultSecurityRuleName is the name of the default security rule. // networkSecurityGroupName - the name of the network security group.
// defaultSecurityRuleName - the name of the default security rule.
func (client DefaultSecurityRulesClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, defaultSecurityRuleName string) (result SecurityRule, err error) { func (client DefaultSecurityRulesClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, defaultSecurityRuleName string) (result SecurityRule, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName) req, err := client.GetPreparer(ctx, resourceGroupName, networkSecurityGroupName, defaultSecurityRuleName)
if err != nil { if err != nil {
...@@ -108,9 +109,9 @@ func (client DefaultSecurityRulesClient) GetResponder(resp *http.Response) (resu ...@@ -108,9 +109,9 @@ func (client DefaultSecurityRulesClient) GetResponder(resp *http.Response) (resu
} }
// List gets all default security rules in a network security group. // List gets all default security rules in a network security group.
// // Parameters:
// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network // resourceGroupName - the name of the resource group.
// security group. // networkSecurityGroupName - the name of the network security group.
func (client DefaultSecurityRulesClient) List(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (result SecurityRuleListResultPage, err error) { func (client DefaultSecurityRulesClient) List(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (result SecurityRuleListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName, networkSecurityGroupName) req, err := client.ListPreparer(ctx, resourceGroupName, networkSecurityGroupName)
......
...@@ -42,10 +42,12 @@ func NewExpressRouteCircuitAuthorizationsClientWithBaseURI(baseURI string, subsc ...@@ -42,10 +42,12 @@ func NewExpressRouteCircuitAuthorizationsClientWithBaseURI(baseURI string, subsc
} }
// CreateOrUpdate creates or updates an authorization in the specified express route circuit. // CreateOrUpdate creates or updates an authorization in the specified express route circuit.
// // Parameters:
// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. // resourceGroupName - the name of the resource group.
// authorizationName is the name of the authorization. authorizationParameters is parameters supplied to the create // circuitName - the name of the express route circuit.
// or update express route circuit authorization operation. // authorizationName - the name of the authorization.
// authorizationParameters - parameters supplied to the create or update express route circuit authorization
// operation.
func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization) (result ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture, err error) { func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization) (result ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture, err error) {
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, circuitName, authorizationName, authorizationParameters) req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, circuitName, authorizationName, authorizationParameters)
if err != nil { if err != nil {
...@@ -77,7 +79,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdatePreparer(ctx ...@@ -77,7 +79,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdatePreparer(ctx
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", pathParameters),
...@@ -89,15 +91,17 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdatePreparer(ctx ...@@ -89,15 +91,17 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdatePreparer(ctx
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture, err error) { func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteCircuitAuthorizationsCreateOrUpdateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
return return
} }
...@@ -115,9 +119,10 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateResponder(re ...@@ -115,9 +119,10 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateResponder(re
} }
// Delete deletes the specified authorization from the specified express route circuit. // Delete deletes the specified authorization from the specified express route circuit.
// // Parameters:
// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. // resourceGroupName - the name of the resource group.
// authorizationName is the name of the authorization. // circuitName - the name of the express route circuit.
// authorizationName - the name of the authorization.
func (client ExpressRouteCircuitAuthorizationsClient) Delete(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string) (result ExpressRouteCircuitAuthorizationsDeleteFuture, err error) { func (client ExpressRouteCircuitAuthorizationsClient) Delete(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string) (result ExpressRouteCircuitAuthorizationsDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, circuitName, authorizationName) req, err := client.DeletePreparer(ctx, resourceGroupName, circuitName, authorizationName)
if err != nil { if err != nil {
...@@ -159,15 +164,17 @@ func (client ExpressRouteCircuitAuthorizationsClient) DeletePreparer(ctx context ...@@ -159,15 +164,17 @@ func (client ExpressRouteCircuitAuthorizationsClient) DeletePreparer(ctx context
// DeleteSender sends the Delete request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client ExpressRouteCircuitAuthorizationsClient) DeleteSender(req *http.Request) (future ExpressRouteCircuitAuthorizationsDeleteFuture, err error) { func (client ExpressRouteCircuitAuthorizationsClient) DeleteSender(req *http.Request) (future ExpressRouteCircuitAuthorizationsDeleteFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
return return
} }
...@@ -184,9 +191,10 @@ func (client ExpressRouteCircuitAuthorizationsClient) DeleteResponder(resp *http ...@@ -184,9 +191,10 @@ func (client ExpressRouteCircuitAuthorizationsClient) DeleteResponder(resp *http
} }
// Get gets the specified authorization from the specified express route circuit. // Get gets the specified authorization from the specified express route circuit.
// // Parameters:
// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. // resourceGroupName - the name of the resource group.
// authorizationName is the name of the authorization. // circuitName - the name of the express route circuit.
// authorizationName - the name of the authorization.
func (client ExpressRouteCircuitAuthorizationsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string) (result ExpressRouteCircuitAuthorization, err error) { func (client ExpressRouteCircuitAuthorizationsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, authorizationName string) (result ExpressRouteCircuitAuthorization, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, circuitName, authorizationName) req, err := client.GetPreparer(ctx, resourceGroupName, circuitName, authorizationName)
if err != nil { if err != nil {
...@@ -252,8 +260,9 @@ func (client ExpressRouteCircuitAuthorizationsClient) GetResponder(resp *http.Re ...@@ -252,8 +260,9 @@ 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.
// // Parameters:
// resourceGroupName is the name of the resource group. circuitName is the name of the circuit. // resourceGroupName - the name of the resource group.
// circuitName - the name of the circuit.
func (client ExpressRouteCircuitAuthorizationsClient) List(ctx context.Context, resourceGroupName string, circuitName string) (result AuthorizationListResultPage, err error) { func (client ExpressRouteCircuitAuthorizationsClient) List(ctx context.Context, resourceGroupName string, circuitName string) (result AuthorizationListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName, circuitName) req, err := client.ListPreparer(ctx, resourceGroupName, circuitName)
......
...@@ -40,10 +40,11 @@ func NewExpressRouteCircuitPeeringsClientWithBaseURI(baseURI string, subscriptio ...@@ -40,10 +40,11 @@ func NewExpressRouteCircuitPeeringsClientWithBaseURI(baseURI string, subscriptio
} }
// CreateOrUpdate creates or updates a peering in the specified express route circuits. // CreateOrUpdate creates or updates a peering in the specified express route circuits.
// // Parameters:
// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. // resourceGroupName - the name of the resource group.
// peeringName is the name of the peering. peeringParameters is parameters supplied to the create or update express // circuitName - the name of the express route circuit.
// route circuit peering operation. // peeringName - the name of the peering.
// peeringParameters - parameters supplied to the create or update express route circuit peering operation.
func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering) (result ExpressRouteCircuitPeeringsCreateOrUpdateFuture, err error) { func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering) (result ExpressRouteCircuitPeeringsCreateOrUpdateFuture, err error) {
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, circuitName, peeringName, peeringParameters) req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, circuitName, peeringName, peeringParameters)
if err != nil { if err != nil {
...@@ -75,7 +76,7 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdatePreparer(ctx conte ...@@ -75,7 +76,7 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdatePreparer(ctx conte
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", pathParameters),
...@@ -87,15 +88,17 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdatePreparer(ctx conte ...@@ -87,15 +88,17 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdatePreparer(ctx conte
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteCircuitPeeringsCreateOrUpdateFuture, err error) { func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteCircuitPeeringsCreateOrUpdateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
return return
} }
...@@ -113,9 +116,10 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateResponder(resp *ht ...@@ -113,9 +116,10 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateResponder(resp *ht
} }
// Delete deletes the specified peering from the specified express route circuit. // Delete deletes the specified peering from the specified express route circuit.
// // Parameters:
// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. // resourceGroupName - the name of the resource group.
// peeringName is the name of the peering. // circuitName - the name of the express route circuit.
// peeringName - the name of the peering.
func (client ExpressRouteCircuitPeeringsClient) Delete(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitPeeringsDeleteFuture, err error) { func (client ExpressRouteCircuitPeeringsClient) Delete(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitPeeringsDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, circuitName, peeringName) req, err := client.DeletePreparer(ctx, resourceGroupName, circuitName, peeringName)
if err != nil { if err != nil {
...@@ -157,15 +161,17 @@ func (client ExpressRouteCircuitPeeringsClient) DeletePreparer(ctx context.Conte ...@@ -157,15 +161,17 @@ func (client ExpressRouteCircuitPeeringsClient) DeletePreparer(ctx context.Conte
// DeleteSender sends the Delete request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client ExpressRouteCircuitPeeringsClient) DeleteSender(req *http.Request) (future ExpressRouteCircuitPeeringsDeleteFuture, err error) { func (client ExpressRouteCircuitPeeringsClient) DeleteSender(req *http.Request) (future ExpressRouteCircuitPeeringsDeleteFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
return return
} }
...@@ -182,9 +188,10 @@ func (client ExpressRouteCircuitPeeringsClient) DeleteResponder(resp *http.Respo ...@@ -182,9 +188,10 @@ func (client ExpressRouteCircuitPeeringsClient) DeleteResponder(resp *http.Respo
} }
// Get gets the specified authorization from the specified express route circuit. // Get gets the specified authorization from the specified express route circuit.
// // Parameters:
// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. // resourceGroupName - the name of the resource group.
// peeringName is the name of the peering. // circuitName - the name of the express route circuit.
// peeringName - the name of the peering.
func (client ExpressRouteCircuitPeeringsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitPeering, err error) { func (client ExpressRouteCircuitPeeringsClient) Get(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitPeering, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, circuitName, peeringName) req, err := client.GetPreparer(ctx, resourceGroupName, circuitName, peeringName)
if err != nil { if err != nil {
...@@ -250,8 +257,9 @@ func (client ExpressRouteCircuitPeeringsClient) GetResponder(resp *http.Response ...@@ -250,8 +257,9 @@ 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.
// // Parameters:
// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit. // resourceGroupName - the name of the resource group.
// circuitName - the name of the express route circuit.
func (client ExpressRouteCircuitPeeringsClient) List(ctx context.Context, resourceGroupName string, circuitName string) (result ExpressRouteCircuitPeeringListResultPage, err error) { func (client ExpressRouteCircuitPeeringsClient) List(ctx context.Context, resourceGroupName string, circuitName string) (result ExpressRouteCircuitPeeringListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName, circuitName) req, err := client.ListPreparer(ctx, resourceGroupName, circuitName)
......
...@@ -41,10 +41,11 @@ func NewInboundNatRulesClientWithBaseURI(baseURI string, subscriptionID string) ...@@ -41,10 +41,11 @@ func NewInboundNatRulesClientWithBaseURI(baseURI string, subscriptionID string)
} }
// CreateOrUpdate creates or updates a load balancer inbound nat rule. // CreateOrUpdate creates or updates a load balancer inbound nat rule.
// // Parameters:
// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. // resourceGroupName - the name of the resource group.
// inboundNatRuleName is the name of the inbound nat rule. inboundNatRuleParameters is parameters supplied to the // loadBalancerName - the name of the load balancer.
// create or update inbound nat rule operation. // inboundNatRuleName - the name of the inbound nat rule.
// inboundNatRuleParameters - parameters supplied to the create or update inbound nat rule operation.
func (client InboundNatRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, inboundNatRuleParameters InboundNatRule) (result InboundNatRulesCreateOrUpdateFuture, err error) { func (client InboundNatRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, inboundNatRuleParameters InboundNatRule) (result InboundNatRulesCreateOrUpdateFuture, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: inboundNatRuleParameters, {TargetValue: inboundNatRuleParameters,
...@@ -95,7 +96,7 @@ func (client InboundNatRulesClient) CreateOrUpdatePreparer(ctx context.Context, ...@@ -95,7 +96,7 @@ func (client InboundNatRulesClient) CreateOrUpdatePreparer(ctx context.Context,
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatRules/{inboundNatRuleName}", pathParameters),
...@@ -107,15 +108,17 @@ func (client InboundNatRulesClient) CreateOrUpdatePreparer(ctx context.Context, ...@@ -107,15 +108,17 @@ func (client InboundNatRulesClient) CreateOrUpdatePreparer(ctx context.Context,
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client InboundNatRulesClient) CreateOrUpdateSender(req *http.Request) (future InboundNatRulesCreateOrUpdateFuture, err error) { func (client InboundNatRulesClient) CreateOrUpdateSender(req *http.Request) (future InboundNatRulesCreateOrUpdateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
return return
} }
...@@ -133,9 +136,10 @@ func (client InboundNatRulesClient) CreateOrUpdateResponder(resp *http.Response) ...@@ -133,9 +136,10 @@ func (client InboundNatRulesClient) CreateOrUpdateResponder(resp *http.Response)
} }
// Delete deletes the specified load balancer inbound nat rule. // Delete deletes the specified load balancer inbound nat rule.
// // Parameters:
// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. // resourceGroupName - the name of the resource group.
// inboundNatRuleName is the name of the inbound nat rule. // loadBalancerName - the name of the load balancer.
// inboundNatRuleName - the name of the inbound nat rule.
func (client InboundNatRulesClient) Delete(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string) (result InboundNatRulesDeleteFuture, err error) { func (client InboundNatRulesClient) Delete(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string) (result InboundNatRulesDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName) req, err := client.DeletePreparer(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName)
if err != nil { if err != nil {
...@@ -177,15 +181,17 @@ func (client InboundNatRulesClient) DeletePreparer(ctx context.Context, resource ...@@ -177,15 +181,17 @@ func (client InboundNatRulesClient) DeletePreparer(ctx context.Context, resource
// DeleteSender sends the Delete request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client InboundNatRulesClient) DeleteSender(req *http.Request) (future InboundNatRulesDeleteFuture, err error) { func (client InboundNatRulesClient) DeleteSender(req *http.Request) (future InboundNatRulesDeleteFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
return return
} }
...@@ -202,9 +208,11 @@ func (client InboundNatRulesClient) DeleteResponder(resp *http.Response) (result ...@@ -202,9 +208,11 @@ func (client InboundNatRulesClient) DeleteResponder(resp *http.Response) (result
} }
// Get gets the specified load balancer inbound nat rule. // Get gets the specified load balancer inbound nat rule.
// // Parameters:
// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. // resourceGroupName - the name of the resource group.
// inboundNatRuleName is the name of the inbound nat rule. expand is expands referenced resources. // loadBalancerName - the name of the load balancer.
// inboundNatRuleName - the name of the inbound nat rule.
// expand - expands referenced resources.
func (client InboundNatRulesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, expand string) (result InboundNatRule, err error) { func (client InboundNatRulesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, inboundNatRuleName string, expand string) (result InboundNatRule, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName, expand) req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, inboundNatRuleName, expand)
if err != nil { if err != nil {
...@@ -273,8 +281,9 @@ func (client InboundNatRulesClient) GetResponder(resp *http.Response) (result In ...@@ -273,8 +281,9 @@ func (client InboundNatRulesClient) GetResponder(resp *http.Response) (result In
} }
// List gets all the inbound nat rules in a load balancer. // List gets all the inbound nat rules in a load balancer.
// // Parameters:
// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. // resourceGroupName - the name of the resource group.
// loadBalancerName - the name of the load balancer.
func (client InboundNatRulesClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result InboundNatRuleListResultPage, err error) { func (client InboundNatRulesClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result InboundNatRuleListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName)
......
...@@ -40,9 +40,10 @@ func NewInterfaceIPConfigurationsClientWithBaseURI(baseURI string, subscriptionI ...@@ -40,9 +40,10 @@ func NewInterfaceIPConfigurationsClientWithBaseURI(baseURI string, subscriptionI
} }
// Get gets the specified network interface ip configuration. // Get gets the specified network interface ip configuration.
// // Parameters:
// resourceGroupName is the name of the resource group. networkInterfaceName is the name of the network interface. // resourceGroupName - the name of the resource group.
// IPConfigurationName is the name of the ip configuration name. // networkInterfaceName - the name of the network interface.
// IPConfigurationName - the name of the ip configuration name.
func (client InterfaceIPConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, IPConfigurationName string) (result InterfaceIPConfiguration, err error) { func (client InterfaceIPConfigurationsClient) Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, IPConfigurationName string) (result InterfaceIPConfiguration, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, networkInterfaceName, IPConfigurationName) req, err := client.GetPreparer(ctx, resourceGroupName, networkInterfaceName, IPConfigurationName)
if err != nil { if err != nil {
...@@ -108,8 +109,9 @@ func (client InterfaceIPConfigurationsClient) GetResponder(resp *http.Response) ...@@ -108,8 +109,9 @@ func (client InterfaceIPConfigurationsClient) GetResponder(resp *http.Response)
} }
// List get all ip configurations in a network interface // List get all ip configurations in a network interface
// // Parameters:
// resourceGroupName is the name of the resource group. networkInterfaceName is the name of the network interface. // resourceGroupName - the name of the resource group.
// networkInterfaceName - the name of the network interface.
func (client InterfaceIPConfigurationsClient) List(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfaceIPConfigurationListResultPage, err error) { func (client InterfaceIPConfigurationsClient) List(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfaceIPConfigurationListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName, networkInterfaceName) req, err := client.ListPreparer(ctx, resourceGroupName, networkInterfaceName)
......
...@@ -40,8 +40,9 @@ func NewInterfaceLoadBalancersClientWithBaseURI(baseURI string, subscriptionID s ...@@ -40,8 +40,9 @@ func NewInterfaceLoadBalancersClientWithBaseURI(baseURI string, subscriptionID s
} }
// List list all load balancers in a network interface. // List list all load balancers in a network interface.
// // Parameters:
// resourceGroupName is the name of the resource group. networkInterfaceName is the name of the network interface. // resourceGroupName - the name of the resource group.
// networkInterfaceName - the name of the network interface.
func (client InterfaceLoadBalancersClient) List(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfaceLoadBalancerListResultPage, err error) { func (client InterfaceLoadBalancersClient) List(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfaceLoadBalancerListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName, networkInterfaceName) req, err := client.ListPreparer(ctx, resourceGroupName, networkInterfaceName)
......
...@@ -41,9 +41,10 @@ func NewLoadBalancerBackendAddressPoolsClientWithBaseURI(baseURI string, subscri ...@@ -41,9 +41,10 @@ func NewLoadBalancerBackendAddressPoolsClientWithBaseURI(baseURI string, subscri
} }
// Get gets load balancer backend address pool. // Get gets load balancer backend address pool.
// // Parameters:
// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. // resourceGroupName - the name of the resource group.
// backendAddressPoolName is the name of the backend address pool. // loadBalancerName - the name of the load balancer.
// backendAddressPoolName - the name of the backend address pool.
func (client LoadBalancerBackendAddressPoolsClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string) (result BackendAddressPool, err error) { func (client LoadBalancerBackendAddressPoolsClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, backendAddressPoolName string) (result BackendAddressPool, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, backendAddressPoolName) req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, backendAddressPoolName)
if err != nil { if err != nil {
...@@ -109,8 +110,9 @@ func (client LoadBalancerBackendAddressPoolsClient) GetResponder(resp *http.Resp ...@@ -109,8 +110,9 @@ func (client LoadBalancerBackendAddressPoolsClient) GetResponder(resp *http.Resp
} }
// List gets all the load balancer backed address pools. // List gets all the load balancer backed address pools.
// // Parameters:
// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. // resourceGroupName - the name of the resource group.
// loadBalancerName - the name of the load balancer.
func (client LoadBalancerBackendAddressPoolsClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerBackendAddressPoolListResultPage, err error) { func (client LoadBalancerBackendAddressPoolsClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerBackendAddressPoolListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName)
......
...@@ -42,9 +42,10 @@ func NewLoadBalancerFrontendIPConfigurationsClientWithBaseURI(baseURI string, su ...@@ -42,9 +42,10 @@ func NewLoadBalancerFrontendIPConfigurationsClientWithBaseURI(baseURI string, su
} }
// Get gets load balancer frontend IP configuration. // Get gets load balancer frontend IP configuration.
// // Parameters:
// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. // resourceGroupName - the name of the resource group.
// frontendIPConfigurationName is the name of the frontend IP configuration. // loadBalancerName - the name of the load balancer.
// frontendIPConfigurationName - the name of the frontend IP configuration.
func (client LoadBalancerFrontendIPConfigurationsClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, frontendIPConfigurationName string) (result FrontendIPConfiguration, err error) { func (client LoadBalancerFrontendIPConfigurationsClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, frontendIPConfigurationName string) (result FrontendIPConfiguration, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, frontendIPConfigurationName) req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, frontendIPConfigurationName)
if err != nil { if err != nil {
...@@ -110,8 +111,9 @@ func (client LoadBalancerFrontendIPConfigurationsClient) GetResponder(resp *http ...@@ -110,8 +111,9 @@ func (client LoadBalancerFrontendIPConfigurationsClient) GetResponder(resp *http
} }
// List gets all the load balancer frontend IP configurations. // List gets all the load balancer frontend IP configurations.
// // Parameters:
// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. // resourceGroupName - the name of the resource group.
// loadBalancerName - the name of the load balancer.
func (client LoadBalancerFrontendIPConfigurationsClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerFrontendIPConfigurationListResultPage, err error) { func (client LoadBalancerFrontendIPConfigurationsClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerFrontendIPConfigurationListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName)
......
...@@ -41,9 +41,10 @@ func NewLoadBalancerLoadBalancingRulesClientWithBaseURI(baseURI string, subscrip ...@@ -41,9 +41,10 @@ func NewLoadBalancerLoadBalancingRulesClientWithBaseURI(baseURI string, subscrip
} }
// Get gets the specified load balancer load balancing rule. // Get gets the specified load balancer load balancing rule.
// // Parameters:
// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. // resourceGroupName - the name of the resource group.
// loadBalancingRuleName is the name of the load balancing rule. // loadBalancerName - the name of the load balancer.
// loadBalancingRuleName - the name of the load balancing rule.
func (client LoadBalancerLoadBalancingRulesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, loadBalancingRuleName string) (result LoadBalancingRule, err error) { func (client LoadBalancerLoadBalancingRulesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, loadBalancingRuleName string) (result LoadBalancingRule, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, loadBalancingRuleName) req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, loadBalancingRuleName)
if err != nil { if err != nil {
...@@ -109,8 +110,9 @@ func (client LoadBalancerLoadBalancingRulesClient) GetResponder(resp *http.Respo ...@@ -109,8 +110,9 @@ func (client LoadBalancerLoadBalancingRulesClient) GetResponder(resp *http.Respo
} }
// List gets all the load balancing rules in a load balancer. // List gets all the load balancing rules in a load balancer.
// // Parameters:
// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. // resourceGroupName - the name of the resource group.
// loadBalancerName - the name of the load balancer.
func (client LoadBalancerLoadBalancingRulesClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerLoadBalancingRuleListResultPage, err error) { func (client LoadBalancerLoadBalancingRulesClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerLoadBalancingRuleListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName)
......
...@@ -41,8 +41,9 @@ func NewLoadBalancerNetworkInterfacesClientWithBaseURI(baseURI string, subscript ...@@ -41,8 +41,9 @@ func NewLoadBalancerNetworkInterfacesClientWithBaseURI(baseURI string, subscript
} }
// List gets associated load balancer network interfaces. // List gets associated load balancer network interfaces.
// // Parameters:
// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. // resourceGroupName - the name of the resource group.
// loadBalancerName - the name of the load balancer.
func (client LoadBalancerNetworkInterfacesClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result InterfaceListResultPage, err error) { func (client LoadBalancerNetworkInterfacesClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result InterfaceListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName)
......
...@@ -40,9 +40,10 @@ func NewLoadBalancerProbesClientWithBaseURI(baseURI string, subscriptionID strin ...@@ -40,9 +40,10 @@ func NewLoadBalancerProbesClientWithBaseURI(baseURI string, subscriptionID strin
} }
// Get gets load balancer probe. // Get gets load balancer probe.
// // Parameters:
// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. // resourceGroupName - the name of the resource group.
// probeName is the name of the probe. // loadBalancerName - the name of the load balancer.
// probeName - the name of the probe.
func (client LoadBalancerProbesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, probeName string) (result Probe, err error) { func (client LoadBalancerProbesClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, probeName string) (result Probe, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, probeName) req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, probeName)
if err != nil { if err != nil {
...@@ -108,8 +109,9 @@ func (client LoadBalancerProbesClient) GetResponder(resp *http.Response) (result ...@@ -108,8 +109,9 @@ func (client LoadBalancerProbesClient) GetResponder(resp *http.Response) (result
} }
// List gets all the load balancer probes. // List gets all the load balancer probes.
// // Parameters:
// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. // resourceGroupName - the name of the resource group.
// loadBalancerName - the name of the load balancer.
func (client LoadBalancerProbesClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerProbeListResultPage, err error) { func (client LoadBalancerProbesClient) List(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancerProbeListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName) req, err := client.ListPreparer(ctx, resourceGroupName, loadBalancerName)
......
...@@ -40,9 +40,10 @@ func NewLoadBalancersClientWithBaseURI(baseURI string, subscriptionID string) Lo ...@@ -40,9 +40,10 @@ func NewLoadBalancersClientWithBaseURI(baseURI string, subscriptionID string) Lo
} }
// CreateOrUpdate creates or updates a load balancer. // CreateOrUpdate creates or updates a load balancer.
// // Parameters:
// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. // resourceGroupName - the name of the resource group.
// parameters is parameters supplied to the create or update load balancer operation. // loadBalancerName - the name of the load balancer.
// parameters - parameters supplied to the create or update load balancer operation.
func (client LoadBalancersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer) (result LoadBalancersCreateOrUpdateFuture, err error) { func (client LoadBalancersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters LoadBalancer) (result LoadBalancersCreateOrUpdateFuture, err error) {
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, loadBalancerName, parameters) req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, loadBalancerName, parameters)
if err != nil { if err != nil {
...@@ -73,7 +74,7 @@ func (client LoadBalancersClient) CreateOrUpdatePreparer(ctx context.Context, re ...@@ -73,7 +74,7 @@ func (client LoadBalancersClient) CreateOrUpdatePreparer(ctx context.Context, re
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters),
...@@ -85,15 +86,17 @@ func (client LoadBalancersClient) CreateOrUpdatePreparer(ctx context.Context, re ...@@ -85,15 +86,17 @@ func (client LoadBalancersClient) CreateOrUpdatePreparer(ctx context.Context, re
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client LoadBalancersClient) CreateOrUpdateSender(req *http.Request) (future LoadBalancersCreateOrUpdateFuture, err error) { func (client LoadBalancersClient) CreateOrUpdateSender(req *http.Request) (future LoadBalancersCreateOrUpdateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
return return
} }
...@@ -111,8 +114,9 @@ func (client LoadBalancersClient) CreateOrUpdateResponder(resp *http.Response) ( ...@@ -111,8 +114,9 @@ func (client LoadBalancersClient) CreateOrUpdateResponder(resp *http.Response) (
} }
// Delete deletes the specified load balancer. // Delete deletes the specified load balancer.
// // Parameters:
// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. // resourceGroupName - the name of the resource group.
// loadBalancerName - the name of the load balancer.
func (client LoadBalancersClient) Delete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancersDeleteFuture, err error) { func (client LoadBalancersClient) Delete(ctx context.Context, resourceGroupName string, loadBalancerName string) (result LoadBalancersDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, loadBalancerName) req, err := client.DeletePreparer(ctx, resourceGroupName, loadBalancerName)
if err != nil { if err != nil {
...@@ -153,15 +157,17 @@ func (client LoadBalancersClient) DeletePreparer(ctx context.Context, resourceGr ...@@ -153,15 +157,17 @@ func (client LoadBalancersClient) DeletePreparer(ctx context.Context, resourceGr
// DeleteSender sends the Delete request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client LoadBalancersClient) DeleteSender(req *http.Request) (future LoadBalancersDeleteFuture, err error) { func (client LoadBalancersClient) DeleteSender(req *http.Request) (future LoadBalancersDeleteFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender)
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return return
} }
...@@ -178,9 +184,10 @@ func (client LoadBalancersClient) DeleteResponder(resp *http.Response) (result a ...@@ -178,9 +184,10 @@ func (client LoadBalancersClient) DeleteResponder(resp *http.Response) (result a
} }
// Get gets the specified load balancer. // Get gets the specified load balancer.
// // Parameters:
// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. expand // resourceGroupName - the name of the resource group.
// is expands referenced resources. // loadBalancerName - the name of the load balancer.
// expand - expands referenced resources.
func (client LoadBalancersClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, expand string) (result LoadBalancer, err error) { func (client LoadBalancersClient) Get(ctx context.Context, resourceGroupName string, loadBalancerName string, expand string) (result LoadBalancer, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, expand) req, err := client.GetPreparer(ctx, resourceGroupName, loadBalancerName, expand)
if err != nil { if err != nil {
...@@ -248,8 +255,8 @@ func (client LoadBalancersClient) GetResponder(resp *http.Response) (result Load ...@@ -248,8 +255,8 @@ func (client LoadBalancersClient) GetResponder(resp *http.Response) (result Load
} }
// List gets all the load balancers in a resource group. // List gets all the load balancers in a resource group.
// // Parameters:
// resourceGroupName is the name of the resource group. // resourceGroupName - the name of the resource group.
func (client LoadBalancersClient) List(ctx context.Context, resourceGroupName string) (result LoadBalancerListResultPage, err error) { func (client LoadBalancersClient) List(ctx context.Context, resourceGroupName string) (result LoadBalancerListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName) req, err := client.ListPreparer(ctx, resourceGroupName)
...@@ -431,9 +438,10 @@ func (client LoadBalancersClient) ListAllComplete(ctx context.Context) (result L ...@@ -431,9 +438,10 @@ func (client LoadBalancersClient) ListAllComplete(ctx context.Context) (result L
} }
// UpdateTags updates a load balancer tags. // UpdateTags updates a load balancer tags.
// // Parameters:
// resourceGroupName is the name of the resource group. loadBalancerName is the name of the load balancer. // resourceGroupName - the name of the resource group.
// parameters is parameters supplied to update load balancer tags. // loadBalancerName - the name of the load balancer.
// parameters - parameters supplied to update load balancer tags.
func (client LoadBalancersClient) UpdateTags(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters TagsObject) (result LoadBalancersUpdateTagsFuture, err error) { func (client LoadBalancersClient) UpdateTags(ctx context.Context, resourceGroupName string, loadBalancerName string, parameters TagsObject) (result LoadBalancersUpdateTagsFuture, err error) {
req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, loadBalancerName, parameters) req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, loadBalancerName, parameters)
if err != nil { if err != nil {
...@@ -464,7 +472,7 @@ func (client LoadBalancersClient) UpdateTagsPreparer(ctx context.Context, resour ...@@ -464,7 +472,7 @@ func (client LoadBalancersClient) UpdateTagsPreparer(ctx context.Context, resour
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(), autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters),
...@@ -476,15 +484,17 @@ func (client LoadBalancersClient) UpdateTagsPreparer(ctx context.Context, resour ...@@ -476,15 +484,17 @@ func (client LoadBalancersClient) UpdateTagsPreparer(ctx context.Context, resour
// UpdateTagsSender sends the UpdateTags request. The method will close the // UpdateTagsSender sends the UpdateTags request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client LoadBalancersClient) UpdateTagsSender(req *http.Request) (future LoadBalancersUpdateTagsFuture, err error) { func (client LoadBalancersClient) UpdateTagsSender(req *http.Request) (future LoadBalancersUpdateTagsFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK))
return return
} }
......
...@@ -41,9 +41,10 @@ func NewLocalNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID str ...@@ -41,9 +41,10 @@ func NewLocalNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID str
} }
// CreateOrUpdate creates or updates a local network gateway in the specified resource group. // CreateOrUpdate creates or updates a local network gateway in the specified resource group.
// // Parameters:
// resourceGroupName is the name of the resource group. localNetworkGatewayName is the name of the local network // resourceGroupName - the name of the resource group.
// gateway. parameters is parameters supplied to the create or update local network gateway operation. // localNetworkGatewayName - the name of the local network gateway.
// parameters - parameters supplied to the create or update local network gateway operation.
func (client LocalNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway) (result LocalNetworkGatewaysCreateOrUpdateFuture, err error) { func (client LocalNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway) (result LocalNetworkGatewaysCreateOrUpdateFuture, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: localNetworkGatewayName, {TargetValue: localNetworkGatewayName,
...@@ -82,7 +83,7 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Cont ...@@ -82,7 +83,7 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Cont
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", pathParameters),
...@@ -94,15 +95,17 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Cont ...@@ -94,15 +95,17 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Cont
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client LocalNetworkGatewaysClient) CreateOrUpdateSender(req *http.Request) (future LocalNetworkGatewaysCreateOrUpdateFuture, err error) { func (client LocalNetworkGatewaysClient) CreateOrUpdateSender(req *http.Request) (future LocalNetworkGatewaysCreateOrUpdateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
return return
} }
...@@ -120,9 +123,9 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Resp ...@@ -120,9 +123,9 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Resp
} }
// Delete deletes the specified local network gateway. // Delete deletes the specified local network gateway.
// // Parameters:
// resourceGroupName is the name of the resource group. localNetworkGatewayName is the name of the local network // resourceGroupName - the name of the resource group.
// gateway. // localNetworkGatewayName - the name of the local network gateway.
func (client LocalNetworkGatewaysClient) Delete(ctx context.Context, resourceGroupName string, localNetworkGatewayName string) (result LocalNetworkGatewaysDeleteFuture, err error) { func (client LocalNetworkGatewaysClient) Delete(ctx context.Context, resourceGroupName string, localNetworkGatewayName string) (result LocalNetworkGatewaysDeleteFuture, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: localNetworkGatewayName, {TargetValue: localNetworkGatewayName,
...@@ -169,15 +172,17 @@ func (client LocalNetworkGatewaysClient) DeletePreparer(ctx context.Context, res ...@@ -169,15 +172,17 @@ func (client LocalNetworkGatewaysClient) DeletePreparer(ctx context.Context, res
// DeleteSender sends the Delete request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client LocalNetworkGatewaysClient) DeleteSender(req *http.Request) (future LocalNetworkGatewaysDeleteFuture, err error) { func (client LocalNetworkGatewaysClient) DeleteSender(req *http.Request) (future LocalNetworkGatewaysDeleteFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender)
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return return
} }
...@@ -194,9 +199,9 @@ func (client LocalNetworkGatewaysClient) DeleteResponder(resp *http.Response) (r ...@@ -194,9 +199,9 @@ 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.
// // Parameters:
// resourceGroupName is the name of the resource group. localNetworkGatewayName is the name of the local network // resourceGroupName - the name of the resource group.
// gateway. // localNetworkGatewayName - the name of the local network gateway.
func (client LocalNetworkGatewaysClient) Get(ctx context.Context, resourceGroupName string, localNetworkGatewayName string) (result LocalNetworkGateway, err error) { func (client LocalNetworkGatewaysClient) Get(ctx context.Context, resourceGroupName string, localNetworkGatewayName string) (result LocalNetworkGateway, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: localNetworkGatewayName, {TargetValue: localNetworkGatewayName,
...@@ -267,8 +272,8 @@ func (client LocalNetworkGatewaysClient) GetResponder(resp *http.Response) (resu ...@@ -267,8 +272,8 @@ func (client LocalNetworkGatewaysClient) GetResponder(resp *http.Response) (resu
} }
// List gets all the local network gateways in a resource group. // List gets all the local network gateways in a resource group.
// // Parameters:
// resourceGroupName is the name of the resource group. // resourceGroupName - the name of the resource group.
func (client LocalNetworkGatewaysClient) List(ctx context.Context, resourceGroupName string) (result LocalNetworkGatewayListResultPage, err error) { func (client LocalNetworkGatewaysClient) List(ctx context.Context, resourceGroupName string) (result LocalNetworkGatewayListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName) req, err := client.ListPreparer(ctx, resourceGroupName)
...@@ -360,9 +365,10 @@ func (client LocalNetworkGatewaysClient) ListComplete(ctx context.Context, resou ...@@ -360,9 +365,10 @@ func (client LocalNetworkGatewaysClient) ListComplete(ctx context.Context, resou
} }
// UpdateTags updates a local network gateway tags. // UpdateTags updates a local network gateway tags.
// // Parameters:
// resourceGroupName is the name of the resource group. localNetworkGatewayName is the name of the local network // resourceGroupName - the name of the resource group.
// gateway. parameters is parameters supplied to update local network gateway tags. // localNetworkGatewayName - the name of the local network gateway.
// parameters - parameters supplied to update local network gateway tags.
func (client LocalNetworkGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters TagsObject) (result LocalNetworkGatewaysUpdateTagsFuture, err error) { func (client LocalNetworkGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, localNetworkGatewayName string, parameters TagsObject) (result LocalNetworkGatewaysUpdateTagsFuture, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: localNetworkGatewayName, {TargetValue: localNetworkGatewayName,
...@@ -399,7 +405,7 @@ func (client LocalNetworkGatewaysClient) UpdateTagsPreparer(ctx context.Context, ...@@ -399,7 +405,7 @@ func (client LocalNetworkGatewaysClient) UpdateTagsPreparer(ctx context.Context,
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(), autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", pathParameters),
...@@ -411,15 +417,17 @@ func (client LocalNetworkGatewaysClient) UpdateTagsPreparer(ctx context.Context, ...@@ -411,15 +417,17 @@ func (client LocalNetworkGatewaysClient) UpdateTagsPreparer(ctx context.Context,
// UpdateTagsSender sends the UpdateTags request. The method will close the // UpdateTagsSender sends the UpdateTags request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client LocalNetworkGatewaysClient) UpdateTagsSender(req *http.Request) (future LocalNetworkGatewaysUpdateTagsFuture, err error) { func (client LocalNetworkGatewaysClient) UpdateTagsSender(req *http.Request) (future LocalNetworkGatewaysUpdateTagsFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK))
return return
} }
......
...@@ -41,10 +41,11 @@ func NewPacketCapturesClientWithBaseURI(baseURI string, subscriptionID string) P ...@@ -41,10 +41,11 @@ func NewPacketCapturesClientWithBaseURI(baseURI string, subscriptionID string) P
} }
// Create create and start a packet capture on the specified VM. // Create create and start a packet capture on the specified VM.
// // Parameters:
// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher. // resourceGroupName - the name of the resource group.
// packetCaptureName is the name of the packet capture session. parameters is parameters that define the create // networkWatcherName - the name of the network watcher.
// packet capture operation. // packetCaptureName - the name of the packet capture session.
// parameters - parameters that define the create packet capture operation.
func (client PacketCapturesClient) Create(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, parameters PacketCapture) (result PacketCapturesCreateFuture, err error) { func (client PacketCapturesClient) Create(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string, parameters PacketCapture) (result PacketCapturesCreateFuture, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: parameters, {TargetValue: parameters,
...@@ -85,7 +86,7 @@ func (client PacketCapturesClient) CreatePreparer(ctx context.Context, resourceG ...@@ -85,7 +86,7 @@ func (client PacketCapturesClient) CreatePreparer(ctx context.Context, resourceG
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/packetCaptures/{packetCaptureName}", pathParameters),
...@@ -97,15 +98,17 @@ func (client PacketCapturesClient) CreatePreparer(ctx context.Context, resourceG ...@@ -97,15 +98,17 @@ func (client PacketCapturesClient) CreatePreparer(ctx context.Context, resourceG
// CreateSender sends the Create request. The method will close the // CreateSender sends the Create request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client PacketCapturesClient) CreateSender(req *http.Request) (future PacketCapturesCreateFuture, err error) { func (client PacketCapturesClient) CreateSender(req *http.Request) (future PacketCapturesCreateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
return return
} }
...@@ -123,9 +126,10 @@ func (client PacketCapturesClient) CreateResponder(resp *http.Response) (result ...@@ -123,9 +126,10 @@ func (client PacketCapturesClient) CreateResponder(resp *http.Response) (result
} }
// Delete deletes the specified packet capture session. // Delete deletes the specified packet capture session.
// // Parameters:
// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher. // resourceGroupName - the name of the resource group.
// packetCaptureName is the name of the packet capture session. // networkWatcherName - the name of the network watcher.
// packetCaptureName - the name of the packet capture session.
func (client PacketCapturesClient) Delete(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (result PacketCapturesDeleteFuture, err error) { func (client PacketCapturesClient) Delete(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (result PacketCapturesDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName) req, err := client.DeletePreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName)
if err != nil { if err != nil {
...@@ -167,15 +171,17 @@ func (client PacketCapturesClient) DeletePreparer(ctx context.Context, resourceG ...@@ -167,15 +171,17 @@ func (client PacketCapturesClient) DeletePreparer(ctx context.Context, resourceG
// DeleteSender sends the Delete request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client PacketCapturesClient) DeleteSender(req *http.Request) (future PacketCapturesDeleteFuture, err error) { func (client PacketCapturesClient) DeleteSender(req *http.Request) (future PacketCapturesDeleteFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender)
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return return
} }
...@@ -192,9 +198,10 @@ func (client PacketCapturesClient) DeleteResponder(resp *http.Response) (result ...@@ -192,9 +198,10 @@ func (client PacketCapturesClient) DeleteResponder(resp *http.Response) (result
} }
// Get gets a packet capture session by name. // Get gets a packet capture session by name.
// // Parameters:
// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher. // resourceGroupName - the name of the resource group.
// packetCaptureName is the name of the packet capture session. // networkWatcherName - the name of the network watcher.
// packetCaptureName - the name of the packet capture session.
func (client PacketCapturesClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (result PacketCaptureResult, err error) { func (client PacketCapturesClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (result PacketCaptureResult, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName) req, err := client.GetPreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName)
if err != nil { if err != nil {
...@@ -260,9 +267,10 @@ func (client PacketCapturesClient) GetResponder(resp *http.Response) (result Pac ...@@ -260,9 +267,10 @@ func (client PacketCapturesClient) GetResponder(resp *http.Response) (result Pac
} }
// GetStatus query the status of a running packet capture session. // GetStatus query the status of a running packet capture session.
// // Parameters:
// resourceGroupName is the name of the resource group. networkWatcherName is the name of the Network Watcher // resourceGroupName - the name of the resource group.
// resource. packetCaptureName is the name given to the packet capture session. // networkWatcherName - the name of the Network Watcher resource.
// packetCaptureName - the name given to the packet capture session.
func (client PacketCapturesClient) GetStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (result PacketCapturesGetStatusFuture, err error) { func (client PacketCapturesClient) GetStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (result PacketCapturesGetStatusFuture, err error) {
req, err := client.GetStatusPreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName) req, err := client.GetStatusPreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName)
if err != nil { if err != nil {
...@@ -304,15 +312,17 @@ func (client PacketCapturesClient) GetStatusPreparer(ctx context.Context, resour ...@@ -304,15 +312,17 @@ func (client PacketCapturesClient) GetStatusPreparer(ctx context.Context, resour
// GetStatusSender sends the GetStatus request. The method will close the // GetStatusSender sends the GetStatus request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client PacketCapturesClient) GetStatusSender(req *http.Request) (future PacketCapturesGetStatusFuture, err error) { func (client PacketCapturesClient) GetStatusSender(req *http.Request) (future PacketCapturesGetStatusFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
return return
} }
...@@ -330,9 +340,9 @@ func (client PacketCapturesClient) GetStatusResponder(resp *http.Response) (resu ...@@ -330,9 +340,9 @@ func (client PacketCapturesClient) GetStatusResponder(resp *http.Response) (resu
} }
// List lists all packet capture sessions within the specified resource group. // List lists all packet capture sessions within the specified resource group.
// // Parameters:
// resourceGroupName is the name of the resource group. networkWatcherName is the name of the Network Watcher // resourceGroupName - the name of the resource group.
// resource. // networkWatcherName - the name of the Network Watcher resource.
func (client PacketCapturesClient) List(ctx context.Context, resourceGroupName string, networkWatcherName string) (result PacketCaptureListResult, err error) { func (client PacketCapturesClient) List(ctx context.Context, resourceGroupName string, networkWatcherName string) (result PacketCaptureListResult, err error) {
req, err := client.ListPreparer(ctx, resourceGroupName, networkWatcherName) req, err := client.ListPreparer(ctx, resourceGroupName, networkWatcherName)
if err != nil { if err != nil {
...@@ -397,9 +407,10 @@ func (client PacketCapturesClient) ListResponder(resp *http.Response) (result Pa ...@@ -397,9 +407,10 @@ func (client PacketCapturesClient) ListResponder(resp *http.Response) (result Pa
} }
// Stop stops a specified packet capture session. // Stop stops a specified packet capture session.
// // Parameters:
// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher. // resourceGroupName - the name of the resource group.
// packetCaptureName is the name of the packet capture session. // networkWatcherName - the name of the network watcher.
// packetCaptureName - the name of the packet capture session.
func (client PacketCapturesClient) Stop(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (result PacketCapturesStopFuture, err error) { func (client PacketCapturesClient) Stop(ctx context.Context, resourceGroupName string, networkWatcherName string, packetCaptureName string) (result PacketCapturesStopFuture, err error) {
req, err := client.StopPreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName) req, err := client.StopPreparer(ctx, resourceGroupName, networkWatcherName, packetCaptureName)
if err != nil { if err != nil {
...@@ -441,15 +452,17 @@ func (client PacketCapturesClient) StopPreparer(ctx context.Context, resourceGro ...@@ -441,15 +452,17 @@ func (client PacketCapturesClient) StopPreparer(ctx context.Context, resourceGro
// StopSender sends the Stop request. The method will close the // StopSender sends the Stop request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client PacketCapturesClient) StopSender(req *http.Request) (future PacketCapturesStopFuture, err error) { func (client PacketCapturesClient) StopSender(req *http.Request) (future PacketCapturesStopFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted))
return return
} }
......
...@@ -41,10 +41,11 @@ func NewRouteFilterRulesClientWithBaseURI(baseURI string, subscriptionID string) ...@@ -41,10 +41,11 @@ func NewRouteFilterRulesClientWithBaseURI(baseURI string, subscriptionID string)
} }
// CreateOrUpdate creates or updates a route in the specified route filter. // CreateOrUpdate creates or updates a route in the specified route filter.
// // Parameters:
// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. ruleName // resourceGroupName - the name of the resource group.
// is the name of the route filter rule. routeFilterRuleParameters is parameters supplied to the create or update // routeFilterName - the name of the route filter.
// route filter rule operation. // ruleName - the name of the route filter rule.
// routeFilterRuleParameters - parameters supplied to the create or update route filter rule operation.
func (client RouteFilterRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters RouteFilterRule) (result RouteFilterRulesCreateOrUpdateFuture, err error) { func (client RouteFilterRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters RouteFilterRule) (result RouteFilterRulesCreateOrUpdateFuture, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: routeFilterRuleParameters, {TargetValue: routeFilterRuleParameters,
...@@ -85,7 +86,7 @@ func (client RouteFilterRulesClient) CreateOrUpdatePreparer(ctx context.Context, ...@@ -85,7 +86,7 @@ func (client RouteFilterRulesClient) CreateOrUpdatePreparer(ctx context.Context,
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", pathParameters),
...@@ -97,15 +98,17 @@ func (client RouteFilterRulesClient) CreateOrUpdatePreparer(ctx context.Context, ...@@ -97,15 +98,17 @@ func (client RouteFilterRulesClient) CreateOrUpdatePreparer(ctx context.Context,
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client RouteFilterRulesClient) CreateOrUpdateSender(req *http.Request) (future RouteFilterRulesCreateOrUpdateFuture, err error) { func (client RouteFilterRulesClient) CreateOrUpdateSender(req *http.Request) (future RouteFilterRulesCreateOrUpdateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
return return
} }
...@@ -123,9 +126,10 @@ func (client RouteFilterRulesClient) CreateOrUpdateResponder(resp *http.Response ...@@ -123,9 +126,10 @@ func (client RouteFilterRulesClient) CreateOrUpdateResponder(resp *http.Response
} }
// Delete deletes the specified rule from a route filter. // Delete deletes the specified rule from a route filter.
// // Parameters:
// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. ruleName // resourceGroupName - the name of the resource group.
// is the name of the rule. // routeFilterName - the name of the route filter.
// ruleName - the name of the rule.
func (client RouteFilterRulesClient) Delete(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string) (result RouteFilterRulesDeleteFuture, err error) { func (client RouteFilterRulesClient) Delete(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string) (result RouteFilterRulesDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, routeFilterName, ruleName) req, err := client.DeletePreparer(ctx, resourceGroupName, routeFilterName, ruleName)
if err != nil { if err != nil {
...@@ -167,15 +171,17 @@ func (client RouteFilterRulesClient) DeletePreparer(ctx context.Context, resourc ...@@ -167,15 +171,17 @@ func (client RouteFilterRulesClient) DeletePreparer(ctx context.Context, resourc
// DeleteSender sends the Delete request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client RouteFilterRulesClient) DeleteSender(req *http.Request) (future RouteFilterRulesDeleteFuture, err error) { func (client RouteFilterRulesClient) DeleteSender(req *http.Request) (future RouteFilterRulesDeleteFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender)
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return return
} }
...@@ -192,9 +198,10 @@ func (client RouteFilterRulesClient) DeleteResponder(resp *http.Response) (resul ...@@ -192,9 +198,10 @@ func (client RouteFilterRulesClient) DeleteResponder(resp *http.Response) (resul
} }
// Get gets the specified rule from a route filter. // Get gets the specified rule from a route filter.
// // Parameters:
// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. ruleName // resourceGroupName - the name of the resource group.
// is the name of the rule. // routeFilterName - the name of the route filter.
// ruleName - the name of the rule.
func (client RouteFilterRulesClient) Get(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string) (result RouteFilterRule, err error) { func (client RouteFilterRulesClient) Get(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string) (result RouteFilterRule, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, routeFilterName, ruleName) req, err := client.GetPreparer(ctx, resourceGroupName, routeFilterName, ruleName)
if err != nil { if err != nil {
...@@ -260,8 +267,9 @@ func (client RouteFilterRulesClient) GetResponder(resp *http.Response) (result R ...@@ -260,8 +267,9 @@ func (client RouteFilterRulesClient) GetResponder(resp *http.Response) (result R
} }
// ListByRouteFilter gets all RouteFilterRules in a route filter. // ListByRouteFilter gets all RouteFilterRules in a route filter.
// // Parameters:
// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. // resourceGroupName - the name of the resource group.
// routeFilterName - the name of the route filter.
func (client RouteFilterRulesClient) ListByRouteFilter(ctx context.Context, resourceGroupName string, routeFilterName string) (result RouteFilterRuleListResultPage, err error) { func (client RouteFilterRulesClient) ListByRouteFilter(ctx context.Context, resourceGroupName string, routeFilterName string) (result RouteFilterRuleListResultPage, err error) {
result.fn = client.listByRouteFilterNextResults result.fn = client.listByRouteFilterNextResults
req, err := client.ListByRouteFilterPreparer(ctx, resourceGroupName, routeFilterName) req, err := client.ListByRouteFilterPreparer(ctx, resourceGroupName, routeFilterName)
...@@ -354,10 +362,11 @@ func (client RouteFilterRulesClient) ListByRouteFilterComplete(ctx context.Conte ...@@ -354,10 +362,11 @@ func (client RouteFilterRulesClient) ListByRouteFilterComplete(ctx context.Conte
} }
// Update updates a route in the specified route filter. // Update updates a route in the specified route filter.
// // Parameters:
// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. ruleName // resourceGroupName - the name of the resource group.
// is the name of the route filter rule. routeFilterRuleParameters is parameters supplied to the update route // routeFilterName - the name of the route filter.
// filter rule operation. // ruleName - the name of the route filter rule.
// routeFilterRuleParameters - parameters supplied to the update route filter rule operation.
func (client RouteFilterRulesClient) Update(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters PatchRouteFilterRule) (result RouteFilterRulesUpdateFuture, err error) { func (client RouteFilterRulesClient) Update(ctx context.Context, resourceGroupName string, routeFilterName string, ruleName string, routeFilterRuleParameters PatchRouteFilterRule) (result RouteFilterRulesUpdateFuture, err error) {
req, err := client.UpdatePreparer(ctx, resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters) req, err := client.UpdatePreparer(ctx, resourceGroupName, routeFilterName, ruleName, routeFilterRuleParameters)
if err != nil { if err != nil {
...@@ -389,7 +398,7 @@ func (client RouteFilterRulesClient) UpdatePreparer(ctx context.Context, resourc ...@@ -389,7 +398,7 @@ func (client RouteFilterRulesClient) UpdatePreparer(ctx context.Context, resourc
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(), autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}/routeFilterRules/{ruleName}", pathParameters),
...@@ -401,15 +410,17 @@ func (client RouteFilterRulesClient) UpdatePreparer(ctx context.Context, resourc ...@@ -401,15 +410,17 @@ func (client RouteFilterRulesClient) UpdatePreparer(ctx context.Context, resourc
// UpdateSender sends the Update request. The method will close the // UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client RouteFilterRulesClient) UpdateSender(req *http.Request) (future RouteFilterRulesUpdateFuture, err error) { func (client RouteFilterRulesClient) UpdateSender(req *http.Request) (future RouteFilterRulesUpdateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK))
return return
} }
......
...@@ -40,9 +40,10 @@ func NewRouteFiltersClientWithBaseURI(baseURI string, subscriptionID string) Rou ...@@ -40,9 +40,10 @@ func NewRouteFiltersClientWithBaseURI(baseURI string, subscriptionID string) Rou
} }
// CreateOrUpdate creates or updates a route filter in a specified resource group. // CreateOrUpdate creates or updates a route filter in a specified resource group.
// // Parameters:
// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. // resourceGroupName - the name of the resource group.
// routeFilterParameters is parameters supplied to the create or update route filter operation. // routeFilterName - the name of the route filter.
// routeFilterParameters - parameters supplied to the create or update route filter operation.
func (client RouteFiltersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, routeFilterParameters RouteFilter) (result RouteFiltersCreateOrUpdateFuture, err error) { func (client RouteFiltersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeFilterName string, routeFilterParameters RouteFilter) (result RouteFiltersCreateOrUpdateFuture, err error) {
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, routeFilterName, routeFilterParameters) req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, routeFilterName, routeFilterParameters)
if err != nil { if err != nil {
...@@ -73,7 +74,7 @@ func (client RouteFiltersClient) CreateOrUpdatePreparer(ctx context.Context, res ...@@ -73,7 +74,7 @@ func (client RouteFiltersClient) CreateOrUpdatePreparer(ctx context.Context, res
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", pathParameters),
...@@ -85,15 +86,17 @@ func (client RouteFiltersClient) CreateOrUpdatePreparer(ctx context.Context, res ...@@ -85,15 +86,17 @@ func (client RouteFiltersClient) CreateOrUpdatePreparer(ctx context.Context, res
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client RouteFiltersClient) CreateOrUpdateSender(req *http.Request) (future RouteFiltersCreateOrUpdateFuture, err error) { func (client RouteFiltersClient) CreateOrUpdateSender(req *http.Request) (future RouteFiltersCreateOrUpdateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
return return
} }
...@@ -111,8 +114,9 @@ func (client RouteFiltersClient) CreateOrUpdateResponder(resp *http.Response) (r ...@@ -111,8 +114,9 @@ func (client RouteFiltersClient) CreateOrUpdateResponder(resp *http.Response) (r
} }
// Delete deletes the specified route filter. // Delete deletes the specified route filter.
// // Parameters:
// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. // resourceGroupName - the name of the resource group.
// routeFilterName - the name of the route filter.
func (client RouteFiltersClient) Delete(ctx context.Context, resourceGroupName string, routeFilterName string) (result RouteFiltersDeleteFuture, err error) { func (client RouteFiltersClient) Delete(ctx context.Context, resourceGroupName string, routeFilterName string) (result RouteFiltersDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, routeFilterName) req, err := client.DeletePreparer(ctx, resourceGroupName, routeFilterName)
if err != nil { if err != nil {
...@@ -153,15 +157,17 @@ func (client RouteFiltersClient) DeletePreparer(ctx context.Context, resourceGro ...@@ -153,15 +157,17 @@ func (client RouteFiltersClient) DeletePreparer(ctx context.Context, resourceGro
// DeleteSender sends the Delete request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client RouteFiltersClient) DeleteSender(req *http.Request) (future RouteFiltersDeleteFuture, err error) { func (client RouteFiltersClient) DeleteSender(req *http.Request) (future RouteFiltersDeleteFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender)
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return return
} }
...@@ -178,9 +184,10 @@ func (client RouteFiltersClient) DeleteResponder(resp *http.Response) (result au ...@@ -178,9 +184,10 @@ func (client RouteFiltersClient) DeleteResponder(resp *http.Response) (result au
} }
// Get gets the specified route filter. // Get gets the specified route filter.
// // Parameters:
// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. expand is // resourceGroupName - the name of the resource group.
// expands referenced express route bgp peering resources. // routeFilterName - the name of the route filter.
// expand - expands referenced express route bgp peering resources.
func (client RouteFiltersClient) Get(ctx context.Context, resourceGroupName string, routeFilterName string, expand string) (result RouteFilter, err error) { func (client RouteFiltersClient) Get(ctx context.Context, resourceGroupName string, routeFilterName string, expand string) (result RouteFilter, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, routeFilterName, expand) req, err := client.GetPreparer(ctx, resourceGroupName, routeFilterName, expand)
if err != nil { if err != nil {
...@@ -338,8 +345,8 @@ func (client RouteFiltersClient) ListComplete(ctx context.Context) (result Route ...@@ -338,8 +345,8 @@ func (client RouteFiltersClient) ListComplete(ctx context.Context) (result Route
} }
// ListByResourceGroup gets all route filters in a resource group. // ListByResourceGroup gets all route filters in a resource group.
// // Parameters:
// resourceGroupName is the name of the resource group. // resourceGroupName - the name of the resource group.
func (client RouteFiltersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result RouteFilterListResultPage, err error) { func (client RouteFiltersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result RouteFilterListResultPage, err error) {
result.fn = client.listByResourceGroupNextResults result.fn = client.listByResourceGroupNextResults
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
...@@ -431,9 +438,10 @@ func (client RouteFiltersClient) ListByResourceGroupComplete(ctx context.Context ...@@ -431,9 +438,10 @@ func (client RouteFiltersClient) ListByResourceGroupComplete(ctx context.Context
} }
// Update updates a route filter in a specified resource group. // Update updates a route filter in a specified resource group.
// // Parameters:
// resourceGroupName is the name of the resource group. routeFilterName is the name of the route filter. // resourceGroupName - the name of the resource group.
// routeFilterParameters is parameters supplied to the update route filter operation. // routeFilterName - the name of the route filter.
// routeFilterParameters - parameters supplied to the update route filter operation.
func (client RouteFiltersClient) Update(ctx context.Context, resourceGroupName string, routeFilterName string, routeFilterParameters PatchRouteFilter) (result RouteFiltersUpdateFuture, err error) { func (client RouteFiltersClient) Update(ctx context.Context, resourceGroupName string, routeFilterName string, routeFilterParameters PatchRouteFilter) (result RouteFiltersUpdateFuture, err error) {
req, err := client.UpdatePreparer(ctx, resourceGroupName, routeFilterName, routeFilterParameters) req, err := client.UpdatePreparer(ctx, resourceGroupName, routeFilterName, routeFilterParameters)
if err != nil { if err != nil {
...@@ -464,7 +472,7 @@ func (client RouteFiltersClient) UpdatePreparer(ctx context.Context, resourceGro ...@@ -464,7 +472,7 @@ func (client RouteFiltersClient) UpdatePreparer(ctx context.Context, resourceGro
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(), autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeFilters/{routeFilterName}", pathParameters),
...@@ -476,15 +484,17 @@ func (client RouteFiltersClient) UpdatePreparer(ctx context.Context, resourceGro ...@@ -476,15 +484,17 @@ func (client RouteFiltersClient) UpdatePreparer(ctx context.Context, resourceGro
// UpdateSender sends the Update request. The method will close the // UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client RouteFiltersClient) UpdateSender(req *http.Request) (future RouteFiltersUpdateFuture, err error) { func (client RouteFiltersClient) UpdateSender(req *http.Request) (future RouteFiltersUpdateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK))
return return
} }
......
...@@ -40,9 +40,11 @@ func NewRoutesClientWithBaseURI(baseURI string, subscriptionID string) RoutesCli ...@@ -40,9 +40,11 @@ func NewRoutesClientWithBaseURI(baseURI string, subscriptionID string) RoutesCli
} }
// CreateOrUpdate creates or updates a route in the specified route table. // CreateOrUpdate creates or updates a route in the specified route table.
// // Parameters:
// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. routeName is // resourceGroupName - the name of the resource group.
// the name of the route. routeParameters is parameters supplied to the create or update route operation. // routeTableName - the name of the route table.
// routeName - the name of the route.
// routeParameters - parameters supplied to the create or update route operation.
func (client RoutesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, routeParameters Route) (result RoutesCreateOrUpdateFuture, err error) { func (client RoutesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, routeName string, routeParameters Route) (result RoutesCreateOrUpdateFuture, err error) {
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, routeTableName, routeName, routeParameters) req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, routeTableName, routeName, routeParameters)
if err != nil { if err != nil {
...@@ -74,7 +76,7 @@ func (client RoutesClient) CreateOrUpdatePreparer(ctx context.Context, resourceG ...@@ -74,7 +76,7 @@ func (client RoutesClient) CreateOrUpdatePreparer(ctx context.Context, resourceG
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", pathParameters),
...@@ -86,15 +88,17 @@ func (client RoutesClient) CreateOrUpdatePreparer(ctx context.Context, resourceG ...@@ -86,15 +88,17 @@ func (client RoutesClient) CreateOrUpdatePreparer(ctx context.Context, resourceG
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client RoutesClient) CreateOrUpdateSender(req *http.Request) (future RoutesCreateOrUpdateFuture, err error) { func (client RoutesClient) CreateOrUpdateSender(req *http.Request) (future RoutesCreateOrUpdateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
return return
} }
...@@ -112,9 +116,10 @@ func (client RoutesClient) CreateOrUpdateResponder(resp *http.Response) (result ...@@ -112,9 +116,10 @@ func (client RoutesClient) CreateOrUpdateResponder(resp *http.Response) (result
} }
// Delete deletes the specified route from a route table. // Delete deletes the specified route from a route table.
// // Parameters:
// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. routeName is // resourceGroupName - the name of the resource group.
// the name of the route. // routeTableName - the name of the route table.
// routeName - the name of the route.
func (client RoutesClient) Delete(ctx context.Context, resourceGroupName string, routeTableName string, routeName string) (result RoutesDeleteFuture, err error) { func (client RoutesClient) Delete(ctx context.Context, resourceGroupName string, routeTableName string, routeName string) (result RoutesDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, routeTableName, routeName) req, err := client.DeletePreparer(ctx, resourceGroupName, routeTableName, routeName)
if err != nil { if err != nil {
...@@ -156,15 +161,17 @@ func (client RoutesClient) DeletePreparer(ctx context.Context, resourceGroupName ...@@ -156,15 +161,17 @@ func (client RoutesClient) DeletePreparer(ctx context.Context, resourceGroupName
// DeleteSender sends the Delete request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client RoutesClient) DeleteSender(req *http.Request) (future RoutesDeleteFuture, err error) { func (client RoutesClient) DeleteSender(req *http.Request) (future RoutesDeleteFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
return return
} }
...@@ -181,9 +188,10 @@ func (client RoutesClient) DeleteResponder(resp *http.Response) (result autorest ...@@ -181,9 +188,10 @@ func (client RoutesClient) DeleteResponder(resp *http.Response) (result autorest
} }
// Get gets the specified route from a route table. // Get gets the specified route from a route table.
// // Parameters:
// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. routeName is // resourceGroupName - the name of the resource group.
// the name of the route. // routeTableName - the name of the route table.
// routeName - the name of the route.
func (client RoutesClient) Get(ctx context.Context, resourceGroupName string, routeTableName string, routeName string) (result Route, err error) { func (client RoutesClient) Get(ctx context.Context, resourceGroupName string, routeTableName string, routeName string) (result Route, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, routeTableName, routeName) req, err := client.GetPreparer(ctx, resourceGroupName, routeTableName, routeName)
if err != nil { if err != nil {
...@@ -249,8 +257,9 @@ func (client RoutesClient) GetResponder(resp *http.Response) (result Route, err ...@@ -249,8 +257,9 @@ func (client RoutesClient) GetResponder(resp *http.Response) (result Route, err
} }
// List gets all routes in a route table. // List gets all routes in a route table.
// // Parameters:
// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. // resourceGroupName - the name of the resource group.
// routeTableName - the name of the route table.
func (client RoutesClient) List(ctx context.Context, resourceGroupName string, routeTableName string) (result RouteListResultPage, err error) { func (client RoutesClient) List(ctx context.Context, resourceGroupName string, routeTableName string) (result RouteListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName, routeTableName) req, err := client.ListPreparer(ctx, resourceGroupName, routeTableName)
......
...@@ -40,9 +40,10 @@ func NewRouteTablesClientWithBaseURI(baseURI string, subscriptionID string) Rout ...@@ -40,9 +40,10 @@ func NewRouteTablesClientWithBaseURI(baseURI string, subscriptionID string) Rout
} }
// CreateOrUpdate create or updates a route table in a specified resource group. // CreateOrUpdate create or updates a route table in a specified resource group.
// // Parameters:
// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. parameters // resourceGroupName - the name of the resource group.
// is parameters supplied to the create or update route table operation. // routeTableName - the name of the route table.
// parameters - parameters supplied to the create or update route table operation.
func (client RouteTablesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, parameters RouteTable) (result RouteTablesCreateOrUpdateFuture, err error) { func (client RouteTablesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, routeTableName string, parameters RouteTable) (result RouteTablesCreateOrUpdateFuture, err error) {
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, routeTableName, parameters) req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, routeTableName, parameters)
if err != nil { if err != nil {
...@@ -73,7 +74,7 @@ func (client RouteTablesClient) CreateOrUpdatePreparer(ctx context.Context, reso ...@@ -73,7 +74,7 @@ func (client RouteTablesClient) CreateOrUpdatePreparer(ctx context.Context, reso
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", pathParameters),
...@@ -85,15 +86,17 @@ func (client RouteTablesClient) CreateOrUpdatePreparer(ctx context.Context, reso ...@@ -85,15 +86,17 @@ func (client RouteTablesClient) CreateOrUpdatePreparer(ctx context.Context, reso
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client RouteTablesClient) CreateOrUpdateSender(req *http.Request) (future RouteTablesCreateOrUpdateFuture, err error) { func (client RouteTablesClient) CreateOrUpdateSender(req *http.Request) (future RouteTablesCreateOrUpdateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
return return
} }
...@@ -111,8 +114,9 @@ func (client RouteTablesClient) CreateOrUpdateResponder(resp *http.Response) (re ...@@ -111,8 +114,9 @@ func (client RouteTablesClient) CreateOrUpdateResponder(resp *http.Response) (re
} }
// Delete deletes the specified route table. // Delete deletes the specified route table.
// // Parameters:
// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. // resourceGroupName - the name of the resource group.
// routeTableName - the name of the route table.
func (client RouteTablesClient) Delete(ctx context.Context, resourceGroupName string, routeTableName string) (result RouteTablesDeleteFuture, err error) { func (client RouteTablesClient) Delete(ctx context.Context, resourceGroupName string, routeTableName string) (result RouteTablesDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, routeTableName) req, err := client.DeletePreparer(ctx, resourceGroupName, routeTableName)
if err != nil { if err != nil {
...@@ -153,15 +157,17 @@ func (client RouteTablesClient) DeletePreparer(ctx context.Context, resourceGrou ...@@ -153,15 +157,17 @@ func (client RouteTablesClient) DeletePreparer(ctx context.Context, resourceGrou
// DeleteSender sends the Delete request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client RouteTablesClient) DeleteSender(req *http.Request) (future RouteTablesDeleteFuture, err error) { func (client RouteTablesClient) DeleteSender(req *http.Request) (future RouteTablesDeleteFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender)
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return return
} }
...@@ -178,9 +184,10 @@ func (client RouteTablesClient) DeleteResponder(resp *http.Response) (result aut ...@@ -178,9 +184,10 @@ func (client RouteTablesClient) DeleteResponder(resp *http.Response) (result aut
} }
// Get gets the specified route table. // Get gets the specified route table.
// // Parameters:
// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. expand is // resourceGroupName - the name of the resource group.
// expands referenced resources. // routeTableName - the name of the route table.
// expand - expands referenced resources.
func (client RouteTablesClient) Get(ctx context.Context, resourceGroupName string, routeTableName string, expand string) (result RouteTable, err error) { func (client RouteTablesClient) Get(ctx context.Context, resourceGroupName string, routeTableName string, expand string) (result RouteTable, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, routeTableName, expand) req, err := client.GetPreparer(ctx, resourceGroupName, routeTableName, expand)
if err != nil { if err != nil {
...@@ -248,8 +255,8 @@ func (client RouteTablesClient) GetResponder(resp *http.Response) (result RouteT ...@@ -248,8 +255,8 @@ func (client RouteTablesClient) GetResponder(resp *http.Response) (result RouteT
} }
// List gets all route tables in a resource group. // List gets all route tables in a resource group.
// // Parameters:
// resourceGroupName is the name of the resource group. // resourceGroupName - the name of the resource group.
func (client RouteTablesClient) List(ctx context.Context, resourceGroupName string) (result RouteTableListResultPage, err error) { func (client RouteTablesClient) List(ctx context.Context, resourceGroupName string) (result RouteTableListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName) req, err := client.ListPreparer(ctx, resourceGroupName)
...@@ -431,9 +438,10 @@ func (client RouteTablesClient) ListAllComplete(ctx context.Context) (result Rou ...@@ -431,9 +438,10 @@ func (client RouteTablesClient) ListAllComplete(ctx context.Context) (result Rou
} }
// UpdateTags updates a route table tags. // UpdateTags updates a route table tags.
// // Parameters:
// resourceGroupName is the name of the resource group. routeTableName is the name of the route table. parameters // resourceGroupName - the name of the resource group.
// is parameters supplied to update route table tags. // routeTableName - the name of the route table.
// parameters - parameters supplied to update route table tags.
func (client RouteTablesClient) UpdateTags(ctx context.Context, resourceGroupName string, routeTableName string, parameters TagsObject) (result RouteTablesUpdateTagsFuture, err error) { func (client RouteTablesClient) UpdateTags(ctx context.Context, resourceGroupName string, routeTableName string, parameters TagsObject) (result RouteTablesUpdateTagsFuture, err error) {
req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, routeTableName, parameters) req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, routeTableName, parameters)
if err != nil { if err != nil {
...@@ -464,7 +472,7 @@ func (client RouteTablesClient) UpdateTagsPreparer(ctx context.Context, resource ...@@ -464,7 +472,7 @@ func (client RouteTablesClient) UpdateTagsPreparer(ctx context.Context, resource
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(), autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", pathParameters),
...@@ -476,15 +484,17 @@ func (client RouteTablesClient) UpdateTagsPreparer(ctx context.Context, resource ...@@ -476,15 +484,17 @@ func (client RouteTablesClient) UpdateTagsPreparer(ctx context.Context, resource
// UpdateTagsSender sends the UpdateTags request. The method will close the // UpdateTagsSender sends the UpdateTags request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client RouteTablesClient) UpdateTagsSender(req *http.Request) (future RouteTablesUpdateTagsFuture, err error) { func (client RouteTablesClient) UpdateTagsSender(req *http.Request) (future RouteTablesUpdateTagsFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK))
return return
} }
......
...@@ -40,9 +40,10 @@ func NewSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string) S ...@@ -40,9 +40,10 @@ func NewSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string) S
} }
// CreateOrUpdate creates or updates a network security group in the specified resource group. // CreateOrUpdate creates or updates a network security group in the specified resource group.
// // Parameters:
// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network // resourceGroupName - the name of the resource group.
// security group. parameters is parameters supplied to the create or update network security group operation. // networkSecurityGroupName - the name of the network security group.
// parameters - parameters supplied to the create or update network security group operation.
func (client SecurityGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup) (result SecurityGroupsCreateOrUpdateFuture, err error) { func (client SecurityGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup) (result SecurityGroupsCreateOrUpdateFuture, err error) {
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkSecurityGroupName, parameters) req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkSecurityGroupName, parameters)
if err != nil { if err != nil {
...@@ -73,7 +74,7 @@ func (client SecurityGroupsClient) CreateOrUpdatePreparer(ctx context.Context, r ...@@ -73,7 +74,7 @@ func (client SecurityGroupsClient) CreateOrUpdatePreparer(ctx context.Context, r
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", pathParameters),
...@@ -85,15 +86,17 @@ func (client SecurityGroupsClient) CreateOrUpdatePreparer(ctx context.Context, r ...@@ -85,15 +86,17 @@ func (client SecurityGroupsClient) CreateOrUpdatePreparer(ctx context.Context, r
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client SecurityGroupsClient) CreateOrUpdateSender(req *http.Request) (future SecurityGroupsCreateOrUpdateFuture, err error) { func (client SecurityGroupsClient) CreateOrUpdateSender(req *http.Request) (future SecurityGroupsCreateOrUpdateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
return return
} }
...@@ -111,9 +114,9 @@ func (client SecurityGroupsClient) CreateOrUpdateResponder(resp *http.Response) ...@@ -111,9 +114,9 @@ func (client SecurityGroupsClient) CreateOrUpdateResponder(resp *http.Response)
} }
// Delete deletes the specified network security group. // Delete deletes the specified network security group.
// // Parameters:
// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network // resourceGroupName - the name of the resource group.
// security group. // networkSecurityGroupName - the name of the network security group.
func (client SecurityGroupsClient) Delete(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (result SecurityGroupsDeleteFuture, err error) { func (client SecurityGroupsClient) Delete(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (result SecurityGroupsDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, networkSecurityGroupName) req, err := client.DeletePreparer(ctx, resourceGroupName, networkSecurityGroupName)
if err != nil { if err != nil {
...@@ -154,15 +157,17 @@ func (client SecurityGroupsClient) DeletePreparer(ctx context.Context, resourceG ...@@ -154,15 +157,17 @@ func (client SecurityGroupsClient) DeletePreparer(ctx context.Context, resourceG
// DeleteSender sends the Delete request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client SecurityGroupsClient) DeleteSender(req *http.Request) (future SecurityGroupsDeleteFuture, err error) { func (client SecurityGroupsClient) DeleteSender(req *http.Request) (future SecurityGroupsDeleteFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender)
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return return
} }
...@@ -179,9 +184,10 @@ func (client SecurityGroupsClient) DeleteResponder(resp *http.Response) (result ...@@ -179,9 +184,10 @@ func (client SecurityGroupsClient) DeleteResponder(resp *http.Response) (result
} }
// Get gets the specified network security group. // Get gets the specified network security group.
// // Parameters:
// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network // resourceGroupName - the name of the resource group.
// security group. expand is expands referenced resources. // networkSecurityGroupName - the name of the network security group.
// expand - expands referenced resources.
func (client SecurityGroupsClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, expand string) (result SecurityGroup, err error) { func (client SecurityGroupsClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, expand string) (result SecurityGroup, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, networkSecurityGroupName, expand) req, err := client.GetPreparer(ctx, resourceGroupName, networkSecurityGroupName, expand)
if err != nil { if err != nil {
...@@ -249,8 +255,8 @@ func (client SecurityGroupsClient) GetResponder(resp *http.Response) (result Sec ...@@ -249,8 +255,8 @@ func (client SecurityGroupsClient) GetResponder(resp *http.Response) (result Sec
} }
// List gets all network security groups in a resource group. // List gets all network security groups in a resource group.
// // Parameters:
// resourceGroupName is the name of the resource group. // resourceGroupName - the name of the resource group.
func (client SecurityGroupsClient) List(ctx context.Context, resourceGroupName string) (result SecurityGroupListResultPage, err error) { func (client SecurityGroupsClient) List(ctx context.Context, resourceGroupName string) (result SecurityGroupListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName) req, err := client.ListPreparer(ctx, resourceGroupName)
...@@ -432,9 +438,10 @@ func (client SecurityGroupsClient) ListAllComplete(ctx context.Context) (result ...@@ -432,9 +438,10 @@ func (client SecurityGroupsClient) ListAllComplete(ctx context.Context) (result
} }
// UpdateTags updates a network security group tags. // UpdateTags updates a network security group tags.
// // Parameters:
// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network // resourceGroupName - the name of the resource group.
// security group. parameters is parameters supplied to update network security group tags. // networkSecurityGroupName - the name of the network security group.
// parameters - parameters supplied to update network security group tags.
func (client SecurityGroupsClient) UpdateTags(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters TagsObject) (result SecurityGroupsUpdateTagsFuture, err error) { func (client SecurityGroupsClient) UpdateTags(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, parameters TagsObject) (result SecurityGroupsUpdateTagsFuture, err error) {
req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, networkSecurityGroupName, parameters) req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, networkSecurityGroupName, parameters)
if err != nil { if err != nil {
...@@ -465,7 +472,7 @@ func (client SecurityGroupsClient) UpdateTagsPreparer(ctx context.Context, resou ...@@ -465,7 +472,7 @@ func (client SecurityGroupsClient) UpdateTagsPreparer(ctx context.Context, resou
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(), autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", pathParameters),
...@@ -477,15 +484,17 @@ func (client SecurityGroupsClient) UpdateTagsPreparer(ctx context.Context, resou ...@@ -477,15 +484,17 @@ func (client SecurityGroupsClient) UpdateTagsPreparer(ctx context.Context, resou
// UpdateTagsSender sends the UpdateTags request. The method will close the // UpdateTagsSender sends the UpdateTags request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client SecurityGroupsClient) UpdateTagsSender(req *http.Request) (future SecurityGroupsUpdateTagsFuture, err error) { func (client SecurityGroupsClient) UpdateTagsSender(req *http.Request) (future SecurityGroupsUpdateTagsFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK))
return return
} }
......
...@@ -40,10 +40,11 @@ func NewSecurityRulesClientWithBaseURI(baseURI string, subscriptionID string) Se ...@@ -40,10 +40,11 @@ func NewSecurityRulesClientWithBaseURI(baseURI string, subscriptionID string) Se
} }
// CreateOrUpdate creates or updates a security rule in the specified network security group. // CreateOrUpdate creates or updates a security rule in the specified network security group.
// // Parameters:
// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network // resourceGroupName - the name of the resource group.
// security group. securityRuleName is the name of the security rule. securityRuleParameters is parameters supplied // networkSecurityGroupName - the name of the network security group.
// to the create or update network security rule operation. // securityRuleName - the name of the security rule.
// securityRuleParameters - parameters supplied to the create or update network security rule operation.
func (client SecurityRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule) (result SecurityRulesCreateOrUpdateFuture, err error) { func (client SecurityRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule) (result SecurityRulesCreateOrUpdateFuture, err error) {
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters) req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName, securityRuleParameters)
if err != nil { if err != nil {
...@@ -75,7 +76,7 @@ func (client SecurityRulesClient) CreateOrUpdatePreparer(ctx context.Context, re ...@@ -75,7 +76,7 @@ func (client SecurityRulesClient) CreateOrUpdatePreparer(ctx context.Context, re
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", pathParameters),
...@@ -87,15 +88,17 @@ func (client SecurityRulesClient) CreateOrUpdatePreparer(ctx context.Context, re ...@@ -87,15 +88,17 @@ func (client SecurityRulesClient) CreateOrUpdatePreparer(ctx context.Context, re
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client SecurityRulesClient) CreateOrUpdateSender(req *http.Request) (future SecurityRulesCreateOrUpdateFuture, err error) { func (client SecurityRulesClient) CreateOrUpdateSender(req *http.Request) (future SecurityRulesCreateOrUpdateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
return return
} }
...@@ -113,9 +116,10 @@ func (client SecurityRulesClient) CreateOrUpdateResponder(resp *http.Response) ( ...@@ -113,9 +116,10 @@ func (client SecurityRulesClient) CreateOrUpdateResponder(resp *http.Response) (
} }
// Delete deletes the specified network security rule. // Delete deletes the specified network security rule.
// // Parameters:
// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network // resourceGroupName - the name of the resource group.
// security group. securityRuleName is the name of the security rule. // networkSecurityGroupName - the name of the network security group.
// securityRuleName - the name of the security rule.
func (client SecurityRulesClient) Delete(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (result SecurityRulesDeleteFuture, err error) { func (client SecurityRulesClient) Delete(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (result SecurityRulesDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName) req, err := client.DeletePreparer(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName)
if err != nil { if err != nil {
...@@ -157,15 +161,17 @@ func (client SecurityRulesClient) DeletePreparer(ctx context.Context, resourceGr ...@@ -157,15 +161,17 @@ func (client SecurityRulesClient) DeletePreparer(ctx context.Context, resourceGr
// DeleteSender sends the Delete request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client SecurityRulesClient) DeleteSender(req *http.Request) (future SecurityRulesDeleteFuture, err error) { func (client SecurityRulesClient) DeleteSender(req *http.Request) (future SecurityRulesDeleteFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
return return
} }
...@@ -182,9 +188,10 @@ func (client SecurityRulesClient) DeleteResponder(resp *http.Response) (result a ...@@ -182,9 +188,10 @@ func (client SecurityRulesClient) DeleteResponder(resp *http.Response) (result a
} }
// Get get the specified network security rule. // Get get the specified network security rule.
// // Parameters:
// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network // resourceGroupName - the name of the resource group.
// security group. securityRuleName is the name of the security rule. // networkSecurityGroupName - the name of the network security group.
// securityRuleName - the name of the security rule.
func (client SecurityRulesClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (result SecurityRule, err error) { func (client SecurityRulesClient) Get(ctx context.Context, resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (result SecurityRule, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName) req, err := client.GetPreparer(ctx, resourceGroupName, networkSecurityGroupName, securityRuleName)
if err != nil { if err != nil {
...@@ -250,9 +257,9 @@ func (client SecurityRulesClient) GetResponder(resp *http.Response) (result Secu ...@@ -250,9 +257,9 @@ func (client SecurityRulesClient) GetResponder(resp *http.Response) (result Secu
} }
// List gets all security rules in a network security group. // List gets all security rules in a network security group.
// // Parameters:
// resourceGroupName is the name of the resource group. networkSecurityGroupName is the name of the network // resourceGroupName - the name of the resource group.
// security group. // networkSecurityGroupName - the name of the network security group.
func (client SecurityRulesClient) List(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (result SecurityRuleListResultPage, err error) { func (client SecurityRulesClient) List(ctx context.Context, resourceGroupName string, networkSecurityGroupName string) (result SecurityRuleListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName, networkSecurityGroupName) req, err := client.ListPreparer(ctx, resourceGroupName, networkSecurityGroupName)
......
...@@ -40,10 +40,11 @@ func NewSubnetsClientWithBaseURI(baseURI string, subscriptionID string) SubnetsC ...@@ -40,10 +40,11 @@ func NewSubnetsClientWithBaseURI(baseURI string, subscriptionID string) SubnetsC
} }
// CreateOrUpdate creates or updates a subnet in the specified virtual network. // CreateOrUpdate creates or updates a subnet in the specified virtual network.
// // Parameters:
// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. // resourceGroupName - the name of the resource group.
// subnetName is the name of the subnet. subnetParameters is parameters supplied to the create or update subnet // virtualNetworkName - the name of the virtual network.
// operation. // subnetName - the name of the subnet.
// subnetParameters - parameters supplied to the create or update subnet operation.
func (client SubnetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet) (result SubnetsCreateOrUpdateFuture, err error) { func (client SubnetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet) (result SubnetsCreateOrUpdateFuture, err error) {
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkName, subnetName, subnetParameters) req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkName, subnetName, subnetParameters)
if err != nil { if err != nil {
...@@ -75,7 +76,7 @@ func (client SubnetsClient) CreateOrUpdatePreparer(ctx context.Context, resource ...@@ -75,7 +76,7 @@ func (client SubnetsClient) CreateOrUpdatePreparer(ctx context.Context, resource
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", pathParameters),
...@@ -87,15 +88,17 @@ func (client SubnetsClient) CreateOrUpdatePreparer(ctx context.Context, resource ...@@ -87,15 +88,17 @@ func (client SubnetsClient) CreateOrUpdatePreparer(ctx context.Context, resource
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client SubnetsClient) CreateOrUpdateSender(req *http.Request) (future SubnetsCreateOrUpdateFuture, err error) { func (client SubnetsClient) CreateOrUpdateSender(req *http.Request) (future SubnetsCreateOrUpdateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
return return
} }
...@@ -113,9 +116,10 @@ func (client SubnetsClient) CreateOrUpdateResponder(resp *http.Response) (result ...@@ -113,9 +116,10 @@ func (client SubnetsClient) CreateOrUpdateResponder(resp *http.Response) (result
} }
// Delete deletes the specified subnet. // Delete deletes the specified subnet.
// // Parameters:
// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. // resourceGroupName - the name of the resource group.
// subnetName is the name of the subnet. // virtualNetworkName - the name of the virtual network.
// subnetName - the name of the subnet.
func (client SubnetsClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string) (result SubnetsDeleteFuture, err error) { func (client SubnetsClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string) (result SubnetsDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkName, subnetName) req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkName, subnetName)
if err != nil { if err != nil {
...@@ -157,15 +161,17 @@ func (client SubnetsClient) DeletePreparer(ctx context.Context, resourceGroupNam ...@@ -157,15 +161,17 @@ func (client SubnetsClient) DeletePreparer(ctx context.Context, resourceGroupNam
// DeleteSender sends the Delete request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client SubnetsClient) DeleteSender(req *http.Request) (future SubnetsDeleteFuture, err error) { func (client SubnetsClient) DeleteSender(req *http.Request) (future SubnetsDeleteFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
return return
} }
...@@ -182,9 +188,11 @@ func (client SubnetsClient) DeleteResponder(resp *http.Response) (result autores ...@@ -182,9 +188,11 @@ func (client SubnetsClient) DeleteResponder(resp *http.Response) (result autores
} }
// Get gets the specified subnet by virtual network and resource group. // Get gets the specified subnet by virtual network and resource group.
// // Parameters:
// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. // resourceGroupName - the name of the resource group.
// subnetName is the name of the subnet. expand is expands referenced resources. // virtualNetworkName - the name of the virtual network.
// subnetName - the name of the subnet.
// expand - expands referenced resources.
func (client SubnetsClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, expand string) (result Subnet, err error) { func (client SubnetsClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, subnetName string, expand string) (result Subnet, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkName, subnetName, expand) req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkName, subnetName, expand)
if err != nil { if err != nil {
...@@ -253,8 +261,9 @@ func (client SubnetsClient) GetResponder(resp *http.Response) (result Subnet, er ...@@ -253,8 +261,9 @@ func (client SubnetsClient) GetResponder(resp *http.Response) (result Subnet, er
} }
// List gets all subnets in a virtual network. // List gets all subnets in a virtual network.
// // Parameters:
// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. // resourceGroupName - the name of the resource group.
// virtualNetworkName - the name of the virtual network.
func (client SubnetsClient) List(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result SubnetListResultPage, err error) { func (client SubnetsClient) List(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result SubnetListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName, virtualNetworkName) req, err := client.ListPreparer(ctx, resourceGroupName, virtualNetworkName)
......
...@@ -41,8 +41,8 @@ func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesCli ...@@ -41,8 +41,8 @@ func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesCli
} }
// List list network usages for a subscription. // List list network usages for a subscription.
// // Parameters:
// location is the location where resource usage is queried. // location - the location where resource usage is queried.
func (client UsagesClient) List(ctx context.Context, location string) (result UsagesListResultPage, err error) { func (client UsagesClient) List(ctx context.Context, location string) (result UsagesListResultPage, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: location, {TargetValue: location,
......
...@@ -40,10 +40,12 @@ func NewVirtualNetworkPeeringsClientWithBaseURI(baseURI string, subscriptionID s ...@@ -40,10 +40,12 @@ func NewVirtualNetworkPeeringsClientWithBaseURI(baseURI string, subscriptionID s
} }
// CreateOrUpdate creates or updates a peering in the specified virtual network. // CreateOrUpdate creates or updates a peering in the specified virtual network.
// // Parameters:
// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. // resourceGroupName - the name of the resource group.
// virtualNetworkPeeringName is the name of the peering. virtualNetworkPeeringParameters is parameters supplied to // virtualNetworkName - the name of the virtual network.
// the create or update virtual network peering operation. // virtualNetworkPeeringName - the name of the peering.
// virtualNetworkPeeringParameters - parameters supplied to the create or update virtual network peering
// operation.
func (client VirtualNetworkPeeringsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering) (result VirtualNetworkPeeringsCreateOrUpdateFuture, err error) { func (client VirtualNetworkPeeringsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering) (result VirtualNetworkPeeringsCreateOrUpdateFuture, err error) {
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters) req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters)
if err != nil { if err != nil {
...@@ -75,7 +77,7 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdatePreparer(ctx context.Co ...@@ -75,7 +77,7 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdatePreparer(ctx context.Co
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", pathParameters),
...@@ -87,15 +89,17 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdatePreparer(ctx context.Co ...@@ -87,15 +89,17 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdatePreparer(ctx context.Co
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client VirtualNetworkPeeringsClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkPeeringsCreateOrUpdateFuture, err error) { func (client VirtualNetworkPeeringsClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkPeeringsCreateOrUpdateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
return return
} }
...@@ -113,9 +117,10 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdateResponder(resp *http.Re ...@@ -113,9 +117,10 @@ func (client VirtualNetworkPeeringsClient) CreateOrUpdateResponder(resp *http.Re
} }
// Delete deletes the specified virtual network peering. // Delete deletes the specified virtual network peering.
// // Parameters:
// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. // resourceGroupName - the name of the resource group.
// virtualNetworkPeeringName is the name of the virtual network peering. // virtualNetworkName - the name of the virtual network.
// virtualNetworkPeeringName - the name of the virtual network peering.
func (client VirtualNetworkPeeringsClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string) (result VirtualNetworkPeeringsDeleteFuture, err error) { func (client VirtualNetworkPeeringsClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string) (result VirtualNetworkPeeringsDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName) req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName)
if err != nil { if err != nil {
...@@ -157,15 +162,17 @@ func (client VirtualNetworkPeeringsClient) DeletePreparer(ctx context.Context, r ...@@ -157,15 +162,17 @@ func (client VirtualNetworkPeeringsClient) DeletePreparer(ctx context.Context, r
// DeleteSender sends the Delete request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client VirtualNetworkPeeringsClient) DeleteSender(req *http.Request) (future VirtualNetworkPeeringsDeleteFuture, err error) { func (client VirtualNetworkPeeringsClient) DeleteSender(req *http.Request) (future VirtualNetworkPeeringsDeleteFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
return return
} }
...@@ -182,9 +189,10 @@ func (client VirtualNetworkPeeringsClient) DeleteResponder(resp *http.Response) ...@@ -182,9 +189,10 @@ func (client VirtualNetworkPeeringsClient) DeleteResponder(resp *http.Response)
} }
// Get gets the specified virtual network peering. // Get gets the specified virtual network peering.
// // Parameters:
// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. // resourceGroupName - the name of the resource group.
// virtualNetworkPeeringName is the name of the virtual network peering. // virtualNetworkName - the name of the virtual network.
// virtualNetworkPeeringName - the name of the virtual network peering.
func (client VirtualNetworkPeeringsClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string) (result VirtualNetworkPeering, err error) { func (client VirtualNetworkPeeringsClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string) (result VirtualNetworkPeering, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName) req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkName, virtualNetworkPeeringName)
if err != nil { if err != nil {
...@@ -250,8 +258,9 @@ func (client VirtualNetworkPeeringsClient) GetResponder(resp *http.Response) (re ...@@ -250,8 +258,9 @@ func (client VirtualNetworkPeeringsClient) GetResponder(resp *http.Response) (re
} }
// List gets all virtual network peerings in a virtual network. // List gets all virtual network peerings in a virtual network.
// // Parameters:
// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. // resourceGroupName - the name of the resource group.
// virtualNetworkName - the name of the virtual network.
func (client VirtualNetworkPeeringsClient) List(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result VirtualNetworkPeeringListResultPage, err error) { func (client VirtualNetworkPeeringsClient) List(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result VirtualNetworkPeeringListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName, virtualNetworkName) req, err := client.ListPreparer(ctx, resourceGroupName, virtualNetworkName)
......
...@@ -40,9 +40,10 @@ func NewVirtualNetworksClientWithBaseURI(baseURI string, subscriptionID string) ...@@ -40,9 +40,10 @@ func NewVirtualNetworksClientWithBaseURI(baseURI string, subscriptionID string)
} }
// CheckIPAddressAvailability checks whether a private IP address is available for use. // CheckIPAddressAvailability checks whether a private IP address is available for use.
// // Parameters:
// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. // resourceGroupName - the name of the resource group.
// IPAddress is the private IP address to be verified. // virtualNetworkName - the name of the virtual network.
// IPAddress - the private IP address to be verified.
func (client VirtualNetworksClient) CheckIPAddressAvailability(ctx context.Context, resourceGroupName string, virtualNetworkName string, IPAddress string) (result IPAddressAvailabilityResult, err error) { func (client VirtualNetworksClient) CheckIPAddressAvailability(ctx context.Context, resourceGroupName string, virtualNetworkName string, IPAddress string) (result IPAddressAvailabilityResult, err error) {
req, err := client.CheckIPAddressAvailabilityPreparer(ctx, resourceGroupName, virtualNetworkName, IPAddress) req, err := client.CheckIPAddressAvailabilityPreparer(ctx, resourceGroupName, virtualNetworkName, IPAddress)
if err != nil { if err != nil {
...@@ -110,9 +111,10 @@ func (client VirtualNetworksClient) CheckIPAddressAvailabilityResponder(resp *ht ...@@ -110,9 +111,10 @@ func (client VirtualNetworksClient) CheckIPAddressAvailabilityResponder(resp *ht
} }
// CreateOrUpdate creates or updates a virtual network in the specified resource group. // CreateOrUpdate creates or updates a virtual network in the specified resource group.
// // Parameters:
// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. // resourceGroupName - the name of the resource group.
// parameters is parameters supplied to the create or update virtual network operation // virtualNetworkName - the name of the virtual network.
// parameters - parameters supplied to the create or update virtual network operation
func (client VirtualNetworksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork) (result VirtualNetworksCreateOrUpdateFuture, err error) { func (client VirtualNetworksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork) (result VirtualNetworksCreateOrUpdateFuture, err error) {
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkName, parameters) req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, virtualNetworkName, parameters)
if err != nil { if err != nil {
...@@ -143,7 +145,7 @@ func (client VirtualNetworksClient) CreateOrUpdatePreparer(ctx context.Context, ...@@ -143,7 +145,7 @@ func (client VirtualNetworksClient) CreateOrUpdatePreparer(ctx context.Context,
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", pathParameters),
...@@ -155,15 +157,17 @@ func (client VirtualNetworksClient) CreateOrUpdatePreparer(ctx context.Context, ...@@ -155,15 +157,17 @@ func (client VirtualNetworksClient) CreateOrUpdatePreparer(ctx context.Context,
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the // CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client VirtualNetworksClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworksCreateOrUpdateFuture, err error) { func (client VirtualNetworksClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworksCreateOrUpdateFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated))
return return
} }
...@@ -181,8 +185,9 @@ func (client VirtualNetworksClient) CreateOrUpdateResponder(resp *http.Response) ...@@ -181,8 +185,9 @@ func (client VirtualNetworksClient) CreateOrUpdateResponder(resp *http.Response)
} }
// Delete deletes the specified virtual network. // Delete deletes the specified virtual network.
// // Parameters:
// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. // resourceGroupName - the name of the resource group.
// virtualNetworkName - the name of the virtual network.
func (client VirtualNetworksClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result VirtualNetworksDeleteFuture, err error) { func (client VirtualNetworksClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result VirtualNetworksDeleteFuture, err error) {
req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkName) req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkName)
if err != nil { if err != nil {
...@@ -223,15 +228,17 @@ func (client VirtualNetworksClient) DeletePreparer(ctx context.Context, resource ...@@ -223,15 +228,17 @@ func (client VirtualNetworksClient) DeletePreparer(ctx context.Context, resource
// DeleteSender sends the Delete request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client VirtualNetworksClient) DeleteSender(req *http.Request) (future VirtualNetworksDeleteFuture, err error) { func (client VirtualNetworksClient) DeleteSender(req *http.Request) (future VirtualNetworksDeleteFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender)
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent))
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent)) if err != nil {
return
}
future.Future, err = azure.NewFutureFromResponse(resp)
return return
} }
...@@ -248,9 +255,10 @@ func (client VirtualNetworksClient) DeleteResponder(resp *http.Response) (result ...@@ -248,9 +255,10 @@ func (client VirtualNetworksClient) DeleteResponder(resp *http.Response) (result
} }
// Get gets the specified virtual network by resource group. // Get gets the specified virtual network by resource group.
// // Parameters:
// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. // resourceGroupName - the name of the resource group.
// expand is expands referenced resources. // virtualNetworkName - the name of the virtual network.
// expand - expands referenced resources.
func (client VirtualNetworksClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, expand string) (result VirtualNetwork, err error) { func (client VirtualNetworksClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkName string, expand string) (result VirtualNetwork, err error) {
req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkName, expand) req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkName, expand)
if err != nil { if err != nil {
...@@ -318,8 +326,8 @@ func (client VirtualNetworksClient) GetResponder(resp *http.Response) (result Vi ...@@ -318,8 +326,8 @@ func (client VirtualNetworksClient) GetResponder(resp *http.Response) (result Vi
} }
// List gets all virtual networks in a resource group. // List gets all virtual networks in a resource group.
// // Parameters:
// resourceGroupName is the name of the resource group. // resourceGroupName - the name of the resource group.
func (client VirtualNetworksClient) List(ctx context.Context, resourceGroupName string) (result VirtualNetworkListResultPage, err error) { func (client VirtualNetworksClient) List(ctx context.Context, resourceGroupName string) (result VirtualNetworkListResultPage, err error) {
result.fn = client.listNextResults result.fn = client.listNextResults
req, err := client.ListPreparer(ctx, resourceGroupName) req, err := client.ListPreparer(ctx, resourceGroupName)
...@@ -501,8 +509,9 @@ func (client VirtualNetworksClient) ListAllComplete(ctx context.Context) (result ...@@ -501,8 +509,9 @@ func (client VirtualNetworksClient) ListAllComplete(ctx context.Context) (result
} }
// ListUsage lists usage stats. // ListUsage lists usage stats.
// // Parameters:
// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. // resourceGroupName - the name of the resource group.
// virtualNetworkName - the name of the virtual network.
func (client VirtualNetworksClient) ListUsage(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result VirtualNetworkListUsageResultPage, err error) { func (client VirtualNetworksClient) ListUsage(ctx context.Context, resourceGroupName string, virtualNetworkName string) (result VirtualNetworkListUsageResultPage, err error) {
result.fn = client.listUsageNextResults result.fn = client.listUsageNextResults
req, err := client.ListUsagePreparer(ctx, resourceGroupName, virtualNetworkName) req, err := client.ListUsagePreparer(ctx, resourceGroupName, virtualNetworkName)
...@@ -595,9 +604,10 @@ func (client VirtualNetworksClient) ListUsageComplete(ctx context.Context, resou ...@@ -595,9 +604,10 @@ func (client VirtualNetworksClient) ListUsageComplete(ctx context.Context, resou
} }
// UpdateTags updates a virtual network tags. // UpdateTags updates a virtual network tags.
// // Parameters:
// resourceGroupName is the name of the resource group. virtualNetworkName is the name of the virtual network. // resourceGroupName - the name of the resource group.
// parameters is parameters supplied to update virtual network tags. // virtualNetworkName - the name of the virtual network.
// parameters - parameters supplied to update virtual network tags.
func (client VirtualNetworksClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters TagsObject) (result VirtualNetworksUpdateTagsFuture, err error) { func (client VirtualNetworksClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualNetworkName string, parameters TagsObject) (result VirtualNetworksUpdateTagsFuture, err error) {
req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, virtualNetworkName, parameters) req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, virtualNetworkName, parameters)
if err != nil { if err != nil {
...@@ -628,7 +638,7 @@ func (client VirtualNetworksClient) UpdateTagsPreparer(ctx context.Context, reso ...@@ -628,7 +638,7 @@ func (client VirtualNetworksClient) UpdateTagsPreparer(ctx context.Context, reso
} }
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(), autorest.AsContentType("application/json; charset=utf-8"),
autorest.AsPatch(), autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", pathParameters),
...@@ -640,15 +650,17 @@ func (client VirtualNetworksClient) UpdateTagsPreparer(ctx context.Context, reso ...@@ -640,15 +650,17 @@ func (client VirtualNetworksClient) UpdateTagsPreparer(ctx context.Context, reso
// UpdateTagsSender sends the UpdateTags request. The method will close the // UpdateTagsSender sends the UpdateTags request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client VirtualNetworksClient) UpdateTagsSender(req *http.Request) (future VirtualNetworksUpdateTagsFuture, err error) { func (client VirtualNetworksClient) UpdateTagsSender(req *http.Request) (future VirtualNetworksUpdateTagsFuture, err error) {
sender := autorest.DecorateSender(client, azure.DoRetryWithRegistration(client.Client)) var resp *http.Response
future.Future = azure.NewFuture(req) resp, err = autorest.SendWithSender(client, req,
future.req = req azure.DoRetryWithRegistration(client.Client))
_, err = future.Done(sender) if err != nil {
return
}
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
if err != nil { if err != nil {
return return
} }
err = autorest.Respond(future.Response(), future.Future, err = azure.NewFutureFromResponse(resp)
azure.WithErrorUnlessStatusCode(http.StatusOK))
return return
} }
......
# Azure Storage SDK for Go (Preview) # Azure Storage SDK for Go (Preview)
:exclamation: IMPORTANT: This package is in maintenance only and will be deprecated in the :exclamation: IMPORTANT: This package is in maintenance only and will be deprecated in the
future. Consider using the new package for blobs currently in preview at future. Please use one of the following packages instead.
[github.com/Azure/azure-storage-blob-go](https://github.com/Azure/azure-storage-blob-go).
New Table, Queue and File packages are also in development. | Service | Import Path/Repo |
|---------|------------------|
| Storage - Blobs | [github.com/Azure/azure-storage-blob-go](https://github.com/Azure/azure-storage-blob-go) |
| Storage - Files | [github.com/Azure/azure-storage-file-go](https://github.com/Azure/azure-storage-file-go) |
| Storage - Queues | [github.com/Azure/azure-storage-queue-go](https://github.com/Azure/azure-storage-queue-go) |
The `github.com/Azure/azure-sdk-for-go/storage` package is used to manage The `github.com/Azure/azure-sdk-for-go/storage` package is used to manage
[Azure Storage](https://docs.microsoft.com/en-us/azure/storage/) data plane [Azure Storage](https://docs.microsoft.com/en-us/azure/storage/) data plane
......
...@@ -140,7 +140,7 @@ func (b *Blob) Exists() (bool, error) { ...@@ -140,7 +140,7 @@ func (b *Blob) Exists() (bool, error) {
headers := b.Container.bsc.client.getStandardHeaders() headers := b.Container.bsc.client.getStandardHeaders()
resp, err := b.Container.bsc.client.exec(http.MethodHead, uri, headers, nil, b.Container.bsc.auth) resp, err := b.Container.bsc.client.exec(http.MethodHead, uri, headers, nil, b.Container.bsc.auth)
if resp != nil { if resp != nil {
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusNotFound { if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusNotFound {
return resp.StatusCode == http.StatusOK, nil return resp.StatusCode == http.StatusOK, nil
} }
...@@ -293,7 +293,7 @@ func (b *Blob) CreateSnapshot(options *SnapshotOptions) (snapshotTimestamp *time ...@@ -293,7 +293,7 @@ func (b *Blob) CreateSnapshot(options *SnapshotOptions) (snapshotTimestamp *time
if err != nil || resp == nil { if err != nil || resp == nil {
return nil, err return nil, err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if err := checkRespCode(resp, []int{http.StatusCreated}); err != nil { if err := checkRespCode(resp, []int{http.StatusCreated}); err != nil {
return nil, err return nil, err
...@@ -340,7 +340,7 @@ func (b *Blob) GetProperties(options *GetBlobPropertiesOptions) error { ...@@ -340,7 +340,7 @@ func (b *Blob) GetProperties(options *GetBlobPropertiesOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if err = checkRespCode(resp, []int{http.StatusOK}); err != nil { if err = checkRespCode(resp, []int{http.StatusOK}); err != nil {
return err return err
...@@ -463,7 +463,7 @@ func (b *Blob) SetProperties(options *SetBlobPropertiesOptions) error { ...@@ -463,7 +463,7 @@ func (b *Blob) SetProperties(options *SetBlobPropertiesOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return checkRespCode(resp, []int{http.StatusOK}) return checkRespCode(resp, []int{http.StatusOK})
} }
...@@ -501,7 +501,7 @@ func (b *Blob) SetMetadata(options *SetBlobMetadataOptions) error { ...@@ -501,7 +501,7 @@ func (b *Blob) SetMetadata(options *SetBlobMetadataOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return checkRespCode(resp, []int{http.StatusOK}) return checkRespCode(resp, []int{http.StatusOK})
} }
...@@ -538,7 +538,7 @@ func (b *Blob) GetMetadata(options *GetBlobMetadataOptions) error { ...@@ -538,7 +538,7 @@ func (b *Blob) GetMetadata(options *GetBlobMetadataOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if err := checkRespCode(resp, []int{http.StatusOK}); err != nil { if err := checkRespCode(resp, []int{http.StatusOK}); err != nil {
return err return err
...@@ -574,7 +574,7 @@ func (b *Blob) Delete(options *DeleteBlobOptions) error { ...@@ -574,7 +574,7 @@ func (b *Blob) Delete(options *DeleteBlobOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return checkRespCode(resp, []int{http.StatusAccepted}) return checkRespCode(resp, []int{http.StatusAccepted})
} }
...@@ -585,7 +585,7 @@ func (b *Blob) Delete(options *DeleteBlobOptions) error { ...@@ -585,7 +585,7 @@ func (b *Blob) Delete(options *DeleteBlobOptions) error {
func (b *Blob) DeleteIfExists(options *DeleteBlobOptions) (bool, error) { func (b *Blob) DeleteIfExists(options *DeleteBlobOptions) (bool, error) {
resp, err := b.delete(options) resp, err := b.delete(options)
if resp != nil { if resp != nil {
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if resp.StatusCode == http.StatusAccepted || resp.StatusCode == http.StatusNotFound { if resp.StatusCode == http.StatusAccepted || resp.StatusCode == http.StatusNotFound {
return resp.StatusCode == http.StatusAccepted, nil return resp.StatusCode == http.StatusAccepted, nil
} }
...@@ -622,7 +622,7 @@ func pathForResource(container, name string) string { ...@@ -622,7 +622,7 @@ func pathForResource(container, name string) string {
} }
func (b *Blob) respondCreation(resp *http.Response, bt BlobType) error { func (b *Blob) respondCreation(resp *http.Response, bt BlobType) error {
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
err := checkRespCode(resp, []int{http.StatusCreated}) err := checkRespCode(resp, []int{http.StatusCreated})
if err != nil { if err != nil {
return err return err
......
...@@ -69,7 +69,11 @@ func GetContainerReferenceFromSASURI(sasuri url.URL) (*Container, error) { ...@@ -69,7 +69,11 @@ func GetContainerReferenceFromSASURI(sasuri url.URL) (*Container, error) {
if len(path) <= 1 { if len(path) <= 1 {
return nil, fmt.Errorf("could not find a container in URI: %s", sasuri.String()) return nil, fmt.Errorf("could not find a container in URI: %s", sasuri.String())
} }
cli := newSASClient().GetBlobService() c, err := newSASClientFromURL(&sasuri)
if err != nil {
return nil, err
}
cli := c.GetBlobService()
return &Container{ return &Container{
bsc: &cli, bsc: &cli,
Name: path[1], Name: path[1],
......
...@@ -229,7 +229,7 @@ func (b *Blob) PutBlockList(blocks []Block, options *PutBlockListOptions) error ...@@ -229,7 +229,7 @@ func (b *Blob) PutBlockList(blocks []Block, options *PutBlockListOptions) error
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return checkRespCode(resp, []int{http.StatusCreated}) return checkRespCode(resp, []int{http.StatusCreated})
} }
......
...@@ -120,6 +120,7 @@ func (ds *DefaultSender) Send(c *Client, req *http.Request) (resp *http.Response ...@@ -120,6 +120,7 @@ func (ds *DefaultSender) Send(c *Client, req *http.Request) (resp *http.Response
if err != nil || !autorest.ResponseHasStatusCode(resp, ds.ValidStatusCodes...) { if err != nil || !autorest.ResponseHasStatusCode(resp, ds.ValidStatusCodes...) {
return resp, err return resp, err
} }
drainRespBody(resp)
autorest.DelayForBackoff(ds.RetryDuration, attempts, req.Cancel) autorest.DelayForBackoff(ds.RetryDuration, attempts, req.Cancel)
ds.attempts = attempts ds.attempts = attempts
} }
...@@ -335,15 +336,7 @@ func IsValidStorageAccount(account string) bool { ...@@ -335,15 +336,7 @@ func IsValidStorageAccount(account string) bool {
// NewAccountSASClient contructs a client that uses accountSAS authorization // NewAccountSASClient contructs a client that uses accountSAS authorization
// for its operations. // for its operations.
func NewAccountSASClient(account string, token url.Values, env azure.Environment) Client { func NewAccountSASClient(account string, token url.Values, env azure.Environment) Client {
c := newSASClient() return newSASClient(account, env.StorageEndpointSuffix, token)
c.accountSASToken = token
c.accountName = account
c.baseURL = env.StorageEndpointSuffix
// Get API version and protocol from token
c.apiVersion = token.Get("sv")
c.useHTTPS = token.Get("spr") == "https"
return c
} }
// NewAccountSASClientFromEndpointToken constructs a client that uses accountSAS authorization // NewAccountSASClientFromEndpointToken constructs a client that uses accountSAS authorization
...@@ -353,12 +346,36 @@ func NewAccountSASClientFromEndpointToken(endpoint string, sasToken string) (Cli ...@@ -353,12 +346,36 @@ func NewAccountSASClientFromEndpointToken(endpoint string, sasToken string) (Cli
if err != nil { if err != nil {
return Client{}, err return Client{}, err
} }
_, err = url.ParseQuery(sasToken)
token, err := url.ParseQuery(sasToken)
if err != nil { if err != nil {
return Client{}, err return Client{}, err
} }
u.RawQuery = sasToken
return newSASClientFromURL(u)
}
func newSASClient(accountName, baseURL string, sasToken url.Values) Client {
c := Client{
HTTPClient: http.DefaultClient,
apiVersion: DefaultAPIVersion,
sasClient: true,
Sender: &DefaultSender{
RetryAttempts: defaultRetryAttempts,
ValidStatusCodes: defaultValidStatusCodes,
RetryDuration: defaultRetryDuration,
},
accountName: accountName,
baseURL: baseURL,
accountSASToken: sasToken,
}
c.userAgent = c.getDefaultUserAgent()
// Get API version and protocol from token
c.apiVersion = sasToken.Get("sv")
c.useHTTPS = sasToken.Get("spr") == "https"
return c
}
func newSASClientFromURL(u *url.URL) (Client, error) {
// the host name will look something like this // the host name will look something like this
// - foo.blob.core.windows.net // - foo.blob.core.windows.net
// "foo" is the account name // "foo" is the account name
...@@ -376,30 +393,13 @@ func NewAccountSASClientFromEndpointToken(endpoint string, sasToken string) (Cli ...@@ -376,30 +393,13 @@ func NewAccountSASClientFromEndpointToken(endpoint string, sasToken string) (Cli
return Client{}, fmt.Errorf("failed to find '.' in %s", u.Host[i1+1:]) return Client{}, fmt.Errorf("failed to find '.' in %s", u.Host[i1+1:])
} }
c := newSASClient() sasToken := u.Query()
c.accountSASToken = token c := newSASClient(u.Host[:i1], u.Host[i1+i2+2:], sasToken)
c.accountName = u.Host[:i1] if spr := sasToken.Get("spr"); spr == "" {
c.baseURL = u.Host[i1+i2+2:] // infer from URL if not in the query params set
c.useHTTPS = u.Scheme == "https"
// Get API version and protocol from token
c.apiVersion = token.Get("sv")
c.useHTTPS = token.Get("spr") == "https"
return c, nil
}
func newSASClient() Client {
c := Client{
HTTPClient: http.DefaultClient,
apiVersion: DefaultAPIVersion,
sasClient: true,
Sender: &DefaultSender{
RetryAttempts: defaultRetryAttempts,
ValidStatusCodes: defaultValidStatusCodes,
RetryDuration: defaultRetryDuration,
},
} }
c.userAgent = c.getDefaultUserAgent() return c, nil
return c
} }
func (c Client) isServiceSASClient() bool { func (c Client) isServiceSASClient() bool {
...@@ -592,15 +592,11 @@ func (c Client) GetAccountSASToken(options AccountSASTokenOptions) (url.Values, ...@@ -592,15 +592,11 @@ func (c Client) GetAccountSASToken(options AccountSASTokenOptions) (url.Values,
// build start time, if exists // build start time, if exists
start := "" start := ""
if options.Start != (time.Time{}) { if options.Start != (time.Time{}) {
start = options.Start.Format(time.RFC3339) start = options.Start.UTC().Format(time.RFC3339)
// For some reason I don't understand, it fails when the rest of the string is included
start = start[:10]
} }
// build expiry time // build expiry time
expiry := options.Expiry.Format(time.RFC3339) expiry := options.Expiry.UTC().Format(time.RFC3339)
// For some reason I don't understand, it fails when the rest of the string is included
expiry = expiry[:10]
protocol := "https,http" protocol := "https,http"
if options.UseHTTPS { if options.UseHTTPS {
...@@ -884,6 +880,12 @@ func readAndCloseBody(body io.ReadCloser) ([]byte, error) { ...@@ -884,6 +880,12 @@ func readAndCloseBody(body io.ReadCloser) ([]byte, error) {
return out, err return out, err
} }
// reads the response body then closes it
func drainRespBody(resp *http.Response) {
io.Copy(ioutil.Discard, resp.Body)
resp.Body.Close()
}
func serviceErrFromXML(body []byte, storageErr *AzureStorageServiceError) error { func serviceErrFromXML(body []byte, storageErr *AzureStorageServiceError) error {
if err := xml.Unmarshal(body, storageErr); err != nil { if err := xml.Unmarshal(body, storageErr); err != nil {
storageErr.Message = fmt.Sprintf("Response body could no be unmarshaled: %v. Body: %v.", err, string(body)) storageErr.Message = fmt.Sprintf("Response body could no be unmarshaled: %v. Body: %v.", err, string(body))
......
...@@ -258,7 +258,7 @@ func (c *Container) Create(options *CreateContainerOptions) error { ...@@ -258,7 +258,7 @@ func (c *Container) Create(options *CreateContainerOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return checkRespCode(resp, []int{http.StatusCreated}) return checkRespCode(resp, []int{http.StatusCreated})
} }
...@@ -267,7 +267,7 @@ func (c *Container) Create(options *CreateContainerOptions) error { ...@@ -267,7 +267,7 @@ func (c *Container) Create(options *CreateContainerOptions) error {
func (c *Container) CreateIfNotExists(options *CreateContainerOptions) (bool, error) { func (c *Container) CreateIfNotExists(options *CreateContainerOptions) (bool, error) {
resp, err := c.create(options) resp, err := c.create(options)
if resp != nil { if resp != nil {
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if resp.StatusCode == http.StatusCreated || resp.StatusCode == http.StatusConflict { if resp.StatusCode == http.StatusCreated || resp.StatusCode == http.StatusConflict {
return resp.StatusCode == http.StatusCreated, nil return resp.StatusCode == http.StatusCreated, nil
} }
...@@ -307,7 +307,7 @@ func (c *Container) Exists() (bool, error) { ...@@ -307,7 +307,7 @@ func (c *Container) Exists() (bool, error) {
resp, err := c.bsc.client.exec(http.MethodHead, uri, headers, nil, c.bsc.auth) resp, err := c.bsc.client.exec(http.MethodHead, uri, headers, nil, c.bsc.auth)
if resp != nil { if resp != nil {
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusNotFound { if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusNotFound {
return resp.StatusCode == http.StatusOK, nil return resp.StatusCode == http.StatusOK, nil
} }
...@@ -349,7 +349,7 @@ func (c *Container) SetPermissions(permissions ContainerPermissions, options *Se ...@@ -349,7 +349,7 @@ func (c *Container) SetPermissions(permissions ContainerPermissions, options *Se
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return checkRespCode(resp, []int{http.StatusOK}) return checkRespCode(resp, []int{http.StatusOK})
} }
...@@ -431,7 +431,7 @@ func (c *Container) Delete(options *DeleteContainerOptions) error { ...@@ -431,7 +431,7 @@ func (c *Container) Delete(options *DeleteContainerOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return checkRespCode(resp, []int{http.StatusAccepted}) return checkRespCode(resp, []int{http.StatusAccepted})
} }
...@@ -444,7 +444,7 @@ func (c *Container) Delete(options *DeleteContainerOptions) error { ...@@ -444,7 +444,7 @@ func (c *Container) Delete(options *DeleteContainerOptions) error {
func (c *Container) DeleteIfExists(options *DeleteContainerOptions) (bool, error) { func (c *Container) DeleteIfExists(options *DeleteContainerOptions) (bool, error) {
resp, err := c.delete(options) resp, err := c.delete(options)
if resp != nil { if resp != nil {
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if resp.StatusCode == http.StatusAccepted || resp.StatusCode == http.StatusNotFound { if resp.StatusCode == http.StatusAccepted || resp.StatusCode == http.StatusNotFound {
return resp.StatusCode == http.StatusAccepted, nil return resp.StatusCode == http.StatusAccepted, nil
} }
...@@ -535,7 +535,7 @@ func (c *Container) SetMetadata(options *ContainerMetadataOptions) error { ...@@ -535,7 +535,7 @@ func (c *Container) SetMetadata(options *ContainerMetadataOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return checkRespCode(resp, []int{http.StatusOK}) return checkRespCode(resp, []int{http.StatusOK})
} }
...@@ -563,7 +563,7 @@ func (c *Container) GetMetadata(options *ContainerMetadataOptions) error { ...@@ -563,7 +563,7 @@ func (c *Container) GetMetadata(options *ContainerMetadataOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if err := checkRespCode(resp, []int{http.StatusOK}); err != nil { if err := checkRespCode(resp, []int{http.StatusOK}); err != nil {
return err return err
} }
......
...@@ -110,7 +110,7 @@ func (b *Blob) StartCopy(sourceBlob string, options *CopyOptions) (string, error ...@@ -110,7 +110,7 @@ func (b *Blob) StartCopy(sourceBlob string, options *CopyOptions) (string, error
if err != nil { if err != nil {
return "", err return "", err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if err := checkRespCode(resp, []int{http.StatusAccepted, http.StatusCreated}); err != nil { if err := checkRespCode(resp, []int{http.StatusAccepted, http.StatusCreated}); err != nil {
return "", err return "", err
...@@ -152,7 +152,7 @@ func (b *Blob) AbortCopy(copyID string, options *AbortCopyOptions) error { ...@@ -152,7 +152,7 @@ func (b *Blob) AbortCopy(copyID string, options *AbortCopyOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return checkRespCode(resp, []int{http.StatusNoContent}) return checkRespCode(resp, []int{http.StatusNoContent})
} }
...@@ -223,7 +223,7 @@ func (b *Blob) IncrementalCopyBlob(sourceBlobURL string, snapshotTime time.Time, ...@@ -223,7 +223,7 @@ func (b *Blob) IncrementalCopyBlob(sourceBlobURL string, snapshotTime time.Time,
if err != nil { if err != nil {
return "", err return "", err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if err := checkRespCode(resp, []int{http.StatusAccepted}); err != nil { if err := checkRespCode(resp, []int{http.StatusAccepted}); err != nil {
return "", err return "", err
......
...@@ -107,7 +107,7 @@ func (d *Directory) CreateIfNotExists(options *FileRequestOptions) (bool, error) ...@@ -107,7 +107,7 @@ func (d *Directory) CreateIfNotExists(options *FileRequestOptions) (bool, error)
params := prepareOptions(options) params := prepareOptions(options)
resp, err := d.fsc.createResourceNoClose(d.buildPath(), resourceDirectory, params, nil) resp, err := d.fsc.createResourceNoClose(d.buildPath(), resourceDirectory, params, nil)
if resp != nil { if resp != nil {
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if resp.StatusCode == http.StatusCreated || resp.StatusCode == http.StatusConflict { if resp.StatusCode == http.StatusCreated || resp.StatusCode == http.StatusConflict {
if resp.StatusCode == http.StatusCreated { if resp.StatusCode == http.StatusCreated {
d.updateEtagAndLastModified(resp.Header) d.updateEtagAndLastModified(resp.Header)
...@@ -135,7 +135,7 @@ func (d *Directory) Delete(options *FileRequestOptions) error { ...@@ -135,7 +135,7 @@ func (d *Directory) Delete(options *FileRequestOptions) error {
func (d *Directory) DeleteIfExists(options *FileRequestOptions) (bool, error) { func (d *Directory) DeleteIfExists(options *FileRequestOptions) (bool, error) {
resp, err := d.fsc.deleteResourceNoClose(d.buildPath(), resourceDirectory, options) resp, err := d.fsc.deleteResourceNoClose(d.buildPath(), resourceDirectory, options)
if resp != nil { if resp != nil {
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if resp.StatusCode == http.StatusAccepted || resp.StatusCode == http.StatusNotFound { if resp.StatusCode == http.StatusAccepted || resp.StatusCode == http.StatusNotFound {
return resp.StatusCode == http.StatusAccepted, nil return resp.StatusCode == http.StatusAccepted, nil
} }
......
...@@ -112,7 +112,7 @@ func (e *Entity) Get(timeout uint, ml MetadataLevel, options *GetEntityOptions) ...@@ -112,7 +112,7 @@ func (e *Entity) Get(timeout uint, ml MetadataLevel, options *GetEntityOptions)
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if err = checkRespCode(resp, []int{http.StatusOK}); err != nil { if err = checkRespCode(resp, []int{http.StatusOK}); err != nil {
return err return err
...@@ -154,7 +154,7 @@ func (e *Entity) Insert(ml MetadataLevel, options *EntityOptions) error { ...@@ -154,7 +154,7 @@ func (e *Entity) Insert(ml MetadataLevel, options *EntityOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if ml != EmptyPayload { if ml != EmptyPayload {
if err = checkRespCode(resp, []int{http.StatusCreated}); err != nil { if err = checkRespCode(resp, []int{http.StatusCreated}); err != nil {
...@@ -212,7 +212,7 @@ func (e *Entity) Delete(force bool, options *EntityOptions) error { ...@@ -212,7 +212,7 @@ func (e *Entity) Delete(force bool, options *EntityOptions) error {
} }
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if err = checkRespCode(resp, []int{http.StatusNoContent}); err != nil { if err = checkRespCode(resp, []int{http.StatusNoContent}); err != nil {
return err return err
...@@ -399,7 +399,7 @@ func (e *Entity) insertOr(verb string, options *EntityOptions) error { ...@@ -399,7 +399,7 @@ func (e *Entity) insertOr(verb string, options *EntityOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if err = checkRespCode(resp, []int{http.StatusNoContent}); err != nil { if err = checkRespCode(resp, []int{http.StatusNoContent}); err != nil {
return err return err
...@@ -428,7 +428,7 @@ func (e *Entity) updateMerge(force bool, verb string, options *EntityOptions) er ...@@ -428,7 +428,7 @@ func (e *Entity) updateMerge(force bool, verb string, options *EntityOptions) er
} }
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if err = checkRespCode(resp, []int{http.StatusNoContent}); err != nil { if err = checkRespCode(resp, []int{http.StatusNoContent}); err != nil {
return err return err
......
...@@ -187,7 +187,7 @@ func (f *File) Delete(options *FileRequestOptions) error { ...@@ -187,7 +187,7 @@ func (f *File) Delete(options *FileRequestOptions) error {
func (f *File) DeleteIfExists(options *FileRequestOptions) (bool, error) { func (f *File) DeleteIfExists(options *FileRequestOptions) (bool, error) {
resp, err := f.fsc.deleteResourceNoClose(f.buildPath(), resourceFile, options) resp, err := f.fsc.deleteResourceNoClose(f.buildPath(), resourceFile, options)
if resp != nil { if resp != nil {
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if resp.StatusCode == http.StatusAccepted || resp.StatusCode == http.StatusNotFound { if resp.StatusCode == http.StatusAccepted || resp.StatusCode == http.StatusNotFound {
return resp.StatusCode == http.StatusAccepted, nil return resp.StatusCode == http.StatusAccepted, nil
} }
...@@ -212,7 +212,7 @@ func (f *File) DownloadToStream(options *FileRequestOptions) (io.ReadCloser, err ...@@ -212,7 +212,7 @@ func (f *File) DownloadToStream(options *FileRequestOptions) (io.ReadCloser, err
} }
if err = checkRespCode(resp, []int{http.StatusOK}); err != nil { if err = checkRespCode(resp, []int{http.StatusOK}); err != nil {
readAndCloseBody(resp.Body) drainRespBody(resp)
return nil, err return nil, err
} }
return resp.Body, nil return resp.Body, nil
...@@ -242,7 +242,7 @@ func (f *File) DownloadRangeToStream(fileRange FileRange, options *GetFileOption ...@@ -242,7 +242,7 @@ func (f *File) DownloadRangeToStream(fileRange FileRange, options *GetFileOption
} }
if err = checkRespCode(resp, []int{http.StatusOK, http.StatusPartialContent}); err != nil { if err = checkRespCode(resp, []int{http.StatusOK, http.StatusPartialContent}); err != nil {
readAndCloseBody(resp.Body) drainRespBody(resp)
return fs, err return fs, err
} }
...@@ -375,7 +375,7 @@ func (f *File) modifyRange(bytes io.Reader, fileRange FileRange, timeout *uint, ...@@ -375,7 +375,7 @@ func (f *File) modifyRange(bytes io.Reader, fileRange FileRange, timeout *uint,
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return resp.Header, checkRespCode(resp, []int{http.StatusCreated}) return resp.Header, checkRespCode(resp, []int{http.StatusCreated})
} }
......
...@@ -194,7 +194,7 @@ func (f FileServiceClient) listContent(path string, params url.Values, extraHead ...@@ -194,7 +194,7 @@ func (f FileServiceClient) listContent(path string, params url.Values, extraHead
} }
if err = checkRespCode(resp, []int{http.StatusOK}); err != nil { if err = checkRespCode(resp, []int{http.StatusOK}); err != nil {
readAndCloseBody(resp.Body) drainRespBody(resp)
return nil, err return nil, err
} }
...@@ -212,7 +212,7 @@ func (f FileServiceClient) resourceExists(path string, res resourceType) (bool, ...@@ -212,7 +212,7 @@ func (f FileServiceClient) resourceExists(path string, res resourceType) (bool,
resp, err := f.client.exec(http.MethodHead, uri, headers, nil, f.auth) resp, err := f.client.exec(http.MethodHead, uri, headers, nil, f.auth)
if resp != nil { if resp != nil {
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusNotFound { if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusNotFound {
return resp.StatusCode == http.StatusOK, resp.Header, nil return resp.StatusCode == http.StatusOK, resp.Header, nil
} }
...@@ -226,7 +226,7 @@ func (f FileServiceClient) createResource(path string, res resourceType, urlPara ...@@ -226,7 +226,7 @@ func (f FileServiceClient) createResource(path string, res resourceType, urlPara
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return resp.Header, checkRespCode(resp, expectedResponseCodes) return resp.Header, checkRespCode(resp, expectedResponseCodes)
} }
...@@ -251,7 +251,7 @@ func (f FileServiceClient) getResourceHeaders(path string, comp compType, res re ...@@ -251,7 +251,7 @@ func (f FileServiceClient) getResourceHeaders(path string, comp compType, res re
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if err = checkRespCode(resp, []int{http.StatusOK}); err != nil { if err = checkRespCode(resp, []int{http.StatusOK}); err != nil {
return nil, err return nil, err
...@@ -279,7 +279,7 @@ func (f FileServiceClient) deleteResource(path string, res resourceType, options ...@@ -279,7 +279,7 @@ func (f FileServiceClient) deleteResource(path string, res resourceType, options
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return checkRespCode(resp, []int{http.StatusAccepted}) return checkRespCode(resp, []int{http.StatusAccepted})
} }
...@@ -323,7 +323,7 @@ func (f FileServiceClient) setResourceHeaders(path string, comp compType, res re ...@@ -323,7 +323,7 @@ func (f FileServiceClient) setResourceHeaders(path string, comp compType, res re
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return resp.Header, checkRespCode(resp, []int{http.StatusOK}) return resp.Header, checkRespCode(resp, []int{http.StatusOK})
} }
......
...@@ -53,7 +53,7 @@ func (b *Blob) leaseCommonPut(headers map[string]string, expectedStatus int, opt ...@@ -53,7 +53,7 @@ func (b *Blob) leaseCommonPut(headers map[string]string, expectedStatus int, opt
if err != nil { if err != nil {
return nil, err return nil, err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if err := checkRespCode(resp, []int{expectedStatus}); err != nil { if err := checkRespCode(resp, []int{expectedStatus}); err != nil {
return nil, err return nil, err
......
...@@ -78,7 +78,7 @@ func (m *Message) Put(options *PutMessageOptions) error { ...@@ -78,7 +78,7 @@ func (m *Message) Put(options *PutMessageOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
err = checkRespCode(resp, []int{http.StatusCreated}) err = checkRespCode(resp, []int{http.StatusCreated})
if err != nil { if err != nil {
return err return err
...@@ -114,7 +114,8 @@ func (m *Message) Update(options *UpdateMessageOptions) error { ...@@ -114,7 +114,8 @@ func (m *Message) Update(options *UpdateMessageOptions) error {
return err return err
} }
headers["Content-Length"] = strconv.Itoa(nn) headers["Content-Length"] = strconv.Itoa(nn)
// visibilitytimeout is required for Update (zero or greater) so set the default here
query.Set("visibilitytimeout", "0")
if options != nil { if options != nil {
if options.VisibilityTimeout != 0 { if options.VisibilityTimeout != 0 {
query.Set("visibilitytimeout", strconv.Itoa(options.VisibilityTimeout)) query.Set("visibilitytimeout", strconv.Itoa(options.VisibilityTimeout))
...@@ -128,7 +129,7 @@ func (m *Message) Update(options *UpdateMessageOptions) error { ...@@ -128,7 +129,7 @@ func (m *Message) Update(options *UpdateMessageOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
m.PopReceipt = resp.Header.Get("x-ms-popreceipt") m.PopReceipt = resp.Header.Get("x-ms-popreceipt")
nextTimeStr := resp.Header.Get("x-ms-time-next-visible") nextTimeStr := resp.Header.Get("x-ms-time-next-visible")
...@@ -160,7 +161,7 @@ func (m *Message) Delete(options *QueueServiceOptions) error { ...@@ -160,7 +161,7 @@ func (m *Message) Delete(options *QueueServiceOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return checkRespCode(resp, []int{http.StatusNoContent}) return checkRespCode(resp, []int{http.StatusNoContent})
} }
......
...@@ -121,7 +121,7 @@ func (b *Blob) modifyRange(blobRange BlobRange, bytes io.Reader, options *PutPag ...@@ -121,7 +121,7 @@ func (b *Blob) modifyRange(blobRange BlobRange, bytes io.Reader, options *PutPag
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return checkRespCode(resp, []int{http.StatusCreated}) return checkRespCode(resp, []int{http.StatusCreated})
} }
...@@ -160,7 +160,7 @@ func (b *Blob) GetPageRanges(options *GetPageRangesOptions) (GetPageRangesRespon ...@@ -160,7 +160,7 @@ func (b *Blob) GetPageRanges(options *GetPageRangesOptions) (GetPageRangesRespon
if err != nil { if err != nil {
return out, err return out, err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if err = checkRespCode(resp, []int{http.StatusOK}); err != nil { if err = checkRespCode(resp, []int{http.StatusOK}); err != nil {
return out, err return out, err
......
...@@ -91,7 +91,7 @@ func (q *Queue) Create(options *QueueServiceOptions) error { ...@@ -91,7 +91,7 @@ func (q *Queue) Create(options *QueueServiceOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return checkRespCode(resp, []int{http.StatusCreated}) return checkRespCode(resp, []int{http.StatusCreated})
} }
...@@ -111,7 +111,7 @@ func (q *Queue) Delete(options *QueueServiceOptions) error { ...@@ -111,7 +111,7 @@ func (q *Queue) Delete(options *QueueServiceOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return checkRespCode(resp, []int{http.StatusNoContent}) return checkRespCode(resp, []int{http.StatusNoContent})
} }
...@@ -120,7 +120,7 @@ func (q *Queue) Exists() (bool, error) { ...@@ -120,7 +120,7 @@ func (q *Queue) Exists() (bool, error) {
uri := q.qsc.client.getEndpoint(queueServiceName, q.buildPath(), url.Values{"comp": {"metadata"}}) uri := q.qsc.client.getEndpoint(queueServiceName, q.buildPath(), url.Values{"comp": {"metadata"}})
resp, err := q.qsc.client.exec(http.MethodGet, uri, q.qsc.client.getStandardHeaders(), nil, q.qsc.auth) resp, err := q.qsc.client.exec(http.MethodGet, uri, q.qsc.client.getStandardHeaders(), nil, q.qsc.auth)
if resp != nil { if resp != nil {
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusNotFound { if resp.StatusCode == http.StatusOK || resp.StatusCode == http.StatusNotFound {
return resp.StatusCode == http.StatusOK, nil return resp.StatusCode == http.StatusOK, nil
} }
...@@ -148,7 +148,7 @@ func (q *Queue) SetMetadata(options *QueueServiceOptions) error { ...@@ -148,7 +148,7 @@ func (q *Queue) SetMetadata(options *QueueServiceOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return checkRespCode(resp, []int{http.StatusNoContent}) return checkRespCode(resp, []int{http.StatusNoContent})
} }
...@@ -175,7 +175,7 @@ func (q *Queue) GetMetadata(options *QueueServiceOptions) error { ...@@ -175,7 +175,7 @@ func (q *Queue) GetMetadata(options *QueueServiceOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
if err := checkRespCode(resp, []int{http.StatusOK}); err != nil { if err := checkRespCode(resp, []int{http.StatusOK}); err != nil {
return err return err
...@@ -314,7 +314,7 @@ func (q *Queue) ClearMessages(options *QueueServiceOptions) error { ...@@ -314,7 +314,7 @@ func (q *Queue) ClearMessages(options *QueueServiceOptions) error {
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return checkRespCode(resp, []int{http.StatusNoContent}) return checkRespCode(resp, []int{http.StatusNoContent})
} }
...@@ -341,7 +341,7 @@ func (q *Queue) SetPermissions(permissions QueuePermissions, options *SetQueuePe ...@@ -341,7 +341,7 @@ func (q *Queue) SetPermissions(permissions QueuePermissions, options *SetQueuePe
if err != nil { if err != nil {
return err return err
} }
defer readAndCloseBody(resp.Body) defer drainRespBody(resp)
return checkRespCode(resp, []int{http.StatusNoContent}) return checkRespCode(resp, []int{http.StatusNoContent})
} }
......
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