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