Merge pull request #6479 from hashicorp/pr-azure-build-on-32bit
azure: Upgrade to a new SDK to fix 32-bit build breakage
This commit is contained in:
commit
d31e38bafa
|
@ -40,9 +40,10 @@ func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string)
|
|||
}
|
||||
|
||||
// CreateOrUpdate create or update an availability set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. availabilitySetName is the name of the availability set.
|
||||
// parameters is parameters supplied to the Create Availability Set operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// availabilitySetName - the name of the availability set.
|
||||
// parameters - parameters supplied to the Create Availability Set operation.
|
||||
func (client AvailabilitySetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySet) (result AvailabilitySet, err error) {
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, availabilitySetName, parameters)
|
||||
if err != nil {
|
||||
|
@ -109,8 +110,9 @@ func (client AvailabilitySetsClient) CreateOrUpdateResponder(resp *http.Response
|
|||
}
|
||||
|
||||
// Delete delete an availability set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. availabilitySetName is the name of the availability set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// availabilitySetName - the name of the availability set.
|
||||
func (client AvailabilitySetsClient) Delete(ctx context.Context, resourceGroupName string, availabilitySetName string) (result OperationStatusResponse, err error) {
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, availabilitySetName)
|
||||
if err != nil {
|
||||
|
@ -175,8 +177,9 @@ func (client AvailabilitySetsClient) DeleteResponder(resp *http.Response) (resul
|
|||
}
|
||||
|
||||
// Get retrieves information about an availability set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. availabilitySetName is the name of the availability set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// availabilitySetName - the name of the availability set.
|
||||
func (client AvailabilitySetsClient) Get(ctx context.Context, resourceGroupName string, availabilitySetName string) (result AvailabilitySet, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, availabilitySetName)
|
||||
if err != nil {
|
||||
|
@ -241,8 +244,8 @@ func (client AvailabilitySetsClient) GetResponder(resp *http.Response) (result A
|
|||
}
|
||||
|
||||
// List lists all availability sets in a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
func (client AvailabilitySetsClient) List(ctx context.Context, resourceGroupName string) (result AvailabilitySetListResult, err error) {
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName)
|
||||
if err != nil {
|
||||
|
@ -307,8 +310,9 @@ func (client AvailabilitySetsClient) ListResponder(resp *http.Response) (result
|
|||
|
||||
// ListAvailableSizes lists all available virtual machine sizes that can be used to create a new virtual machine in an
|
||||
// existing availability set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. availabilitySetName is the name of the availability set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// availabilitySetName - the name of the availability set.
|
||||
func (client AvailabilitySetsClient) ListAvailableSizes(ctx context.Context, resourceGroupName string, availabilitySetName string) (result VirtualMachineSizeListResult, err error) {
|
||||
req, err := client.ListAvailableSizesPreparer(ctx, resourceGroupName, availabilitySetName)
|
||||
if err != nil {
|
||||
|
@ -373,9 +377,10 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp
|
|||
}
|
||||
|
||||
// Update update an availability set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. availabilitySetName is the name of the availability set.
|
||||
// parameters is parameters supplied to the Update Availability Set operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// availabilitySetName - the name of the availability set.
|
||||
// parameters - parameters supplied to the Update Availability Set operation.
|
||||
func (client AvailabilitySetsClient) Update(ctx context.Context, resourceGroupName string, availabilitySetName string, parameters AvailabilitySetUpdate) (result AvailabilitySet, err error) {
|
||||
req, err := client.UpdatePreparer(ctx, resourceGroupName, availabilitySetName, parameters)
|
||||
if err != nil {
|
||||
|
|
|
@ -42,10 +42,10 @@ func NewContainerServicesClientWithBaseURI(baseURI string, subscriptionID string
|
|||
|
||||
// CreateOrUpdate creates or updates a container service with the specified configuration of orchestrator, masters, and
|
||||
// agents.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. containerServiceName is the name of the container service
|
||||
// in the specified subscription and resource group. parameters is parameters supplied to the Create or Update a
|
||||
// Container Service operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// containerServiceName - the name of the container service in the specified subscription and resource group.
|
||||
// parameters - parameters supplied to the Create or Update a Container Service operation.
|
||||
func (client ContainerServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, containerServiceName string, parameters ContainerService) (result ContainerServicesCreateOrUpdateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -119,15 +119,17 @@ func (client ContainerServicesClient) CreateOrUpdatePreparer(ctx context.Context
|
|||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ContainerServicesClient) CreateOrUpdateSender(req *http.Request) (future ContainerServicesCreateOrUpdateFuture, 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, http.StatusAccepted))
|
||||
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -148,9 +150,9 @@ func (client ContainerServicesClient) CreateOrUpdateResponder(resp *http.Respons
|
|||
// not delete other resources created as part of creating a container service, including storage accounts, VMs, and
|
||||
// availability sets. All the other resources created with the container service are part of the same resource group
|
||||
// and can be deleted individually.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. containerServiceName is the name of the container service
|
||||
// in the specified subscription and resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// containerServiceName - the name of the container service in the specified subscription and resource group.
|
||||
func (client ContainerServicesClient) Delete(ctx context.Context, resourceGroupName string, containerServiceName string) (result ContainerServicesDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, containerServiceName)
|
||||
if err != nil {
|
||||
|
@ -191,15 +193,17 @@ func (client ContainerServicesClient) DeletePreparer(ctx context.Context, resour
|
|||
// DeleteSender sends the Delete request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ContainerServicesClient) DeleteSender(req *http.Request) (future ContainerServicesDeleteFuture, 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
|
||||
}
|
||||
|
||||
|
@ -218,9 +222,9 @@ func (client ContainerServicesClient) DeleteResponder(resp *http.Response) (resu
|
|||
// Get gets the properties of the specified container service in the specified subscription and resource group. The
|
||||
// operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of masters
|
||||
// and agents.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. containerServiceName is the name of the container service
|
||||
// in the specified subscription and resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// containerServiceName - the name of the container service in the specified subscription and resource group.
|
||||
func (client ContainerServicesClient) Get(ctx context.Context, resourceGroupName string, containerServiceName string) (result ContainerService, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, containerServiceName)
|
||||
if err != nil {
|
||||
|
@ -378,8 +382,8 @@ func (client ContainerServicesClient) ListComplete(ctx context.Context) (result
|
|||
// ListByResourceGroup gets a list of container services in the specified subscription and resource group. The
|
||||
// operation returns properties of each container service including state, orchestrator, number of masters and agents,
|
||||
// and FQDNs of masters and agents.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
func (client ContainerServicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ContainerServiceListResultPage, err error) {
|
||||
result.fn = client.listByResourceGroupNextResults
|
||||
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
|
||||
|
|
144
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/disks.go
generated
vendored
144
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/disks.go
generated
vendored
|
@ -41,11 +41,12 @@ func NewDisksClientWithBaseURI(baseURI string, subscriptionID string) DisksClien
|
|||
}
|
||||
|
||||
// CreateOrUpdate creates or updates a disk.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. diskName is the name of the managed disk that is being
|
||||
// created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z,
|
||||
// 0-9 and _. The maximum name length is 80 characters. disk is disk object supplied in the body of the Put disk
|
||||
// operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
|
||||
// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
|
||||
// characters.
|
||||
// disk - disk object supplied in the body of the Put disk operation.
|
||||
func (client DisksClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, disk Disk) (result DisksCreateOrUpdateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: disk,
|
||||
|
@ -109,15 +110,17 @@ func (client DisksClient) CreateOrUpdatePreparer(ctx context.Context, resourceGr
|
|||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client DisksClient) CreateOrUpdateSender(req *http.Request) (future DisksCreateOrUpdateFuture, 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
|
||||
}
|
||||
|
||||
|
@ -135,10 +138,11 @@ func (client DisksClient) CreateOrUpdateResponder(resp *http.Response) (result D
|
|||
}
|
||||
|
||||
// Delete deletes a disk.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. diskName is the name of the managed disk that is being
|
||||
// created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z,
|
||||
// 0-9 and _. The maximum name length is 80 characters.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
|
||||
// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
|
||||
// characters.
|
||||
func (client DisksClient) Delete(ctx context.Context, resourceGroupName string, diskName string) (result DisksDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, diskName)
|
||||
if err != nil {
|
||||
|
@ -179,36 +183,38 @@ func (client DisksClient) 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 DisksClient) DeleteSender(req *http.Request) (future DisksDeleteFuture, 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 DisksClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
|
||||
func (client DisksClient) 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 gets information about a disk.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. diskName is the name of the managed disk that is being
|
||||
// created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z,
|
||||
// 0-9 and _. The maximum name length is 80 characters.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
|
||||
// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
|
||||
// characters.
|
||||
func (client DisksClient) Get(ctx context.Context, resourceGroupName string, diskName string) (result Disk, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, diskName)
|
||||
if err != nil {
|
||||
|
@ -273,11 +279,12 @@ func (client DisksClient) GetResponder(resp *http.Response) (result Disk, err er
|
|||
}
|
||||
|
||||
// GrantAccess grants access to a disk.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. diskName is the name of the managed disk that is being
|
||||
// created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z,
|
||||
// 0-9 and _. The maximum name length is 80 characters. grantAccessData is access data object supplied in the body
|
||||
// of the get disk access operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
|
||||
// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
|
||||
// characters.
|
||||
// grantAccessData - access data object supplied in the body of the get disk access operation.
|
||||
func (client DisksClient) GrantAccess(ctx context.Context, resourceGroupName string, diskName string, grantAccessData GrantAccessData) (result DisksGrantAccessFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: grantAccessData,
|
||||
|
@ -326,15 +333,17 @@ func (client DisksClient) GrantAccessPreparer(ctx context.Context, resourceGroup
|
|||
// GrantAccessSender sends the GrantAccess request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client DisksClient) GrantAccessSender(req *http.Request) (future DisksGrantAccessFuture, 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
|
||||
}
|
||||
|
||||
|
@ -442,8 +451,8 @@ func (client DisksClient) ListComplete(ctx context.Context) (result DiskListIter
|
|||
}
|
||||
|
||||
// ListByResourceGroup lists all the disks under a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
func (client DisksClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DiskListPage, err error) {
|
||||
result.fn = client.listByResourceGroupNextResults
|
||||
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
|
||||
|
@ -535,10 +544,11 @@ func (client DisksClient) ListByResourceGroupComplete(ctx context.Context, resou
|
|||
}
|
||||
|
||||
// RevokeAccess revokes access to a disk.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. diskName is the name of the managed disk that is being
|
||||
// created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z,
|
||||
// 0-9 and _. The maximum name length is 80 characters.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
|
||||
// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
|
||||
// characters.
|
||||
func (client DisksClient) RevokeAccess(ctx context.Context, resourceGroupName string, diskName string) (result DisksRevokeAccessFuture, err error) {
|
||||
req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, diskName)
|
||||
if err != nil {
|
||||
|
@ -579,37 +589,39 @@ func (client DisksClient) RevokeAccessPreparer(ctx context.Context, resourceGrou
|
|||
// RevokeAccessSender sends the RevokeAccess request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client DisksClient) RevokeAccessSender(req *http.Request) (future DisksRevokeAccessFuture, 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
|
||||
}
|
||||
|
||||
// RevokeAccessResponder handles the response to the RevokeAccess request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client DisksClient) RevokeAccessResponder(resp *http.Response) (result OperationStatusResponse, err error) {
|
||||
func (client DisksClient) RevokeAccessResponder(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
|
||||
}
|
||||
|
||||
// Update updates (patches) a disk.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. diskName is the name of the managed disk that is being
|
||||
// created. The name can't be changed after the disk is created. Supported characters for the name are a-z, A-Z,
|
||||
// 0-9 and _. The maximum name length is 80 characters. disk is disk object supplied in the body of the Patch disk
|
||||
// operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// diskName - the name of the managed disk that is being created. The name can't be changed after the disk is
|
||||
// created. Supported characters for the name are a-z, A-Z, 0-9 and _. The maximum name length is 80
|
||||
// characters.
|
||||
// disk - disk object supplied in the body of the Patch disk operation.
|
||||
func (client DisksClient) Update(ctx context.Context, resourceGroupName string, diskName string, disk DiskUpdate) (result DisksUpdateFuture, err error) {
|
||||
req, err := client.UpdatePreparer(ctx, resourceGroupName, diskName, disk)
|
||||
if err != nil {
|
||||
|
@ -652,15 +664,17 @@ func (client DisksClient) UpdatePreparer(ctx context.Context, resourceGroupName
|
|||
// UpdateSender sends the Update request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client DisksClient) UpdateSender(req *http.Request) (future DisksUpdateFuture, 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
|
||||
}
|
||||
|
||||
|
|
|
@ -40,9 +40,10 @@ func NewImagesClientWithBaseURI(baseURI string, subscriptionID string) ImagesCli
|
|||
}
|
||||
|
||||
// CreateOrUpdate create or update an image.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. imageName is the name of the image. parameters is
|
||||
// parameters supplied to the Create Image operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// imageName - the name of the image.
|
||||
// parameters - parameters supplied to the Create Image operation.
|
||||
func (client ImagesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, imageName string, parameters Image) (result ImagesCreateOrUpdateFuture, err error) {
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, imageName, parameters)
|
||||
if err != nil {
|
||||
|
@ -85,15 +86,17 @@ func (client ImagesClient) 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 ImagesClient) CreateOrUpdateSender(req *http.Request) (future ImagesCreateOrUpdateFuture, 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
|
||||
}
|
||||
|
||||
|
@ -111,8 +114,9 @@ func (client ImagesClient) CreateOrUpdateResponder(resp *http.Response) (result
|
|||
}
|
||||
|
||||
// Delete deletes an Image.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. imageName is the name of the image.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// imageName - the name of the image.
|
||||
func (client ImagesClient) Delete(ctx context.Context, resourceGroupName string, imageName string) (result ImagesDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, imageName)
|
||||
if err != nil {
|
||||
|
@ -153,15 +157,17 @@ func (client ImagesClient) 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 ImagesClient) DeleteSender(req *http.Request) (future ImagesDeleteFuture, 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 +185,10 @@ func (client ImagesClient) DeleteResponder(resp *http.Response) (result Operatio
|
|||
}
|
||||
|
||||
// Get gets an image.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. imageName is the name of the image. expand is the expand
|
||||
// expression to apply on the operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// imageName - the name of the image.
|
||||
// expand - the expand expression to apply on the operation.
|
||||
func (client ImagesClient) Get(ctx context.Context, resourceGroupName string, imageName string, expand string) (result Image, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, imageName, expand)
|
||||
if err != nil {
|
||||
|
@ -340,8 +347,8 @@ func (client ImagesClient) ListComplete(ctx context.Context) (result ImageListRe
|
|||
}
|
||||
|
||||
// ListByResourceGroup gets the list of images under a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
func (client ImagesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ImageListResultPage, err error) {
|
||||
result.fn = client.listByResourceGroupNextResults
|
||||
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
|
||||
|
@ -433,9 +440,10 @@ func (client ImagesClient) ListByResourceGroupComplete(ctx context.Context, reso
|
|||
}
|
||||
|
||||
// Update update an image.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. imageName is the name of the image. parameters is
|
||||
// parameters supplied to the Update Image operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// imageName - the name of the image.
|
||||
// parameters - parameters supplied to the Update Image operation.
|
||||
func (client ImagesClient) Update(ctx context.Context, resourceGroupName string, imageName string, parameters ImageUpdate) (result ImagesUpdateFuture, err error) {
|
||||
req, err := client.UpdatePreparer(ctx, resourceGroupName, imageName, parameters)
|
||||
if err != nil {
|
||||
|
@ -478,15 +486,17 @@ func (client ImagesClient) UpdatePreparer(ctx context.Context, resourceGroupName
|
|||
// UpdateSender sends the Update request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ImagesClient) UpdateSender(req *http.Request) (future ImagesUpdateFuture, 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
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
|
2269
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/models.go
generated
vendored
2269
vendor/github.com/Azure/azure-sdk-for-go/services/compute/mgmt/2018-04-01/compute/models.go
generated
vendored
File diff suppressed because it is too large
Load Diff
|
@ -41,11 +41,11 @@ func NewSnapshotsClientWithBaseURI(baseURI string, subscriptionID string) Snapsh
|
|||
}
|
||||
|
||||
// CreateOrUpdate creates or updates a snapshot.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot that is being
|
||||
// created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z,
|
||||
// A-Z, 0-9 and _. The max name length is 80 characters. snapshot is snapshot object supplied in the body of the
|
||||
// Put disk operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
|
||||
// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
|
||||
// snapshot - snapshot object supplied in the body of the Put disk operation.
|
||||
func (client SnapshotsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, snapshotName string, snapshot Snapshot) (result SnapshotsCreateOrUpdateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: snapshot,
|
||||
|
@ -109,15 +109,17 @@ func (client SnapshotsClient) CreateOrUpdatePreparer(ctx context.Context, resour
|
|||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client SnapshotsClient) CreateOrUpdateSender(req *http.Request) (future SnapshotsCreateOrUpdateFuture, 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
|
||||
}
|
||||
|
||||
|
@ -135,10 +137,10 @@ func (client SnapshotsClient) CreateOrUpdateResponder(resp *http.Response) (resu
|
|||
}
|
||||
|
||||
// Delete deletes a snapshot.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot that is being
|
||||
// created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z,
|
||||
// A-Z, 0-9 and _. The max name length is 80 characters.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
|
||||
// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
|
||||
func (client SnapshotsClient) Delete(ctx context.Context, resourceGroupName string, snapshotName string) (result SnapshotsDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, snapshotName)
|
||||
if err != nil {
|
||||
|
@ -179,36 +181,37 @@ func (client SnapshotsClient) DeletePreparer(ctx context.Context, resourceGroupN
|
|||
// DeleteSender sends the Delete request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client SnapshotsClient) DeleteSender(req *http.Request) (future SnapshotsDeleteFuture, 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 SnapshotsClient) DeleteResponder(resp *http.Response) (result OperationStatusResponse, err error) {
|
||||
func (client SnapshotsClient) 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 gets information about a snapshot.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot that is being
|
||||
// created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z,
|
||||
// A-Z, 0-9 and _. The max name length is 80 characters.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
|
||||
// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
|
||||
func (client SnapshotsClient) Get(ctx context.Context, resourceGroupName string, snapshotName string) (result Snapshot, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, snapshotName)
|
||||
if err != nil {
|
||||
|
@ -273,11 +276,11 @@ func (client SnapshotsClient) GetResponder(resp *http.Response) (result Snapshot
|
|||
}
|
||||
|
||||
// GrantAccess grants access to a snapshot.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot that is being
|
||||
// created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z,
|
||||
// A-Z, 0-9 and _. The max name length is 80 characters. grantAccessData is access data object supplied in the body
|
||||
// of the get snapshot access operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
|
||||
// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
|
||||
// grantAccessData - access data object supplied in the body of the get snapshot access operation.
|
||||
func (client SnapshotsClient) GrantAccess(ctx context.Context, resourceGroupName string, snapshotName string, grantAccessData GrantAccessData) (result SnapshotsGrantAccessFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: grantAccessData,
|
||||
|
@ -326,15 +329,17 @@ func (client SnapshotsClient) GrantAccessPreparer(ctx context.Context, resourceG
|
|||
// GrantAccessSender sends the GrantAccess request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client SnapshotsClient) GrantAccessSender(req *http.Request) (future SnapshotsGrantAccessFuture, 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
|
||||
}
|
||||
|
||||
|
@ -442,8 +447,8 @@ func (client SnapshotsClient) ListComplete(ctx context.Context) (result Snapshot
|
|||
}
|
||||
|
||||
// ListByResourceGroup lists snapshots under a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
func (client SnapshotsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SnapshotListPage, err error) {
|
||||
result.fn = client.listByResourceGroupNextResults
|
||||
req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName)
|
||||
|
@ -535,10 +540,10 @@ func (client SnapshotsClient) ListByResourceGroupComplete(ctx context.Context, r
|
|||
}
|
||||
|
||||
// RevokeAccess revokes access to a snapshot.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot that is being
|
||||
// created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z,
|
||||
// A-Z, 0-9 and _. The max name length is 80 characters.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
|
||||
// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
|
||||
func (client SnapshotsClient) RevokeAccess(ctx context.Context, resourceGroupName string, snapshotName string) (result SnapshotsRevokeAccessFuture, err error) {
|
||||
req, err := client.RevokeAccessPreparer(ctx, resourceGroupName, snapshotName)
|
||||
if err != nil {
|
||||
|
@ -579,37 +584,38 @@ func (client SnapshotsClient) RevokeAccessPreparer(ctx context.Context, resource
|
|||
// RevokeAccessSender sends the RevokeAccess request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client SnapshotsClient) RevokeAccessSender(req *http.Request) (future SnapshotsRevokeAccessFuture, 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
|
||||
}
|
||||
|
||||
// RevokeAccessResponder handles the response to the RevokeAccess request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client SnapshotsClient) RevokeAccessResponder(resp *http.Response) (result OperationStatusResponse, err error) {
|
||||
func (client SnapshotsClient) RevokeAccessResponder(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
|
||||
}
|
||||
|
||||
// Update updates (patches) a snapshot.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. snapshotName is the name of the snapshot that is being
|
||||
// created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z,
|
||||
// A-Z, 0-9 and _. The max name length is 80 characters. snapshot is snapshot object supplied in the body of the
|
||||
// Patch snapshot operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// snapshotName - the name of the snapshot that is being created. The name can't be changed after the snapshot
|
||||
// is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
|
||||
// snapshot - snapshot object supplied in the body of the Patch snapshot operation.
|
||||
func (client SnapshotsClient) Update(ctx context.Context, resourceGroupName string, snapshotName string, snapshot SnapshotUpdate) (result SnapshotsUpdateFuture, err error) {
|
||||
req, err := client.UpdatePreparer(ctx, resourceGroupName, snapshotName, snapshot)
|
||||
if err != nil {
|
||||
|
@ -652,15 +658,17 @@ func (client SnapshotsClient) UpdatePreparer(ctx context.Context, resourceGroupN
|
|||
// UpdateSender sends the Update request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client SnapshotsClient) UpdateSender(req *http.Request) (future SnapshotsUpdateFuture, 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
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
|
|
@ -40,10 +40,11 @@ func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID
|
|||
}
|
||||
|
||||
// CreateOrUpdate the operation to create or update the extension.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine where the
|
||||
// extension should be create or updated. VMExtensionName is the name of the virtual machine extension.
|
||||
// extensionParameters is parameters supplied to the Create Virtual Machine Extension operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine where the extension should be created or updated.
|
||||
// VMExtensionName - the name of the virtual machine extension.
|
||||
// extensionParameters - parameters supplied to the Create Virtual Machine Extension operation.
|
||||
func (client VirtualMachineExtensionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtension) (result VirtualMachineExtensionsCreateOrUpdateFuture, err error) {
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters)
|
||||
if err != nil {
|
||||
|
@ -87,15 +88,17 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(ctx context.
|
|||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineExtensionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineExtensionsCreateOrUpdateFuture, 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
|
||||
}
|
||||
|
||||
|
@ -113,9 +116,10 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http.
|
|||
}
|
||||
|
||||
// Delete the operation to delete the extension.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine where the
|
||||
// extension should be deleted. VMExtensionName is the name of the virtual machine extension.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine where the extension should be deleted.
|
||||
// VMExtensionName - the name of the virtual machine extension.
|
||||
func (client VirtualMachineExtensionsClient) Delete(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string) (result VirtualMachineExtensionsDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, VMName, VMExtensionName)
|
||||
if err != nil {
|
||||
|
@ -157,15 +161,17 @@ func (client VirtualMachineExtensionsClient) DeletePreparer(ctx context.Context,
|
|||
// DeleteSender sends the Delete request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineExtensionsClient) DeleteSender(req *http.Request) (future VirtualMachineExtensionsDeleteFuture, 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
|
||||
}
|
||||
|
||||
|
@ -183,10 +189,11 @@ func (client VirtualMachineExtensionsClient) DeleteResponder(resp *http.Response
|
|||
}
|
||||
|
||||
// Get the operation to get the extension.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine containing the
|
||||
// extension. VMExtensionName is the name of the virtual machine extension. expand is the expand expression to
|
||||
// apply on the operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine containing the extension.
|
||||
// VMExtensionName - the name of the virtual machine extension.
|
||||
// expand - the expand expression to apply on the operation.
|
||||
func (client VirtualMachineExtensionsClient) Get(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, expand string) (result VirtualMachineExtension, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, VMName, VMExtensionName, expand)
|
||||
if err != nil {
|
||||
|
@ -253,3 +260,79 @@ func (client VirtualMachineExtensionsClient) GetResponder(resp *http.Response) (
|
|||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// Update the operation to update the extension.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine where the extension should be updated.
|
||||
// VMExtensionName - the name of the virtual machine extension.
|
||||
// extensionParameters - parameters supplied to the Update Virtual Machine Extension operation.
|
||||
func (client VirtualMachineExtensionsClient) Update(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (result VirtualMachineExtensionsUpdateFuture, err error) {
|
||||
req, err := client.UpdatePreparer(ctx, resourceGroupName, VMName, VMExtensionName, extensionParameters)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.UpdateSender(req)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionsClient", "Update", result.Response(), "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// UpdatePreparer prepares the Update request.
|
||||
func (client VirtualMachineExtensionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, VMName string, VMExtensionName string, extensionParameters VirtualMachineExtensionUpdate) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmExtensionName": autorest.Encode("path", VMExtensionName),
|
||||
"vmName": autorest.Encode("path", VMName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-12-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsContentType("application/json; charset=utf-8"),
|
||||
autorest.AsPatch(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
|
||||
autorest.WithJSON(extensionParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// UpdateSender sends the Update request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineExtensionsClient) UpdateSender(req *http.Request) (future VirtualMachineExtensionsUpdateFuture, err error) {
|
||||
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
|
||||
}
|
||||
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||
return
|
||||
}
|
||||
|
||||
// UpdateResponder handles the response to the Update request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineExtensionsClient) UpdateResponder(resp *http.Response) (result VirtualMachineExtension, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
|
@ -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,
|
||||
|
|
|
@ -42,9 +42,10 @@ func NewVirtualMachinesClientWithBaseURI(baseURI string, subscriptionID string)
|
|||
|
||||
// Capture captures the VM by copying virtual hard disks of the VM and outputs a template that can be used to create
|
||||
// similar VMs.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. parameters is
|
||||
// parameters supplied to the Capture Virtual Machine operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine.
|
||||
// parameters - parameters supplied to the Capture Virtual Machine operation.
|
||||
func (client VirtualMachinesClient) Capture(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineCaptureParameters) (result VirtualMachinesCaptureFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -95,15 +96,17 @@ func (client VirtualMachinesClient) CapturePreparer(ctx context.Context, resourc
|
|||
// CaptureSender sends the Capture request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachinesClient) CaptureSender(req *http.Request) (future VirtualMachinesCaptureFuture, 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
|
||||
}
|
||||
|
||||
|
@ -122,8 +125,9 @@ func (client VirtualMachinesClient) CaptureResponder(resp *http.Response) (resul
|
|||
|
||||
// ConvertToManagedDisks converts virtual machine disks from blob-based to managed disks. Virtual machine must be
|
||||
// stop-deallocated before invoking this operation.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine.
|
||||
func (client VirtualMachinesClient) ConvertToManagedDisks(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesConvertToManagedDisksFuture, err error) {
|
||||
req, err := client.ConvertToManagedDisksPreparer(ctx, resourceGroupName, VMName)
|
||||
if err != nil {
|
||||
|
@ -164,15 +168,17 @@ func (client VirtualMachinesClient) ConvertToManagedDisksPreparer(ctx context.Co
|
|||
// ConvertToManagedDisksSender sends the ConvertToManagedDisks request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachinesClient) ConvertToManagedDisksSender(req *http.Request) (future VirtualMachinesConvertToManagedDisksFuture, 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
|
||||
}
|
||||
|
||||
|
@ -190,9 +196,10 @@ func (client VirtualMachinesClient) ConvertToManagedDisksResponder(resp *http.Re
|
|||
}
|
||||
|
||||
// CreateOrUpdate the operation to create or update a virtual machine.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. parameters is
|
||||
// parameters supplied to the Create Virtual Machine operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine.
|
||||
// parameters - parameters supplied to the Create Virtual Machine operation.
|
||||
func (client VirtualMachinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachine) (result VirtualMachinesCreateOrUpdateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -256,15 +263,17 @@ func (client VirtualMachinesClient) CreateOrUpdatePreparer(ctx context.Context,
|
|||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachinesClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachinesCreateOrUpdateFuture, 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
|
||||
}
|
||||
|
||||
|
@ -283,8 +292,9 @@ func (client VirtualMachinesClient) CreateOrUpdateResponder(resp *http.Response)
|
|||
|
||||
// Deallocate shuts down the virtual machine and releases the compute resources. You are not billed for the compute
|
||||
// resources that this virtual machine uses.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine.
|
||||
func (client VirtualMachinesClient) Deallocate(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesDeallocateFuture, err error) {
|
||||
req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMName)
|
||||
if err != nil {
|
||||
|
@ -325,15 +335,17 @@ func (client VirtualMachinesClient) DeallocatePreparer(ctx context.Context, reso
|
|||
// DeallocateSender sends the Deallocate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachinesClient) DeallocateSender(req *http.Request) (future VirtualMachinesDeallocateFuture, 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
|
||||
}
|
||||
|
||||
|
@ -351,8 +363,9 @@ func (client VirtualMachinesClient) DeallocateResponder(resp *http.Response) (re
|
|||
}
|
||||
|
||||
// Delete the operation to delete a virtual machine.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine.
|
||||
func (client VirtualMachinesClient) Delete(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, VMName)
|
||||
if err != nil {
|
||||
|
@ -393,15 +406,17 @@ func (client VirtualMachinesClient) 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 VirtualMachinesClient) DeleteSender(req *http.Request) (future VirtualMachinesDeleteFuture, 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
|
||||
}
|
||||
|
||||
|
@ -419,8 +434,9 @@ func (client VirtualMachinesClient) DeleteResponder(resp *http.Response) (result
|
|||
}
|
||||
|
||||
// Generalize sets the state of the virtual machine to generalized.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine.
|
||||
func (client VirtualMachinesClient) Generalize(ctx context.Context, resourceGroupName string, VMName string) (result OperationStatusResponse, err error) {
|
||||
req, err := client.GeneralizePreparer(ctx, resourceGroupName, VMName)
|
||||
if err != nil {
|
||||
|
@ -485,9 +501,10 @@ func (client VirtualMachinesClient) GeneralizeResponder(resp *http.Response) (re
|
|||
}
|
||||
|
||||
// Get retrieves information about the model view or the instance view of a virtual machine.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. expand is the
|
||||
// expand expression to apply on the operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine.
|
||||
// expand - the expand expression to apply on the operation.
|
||||
func (client VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, VMName string, expand InstanceViewTypes) (result VirtualMachine, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, VMName, expand)
|
||||
if err != nil {
|
||||
|
@ -554,9 +571,81 @@ func (client VirtualMachinesClient) GetResponder(resp *http.Response) (result Vi
|
|||
return
|
||||
}
|
||||
|
||||
// GetExtensions the operation to get all extensions of a Virtual Machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine containing the extension.
|
||||
// expand - the expand expression to apply on the operation.
|
||||
func (client VirtualMachinesClient) GetExtensions(ctx context.Context, resourceGroupName string, VMName string, expand string) (result VirtualMachineExtensionsListResult, err error) {
|
||||
req, err := client.GetExtensionsPreparer(ctx, resourceGroupName, VMName, expand)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "GetExtensions", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetExtensionsSender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "GetExtensions", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result, err = client.GetExtensionsResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "GetExtensions", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetExtensionsPreparer prepares the GetExtensions request.
|
||||
func (client VirtualMachinesClient) GetExtensionsPreparer(ctx context.Context, resourceGroupName string, VMName string, expand string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmName": autorest.Encode("path", VMName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-12-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
if len(expand) > 0 {
|
||||
queryParameters["$expand"] = autorest.Encode("query", expand)
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// GetExtensionsSender sends the GetExtensions request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachinesClient) GetExtensionsSender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetExtensionsResponder handles the response to the GetExtensions request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachinesClient) GetExtensionsResponder(resp *http.Response) (result VirtualMachineExtensionsListResult, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// InstanceView retrieves information about the run-time state of a virtual machine.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine.
|
||||
func (client VirtualMachinesClient) InstanceView(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachineInstanceView, err error) {
|
||||
req, err := client.InstanceViewPreparer(ctx, resourceGroupName, VMName)
|
||||
if err != nil {
|
||||
|
@ -622,8 +711,8 @@ func (client VirtualMachinesClient) InstanceViewResponder(resp *http.Response) (
|
|||
|
||||
// List lists all of the virtual machines in the specified resource group. Use the nextLink property in the response to
|
||||
// get the next page of virtual machines.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
func (client VirtualMachinesClient) List(ctx context.Context, resourceGroupName string) (result VirtualMachineListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName)
|
||||
|
@ -806,8 +895,9 @@ func (client VirtualMachinesClient) ListAllComplete(ctx context.Context) (result
|
|||
}
|
||||
|
||||
// ListAvailableSizes lists all available virtual machine sizes to which the specified virtual machine can be resized.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine.
|
||||
func (client VirtualMachinesClient) ListAvailableSizes(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachineSizeListResult, err error) {
|
||||
req, err := client.ListAvailableSizesPreparer(ctx, resourceGroupName, VMName)
|
||||
if err != nil {
|
||||
|
@ -872,8 +962,9 @@ func (client VirtualMachinesClient) ListAvailableSizesResponder(resp *http.Respo
|
|||
}
|
||||
|
||||
// PerformMaintenance the operation to perform maintenance on a virtual machine.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine.
|
||||
func (client VirtualMachinesClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesPerformMaintenanceFuture, err error) {
|
||||
req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMName)
|
||||
if err != nil {
|
||||
|
@ -914,15 +1005,17 @@ func (client VirtualMachinesClient) PerformMaintenancePreparer(ctx context.Conte
|
|||
// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachinesClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachinesPerformMaintenanceFuture, 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
|
||||
}
|
||||
|
||||
|
@ -941,8 +1034,9 @@ func (client VirtualMachinesClient) PerformMaintenanceResponder(resp *http.Respo
|
|||
|
||||
// PowerOff the operation to power off (stop) a virtual machine. The virtual machine can be restarted with the same
|
||||
// provisioned resources. You are still charged for this virtual machine.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine.
|
||||
func (client VirtualMachinesClient) PowerOff(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesPowerOffFuture, err error) {
|
||||
req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMName)
|
||||
if err != nil {
|
||||
|
@ -983,15 +1077,17 @@ func (client VirtualMachinesClient) PowerOffPreparer(ctx context.Context, resour
|
|||
// PowerOffSender sends the PowerOff request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachinesClient) PowerOffSender(req *http.Request) (future VirtualMachinesPowerOffFuture, 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
|
||||
}
|
||||
|
||||
|
@ -1009,8 +1105,9 @@ func (client VirtualMachinesClient) PowerOffResponder(resp *http.Response) (resu
|
|||
}
|
||||
|
||||
// Redeploy the operation to redeploy a virtual machine.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine.
|
||||
func (client VirtualMachinesClient) Redeploy(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesRedeployFuture, err error) {
|
||||
req, err := client.RedeployPreparer(ctx, resourceGroupName, VMName)
|
||||
if err != nil {
|
||||
|
@ -1051,15 +1148,17 @@ func (client VirtualMachinesClient) RedeployPreparer(ctx context.Context, resour
|
|||
// RedeploySender sends the Redeploy request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachinesClient) RedeploySender(req *http.Request) (future VirtualMachinesRedeployFuture, 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
|
||||
}
|
||||
|
||||
|
@ -1077,8 +1176,9 @@ func (client VirtualMachinesClient) RedeployResponder(resp *http.Response) (resu
|
|||
}
|
||||
|
||||
// Restart the operation to restart a virtual machine.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine.
|
||||
func (client VirtualMachinesClient) Restart(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesRestartFuture, err error) {
|
||||
req, err := client.RestartPreparer(ctx, resourceGroupName, VMName)
|
||||
if err != nil {
|
||||
|
@ -1119,15 +1219,17 @@ func (client VirtualMachinesClient) RestartPreparer(ctx context.Context, resourc
|
|||
// RestartSender sends the Restart request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachinesClient) RestartSender(req *http.Request) (future VirtualMachinesRestartFuture, 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
|
||||
}
|
||||
|
||||
|
@ -1145,9 +1247,10 @@ func (client VirtualMachinesClient) RestartResponder(resp *http.Response) (resul
|
|||
}
|
||||
|
||||
// RunCommand run command on the VM.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. parameters is
|
||||
// parameters supplied to the Run command operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine.
|
||||
// parameters - parameters supplied to the Run command operation.
|
||||
func (client VirtualMachinesClient) RunCommand(ctx context.Context, resourceGroupName string, VMName string, parameters RunCommandInput) (result VirtualMachinesRunCommandFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -1196,15 +1299,17 @@ func (client VirtualMachinesClient) RunCommandPreparer(ctx context.Context, reso
|
|||
// RunCommandSender sends the RunCommand request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachinesClient) RunCommandSender(req *http.Request) (future VirtualMachinesRunCommandFuture, 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
|
||||
}
|
||||
|
||||
|
@ -1222,8 +1327,9 @@ func (client VirtualMachinesClient) RunCommandResponder(resp *http.Response) (re
|
|||
}
|
||||
|
||||
// Start the operation to start a virtual machine.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine.
|
||||
func (client VirtualMachinesClient) Start(ctx context.Context, resourceGroupName string, VMName string) (result VirtualMachinesStartFuture, err error) {
|
||||
req, err := client.StartPreparer(ctx, resourceGroupName, VMName)
|
||||
if err != nil {
|
||||
|
@ -1264,15 +1370,17 @@ func (client VirtualMachinesClient) StartPreparer(ctx context.Context, resourceG
|
|||
// StartSender sends the Start request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachinesClient) StartSender(req *http.Request) (future VirtualMachinesStartFuture, 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
|
||||
}
|
||||
|
||||
|
@ -1290,9 +1398,10 @@ func (client VirtualMachinesClient) StartResponder(resp *http.Response) (result
|
|||
}
|
||||
|
||||
// Update the operation to update a virtual machine.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMName is the name of the virtual machine. parameters is
|
||||
// parameters supplied to the Update Virtual Machine operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMName - the name of the virtual machine.
|
||||
// parameters - parameters supplied to the Update Virtual Machine operation.
|
||||
func (client VirtualMachinesClient) Update(ctx context.Context, resourceGroupName string, VMName string, parameters VirtualMachineUpdate) (result VirtualMachinesUpdateFuture, err error) {
|
||||
req, err := client.UpdatePreparer(ctx, resourceGroupName, VMName, parameters)
|
||||
if err != nil {
|
||||
|
@ -1335,15 +1444,17 @@ func (client VirtualMachinesClient) UpdatePreparer(ctx context.Context, resource
|
|||
// UpdateSender sends the Update request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachinesClient) UpdateSender(req *http.Request) (future VirtualMachinesUpdateFuture, 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
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
@ -158,15 +162,17 @@ 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
|
||||
}
|
||||
|
||||
|
@ -184,10 +190,11 @@ func (client VirtualMachineScaleSetExtensionsClient) DeleteResponder(resp *http.
|
|||
}
|
||||
|
||||
// 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 {
|
||||
|
@ -256,9 +263,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)
|
||||
|
|
|
@ -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 {
|
||||
|
@ -84,15 +85,17 @@ 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(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
|
||||
}
|
||||
|
||||
|
@ -110,8 +113,9 @@ func (client VirtualMachineScaleSetRollingUpgradesClient) CancelResponder(resp *
|
|||
}
|
||||
|
||||
// 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 {
|
||||
|
@ -177,8 +181,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 {
|
||||
|
@ -219,15 +224,17 @@ 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
|
||||
}
|
||||
|
||||
|
|
|
@ -41,9 +41,10 @@ func NewVirtualMachineScaleSetsClientWithBaseURI(baseURI string, subscriptionID
|
|||
}
|
||||
|
||||
// CreateOrUpdate create or update a VM scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set to create or
|
||||
// update. parameters is the scale set object.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set to create or update.
|
||||
// parameters - the scale set object.
|
||||
func (client VirtualMachineScaleSetsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSet) (result VirtualMachineScaleSetsCreateOrUpdateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -109,15 +110,17 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdatePreparer(ctx context.C
|
|||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetsClient) CreateOrUpdateSender(req *http.Request) (future VirtualMachineScaleSetsCreateOrUpdateFuture, 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
|
||||
}
|
||||
|
||||
|
@ -136,9 +139,10 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdateResponder(resp *http.R
|
|||
|
||||
// Deallocate deallocates specific virtual machines in a VM scale set. Shuts down the virtual machines and releases the
|
||||
// compute resources. You are not billed for the compute resources that this virtual machine scale set deallocates.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set.
|
||||
// VMInstanceIDs is a list of virtual machine instance IDs from the VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
|
||||
func (client VirtualMachineScaleSetsClient) Deallocate(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsDeallocateFuture, err error) {
|
||||
req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs)
|
||||
if err != nil {
|
||||
|
@ -184,15 +188,17 @@ func (client VirtualMachineScaleSetsClient) DeallocatePreparer(ctx context.Conte
|
|||
// DeallocateSender sends the Deallocate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetsClient) DeallocateSender(req *http.Request) (future VirtualMachineScaleSetsDeallocateFuture, 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
|
||||
}
|
||||
|
||||
|
@ -210,8 +216,9 @@ func (client VirtualMachineScaleSetsClient) DeallocateResponder(resp *http.Respo
|
|||
}
|
||||
|
||||
// Delete deletes a VM scale set.
|
||||
//
|
||||
// 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 VirtualMachineScaleSetsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetsDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName)
|
||||
if err != nil {
|
||||
|
@ -252,15 +259,17 @@ func (client VirtualMachineScaleSetsClient) DeletePreparer(ctx context.Context,
|
|||
// DeleteSender sends the Delete request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetsDeleteFuture, 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
|
||||
}
|
||||
|
||||
|
@ -278,9 +287,10 @@ func (client VirtualMachineScaleSetsClient) DeleteResponder(resp *http.Response)
|
|||
}
|
||||
|
||||
// DeleteInstances deletes virtual machines in a VM scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set.
|
||||
// VMInstanceIDs is a list of virtual machine instance IDs from the VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
|
||||
func (client VirtualMachineScaleSetsClient) DeleteInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (result VirtualMachineScaleSetsDeleteInstancesFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: VMInstanceIDs,
|
||||
|
@ -329,15 +339,17 @@ func (client VirtualMachineScaleSetsClient) DeleteInstancesPreparer(ctx context.
|
|||
// DeleteInstancesSender sends the DeleteInstances request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetsClient) DeleteInstancesSender(req *http.Request) (future VirtualMachineScaleSetsDeleteInstancesFuture, 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
|
||||
}
|
||||
|
||||
|
@ -356,9 +368,10 @@ func (client VirtualMachineScaleSetsClient) DeleteInstancesResponder(resp *http.
|
|||
|
||||
// ForceRecoveryServiceFabricPlatformUpdateDomainWalk manual platform update domain walk to update virtual machines in
|
||||
// a service fabric virtual machine scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set.
|
||||
// platformUpdateDomain is the platform update domain for which a manual recovery walk is requested
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// platformUpdateDomain - the platform update domain for which a manual recovery walk is requested
|
||||
func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUpdateDomainWalk(ctx context.Context, resourceGroupName string, VMScaleSetName string, platformUpdateDomain int32) (result RecoveryWalkResponse, err error) {
|
||||
req, err := client.ForceRecoveryServiceFabricPlatformUpdateDomainWalkPreparer(ctx, resourceGroupName, VMScaleSetName, platformUpdateDomain)
|
||||
if err != nil {
|
||||
|
@ -424,8 +437,9 @@ func (client VirtualMachineScaleSetsClient) ForceRecoveryServiceFabricPlatformUp
|
|||
}
|
||||
|
||||
// Get display information about a virtual machine scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
func (client VirtualMachineScaleSetsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSet, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName)
|
||||
if err != nil {
|
||||
|
@ -490,8 +504,9 @@ func (client VirtualMachineScaleSetsClient) GetResponder(resp *http.Response) (r
|
|||
}
|
||||
|
||||
// GetInstanceView gets the status of a VM scale set instance.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
func (client VirtualMachineScaleSetsClient) GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetInstanceView, err error) {
|
||||
req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, VMScaleSetName)
|
||||
if err != nil {
|
||||
|
@ -555,9 +570,104 @@ func (client VirtualMachineScaleSetsClient) GetInstanceViewResponder(resp *http.
|
|||
return
|
||||
}
|
||||
|
||||
// GetOSUpgradeHistory gets list of OS upgrades on a VM scale set instance.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistory(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListOSUpgradeHistoryPage, err error) {
|
||||
result.fn = client.getOSUpgradeHistoryNextResults
|
||||
req, err := client.GetOSUpgradeHistoryPreparer(ctx, resourceGroupName, VMScaleSetName)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", nil, "Failure preparing request")
|
||||
return
|
||||
}
|
||||
|
||||
resp, err := client.GetOSUpgradeHistorySender(req)
|
||||
if err != nil {
|
||||
result.vmsslouh.Response = autorest.Response{Response: resp}
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
|
||||
result.vmsslouh, err = client.GetOSUpgradeHistoryResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "GetOSUpgradeHistory", resp, "Failure responding to request")
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
// GetOSUpgradeHistoryPreparer prepares the GetOSUpgradeHistory request.
|
||||
func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryPreparer(ctx context.Context, resourceGroupName string, VMScaleSetName string) (*http.Request, error) {
|
||||
pathParameters := map[string]interface{}{
|
||||
"resourceGroupName": autorest.Encode("path", resourceGroupName),
|
||||
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
|
||||
"vmScaleSetName": autorest.Encode("path", VMScaleSetName),
|
||||
}
|
||||
|
||||
const APIVersion = "2017-12-01"
|
||||
queryParameters := map[string]interface{}{
|
||||
"api-version": APIVersion,
|
||||
}
|
||||
|
||||
preparer := autorest.CreatePreparer(
|
||||
autorest.AsGet(),
|
||||
autorest.WithBaseURL(client.BaseURI),
|
||||
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/osUpgradeHistory", pathParameters),
|
||||
autorest.WithQueryParameters(queryParameters))
|
||||
return preparer.Prepare((&http.Request{}).WithContext(ctx))
|
||||
}
|
||||
|
||||
// GetOSUpgradeHistorySender sends the GetOSUpgradeHistory request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistorySender(req *http.Request) (*http.Response, error) {
|
||||
return autorest.SendWithSender(client, req,
|
||||
azure.DoRetryWithRegistration(client.Client))
|
||||
}
|
||||
|
||||
// GetOSUpgradeHistoryResponder handles the response to the GetOSUpgradeHistory request. The method always
|
||||
// closes the http.Response Body.
|
||||
func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryResponder(resp *http.Response) (result VirtualMachineScaleSetListOSUpgradeHistory, err error) {
|
||||
err = autorest.Respond(
|
||||
resp,
|
||||
client.ByInspecting(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK),
|
||||
autorest.ByUnmarshallingJSON(&result),
|
||||
autorest.ByClosing())
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return
|
||||
}
|
||||
|
||||
// getOSUpgradeHistoryNextResults retrieves the next set of results, if any.
|
||||
func (client VirtualMachineScaleSetsClient) getOSUpgradeHistoryNextResults(lastResults VirtualMachineScaleSetListOSUpgradeHistory) (result VirtualMachineScaleSetListOSUpgradeHistory, err error) {
|
||||
req, err := lastResults.virtualMachineScaleSetListOSUpgradeHistoryPreparer()
|
||||
if err != nil {
|
||||
return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", nil, "Failure preparing next results request")
|
||||
}
|
||||
if req == nil {
|
||||
return
|
||||
}
|
||||
resp, err := client.GetOSUpgradeHistorySender(req)
|
||||
if err != nil {
|
||||
result.Response = autorest.Response{Response: resp}
|
||||
return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", resp, "Failure sending next results request")
|
||||
}
|
||||
result, err = client.GetOSUpgradeHistoryResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "getOSUpgradeHistoryNextResults", resp, "Failure responding to next results request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// GetOSUpgradeHistoryComplete enumerates all values, automatically crossing page boundaries as required.
|
||||
func (client VirtualMachineScaleSetsClient) GetOSUpgradeHistoryComplete(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListOSUpgradeHistoryIterator, err error) {
|
||||
result.page, err = client.GetOSUpgradeHistory(ctx, resourceGroupName, VMScaleSetName)
|
||||
return
|
||||
}
|
||||
|
||||
// List gets a list of all VM scale sets under a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
func (client VirtualMachineScaleSetsClient) List(ctx context.Context, resourceGroupName string) (result VirtualMachineScaleSetListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName)
|
||||
|
@ -742,8 +852,9 @@ func (client VirtualMachineScaleSetsClient) ListAllComplete(ctx context.Context)
|
|||
|
||||
// ListSkus gets a list of SKUs available for your VM scale set, including the minimum and maximum VM instances allowed
|
||||
// for each SKU.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
func (client VirtualMachineScaleSetsClient) ListSkus(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result VirtualMachineScaleSetListSkusResultPage, err error) {
|
||||
result.fn = client.listSkusNextResults
|
||||
req, err := client.ListSkusPreparer(ctx, resourceGroupName, VMScaleSetName)
|
||||
|
@ -836,9 +947,10 @@ func (client VirtualMachineScaleSetsClient) ListSkusComplete(ctx context.Context
|
|||
}
|
||||
|
||||
// PerformMaintenance perform maintenance on one or more virtual machines in a VM scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set.
|
||||
// VMInstanceIDs is a list of virtual machine instance IDs from the VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
|
||||
func (client VirtualMachineScaleSetsClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsPerformMaintenanceFuture, err error) {
|
||||
req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs)
|
||||
if err != nil {
|
||||
|
@ -884,15 +996,17 @@ func (client VirtualMachineScaleSetsClient) PerformMaintenancePreparer(ctx conte
|
|||
// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetsClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachineScaleSetsPerformMaintenanceFuture, 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
|
||||
}
|
||||
|
||||
|
@ -911,9 +1025,10 @@ func (client VirtualMachineScaleSetsClient) PerformMaintenanceResponder(resp *ht
|
|||
|
||||
// PowerOff power off (stop) one or more virtual machines in a VM scale set. Note that resources are still attached and
|
||||
// you are getting charged for the resources. Instead, use deallocate to release resources and avoid charges.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set.
|
||||
// VMInstanceIDs is a list of virtual machine instance IDs from the VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
|
||||
func (client VirtualMachineScaleSetsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsPowerOffFuture, err error) {
|
||||
req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs)
|
||||
if err != nil {
|
||||
|
@ -959,15 +1074,17 @@ func (client VirtualMachineScaleSetsClient) PowerOffPreparer(ctx context.Context
|
|||
// PowerOffSender sends the PowerOff request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetsClient) PowerOffSender(req *http.Request) (future VirtualMachineScaleSetsPowerOffFuture, 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
|
||||
}
|
||||
|
||||
|
@ -985,9 +1102,10 @@ func (client VirtualMachineScaleSetsClient) PowerOffResponder(resp *http.Respons
|
|||
}
|
||||
|
||||
// Redeploy redeploy one or more virtual machines in a VM scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set.
|
||||
// VMInstanceIDs is a list of virtual machine instance IDs from the VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
|
||||
func (client VirtualMachineScaleSetsClient) Redeploy(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsRedeployFuture, err error) {
|
||||
req, err := client.RedeployPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs)
|
||||
if err != nil {
|
||||
|
@ -1033,15 +1151,17 @@ func (client VirtualMachineScaleSetsClient) RedeployPreparer(ctx context.Context
|
|||
// RedeploySender sends the Redeploy request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetsClient) RedeploySender(req *http.Request) (future VirtualMachineScaleSetsRedeployFuture, 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
|
||||
}
|
||||
|
||||
|
@ -1059,9 +1179,10 @@ func (client VirtualMachineScaleSetsClient) RedeployResponder(resp *http.Respons
|
|||
}
|
||||
|
||||
// Reimage reimages (upgrade the operating system) one or more virtual machines in a VM scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set.
|
||||
// VMInstanceIDs is a list of virtual machine instance IDs from the VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
|
||||
func (client VirtualMachineScaleSetsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsReimageFuture, err error) {
|
||||
req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs)
|
||||
if err != nil {
|
||||
|
@ -1107,15 +1228,17 @@ func (client VirtualMachineScaleSetsClient) ReimagePreparer(ctx context.Context,
|
|||
// ReimageSender sends the Reimage request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetsClient) ReimageSender(req *http.Request) (future VirtualMachineScaleSetsReimageFuture, 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
|
||||
}
|
||||
|
||||
|
@ -1134,9 +1257,10 @@ func (client VirtualMachineScaleSetsClient) ReimageResponder(resp *http.Response
|
|||
|
||||
// ReimageAll reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation
|
||||
// is only supported for managed disks.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set.
|
||||
// VMInstanceIDs is a list of virtual machine instance IDs from the VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
|
||||
func (client VirtualMachineScaleSetsClient) ReimageAll(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsReimageAllFuture, err error) {
|
||||
req, err := client.ReimageAllPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs)
|
||||
if err != nil {
|
||||
|
@ -1182,15 +1306,17 @@ func (client VirtualMachineScaleSetsClient) ReimageAllPreparer(ctx context.Conte
|
|||
// ReimageAllSender sends the ReimageAll request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetsClient) ReimageAllSender(req *http.Request) (future VirtualMachineScaleSetsReimageAllFuture, 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
|
||||
}
|
||||
|
||||
|
@ -1208,9 +1334,10 @@ func (client VirtualMachineScaleSetsClient) ReimageAllResponder(resp *http.Respo
|
|||
}
|
||||
|
||||
// Restart restarts one or more virtual machines in a VM scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set.
|
||||
// VMInstanceIDs is a list of virtual machine instance IDs from the VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
|
||||
func (client VirtualMachineScaleSetsClient) Restart(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsRestartFuture, err error) {
|
||||
req, err := client.RestartPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs)
|
||||
if err != nil {
|
||||
|
@ -1256,15 +1383,17 @@ func (client VirtualMachineScaleSetsClient) RestartPreparer(ctx context.Context,
|
|||
// RestartSender sends the Restart request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetsClient) RestartSender(req *http.Request) (future VirtualMachineScaleSetsRestartFuture, 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
|
||||
}
|
||||
|
||||
|
@ -1282,9 +1411,10 @@ func (client VirtualMachineScaleSetsClient) RestartResponder(resp *http.Response
|
|||
}
|
||||
|
||||
// Start starts one or more virtual machines in a VM scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set.
|
||||
// VMInstanceIDs is a list of virtual machine instance IDs from the VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
|
||||
func (client VirtualMachineScaleSetsClient) Start(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs) (result VirtualMachineScaleSetsStartFuture, err error) {
|
||||
req, err := client.StartPreparer(ctx, resourceGroupName, VMScaleSetName, VMInstanceIDs)
|
||||
if err != nil {
|
||||
|
@ -1330,15 +1460,17 @@ func (client VirtualMachineScaleSetsClient) StartPreparer(ctx context.Context, r
|
|||
// StartSender sends the Start request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetsClient) StartSender(req *http.Request) (future VirtualMachineScaleSetsStartFuture, 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
|
||||
}
|
||||
|
||||
|
@ -1356,9 +1488,10 @@ func (client VirtualMachineScaleSetsClient) StartResponder(resp *http.Response)
|
|||
}
|
||||
|
||||
// Update update a VM scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set to create or
|
||||
// update. parameters is the scale set object.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set to create or update.
|
||||
// parameters - the scale set object.
|
||||
func (client VirtualMachineScaleSetsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters VirtualMachineScaleSetUpdate) (result VirtualMachineScaleSetsUpdateFuture, err error) {
|
||||
req, err := client.UpdatePreparer(ctx, resourceGroupName, VMScaleSetName, parameters)
|
||||
if err != nil {
|
||||
|
@ -1401,15 +1534,17 @@ func (client VirtualMachineScaleSetsClient) UpdatePreparer(ctx context.Context,
|
|||
// UpdateSender sends the Update request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetsUpdateFuture, 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))
|
||||
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -1427,9 +1562,10 @@ func (client VirtualMachineScaleSetsClient) UpdateResponder(resp *http.Response)
|
|||
}
|
||||
|
||||
// UpdateInstances upgrades one or more virtual machines to the latest SKU set in the VM scale set model.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set.
|
||||
// VMInstanceIDs is a list of virtual machine instance IDs from the VM scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// VMInstanceIDs - a list of virtual machine instance IDs from the VM scale set.
|
||||
func (client VirtualMachineScaleSetsClient) UpdateInstances(ctx context.Context, resourceGroupName string, VMScaleSetName string, VMInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs) (result VirtualMachineScaleSetsUpdateInstancesFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: VMInstanceIDs,
|
||||
|
@ -1478,15 +1614,17 @@ func (client VirtualMachineScaleSetsClient) UpdateInstancesPreparer(ctx context.
|
|||
// UpdateInstancesSender sends the UpdateInstances request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetsClient) UpdateInstancesSender(req *http.Request) (future VirtualMachineScaleSetsUpdateInstancesFuture, 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
|
||||
}
|
||||
|
||||
|
|
|
@ -43,9 +43,10 @@ func NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI string, subscriptionI
|
|||
// Deallocate deallocates a specific virtual machine in a VM scale set. Shuts down the virtual machine and releases the
|
||||
// compute resources it uses. You are not billed for the compute resources of this virtual machine once it is
|
||||
// deallocated.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID
|
||||
// is the instance ID of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) Deallocate(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsDeallocateFuture, err error) {
|
||||
req, err := client.DeallocatePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
|
@ -87,15 +88,17 @@ func (client VirtualMachineScaleSetVMsClient) DeallocatePreparer(ctx context.Con
|
|||
// DeallocateSender sends the Deallocate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetVMsClient) DeallocateSender(req *http.Request) (future VirtualMachineScaleSetVMsDeallocateFuture, 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
|
||||
}
|
||||
|
||||
|
@ -113,9 +116,10 @@ func (client VirtualMachineScaleSetVMsClient) DeallocateResponder(resp *http.Res
|
|||
}
|
||||
|
||||
// Delete deletes a virtual machine from a VM scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID
|
||||
// is the instance ID of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) Delete(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
|
@ -157,15 +161,17 @@ func (client VirtualMachineScaleSetVMsClient) DeletePreparer(ctx context.Context
|
|||
// DeleteSender sends the Delete request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetVMsClient) DeleteSender(req *http.Request) (future VirtualMachineScaleSetVMsDeleteFuture, 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
|
||||
}
|
||||
|
||||
|
@ -183,9 +189,10 @@ func (client VirtualMachineScaleSetVMsClient) DeleteResponder(resp *http.Respons
|
|||
}
|
||||
|
||||
// Get gets a virtual machine from a VM scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID
|
||||
// is the instance ID of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVM, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
|
@ -251,9 +258,10 @@ func (client VirtualMachineScaleSetVMsClient) GetResponder(resp *http.Response)
|
|||
}
|
||||
|
||||
// GetInstanceView gets the status of a virtual machine from a VM scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID
|
||||
// is the instance ID of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) GetInstanceView(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMInstanceView, err error) {
|
||||
req, err := client.GetInstanceViewPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
|
@ -319,10 +327,12 @@ func (client VirtualMachineScaleSetVMsClient) GetInstanceViewResponder(resp *htt
|
|||
}
|
||||
|
||||
// List gets a list of all virtual machines in a VM scale sets.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the VM scale set.
|
||||
// filter is the filter to apply to the operation. selectParameter is the list parameters. expand is the expand
|
||||
// expression to apply to the operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualMachineScaleSetName - the name of the VM scale set.
|
||||
// filter - the filter to apply to the operation.
|
||||
// selectParameter - the list parameters.
|
||||
// expand - the expand expression to apply to the operation.
|
||||
func (client VirtualMachineScaleSetVMsClient) List(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand)
|
||||
|
@ -424,9 +434,10 @@ func (client VirtualMachineScaleSetVMsClient) ListComplete(ctx context.Context,
|
|||
}
|
||||
|
||||
// PerformMaintenance performs maintenance on a virtual machine in a VM scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID
|
||||
// is the instance ID of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) PerformMaintenance(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsPerformMaintenanceFuture, err error) {
|
||||
req, err := client.PerformMaintenancePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
|
@ -468,15 +479,17 @@ func (client VirtualMachineScaleSetVMsClient) PerformMaintenancePreparer(ctx con
|
|||
// PerformMaintenanceSender sends the PerformMaintenance request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceSender(req *http.Request) (future VirtualMachineScaleSetVMsPerformMaintenanceFuture, 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
|
||||
}
|
||||
|
||||
|
@ -495,9 +508,10 @@ func (client VirtualMachineScaleSetVMsClient) PerformMaintenanceResponder(resp *
|
|||
|
||||
// PowerOff power off (stop) a virtual machine in a VM scale set. Note that resources are still attached and you are
|
||||
// getting charged for the resources. Instead, use deallocate to release resources and avoid charges.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID
|
||||
// is the instance ID of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) PowerOff(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsPowerOffFuture, err error) {
|
||||
req, err := client.PowerOffPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
|
@ -539,15 +553,17 @@ func (client VirtualMachineScaleSetVMsClient) PowerOffPreparer(ctx context.Conte
|
|||
// PowerOffSender sends the PowerOff request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetVMsClient) PowerOffSender(req *http.Request) (future VirtualMachineScaleSetVMsPowerOffFuture, 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
|
||||
}
|
||||
|
||||
|
@ -565,9 +581,10 @@ func (client VirtualMachineScaleSetVMsClient) PowerOffResponder(resp *http.Respo
|
|||
}
|
||||
|
||||
// Redeploy redeploys a virtual machine in a VM scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID
|
||||
// is the instance ID of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) Redeploy(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsRedeployFuture, err error) {
|
||||
req, err := client.RedeployPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
|
@ -609,15 +626,17 @@ func (client VirtualMachineScaleSetVMsClient) RedeployPreparer(ctx context.Conte
|
|||
// RedeploySender sends the Redeploy request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetVMsClient) RedeploySender(req *http.Request) (future VirtualMachineScaleSetVMsRedeployFuture, 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
|
||||
}
|
||||
|
||||
|
@ -635,9 +654,10 @@ func (client VirtualMachineScaleSetVMsClient) RedeployResponder(resp *http.Respo
|
|||
}
|
||||
|
||||
// Reimage reimages (upgrade the operating system) a specific virtual machine in a VM scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID
|
||||
// is the instance ID of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) Reimage(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsReimageFuture, err error) {
|
||||
req, err := client.ReimagePreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
|
@ -679,15 +699,17 @@ func (client VirtualMachineScaleSetVMsClient) ReimagePreparer(ctx context.Contex
|
|||
// ReimageSender sends the Reimage request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetVMsClient) ReimageSender(req *http.Request) (future VirtualMachineScaleSetVMsReimageFuture, 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
|
||||
}
|
||||
|
||||
|
@ -706,9 +728,10 @@ func (client VirtualMachineScaleSetVMsClient) ReimageResponder(resp *http.Respon
|
|||
|
||||
// ReimageAll allows you to re-image all the disks ( including data disks ) in the a VM scale set instance. This
|
||||
// operation is only supported for managed disks.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID
|
||||
// is the instance ID of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) ReimageAll(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsReimageAllFuture, err error) {
|
||||
req, err := client.ReimageAllPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
|
@ -750,15 +773,17 @@ func (client VirtualMachineScaleSetVMsClient) ReimageAllPreparer(ctx context.Con
|
|||
// ReimageAllSender sends the ReimageAll request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetVMsClient) ReimageAllSender(req *http.Request) (future VirtualMachineScaleSetVMsReimageAllFuture, 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
|
||||
}
|
||||
|
||||
|
@ -776,9 +801,10 @@ func (client VirtualMachineScaleSetVMsClient) ReimageAllResponder(resp *http.Res
|
|||
}
|
||||
|
||||
// Restart restarts a virtual machine in a VM scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID
|
||||
// is the instance ID of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) Restart(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsRestartFuture, err error) {
|
||||
req, err := client.RestartPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
|
@ -820,15 +846,17 @@ func (client VirtualMachineScaleSetVMsClient) RestartPreparer(ctx context.Contex
|
|||
// RestartSender sends the Restart request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetVMsClient) RestartSender(req *http.Request) (future VirtualMachineScaleSetVMsRestartFuture, 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
|
||||
}
|
||||
|
||||
|
@ -846,9 +874,10 @@ func (client VirtualMachineScaleSetVMsClient) RestartResponder(resp *http.Respon
|
|||
}
|
||||
|
||||
// Start starts a virtual machine in a VM scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. VMScaleSetName is the name of the VM scale set. instanceID
|
||||
// is the instance ID of the virtual machine.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// VMScaleSetName - the name of the VM scale set.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
func (client VirtualMachineScaleSetVMsClient) Start(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMsStartFuture, err error) {
|
||||
req, err := client.StartPreparer(ctx, resourceGroupName, VMScaleSetName, instanceID)
|
||||
if err != nil {
|
||||
|
@ -890,15 +919,17 @@ func (client VirtualMachineScaleSetVMsClient) StartPreparer(ctx context.Context,
|
|||
// StartSender sends the Start request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetVMsClient) StartSender(req *http.Request) (future VirtualMachineScaleSetVMsStartFuture, 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
|
||||
}
|
||||
|
||||
|
@ -916,10 +947,11 @@ func (client VirtualMachineScaleSetVMsClient) StartResponder(resp *http.Response
|
|||
}
|
||||
|
||||
// Update updates a virtual machine of a VM scale set.
|
||||
//
|
||||
// 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. instanceID is the instance ID of the virtual machine. parameters is
|
||||
// parameters supplied to the Update Virtual Machine Scale Sets VM 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.
|
||||
// instanceID - the instance ID of the virtual machine.
|
||||
// parameters - parameters supplied to the Update Virtual Machine Scale Sets VM operation.
|
||||
func (client VirtualMachineScaleSetVMsClient) Update(ctx context.Context, resourceGroupName string, VMScaleSetName string, instanceID string, parameters VirtualMachineScaleSetVM) (result VirtualMachineScaleSetVMsUpdateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -984,15 +1016,17 @@ func (client VirtualMachineScaleSetVMsClient) UpdatePreparer(ctx context.Context
|
|||
// UpdateSender sends the Update request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualMachineScaleSetVMsClient) UpdateSender(req *http.Request) (future VirtualMachineScaleSetVMsUpdateFuture, 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
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -41,9 +41,10 @@ func NewApplicationGatewaysClientWithBaseURI(baseURI string, subscriptionID stri
|
|||
}
|
||||
|
||||
// BackendHealth gets the backend health of the specified application gateway in a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application
|
||||
// gateway. expand is expands BackendAddressPool and BackendHttpSettings referenced in backend health.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// applicationGatewayName - the name of the application gateway.
|
||||
// expand - expands BackendAddressPool and BackendHttpSettings referenced in backend health.
|
||||
func (client ApplicationGatewaysClient) BackendHealth(ctx context.Context, resourceGroupName string, applicationGatewayName string, expand string) (result ApplicationGatewaysBackendHealthFuture, err error) {
|
||||
req, err := client.BackendHealthPreparer(ctx, resourceGroupName, applicationGatewayName, expand)
|
||||
if err != nil {
|
||||
|
@ -87,15 +88,17 @@ func (client ApplicationGatewaysClient) BackendHealthPreparer(ctx context.Contex
|
|||
// BackendHealthSender sends the BackendHealth request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ApplicationGatewaysClient) BackendHealthSender(req *http.Request) (future ApplicationGatewaysBackendHealthFuture, 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
|
||||
}
|
||||
|
||||
|
@ -113,9 +116,10 @@ func (client ApplicationGatewaysClient) BackendHealthResponder(resp *http.Respon
|
|||
}
|
||||
|
||||
// CreateOrUpdate creates or updates the specified application gateway.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application
|
||||
// gateway. parameters is parameters supplied to the create or update application gateway operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// applicationGatewayName - the name of the application gateway.
|
||||
// parameters - parameters supplied to the create or update application gateway operation.
|
||||
func (client ApplicationGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway) (result ApplicationGatewaysCreateOrUpdateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -174,15 +178,17 @@ func (client ApplicationGatewaysClient) CreateOrUpdatePreparer(ctx context.Conte
|
|||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ApplicationGatewaysClient) CreateOrUpdateSender(req *http.Request) (future ApplicationGatewaysCreateOrUpdateFuture, 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
|
||||
}
|
||||
|
||||
|
@ -200,9 +206,9 @@ func (client ApplicationGatewaysClient) CreateOrUpdateResponder(resp *http.Respo
|
|||
}
|
||||
|
||||
// Delete deletes the specified application gateway.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application
|
||||
// gateway.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// applicationGatewayName - the name of the application gateway.
|
||||
func (client ApplicationGatewaysClient) Delete(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewaysDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, applicationGatewayName)
|
||||
if err != nil {
|
||||
|
@ -243,15 +249,17 @@ func (client ApplicationGatewaysClient) DeletePreparer(ctx context.Context, reso
|
|||
// DeleteSender sends the Delete request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ApplicationGatewaysClient) DeleteSender(req *http.Request) (future ApplicationGatewaysDeleteFuture, 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
|
||||
}
|
||||
|
||||
|
@ -268,9 +276,9 @@ func (client ApplicationGatewaysClient) DeleteResponder(resp *http.Response) (re
|
|||
}
|
||||
|
||||
// Get gets the specified application gateway.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application
|
||||
// gateway.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// applicationGatewayName - the name of the application gateway.
|
||||
func (client ApplicationGatewaysClient) Get(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGateway, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, applicationGatewayName)
|
||||
if err != nil {
|
||||
|
@ -335,8 +343,8 @@ func (client ApplicationGatewaysClient) GetResponder(resp *http.Response) (resul
|
|||
}
|
||||
|
||||
// GetSslPredefinedPolicy gets Ssl predefined policy with the specified policy name.
|
||||
//
|
||||
// predefinedPolicyName is name of Ssl predefined policy.
|
||||
// Parameters:
|
||||
// predefinedPolicyName - name of Ssl predefined policy.
|
||||
func (client ApplicationGatewaysClient) GetSslPredefinedPolicy(ctx context.Context, predefinedPolicyName string) (result ApplicationGatewaySslPredefinedPolicy, err error) {
|
||||
req, err := client.GetSslPredefinedPolicyPreparer(ctx, predefinedPolicyName)
|
||||
if err != nil {
|
||||
|
@ -400,8 +408,8 @@ func (client ApplicationGatewaysClient) GetSslPredefinedPolicyResponder(resp *ht
|
|||
}
|
||||
|
||||
// List lists all application gateways in a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
func (client ApplicationGatewaysClient) List(ctx context.Context, resourceGroupName string) (result ApplicationGatewayListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName)
|
||||
|
@ -797,9 +805,9 @@ func (client ApplicationGatewaysClient) ListAvailableWafRuleSetsResponder(resp *
|
|||
}
|
||||
|
||||
// Start starts the specified application gateway.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application
|
||||
// gateway.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// applicationGatewayName - the name of the application gateway.
|
||||
func (client ApplicationGatewaysClient) Start(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewaysStartFuture, err error) {
|
||||
req, err := client.StartPreparer(ctx, resourceGroupName, applicationGatewayName)
|
||||
if err != nil {
|
||||
|
@ -840,15 +848,17 @@ func (client ApplicationGatewaysClient) StartPreparer(ctx context.Context, resou
|
|||
// StartSender sends the Start request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ApplicationGatewaysClient) StartSender(req *http.Request) (future ApplicationGatewaysStartFuture, 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
|
||||
}
|
||||
|
||||
|
@ -865,9 +875,9 @@ func (client ApplicationGatewaysClient) StartResponder(resp *http.Response) (res
|
|||
}
|
||||
|
||||
// Stop stops the specified application gateway in a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application
|
||||
// gateway.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// applicationGatewayName - the name of the application gateway.
|
||||
func (client ApplicationGatewaysClient) Stop(ctx context.Context, resourceGroupName string, applicationGatewayName string) (result ApplicationGatewaysStopFuture, err error) {
|
||||
req, err := client.StopPreparer(ctx, resourceGroupName, applicationGatewayName)
|
||||
if err != nil {
|
||||
|
@ -908,15 +918,17 @@ func (client ApplicationGatewaysClient) StopPreparer(ctx context.Context, resour
|
|||
// StopSender sends the Stop request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ApplicationGatewaysClient) StopSender(req *http.Request) (future ApplicationGatewaysStopFuture, 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
|
||||
}
|
||||
|
||||
|
@ -933,9 +945,10 @@ func (client ApplicationGatewaysClient) StopResponder(resp *http.Response) (resu
|
|||
}
|
||||
|
||||
// UpdateTags updates the specified application gateway tags.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. applicationGatewayName is the name of the application
|
||||
// gateway. parameters is parameters supplied to update application gateway tags.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// applicationGatewayName - the name of the application gateway.
|
||||
// parameters - parameters supplied to update application gateway tags.
|
||||
func (client ApplicationGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, applicationGatewayName string, parameters TagsObject) (result ApplicationGatewaysUpdateTagsFuture, err error) {
|
||||
req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, applicationGatewayName, parameters)
|
||||
if err != nil {
|
||||
|
@ -978,15 +991,17 @@ func (client ApplicationGatewaysClient) UpdateTagsPreparer(ctx context.Context,
|
|||
// UpdateTagsSender sends the UpdateTags request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ApplicationGatewaysClient) UpdateTagsSender(req *http.Request) (future ApplicationGatewaysUpdateTagsFuture, 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))
|
||||
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
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 {
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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(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,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 {
|
||||
|
|
|
@ -41,10 +41,11 @@ func NewConnectionMonitorsClientWithBaseURI(baseURI string, subscriptionID strin
|
|||
}
|
||||
|
||||
// CreateOrUpdate create or update a connection monitor.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group containing Network Watcher. networkWatcherName is the name
|
||||
// of the Network Watcher resource. connectionMonitorName is the name of the connection monitor. parameters is
|
||||
// parameters that define the operation to create a connection monitor.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group containing Network Watcher.
|
||||
// networkWatcherName - the name of the Network Watcher resource.
|
||||
// connectionMonitorName - the name of the connection monitor.
|
||||
// parameters - parameters that define the operation to create a connection monitor.
|
||||
func (client ConnectionMonitorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string, parameters ConnectionMonitor) (result ConnectionMonitorsCreateOrUpdateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -98,15 +99,17 @@ func (client ConnectionMonitorsClient) CreateOrUpdatePreparer(ctx context.Contex
|
|||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ConnectionMonitorsClient) CreateOrUpdateSender(req *http.Request) (future ConnectionMonitorsCreateOrUpdateFuture, 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
|
||||
}
|
||||
|
||||
|
@ -124,9 +127,10 @@ func (client ConnectionMonitorsClient) CreateOrUpdateResponder(resp *http.Respon
|
|||
}
|
||||
|
||||
// Delete deletes the specified connection monitor.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group containing Network Watcher. networkWatcherName is the name
|
||||
// of the Network Watcher resource. connectionMonitorName is the name of the connection monitor.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group containing Network Watcher.
|
||||
// networkWatcherName - the name of the Network Watcher resource.
|
||||
// connectionMonitorName - the name of the connection monitor.
|
||||
func (client ConnectionMonitorsClient) Delete(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (result ConnectionMonitorsDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, networkWatcherName, connectionMonitorName)
|
||||
if err != nil {
|
||||
|
@ -168,15 +172,17 @@ func (client ConnectionMonitorsClient) DeletePreparer(ctx context.Context, resou
|
|||
// DeleteSender sends the Delete request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ConnectionMonitorsClient) DeleteSender(req *http.Request) (future ConnectionMonitorsDeleteFuture, 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
|
||||
}
|
||||
|
||||
|
@ -193,9 +199,10 @@ func (client ConnectionMonitorsClient) DeleteResponder(resp *http.Response) (res
|
|||
}
|
||||
|
||||
// Get gets a connection monitor by name.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group containing Network Watcher. networkWatcherName is the name
|
||||
// of the Network Watcher resource. connectionMonitorName is the name of the connection monitor.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group containing Network Watcher.
|
||||
// networkWatcherName - the name of the Network Watcher resource.
|
||||
// connectionMonitorName - the name of the connection monitor.
|
||||
func (client ConnectionMonitorsClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (result ConnectionMonitorResult, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, networkWatcherName, connectionMonitorName)
|
||||
if err != nil {
|
||||
|
@ -261,9 +268,9 @@ func (client ConnectionMonitorsClient) GetResponder(resp *http.Response) (result
|
|||
}
|
||||
|
||||
// List lists all connection monitors for the specified Network Watcher.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group containing Network Watcher. networkWatcherName is the name
|
||||
// of the Network Watcher resource.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group containing Network Watcher.
|
||||
// networkWatcherName - the name of the Network Watcher resource.
|
||||
func (client ConnectionMonitorsClient) List(ctx context.Context, resourceGroupName string, networkWatcherName string) (result ConnectionMonitorListResult, err error) {
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName, networkWatcherName)
|
||||
if err != nil {
|
||||
|
@ -328,9 +335,10 @@ func (client ConnectionMonitorsClient) ListResponder(resp *http.Response) (resul
|
|||
}
|
||||
|
||||
// Query query a snapshot of the most recent connection states.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group containing Network Watcher. networkWatcherName is the name
|
||||
// of the Network Watcher resource. connectionMonitorName is the name given to the connection monitor.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group containing Network Watcher.
|
||||
// networkWatcherName - the name of the Network Watcher resource.
|
||||
// connectionMonitorName - the name given to the connection monitor.
|
||||
func (client ConnectionMonitorsClient) Query(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (result ConnectionMonitorsQueryFuture, err error) {
|
||||
req, err := client.QueryPreparer(ctx, resourceGroupName, networkWatcherName, connectionMonitorName)
|
||||
if err != nil {
|
||||
|
@ -372,15 +380,17 @@ func (client ConnectionMonitorsClient) QueryPreparer(ctx context.Context, resour
|
|||
// QuerySender sends the Query request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ConnectionMonitorsClient) QuerySender(req *http.Request) (future ConnectionMonitorsQueryFuture, 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
|
||||
}
|
||||
|
||||
|
@ -398,9 +408,10 @@ func (client ConnectionMonitorsClient) QueryResponder(resp *http.Response) (resu
|
|||
}
|
||||
|
||||
// Start starts the specified connection monitor.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group containing Network Watcher. networkWatcherName is the name
|
||||
// of the Network Watcher resource. connectionMonitorName is the name of the connection monitor.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group containing Network Watcher.
|
||||
// networkWatcherName - the name of the Network Watcher resource.
|
||||
// connectionMonitorName - the name of the connection monitor.
|
||||
func (client ConnectionMonitorsClient) Start(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (result ConnectionMonitorsStartFuture, err error) {
|
||||
req, err := client.StartPreparer(ctx, resourceGroupName, networkWatcherName, connectionMonitorName)
|
||||
if err != nil {
|
||||
|
@ -442,15 +453,17 @@ func (client ConnectionMonitorsClient) StartPreparer(ctx context.Context, resour
|
|||
// StartSender sends the Start request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ConnectionMonitorsClient) StartSender(req *http.Request) (future ConnectionMonitorsStartFuture, 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
|
||||
}
|
||||
|
||||
|
@ -467,9 +480,10 @@ func (client ConnectionMonitorsClient) StartResponder(resp *http.Response) (resu
|
|||
}
|
||||
|
||||
// Stop stops the specified connection monitor.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group containing Network Watcher. networkWatcherName is the name
|
||||
// of the Network Watcher resource. connectionMonitorName is the name of the connection monitor.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group containing Network Watcher.
|
||||
// networkWatcherName - the name of the Network Watcher resource.
|
||||
// connectionMonitorName - the name of the connection monitor.
|
||||
func (client ConnectionMonitorsClient) Stop(ctx context.Context, resourceGroupName string, networkWatcherName string, connectionMonitorName string) (result ConnectionMonitorsStopFuture, err error) {
|
||||
req, err := client.StopPreparer(ctx, resourceGroupName, networkWatcherName, connectionMonitorName)
|
||||
if err != nil {
|
||||
|
@ -511,15 +525,17 @@ func (client ConnectionMonitorsClient) StopPreparer(ctx context.Context, resourc
|
|||
// StopSender sends the Stop request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ConnectionMonitorsClient) StopSender(req *http.Request) (future ConnectionMonitorsStopFuture, 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
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
|
|
@ -19,10 +19,11 @@ package network
|
|||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
|
||||
"github.com/Azure/go-autorest/autorest"
|
||||
"github.com/Azure/go-autorest/autorest/azure"
|
||||
"github.com/Azure/go-autorest/autorest/validation"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
// ExpressRouteCircuitPeeringsClient is the network Client
|
||||
|
@ -41,16 +42,17 @@ 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) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: peeringParameters,
|
||||
Constraints: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.Null, Rule: false,
|
||||
Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMaximum, Rule: 4294967295, Chain: nil},
|
||||
Chain: []validation.Constraint{{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil},
|
||||
{Target: "peeringParameters.ExpressRouteCircuitPeeringPropertiesFormat.PeerASN", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
|
||||
}},
|
||||
}}}}}); err != nil {
|
||||
|
@ -99,15 +101,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(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
|
||||
}
|
||||
|
||||
|
@ -125,9 +129,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 {
|
||||
|
@ -169,15 +174,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(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 +201,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 {
|
||||
|
@ -262,8 +270,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)
|
||||
|
|
|
@ -40,9 +40,10 @@ func NewExpressRouteCircuitsClientWithBaseURI(baseURI string, subscriptionID str
|
|||
}
|
||||
|
||||
// CreateOrUpdate creates or updates an express route circuit.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. circuitName is the name of the circuit. parameters is
|
||||
// parameters supplied to the create or update express route circuit operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// circuitName - the name of the circuit.
|
||||
// parameters - parameters supplied to the create or update express route circuit operation.
|
||||
func (client ExpressRouteCircuitsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, circuitName string, parameters ExpressRouteCircuit) (result ExpressRouteCircuitsCreateOrUpdateFuture, err error) {
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, circuitName, parameters)
|
||||
if err != nil {
|
||||
|
@ -85,15 +86,17 @@ func (client ExpressRouteCircuitsClient) CreateOrUpdatePreparer(ctx context.Cont
|
|||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ExpressRouteCircuitsClient) CreateOrUpdateSender(req *http.Request) (future ExpressRouteCircuitsCreateOrUpdateFuture, 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
|
||||
}
|
||||
|
||||
|
@ -111,8 +114,9 @@ func (client ExpressRouteCircuitsClient) CreateOrUpdateResponder(resp *http.Resp
|
|||
}
|
||||
|
||||
// Delete deletes the 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 ExpressRouteCircuitsClient) Delete(ctx context.Context, resourceGroupName string, circuitName string) (result ExpressRouteCircuitsDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, circuitName)
|
||||
if err != nil {
|
||||
|
@ -153,15 +157,17 @@ func (client ExpressRouteCircuitsClient) 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 ExpressRouteCircuitsClient) DeleteSender(req *http.Request) (future ExpressRouteCircuitsDeleteFuture, 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,8 +184,9 @@ func (client ExpressRouteCircuitsClient) DeleteResponder(resp *http.Response) (r
|
|||
}
|
||||
|
||||
// Get gets information about the specified express route circuit.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. circuitName is the name of express route circuit.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// circuitName - the name of express route circuit.
|
||||
func (client ExpressRouteCircuitsClient) Get(ctx context.Context, resourceGroupName string, circuitName string) (result ExpressRouteCircuit, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, circuitName)
|
||||
if err != nil {
|
||||
|
@ -244,9 +251,10 @@ func (client ExpressRouteCircuitsClient) GetResponder(resp *http.Response) (resu
|
|||
}
|
||||
|
||||
// GetPeeringStats gets all stats from an express route circuit in a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit.
|
||||
// peeringName is the name of the peering.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// circuitName - the name of the express route circuit.
|
||||
// peeringName - the name of the peering.
|
||||
func (client ExpressRouteCircuitsClient) GetPeeringStats(ctx context.Context, resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitStats, err error) {
|
||||
req, err := client.GetPeeringStatsPreparer(ctx, resourceGroupName, circuitName, peeringName)
|
||||
if err != nil {
|
||||
|
@ -312,8 +320,9 @@ func (client ExpressRouteCircuitsClient) GetPeeringStatsResponder(resp *http.Res
|
|||
}
|
||||
|
||||
// GetStats gets all the stats from an express route circuit in a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// circuitName - the name of the express route circuit.
|
||||
func (client ExpressRouteCircuitsClient) GetStats(ctx context.Context, resourceGroupName string, circuitName string) (result ExpressRouteCircuitStats, err error) {
|
||||
req, err := client.GetStatsPreparer(ctx, resourceGroupName, circuitName)
|
||||
if err != nil {
|
||||
|
@ -378,8 +387,8 @@ func (client ExpressRouteCircuitsClient) GetStatsResponder(resp *http.Response)
|
|||
}
|
||||
|
||||
// List gets all the express route circuits in a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
func (client ExpressRouteCircuitsClient) List(ctx context.Context, resourceGroupName string) (result ExpressRouteCircuitListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName)
|
||||
|
@ -561,9 +570,11 @@ func (client ExpressRouteCircuitsClient) ListAllComplete(ctx context.Context) (r
|
|||
}
|
||||
|
||||
// ListArpTable gets the currently advertised ARP table associated with the express route circuit in a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit.
|
||||
// peeringName is the name of the peering. devicePath is the path of the device.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// circuitName - the name of the express route circuit.
|
||||
// peeringName - the name of the peering.
|
||||
// devicePath - the path of the device.
|
||||
func (client ExpressRouteCircuitsClient) ListArpTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string) (result ExpressRouteCircuitsListArpTableFuture, err error) {
|
||||
req, err := client.ListArpTablePreparer(ctx, resourceGroupName, circuitName, peeringName, devicePath)
|
||||
if err != nil {
|
||||
|
@ -606,15 +617,17 @@ func (client ExpressRouteCircuitsClient) ListArpTablePreparer(ctx context.Contex
|
|||
// ListArpTableSender sends the ListArpTable request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ExpressRouteCircuitsClient) ListArpTableSender(req *http.Request) (future ExpressRouteCircuitsListArpTableFuture, 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
|
||||
}
|
||||
|
||||
|
@ -633,9 +646,11 @@ func (client ExpressRouteCircuitsClient) ListArpTableResponder(resp *http.Respon
|
|||
|
||||
// ListRoutesTable gets the currently advertised routes table associated with the express route circuit in a resource
|
||||
// group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit.
|
||||
// peeringName is the name of the peering. devicePath is the path of the device.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// circuitName - the name of the express route circuit.
|
||||
// peeringName - the name of the peering.
|
||||
// devicePath - the path of the device.
|
||||
func (client ExpressRouteCircuitsClient) ListRoutesTable(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string) (result ExpressRouteCircuitsListRoutesTableFuture, err error) {
|
||||
req, err := client.ListRoutesTablePreparer(ctx, resourceGroupName, circuitName, peeringName, devicePath)
|
||||
if err != nil {
|
||||
|
@ -678,15 +693,17 @@ func (client ExpressRouteCircuitsClient) ListRoutesTablePreparer(ctx context.Con
|
|||
// ListRoutesTableSender sends the ListRoutesTable request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ExpressRouteCircuitsClient) ListRoutesTableSender(req *http.Request) (future ExpressRouteCircuitsListRoutesTableFuture, 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
|
||||
}
|
||||
|
||||
|
@ -705,9 +722,11 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableResponder(resp *http.Res
|
|||
|
||||
// ListRoutesTableSummary gets the currently advertised routes table summary associated with the express route circuit
|
||||
// in a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. circuitName is the name of the express route circuit.
|
||||
// peeringName is the name of the peering. devicePath is the path of the device.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// circuitName - the name of the express route circuit.
|
||||
// peeringName - the name of the peering.
|
||||
// devicePath - the path of the device.
|
||||
func (client ExpressRouteCircuitsClient) ListRoutesTableSummary(ctx context.Context, resourceGroupName string, circuitName string, peeringName string, devicePath string) (result ExpressRouteCircuitsListRoutesTableSummaryFuture, err error) {
|
||||
req, err := client.ListRoutesTableSummaryPreparer(ctx, resourceGroupName, circuitName, peeringName, devicePath)
|
||||
if err != nil {
|
||||
|
@ -750,15 +769,17 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableSummaryPreparer(ctx cont
|
|||
// ListRoutesTableSummarySender sends the ListRoutesTableSummary request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ExpressRouteCircuitsClient) ListRoutesTableSummarySender(req *http.Request) (future ExpressRouteCircuitsListRoutesTableSummaryFuture, 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
|
||||
}
|
||||
|
||||
|
@ -776,9 +797,10 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableSummaryResponder(resp *h
|
|||
}
|
||||
|
||||
// UpdateTags updates an express route circuit tags.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. circuitName is the name of the circuit. parameters is
|
||||
// parameters supplied to update express route circuit tags.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// circuitName - the name of the circuit.
|
||||
// parameters - parameters supplied to update express route circuit tags.
|
||||
func (client ExpressRouteCircuitsClient) UpdateTags(ctx context.Context, resourceGroupName string, circuitName string, parameters TagsObject) (result ExpressRouteCircuitsUpdateTagsFuture, err error) {
|
||||
req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, circuitName, parameters)
|
||||
if err != nil {
|
||||
|
@ -821,15 +843,17 @@ func (client ExpressRouteCircuitsClient) UpdateTagsPreparer(ctx context.Context,
|
|||
// UpdateTagsSender sends the UpdateTags request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client ExpressRouteCircuitsClient) UpdateTagsSender(req *http.Request) (future ExpressRouteCircuitsUpdateTagsFuture, 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))
|
||||
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
|
|
@ -40,9 +40,10 @@ func NewInterfacesClientWithBaseURI(baseURI string, subscriptionID string) Inter
|
|||
}
|
||||
|
||||
// CreateOrUpdate creates or updates a network interface.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. networkInterfaceName is the name of the network interface.
|
||||
// parameters is parameters supplied to the create or update network interface operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// networkInterfaceName - the name of the network interface.
|
||||
// parameters - parameters supplied to the create or update network interface operation.
|
||||
func (client InterfacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters Interface) (result InterfacesCreateOrUpdateFuture, err error) {
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkInterfaceName, parameters)
|
||||
if err != nil {
|
||||
|
@ -85,15 +86,17 @@ func (client InterfacesClient) CreateOrUpdatePreparer(ctx context.Context, resou
|
|||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client InterfacesClient) CreateOrUpdateSender(req *http.Request) (future InterfacesCreateOrUpdateFuture, 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
|
||||
}
|
||||
|
||||
|
@ -111,8 +114,9 @@ func (client InterfacesClient) CreateOrUpdateResponder(resp *http.Response) (res
|
|||
}
|
||||
|
||||
// Delete deletes the specified 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 InterfacesClient) Delete(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfacesDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, networkInterfaceName)
|
||||
if err != nil {
|
||||
|
@ -153,15 +157,17 @@ func (client InterfacesClient) DeletePreparer(ctx context.Context, resourceGroup
|
|||
// DeleteSender sends the Delete request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client InterfacesClient) DeleteSender(req *http.Request) (future InterfacesDeleteFuture, 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 InterfacesClient) DeleteResponder(resp *http.Response) (result auto
|
|||
}
|
||||
|
||||
// Get gets information about the specified network interface.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. networkInterfaceName is the name of the network interface.
|
||||
// expand is expands referenced resources.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// networkInterfaceName - the name of the network interface.
|
||||
// expand - expands referenced resources.
|
||||
func (client InterfacesClient) Get(ctx context.Context, resourceGroupName string, networkInterfaceName string, expand string) (result Interface, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, networkInterfaceName, expand)
|
||||
if err != nil {
|
||||
|
@ -248,8 +255,9 @@ func (client InterfacesClient) GetResponder(resp *http.Response) (result Interfa
|
|||
}
|
||||
|
||||
// GetEffectiveRouteTable gets all route tables applied to 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 InterfacesClient) GetEffectiveRouteTable(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfacesGetEffectiveRouteTableFuture, err error) {
|
||||
req, err := client.GetEffectiveRouteTablePreparer(ctx, resourceGroupName, networkInterfaceName)
|
||||
if err != nil {
|
||||
|
@ -290,15 +298,17 @@ func (client InterfacesClient) GetEffectiveRouteTablePreparer(ctx context.Contex
|
|||
// GetEffectiveRouteTableSender sends the GetEffectiveRouteTable request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client InterfacesClient) GetEffectiveRouteTableSender(req *http.Request) (future InterfacesGetEffectiveRouteTableFuture, 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
|
||||
}
|
||||
|
||||
|
@ -317,11 +327,13 @@ func (client InterfacesClient) GetEffectiveRouteTableResponder(resp *http.Respon
|
|||
|
||||
// GetVirtualMachineScaleSetIPConfiguration get the specified network interface ip configuration in a virtual machine
|
||||
// scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual
|
||||
// machine scale set. virtualmachineIndex is the virtual machine index. networkInterfaceName is the name of the
|
||||
// network interface. IPConfigurationName is the name of the ip configuration. expand is expands referenced
|
||||
// resources.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualMachineScaleSetName - the name of the virtual machine scale set.
|
||||
// virtualmachineIndex - the virtual machine index.
|
||||
// networkInterfaceName - the name of the network interface.
|
||||
// IPConfigurationName - the name of the ip configuration.
|
||||
// expand - expands referenced resources.
|
||||
func (client InterfacesClient) GetVirtualMachineScaleSetIPConfiguration(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string, expand string) (result InterfaceIPConfiguration, err error) {
|
||||
req, err := client.GetVirtualMachineScaleSetIPConfigurationPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, IPConfigurationName, expand)
|
||||
if err != nil {
|
||||
|
@ -392,10 +404,12 @@ func (client InterfacesClient) GetVirtualMachineScaleSetIPConfigurationResponder
|
|||
}
|
||||
|
||||
// GetVirtualMachineScaleSetNetworkInterface get the specified network interface in a virtual machine scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual
|
||||
// machine scale set. virtualmachineIndex is the virtual machine index. networkInterfaceName is the name of the
|
||||
// network interface. expand is expands referenced resources.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualMachineScaleSetName - the name of the virtual machine scale set.
|
||||
// virtualmachineIndex - the virtual machine index.
|
||||
// networkInterfaceName - the name of the network interface.
|
||||
// expand - expands referenced resources.
|
||||
func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterface(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (result Interface, err error) {
|
||||
req, err := client.GetVirtualMachineScaleSetNetworkInterfacePreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand)
|
||||
if err != nil {
|
||||
|
@ -465,8 +479,8 @@ func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfaceResponde
|
|||
}
|
||||
|
||||
// List gets all network interfaces in a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
func (client InterfacesClient) List(ctx context.Context, resourceGroupName string) (result InterfaceListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName)
|
||||
|
@ -648,8 +662,9 @@ func (client InterfacesClient) ListAllComplete(ctx context.Context) (result Inte
|
|||
}
|
||||
|
||||
// ListEffectiveNetworkSecurityGroups gets all network security groups applied to 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 InterfacesClient) ListEffectiveNetworkSecurityGroups(ctx context.Context, resourceGroupName string, networkInterfaceName string) (result InterfacesListEffectiveNetworkSecurityGroupsFuture, err error) {
|
||||
req, err := client.ListEffectiveNetworkSecurityGroupsPreparer(ctx, resourceGroupName, networkInterfaceName)
|
||||
if err != nil {
|
||||
|
@ -690,15 +705,17 @@ func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsPreparer(ctx co
|
|||
// ListEffectiveNetworkSecurityGroupsSender sends the ListEffectiveNetworkSecurityGroups request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsSender(req *http.Request) (future InterfacesListEffectiveNetworkSecurityGroupsFuture, 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
|
||||
}
|
||||
|
||||
|
@ -717,10 +734,12 @@ func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsResponder(resp
|
|||
|
||||
// ListVirtualMachineScaleSetIPConfigurations get the specified network interface ip configuration in a virtual machine
|
||||
// scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual
|
||||
// machine scale set. virtualmachineIndex is the virtual machine index. networkInterfaceName is the name of the
|
||||
// network interface. expand is expands referenced resources.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualMachineScaleSetName - the name of the virtual machine scale set.
|
||||
// virtualmachineIndex - the virtual machine index.
|
||||
// networkInterfaceName - the name of the network interface.
|
||||
// expand - expands referenced resources.
|
||||
func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurations(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (result InterfaceIPConfigurationListResultPage, err error) {
|
||||
result.fn = client.listVirtualMachineScaleSetIPConfigurationsNextResults
|
||||
req, err := client.ListVirtualMachineScaleSetIPConfigurationsPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand)
|
||||
|
@ -818,9 +837,9 @@ func (client InterfacesClient) ListVirtualMachineScaleSetIPConfigurationsComplet
|
|||
}
|
||||
|
||||
// ListVirtualMachineScaleSetNetworkInterfaces gets all network interfaces in a virtual machine scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual
|
||||
// machine scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualMachineScaleSetName - the name of the virtual machine scale set.
|
||||
func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfaces(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string) (result InterfaceListResultPage, err error) {
|
||||
result.fn = client.listVirtualMachineScaleSetNetworkInterfacesNextResults
|
||||
req, err := client.ListVirtualMachineScaleSetNetworkInterfacesPreparer(ctx, resourceGroupName, virtualMachineScaleSetName)
|
||||
|
@ -914,9 +933,10 @@ func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesComple
|
|||
|
||||
// ListVirtualMachineScaleSetVMNetworkInterfaces gets information about all network interfaces in a virtual machine in
|
||||
// a virtual machine scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual
|
||||
// machine scale set. virtualmachineIndex is the virtual machine index.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualMachineScaleSetName - the name of the virtual machine scale set.
|
||||
// virtualmachineIndex - the virtual machine index.
|
||||
func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfaces(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string) (result InterfaceListResultPage, err error) {
|
||||
result.fn = client.listVirtualMachineScaleSetVMNetworkInterfacesNextResults
|
||||
req, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex)
|
||||
|
@ -1010,9 +1030,10 @@ func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesComp
|
|||
}
|
||||
|
||||
// UpdateTags updates a network interface tags.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. networkInterfaceName is the name of the network interface.
|
||||
// parameters is parameters supplied to update network interface tags.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// networkInterfaceName - the name of the network interface.
|
||||
// parameters - parameters supplied to update network interface tags.
|
||||
func (client InterfacesClient) UpdateTags(ctx context.Context, resourceGroupName string, networkInterfaceName string, parameters TagsObject) (result InterfacesUpdateTagsFuture, err error) {
|
||||
req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, networkInterfaceName, parameters)
|
||||
if err != nil {
|
||||
|
@ -1055,15 +1076,17 @@ func (client InterfacesClient) UpdateTagsPreparer(ctx context.Context, resourceG
|
|||
// UpdateTagsSender sends the UpdateTags request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client InterfacesClient) UpdateTagsSender(req *http.Request) (future InterfacesUpdateTagsFuture, 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))
|
||||
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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(future.Response(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
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,
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
@ -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(future.Response(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
2948
vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/models.go
generated
vendored
2948
vendor/github.com/Azure/azure-sdk-for-go/services/network/mgmt/2018-01-01/network/models.go
generated
vendored
File diff suppressed because it is too large
Load Diff
|
@ -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,
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
|
|
@ -41,9 +41,10 @@ func NewPublicIPAddressesClientWithBaseURI(baseURI string, subscriptionID string
|
|||
}
|
||||
|
||||
// CreateOrUpdate creates or updates a static or dynamic public IP address.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. publicIPAddressName is the name of the public IP address.
|
||||
// parameters is parameters supplied to the create or update public IP address operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// publicIPAddressName - the name of the public IP address.
|
||||
// parameters - parameters supplied to the create or update public IP address operation.
|
||||
func (client PublicIPAddressesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress) (result PublicIPAddressesCreateOrUpdateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -97,15 +98,17 @@ func (client PublicIPAddressesClient) CreateOrUpdatePreparer(ctx context.Context
|
|||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client PublicIPAddressesClient) CreateOrUpdateSender(req *http.Request) (future PublicIPAddressesCreateOrUpdateFuture, 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
|
||||
}
|
||||
|
||||
|
@ -123,8 +126,9 @@ func (client PublicIPAddressesClient) CreateOrUpdateResponder(resp *http.Respons
|
|||
}
|
||||
|
||||
// Delete deletes the specified public IP address.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. publicIPAddressName is the name of the subnet.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// publicIPAddressName - the name of the subnet.
|
||||
func (client PublicIPAddressesClient) Delete(ctx context.Context, resourceGroupName string, publicIPAddressName string) (result PublicIPAddressesDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, publicIPAddressName)
|
||||
if err != nil {
|
||||
|
@ -165,15 +169,17 @@ func (client PublicIPAddressesClient) DeletePreparer(ctx context.Context, resour
|
|||
// DeleteSender sends the Delete request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client PublicIPAddressesClient) DeleteSender(req *http.Request) (future PublicIPAddressesDeleteFuture, 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
|
||||
}
|
||||
|
||||
|
@ -190,9 +196,10 @@ func (client PublicIPAddressesClient) DeleteResponder(resp *http.Response) (resu
|
|||
}
|
||||
|
||||
// Get gets the specified public IP address in a specified resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. publicIPAddressName is the name of the subnet. expand is
|
||||
// expands referenced resources.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// publicIPAddressName - the name of the subnet.
|
||||
// expand - expands referenced resources.
|
||||
func (client PublicIPAddressesClient) Get(ctx context.Context, resourceGroupName string, publicIPAddressName string, expand string) (result PublicIPAddress, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, publicIPAddressName, expand)
|
||||
if err != nil {
|
||||
|
@ -260,11 +267,14 @@ func (client PublicIPAddressesClient) GetResponder(resp *http.Response) (result
|
|||
}
|
||||
|
||||
// GetVirtualMachineScaleSetPublicIPAddress get the specified public IP address in a virtual machine scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual
|
||||
// machine scale set. virtualmachineIndex is the virtual machine index. networkInterfaceName is the name of the
|
||||
// network interface. IPConfigurationName is the name of the IP configuration. publicIPAddressName is the name of
|
||||
// the public IP Address. expand is expands referenced resources.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualMachineScaleSetName - the name of the virtual machine scale set.
|
||||
// virtualmachineIndex - the virtual machine index.
|
||||
// networkInterfaceName - the name of the network interface.
|
||||
// IPConfigurationName - the name of the IP configuration.
|
||||
// publicIPAddressName - the name of the public IP Address.
|
||||
// expand - expands referenced resources.
|
||||
func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddress(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string, publicIPAddressName string, expand string) (result PublicIPAddress, err error) {
|
||||
req, err := client.GetVirtualMachineScaleSetPublicIPAddressPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, IPConfigurationName, publicIPAddressName, expand)
|
||||
if err != nil {
|
||||
|
@ -336,8 +346,8 @@ func (client PublicIPAddressesClient) GetVirtualMachineScaleSetPublicIPAddressRe
|
|||
}
|
||||
|
||||
// List gets all public IP addresses in a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
func (client PublicIPAddressesClient) List(ctx context.Context, resourceGroupName string) (result PublicIPAddressListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName)
|
||||
|
@ -520,9 +530,9 @@ func (client PublicIPAddressesClient) ListAllComplete(ctx context.Context) (resu
|
|||
|
||||
// ListVirtualMachineScaleSetPublicIPAddresses gets information about all public IP addresses on a virtual machine
|
||||
// scale set level.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual
|
||||
// machine scale set.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualMachineScaleSetName - the name of the virtual machine scale set.
|
||||
func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddresses(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string) (result PublicIPAddressListResultPage, err error) {
|
||||
result.fn = client.listVirtualMachineScaleSetPublicIPAddressesNextResults
|
||||
req, err := client.ListVirtualMachineScaleSetPublicIPAddressesPreparer(ctx, resourceGroupName, virtualMachineScaleSetName)
|
||||
|
@ -616,10 +626,12 @@ func (client PublicIPAddressesClient) ListVirtualMachineScaleSetPublicIPAddresse
|
|||
|
||||
// ListVirtualMachineScaleSetVMPublicIPAddresses gets information about all public IP addresses in a virtual machine IP
|
||||
// configuration in a virtual machine scale set.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualMachineScaleSetName is the name of the virtual
|
||||
// machine scale set. virtualmachineIndex is the virtual machine index. networkInterfaceName is the network
|
||||
// interface name. IPConfigurationName is the IP configuration name.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualMachineScaleSetName - the name of the virtual machine scale set.
|
||||
// virtualmachineIndex - the virtual machine index.
|
||||
// networkInterfaceName - the network interface name.
|
||||
// IPConfigurationName - the IP configuration name.
|
||||
func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddresses(ctx context.Context, resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, IPConfigurationName string) (result PublicIPAddressListResultPage, err error) {
|
||||
result.fn = client.listVirtualMachineScaleSetVMPublicIPAddressesNextResults
|
||||
req, err := client.ListVirtualMachineScaleSetVMPublicIPAddressesPreparer(ctx, resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, IPConfigurationName)
|
||||
|
@ -715,9 +727,10 @@ func (client PublicIPAddressesClient) ListVirtualMachineScaleSetVMPublicIPAddres
|
|||
}
|
||||
|
||||
// UpdateTags updates public IP address tags.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. publicIPAddressName is the name of the public IP address.
|
||||
// parameters is parameters supplied to update public IP address tags.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// publicIPAddressName - the name of the public IP address.
|
||||
// parameters - parameters supplied to update public IP address tags.
|
||||
func (client PublicIPAddressesClient) UpdateTags(ctx context.Context, resourceGroupName string, publicIPAddressName string, parameters TagsObject) (result PublicIPAddressesUpdateTagsFuture, err error) {
|
||||
req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, publicIPAddressName, parameters)
|
||||
if err != nil {
|
||||
|
@ -760,15 +773,17 @@ func (client PublicIPAddressesClient) UpdateTagsPreparer(ctx context.Context, re
|
|||
// UpdateTagsSender sends the UpdateTags request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client PublicIPAddressesClient) UpdateTagsSender(req *http.Request) (future PublicIPAddressesUpdateTagsFuture, 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))
|
||||
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
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,
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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(future.Response(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
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 {
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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(future.Response(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
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 {
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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(future.Response(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
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 {
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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(future.Response(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
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 {
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
|
|
|
@ -42,10 +42,10 @@ func NewVirtualNetworkGatewayConnectionsClientWithBaseURI(baseURI string, subscr
|
|||
}
|
||||
|
||||
// CreateOrUpdate creates or updates a virtual network gateway connection in the specified resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the name of the
|
||||
// virtual network gateway connection. parameters is parameters supplied to the create or update virtual network
|
||||
// gateway connection operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayConnectionName - the name of the virtual network gateway connection.
|
||||
// parameters - parameters supplied to the create or update virtual network gateway connection operation.
|
||||
func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection) (result VirtualNetworkGatewayConnectionsCreateOrUpdateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -101,15 +101,17 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdatePreparer(ctx
|
|||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkGatewayConnectionsCreateOrUpdateFuture, 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
|
||||
}
|
||||
|
||||
|
@ -127,9 +129,9 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdateResponder(res
|
|||
}
|
||||
|
||||
// Delete deletes the specified virtual network Gateway connection.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the name of the
|
||||
// virtual network gateway connection.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayConnectionName - the name of the virtual network gateway connection.
|
||||
func (client VirtualNetworkGatewayConnectionsClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (result VirtualNetworkGatewayConnectionsDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName)
|
||||
if err != nil {
|
||||
|
@ -170,15 +172,17 @@ func (client VirtualNetworkGatewayConnectionsClient) DeletePreparer(ctx context.
|
|||
// DeleteSender sends the Delete request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualNetworkGatewayConnectionsClient) DeleteSender(req *http.Request) (future VirtualNetworkGatewayConnectionsDeleteFuture, 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
|
||||
}
|
||||
|
||||
|
@ -195,9 +199,9 @@ func (client VirtualNetworkGatewayConnectionsClient) DeleteResponder(resp *http.
|
|||
}
|
||||
|
||||
// Get gets the specified virtual network gateway connection by resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the name of the
|
||||
// virtual network gateway connection.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayConnectionName - the name of the virtual network gateway connection.
|
||||
func (client VirtualNetworkGatewayConnectionsClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (result VirtualNetworkGatewayConnection, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName)
|
||||
if err != nil {
|
||||
|
@ -263,9 +267,9 @@ func (client VirtualNetworkGatewayConnectionsClient) GetResponder(resp *http.Res
|
|||
|
||||
// GetSharedKey the Get VirtualNetworkGatewayConnectionSharedKey operation retrieves information about the specified
|
||||
// virtual network gateway connection shared key through Network resource provider.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the virtual network
|
||||
// gateway connection shared key name.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayConnectionName - the virtual network gateway connection shared key name.
|
||||
func (client VirtualNetworkGatewayConnectionsClient) GetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string) (result ConnectionSharedKey, err error) {
|
||||
req, err := client.GetSharedKeyPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName)
|
||||
if err != nil {
|
||||
|
@ -331,8 +335,8 @@ func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyResponder(resp
|
|||
|
||||
// List the List VirtualNetworkGatewayConnections operation retrieves all the virtual network gateways connections
|
||||
// created.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
func (client VirtualNetworkGatewayConnectionsClient) List(ctx context.Context, resourceGroupName string) (result VirtualNetworkGatewayConnectionListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName)
|
||||
|
@ -426,10 +430,11 @@ func (client VirtualNetworkGatewayConnectionsClient) ListComplete(ctx context.Co
|
|||
// ResetSharedKey the VirtualNetworkGatewayConnectionResetSharedKey operation resets the virtual network gateway
|
||||
// connection shared key for passed virtual network gateway connection in the specified resource group through Network
|
||||
// resource provider.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the virtual network
|
||||
// gateway connection reset shared key Name. parameters is parameters supplied to the begin reset virtual network
|
||||
// gateway connection shared key operation through network resource provider.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayConnectionName - the virtual network gateway connection reset shared key Name.
|
||||
// parameters - parameters supplied to the begin reset virtual network gateway connection shared key operation
|
||||
// through network resource provider.
|
||||
func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey) (result VirtualNetworkGatewayConnectionsResetSharedKeyFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -481,15 +486,17 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyPreparer(ctx
|
|||
// ResetSharedKeySender sends the ResetSharedKey request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeySender(req *http.Request) (future VirtualNetworkGatewayConnectionsResetSharedKeyFuture, 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
|
||||
}
|
||||
|
||||
|
@ -509,10 +516,11 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyResponder(res
|
|||
// SetSharedKey the Put VirtualNetworkGatewayConnectionSharedKey operation sets the virtual network gateway connection
|
||||
// shared key for passed virtual network gateway connection in the specified resource group through Network resource
|
||||
// provider.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the virtual network
|
||||
// gateway connection name. parameters is parameters supplied to the Begin Set Virtual Network Gateway connection
|
||||
// Shared key operation throughNetwork resource provider.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayConnectionName - the virtual network gateway connection name.
|
||||
// parameters - parameters supplied to the Begin Set Virtual Network Gateway connection Shared key operation
|
||||
// throughNetwork resource provider.
|
||||
func (client VirtualNetworkGatewayConnectionsClient) SetSharedKey(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey) (result VirtualNetworkGatewayConnectionsSetSharedKeyFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -561,15 +569,17 @@ func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeyPreparer(ctx co
|
|||
// SetSharedKeySender sends the SetSharedKey request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeySender(req *http.Request) (future VirtualNetworkGatewayConnectionsSetSharedKeyFuture, 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
|
||||
}
|
||||
|
||||
|
@ -587,10 +597,10 @@ func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeyResponder(resp
|
|||
}
|
||||
|
||||
// UpdateTags updates a virtual network gateway connection tags.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the name of the
|
||||
// virtual network gateway connection. parameters is parameters supplied to update virtual network gateway
|
||||
// connection tags.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayConnectionName - the name of the virtual network gateway connection.
|
||||
// parameters - parameters supplied to update virtual network gateway connection tags.
|
||||
func (client VirtualNetworkGatewayConnectionsClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters TagsObject) (result VirtualNetworkGatewayConnectionsUpdateTagsFuture, err error) {
|
||||
req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters)
|
||||
if err != nil {
|
||||
|
@ -633,15 +643,17 @@ func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsPreparer(ctx cont
|
|||
// UpdateTagsSender sends the UpdateTags request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualNetworkGatewayConnectionsClient) UpdateTagsSender(req *http.Request) (future VirtualNetworkGatewayConnectionsUpdateTagsFuture, 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))
|
||||
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -41,9 +41,10 @@ func NewVirtualNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID s
|
|||
}
|
||||
|
||||
// CreateOrUpdate creates or updates a virtual network gateway in the specified resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual
|
||||
// network gateway. parameters is parameters supplied to create or update virtual network gateway operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayName - the name of the virtual network gateway.
|
||||
// parameters - parameters supplied to create or update virtual network gateway operation.
|
||||
func (client VirtualNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway) (result VirtualNetworkGatewaysCreateOrUpdateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -92,15 +93,17 @@ func (client VirtualNetworkGatewaysClient) CreateOrUpdatePreparer(ctx context.Co
|
|||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualNetworkGatewaysClient) CreateOrUpdateSender(req *http.Request) (future VirtualNetworkGatewaysCreateOrUpdateFuture, 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
|
||||
}
|
||||
|
||||
|
@ -118,9 +121,9 @@ func (client VirtualNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Re
|
|||
}
|
||||
|
||||
// Delete deletes the specified virtual network gateway.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual
|
||||
// network gateway.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayName - the name of the virtual network gateway.
|
||||
func (client VirtualNetworkGatewaysClient) Delete(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, virtualNetworkGatewayName)
|
||||
if err != nil {
|
||||
|
@ -161,15 +164,17 @@ func (client VirtualNetworkGatewaysClient) 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 VirtualNetworkGatewaysClient) DeleteSender(req *http.Request) (future VirtualNetworkGatewaysDeleteFuture, 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
|
||||
}
|
||||
|
||||
|
@ -187,10 +192,10 @@ func (client VirtualNetworkGatewaysClient) DeleteResponder(resp *http.Response)
|
|||
|
||||
// Generatevpnclientpackage generates VPN client package for P2S client of the virtual network gateway in the specified
|
||||
// resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual
|
||||
// network gateway. parameters is parameters supplied to the generate virtual network gateway VPN client package
|
||||
// operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayName - the name of the virtual network gateway.
|
||||
// parameters - parameters supplied to the generate virtual network gateway VPN client package operation.
|
||||
func (client VirtualNetworkGatewaysClient) Generatevpnclientpackage(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (result VirtualNetworkGatewaysGeneratevpnclientpackageFuture, err error) {
|
||||
req, err := client.GeneratevpnclientpackagePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters)
|
||||
if err != nil {
|
||||
|
@ -233,15 +238,17 @@ func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackagePreparer(ctx
|
|||
// GeneratevpnclientpackageSender sends the Generatevpnclientpackage request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageSender(req *http.Request) (future VirtualNetworkGatewaysGeneratevpnclientpackageFuture, 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))
|
||||
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -260,10 +267,10 @@ func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageResponder(res
|
|||
|
||||
// GenerateVpnProfile generates VPN profile for P2S client of the virtual network gateway in the specified resource
|
||||
// group. Used for IKEV2 and radius based authentication.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual
|
||||
// network gateway. parameters is parameters supplied to the generate virtual network gateway VPN client package
|
||||
// operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayName - the name of the virtual network gateway.
|
||||
// parameters - parameters supplied to the generate virtual network gateway VPN client package operation.
|
||||
func (client VirtualNetworkGatewaysClient) GenerateVpnProfile(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (result VirtualNetworkGatewaysGenerateVpnProfileFuture, err error) {
|
||||
req, err := client.GenerateVpnProfilePreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters)
|
||||
if err != nil {
|
||||
|
@ -306,15 +313,17 @@ func (client VirtualNetworkGatewaysClient) GenerateVpnProfilePreparer(ctx contex
|
|||
// GenerateVpnProfileSender sends the GenerateVpnProfile request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualNetworkGatewaysClient) GenerateVpnProfileSender(req *http.Request) (future VirtualNetworkGatewaysGenerateVpnProfileFuture, 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
|
||||
}
|
||||
|
||||
|
@ -332,9 +341,9 @@ func (client VirtualNetworkGatewaysClient) GenerateVpnProfileResponder(resp *htt
|
|||
}
|
||||
|
||||
// Get gets the specified virtual network gateway by resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual
|
||||
// network gateway.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayName - the name of the virtual network gateway.
|
||||
func (client VirtualNetworkGatewaysClient) Get(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGateway, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, virtualNetworkGatewayName)
|
||||
if err != nil {
|
||||
|
@ -400,9 +409,10 @@ func (client VirtualNetworkGatewaysClient) GetResponder(resp *http.Response) (re
|
|||
|
||||
// GetAdvertisedRoutes this operation retrieves a list of routes the virtual network gateway is advertising to the
|
||||
// specified peer.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual
|
||||
// network gateway. peer is the IP address of the peer
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayName - the name of the virtual network gateway.
|
||||
// peer - the IP address of the peer
|
||||
func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string) (result VirtualNetworkGatewaysGetAdvertisedRoutesFuture, err error) {
|
||||
req, err := client.GetAdvertisedRoutesPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, peer)
|
||||
if err != nil {
|
||||
|
@ -444,15 +454,17 @@ func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesPreparer(ctx conte
|
|||
// GetAdvertisedRoutesSender sends the GetAdvertisedRoutes request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesSender(req *http.Request) (future VirtualNetworkGatewaysGetAdvertisedRoutesFuture, 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
|
||||
}
|
||||
|
||||
|
@ -470,9 +482,10 @@ func (client VirtualNetworkGatewaysClient) GetAdvertisedRoutesResponder(resp *ht
|
|||
}
|
||||
|
||||
// GetBgpPeerStatus the GetBgpPeerStatus operation retrieves the status of all BGP peers.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual
|
||||
// network gateway. peer is the IP address of the peer to retrieve the status of.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayName - the name of the virtual network gateway.
|
||||
// peer - the IP address of the peer to retrieve the status of.
|
||||
func (client VirtualNetworkGatewaysClient) GetBgpPeerStatus(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, peer string) (result VirtualNetworkGatewaysGetBgpPeerStatusFuture, err error) {
|
||||
req, err := client.GetBgpPeerStatusPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, peer)
|
||||
if err != nil {
|
||||
|
@ -516,15 +529,17 @@ func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusPreparer(ctx context.
|
|||
// GetBgpPeerStatusSender sends the GetBgpPeerStatus request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusSender(req *http.Request) (future VirtualNetworkGatewaysGetBgpPeerStatusFuture, 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
|
||||
}
|
||||
|
||||
|
@ -543,9 +558,9 @@ func (client VirtualNetworkGatewaysClient) GetBgpPeerStatusResponder(resp *http.
|
|||
|
||||
// GetLearnedRoutes this operation retrieves a list of routes the virtual network gateway has learned, including routes
|
||||
// learned from BGP peers.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual
|
||||
// network gateway.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayName - the name of the virtual network gateway.
|
||||
func (client VirtualNetworkGatewaysClient) GetLearnedRoutes(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysGetLearnedRoutesFuture, err error) {
|
||||
req, err := client.GetLearnedRoutesPreparer(ctx, resourceGroupName, virtualNetworkGatewayName)
|
||||
if err != nil {
|
||||
|
@ -586,15 +601,17 @@ func (client VirtualNetworkGatewaysClient) GetLearnedRoutesPreparer(ctx context.
|
|||
// GetLearnedRoutesSender sends the GetLearnedRoutes request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualNetworkGatewaysClient) GetLearnedRoutesSender(req *http.Request) (future VirtualNetworkGatewaysGetLearnedRoutesFuture, 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
|
||||
}
|
||||
|
||||
|
@ -613,9 +630,9 @@ func (client VirtualNetworkGatewaysClient) GetLearnedRoutesResponder(resp *http.
|
|||
|
||||
// GetVpnProfilePackageURL gets pre-generated VPN profile for P2S client of the virtual network gateway in the
|
||||
// specified resource group. The profile needs to be generated first using generateVpnProfile.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual
|
||||
// network gateway.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayName - the name of the virtual network gateway.
|
||||
func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURL(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewaysGetVpnProfilePackageURLFuture, err error) {
|
||||
req, err := client.GetVpnProfilePackageURLPreparer(ctx, resourceGroupName, virtualNetworkGatewayName)
|
||||
if err != nil {
|
||||
|
@ -656,15 +673,17 @@ func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLPreparer(ctx c
|
|||
// GetVpnProfilePackageURLSender sends the GetVpnProfilePackageURL request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLSender(req *http.Request) (future VirtualNetworkGatewaysGetVpnProfilePackageURLFuture, 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
|
||||
}
|
||||
|
||||
|
@ -682,8 +701,8 @@ func (client VirtualNetworkGatewaysClient) GetVpnProfilePackageURLResponder(resp
|
|||
}
|
||||
|
||||
// List gets all virtual network gateways by resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
func (client VirtualNetworkGatewaysClient) List(ctx context.Context, resourceGroupName string) (result VirtualNetworkGatewayListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName)
|
||||
|
@ -775,9 +794,9 @@ func (client VirtualNetworkGatewaysClient) ListComplete(ctx context.Context, res
|
|||
}
|
||||
|
||||
// ListConnections gets all the connections in a virtual network gateway.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual
|
||||
// network gateway.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayName - the name of the virtual network gateway.
|
||||
func (client VirtualNetworkGatewaysClient) ListConnections(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result VirtualNetworkGatewayListConnectionsResultPage, err error) {
|
||||
result.fn = client.listConnectionsNextResults
|
||||
req, err := client.ListConnectionsPreparer(ctx, resourceGroupName, virtualNetworkGatewayName)
|
||||
|
@ -870,10 +889,11 @@ func (client VirtualNetworkGatewaysClient) ListConnectionsComplete(ctx context.C
|
|||
}
|
||||
|
||||
// Reset resets the primary of the virtual network gateway in the specified resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual
|
||||
// network gateway. gatewayVip is virtual network gateway vip address supplied to the begin reset of the
|
||||
// active-active feature enabled gateway.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayName - the name of the virtual network gateway.
|
||||
// gatewayVip - virtual network gateway vip address supplied to the begin reset of the active-active feature
|
||||
// enabled gateway.
|
||||
func (client VirtualNetworkGatewaysClient) Reset(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, gatewayVip string) (result VirtualNetworkGatewaysResetFuture, err error) {
|
||||
req, err := client.ResetPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, gatewayVip)
|
||||
if err != nil {
|
||||
|
@ -917,15 +937,17 @@ func (client VirtualNetworkGatewaysClient) ResetPreparer(ctx context.Context, re
|
|||
// ResetSender sends the Reset request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualNetworkGatewaysClient) ResetSender(req *http.Request) (future VirtualNetworkGatewaysResetFuture, 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
|
||||
}
|
||||
|
||||
|
@ -943,9 +965,9 @@ func (client VirtualNetworkGatewaysClient) ResetResponder(resp *http.Response) (
|
|||
}
|
||||
|
||||
// SupportedVpnDevices gets a xml format representation for supported vpn devices.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual
|
||||
// network gateway.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayName - the name of the virtual network gateway.
|
||||
func (client VirtualNetworkGatewaysClient) SupportedVpnDevices(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string) (result String, err error) {
|
||||
req, err := client.SupportedVpnDevicesPreparer(ctx, resourceGroupName, virtualNetworkGatewayName)
|
||||
if err != nil {
|
||||
|
@ -1010,9 +1032,10 @@ func (client VirtualNetworkGatewaysClient) SupportedVpnDevicesResponder(resp *ht
|
|||
}
|
||||
|
||||
// UpdateTags updates a virtual network gateway tags.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayName is the name of the virtual
|
||||
// network gateway. parameters is parameters supplied to update virtual network gateway tags.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayName - the name of the virtual network gateway.
|
||||
// parameters - parameters supplied to update virtual network gateway tags.
|
||||
func (client VirtualNetworkGatewaysClient) UpdateTags(ctx context.Context, resourceGroupName string, virtualNetworkGatewayName string, parameters TagsObject) (result VirtualNetworkGatewaysUpdateTagsFuture, err error) {
|
||||
req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, virtualNetworkGatewayName, parameters)
|
||||
if err != nil {
|
||||
|
@ -1055,15 +1078,17 @@ func (client VirtualNetworkGatewaysClient) UpdateTagsPreparer(ctx context.Contex
|
|||
// UpdateTagsSender sends the UpdateTags request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client VirtualNetworkGatewaysClient) UpdateTagsSender(req *http.Request) (future VirtualNetworkGatewaysUpdateTagsFuture, 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))
|
||||
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -1081,10 +1106,11 @@ func (client VirtualNetworkGatewaysClient) UpdateTagsResponder(resp *http.Respon
|
|||
}
|
||||
|
||||
// VpnDeviceConfigurationScript gets a xml format representation for vpn device configuration script.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. virtualNetworkGatewayConnectionName is the name of the
|
||||
// virtual network gateway connection for which the configuration script is generated. parameters is parameters
|
||||
// supplied to the generate vpn device script operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// virtualNetworkGatewayConnectionName - the name of the virtual network gateway connection for which the
|
||||
// configuration script is generated.
|
||||
// parameters - parameters supplied to the generate vpn device script operation.
|
||||
func (client VirtualNetworkGatewaysClient) VpnDeviceConfigurationScript(ctx context.Context, resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VpnDeviceScriptParameters) (result String, err error) {
|
||||
req, err := client.VpnDeviceConfigurationScriptPreparer(ctx, resourceGroupName, virtualNetworkGatewayConnectionName, parameters)
|
||||
if err != nil {
|
||||
|
|
|
@ -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 {
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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(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
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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(future.Response(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -42,9 +42,10 @@ func NewWatchersClientWithBaseURI(baseURI string, subscriptionID string) Watcher
|
|||
|
||||
// CheckConnectivity verifies the possibility of establishing a direct TCP connection from a virtual machine to a given
|
||||
// endpoint including another VM or an arbitrary remote server.
|
||||
//
|
||||
// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the
|
||||
// network watcher resource. parameters is parameters that determine how the connectivity check will be performed.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the network watcher resource group.
|
||||
// networkWatcherName - the name of the network watcher resource.
|
||||
// parameters - parameters that determine how the connectivity check will be performed.
|
||||
func (client WatchersClient) CheckConnectivity(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters ConnectivityParameters) (result WatchersCheckConnectivityFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -95,15 +96,17 @@ func (client WatchersClient) CheckConnectivityPreparer(ctx context.Context, reso
|
|||
// CheckConnectivitySender sends the CheckConnectivity request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client WatchersClient) CheckConnectivitySender(req *http.Request) (future WatchersCheckConnectivityFuture, 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
|
||||
}
|
||||
|
||||
|
@ -121,9 +124,10 @@ func (client WatchersClient) CheckConnectivityResponder(resp *http.Response) (re
|
|||
}
|
||||
|
||||
// CreateOrUpdate creates or updates a network watcher in the specified resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher.
|
||||
// parameters is parameters that define the network watcher resource.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// networkWatcherName - the name of the network watcher.
|
||||
// parameters - parameters that define the network watcher resource.
|
||||
func (client WatchersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters Watcher) (result Watcher, err error) {
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, networkWatcherName, parameters)
|
||||
if err != nil {
|
||||
|
@ -190,8 +194,9 @@ func (client WatchersClient) CreateOrUpdateResponder(resp *http.Response) (resul
|
|||
}
|
||||
|
||||
// Delete deletes the specified network watcher resource.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// networkWatcherName - the name of the network watcher.
|
||||
func (client WatchersClient) Delete(ctx context.Context, resourceGroupName string, networkWatcherName string) (result WatchersDeleteFuture, err error) {
|
||||
req, err := client.DeletePreparer(ctx, resourceGroupName, networkWatcherName)
|
||||
if err != nil {
|
||||
|
@ -232,15 +237,17 @@ func (client WatchersClient) DeletePreparer(ctx context.Context, resourceGroupNa
|
|||
// DeleteSender sends the Delete request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client WatchersClient) DeleteSender(req *http.Request) (future WatchersDeleteFuture, 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
|
||||
}
|
||||
|
||||
|
@ -257,8 +264,9 @@ func (client WatchersClient) DeleteResponder(resp *http.Response) (result autore
|
|||
}
|
||||
|
||||
// Get gets the specified network watcher by resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// networkWatcherName - the name of the network watcher.
|
||||
func (client WatchersClient) Get(ctx context.Context, resourceGroupName string, networkWatcherName string) (result Watcher, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceGroupName, networkWatcherName)
|
||||
if err != nil {
|
||||
|
@ -324,9 +332,10 @@ func (client WatchersClient) GetResponder(resp *http.Response) (result Watcher,
|
|||
|
||||
// GetAzureReachabilityReport gets the relative latency score for internet service providers from a specified location
|
||||
// to Azure regions.
|
||||
//
|
||||
// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the
|
||||
// network watcher resource. parameters is parameters that determine Azure reachability report configuration.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the network watcher resource group.
|
||||
// networkWatcherName - the name of the network watcher resource.
|
||||
// parameters - parameters that determine Azure reachability report configuration.
|
||||
func (client WatchersClient) GetAzureReachabilityReport(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AzureReachabilityReportParameters) (result WatchersGetAzureReachabilityReportFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -378,15 +387,17 @@ func (client WatchersClient) GetAzureReachabilityReportPreparer(ctx context.Cont
|
|||
// GetAzureReachabilityReportSender sends the GetAzureReachabilityReport request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client WatchersClient) GetAzureReachabilityReportSender(req *http.Request) (future WatchersGetAzureReachabilityReportFuture, 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
|
||||
}
|
||||
|
||||
|
@ -404,10 +415,10 @@ func (client WatchersClient) GetAzureReachabilityReportResponder(resp *http.Resp
|
|||
}
|
||||
|
||||
// GetFlowLogStatus queries status of flow log and traffic analytics (optional) on a specified resource.
|
||||
//
|
||||
// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the
|
||||
// network watcher resource. parameters is parameters that define a resource to query flow log and traffic
|
||||
// analytics (optional) status.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the network watcher resource group.
|
||||
// networkWatcherName - the name of the network watcher resource.
|
||||
// parameters - parameters that define a resource to query flow log and traffic analytics (optional) status.
|
||||
func (client WatchersClient) GetFlowLogStatus(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogStatusParameters) (result WatchersGetFlowLogStatusFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -456,15 +467,17 @@ func (client WatchersClient) GetFlowLogStatusPreparer(ctx context.Context, resou
|
|||
// GetFlowLogStatusSender sends the GetFlowLogStatus request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client WatchersClient) GetFlowLogStatusSender(req *http.Request) (future WatchersGetFlowLogStatusFuture, 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
|
||||
}
|
||||
|
||||
|
@ -482,9 +495,10 @@ func (client WatchersClient) GetFlowLogStatusResponder(resp *http.Response) (res
|
|||
}
|
||||
|
||||
// GetNextHop gets the next hop from the specified VM.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher.
|
||||
// parameters is parameters that define the source and destination endpoint.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// networkWatcherName - the name of the network watcher.
|
||||
// parameters - parameters that define the source and destination endpoint.
|
||||
func (client WatchersClient) GetNextHop(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters NextHopParameters) (result WatchersGetNextHopFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -535,15 +549,17 @@ func (client WatchersClient) GetNextHopPreparer(ctx context.Context, resourceGro
|
|||
// GetNextHopSender sends the GetNextHop request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client WatchersClient) GetNextHopSender(req *http.Request) (future WatchersGetNextHopFuture, 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
|
||||
}
|
||||
|
||||
|
@ -561,9 +577,10 @@ func (client WatchersClient) GetNextHopResponder(resp *http.Response) (result Ne
|
|||
}
|
||||
|
||||
// GetTopology gets the current network topology by resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher.
|
||||
// parameters is parameters that define the representation of topology.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// networkWatcherName - the name of the network watcher.
|
||||
// parameters - parameters that define the representation of topology.
|
||||
func (client WatchersClient) GetTopology(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TopologyParameters) (result Topology, err error) {
|
||||
req, err := client.GetTopologyPreparer(ctx, resourceGroupName, networkWatcherName, parameters)
|
||||
if err != nil {
|
||||
|
@ -630,9 +647,10 @@ func (client WatchersClient) GetTopologyResponder(resp *http.Response) (result T
|
|||
}
|
||||
|
||||
// GetTroubleshooting initiate troubleshooting on a specified resource
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher
|
||||
// resource. parameters is parameters that define the resource to troubleshoot.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// networkWatcherName - the name of the network watcher resource.
|
||||
// parameters - parameters that define the resource to troubleshoot.
|
||||
func (client WatchersClient) GetTroubleshooting(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TroubleshootingParameters) (result WatchersGetTroubleshootingFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -685,15 +703,17 @@ func (client WatchersClient) GetTroubleshootingPreparer(ctx context.Context, res
|
|||
// GetTroubleshootingSender sends the GetTroubleshooting request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client WatchersClient) GetTroubleshootingSender(req *http.Request) (future WatchersGetTroubleshootingFuture, 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
|
||||
}
|
||||
|
||||
|
@ -711,9 +731,10 @@ func (client WatchersClient) GetTroubleshootingResponder(resp *http.Response) (r
|
|||
}
|
||||
|
||||
// GetTroubleshootingResult get the last completed troubleshooting result on a specified resource
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher
|
||||
// resource. parameters is parameters that define the resource to query the troubleshooting result.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// networkWatcherName - the name of the network watcher resource.
|
||||
// parameters - parameters that define the resource to query the troubleshooting result.
|
||||
func (client WatchersClient) GetTroubleshootingResult(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters QueryTroubleshootingParameters) (result WatchersGetTroubleshootingResultFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -762,15 +783,17 @@ func (client WatchersClient) GetTroubleshootingResultPreparer(ctx context.Contex
|
|||
// GetTroubleshootingResultSender sends the GetTroubleshootingResult request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client WatchersClient) GetTroubleshootingResultSender(req *http.Request) (future WatchersGetTroubleshootingResultFuture, 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
|
||||
}
|
||||
|
||||
|
@ -788,9 +811,10 @@ func (client WatchersClient) GetTroubleshootingResultResponder(resp *http.Respon
|
|||
}
|
||||
|
||||
// GetVMSecurityRules gets the configured and effective security group rules on the specified VM.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher.
|
||||
// parameters is parameters that define the VM to check security groups for.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// networkWatcherName - the name of the network watcher.
|
||||
// parameters - parameters that define the VM to check security groups for.
|
||||
func (client WatchersClient) GetVMSecurityRules(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters SecurityGroupViewParameters) (result WatchersGetVMSecurityRulesFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -839,15 +863,17 @@ func (client WatchersClient) GetVMSecurityRulesPreparer(ctx context.Context, res
|
|||
// GetVMSecurityRulesSender sends the GetVMSecurityRules request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client WatchersClient) GetVMSecurityRulesSender(req *http.Request) (future WatchersGetVMSecurityRulesFuture, 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
|
||||
}
|
||||
|
||||
|
@ -865,8 +891,8 @@ func (client WatchersClient) GetVMSecurityRulesResponder(resp *http.Response) (r
|
|||
}
|
||||
|
||||
// List gets all network watchers by resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
func (client WatchersClient) List(ctx context.Context, resourceGroupName string) (result WatcherListResult, err error) {
|
||||
req, err := client.ListPreparer(ctx, resourceGroupName)
|
||||
if err != nil {
|
||||
|
@ -992,9 +1018,10 @@ func (client WatchersClient) ListAllResponder(resp *http.Response) (result Watch
|
|||
}
|
||||
|
||||
// ListAvailableProviders lists all available internet service providers for a specified Azure region.
|
||||
//
|
||||
// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the
|
||||
// network watcher resource. parameters is parameters that scope the list of available providers.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the network watcher resource group.
|
||||
// networkWatcherName - the name of the network watcher resource.
|
||||
// parameters - parameters that scope the list of available providers.
|
||||
func (client WatchersClient) ListAvailableProviders(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters AvailableProvidersListParameters) (result WatchersListAvailableProvidersFuture, err error) {
|
||||
req, err := client.ListAvailableProvidersPreparer(ctx, resourceGroupName, networkWatcherName, parameters)
|
||||
if err != nil {
|
||||
|
@ -1037,15 +1064,17 @@ func (client WatchersClient) ListAvailableProvidersPreparer(ctx context.Context,
|
|||
// ListAvailableProvidersSender sends the ListAvailableProviders request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client WatchersClient) ListAvailableProvidersSender(req *http.Request) (future WatchersListAvailableProvidersFuture, 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
|
||||
}
|
||||
|
||||
|
@ -1063,9 +1092,10 @@ func (client WatchersClient) ListAvailableProvidersResponder(resp *http.Response
|
|||
}
|
||||
|
||||
// SetFlowLogConfiguration configures flow log and traffic analytics (optional) on a specified resource.
|
||||
//
|
||||
// resourceGroupName is the name of the network watcher resource group. networkWatcherName is the name of the
|
||||
// network watcher resource. parameters is parameters that define the configuration of flow log.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the network watcher resource group.
|
||||
// networkWatcherName - the name of the network watcher resource.
|
||||
// parameters - parameters that define the configuration of flow log.
|
||||
func (client WatchersClient) SetFlowLogConfiguration(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters FlowLogInformation) (result WatchersSetFlowLogConfigurationFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -1126,15 +1156,17 @@ func (client WatchersClient) SetFlowLogConfigurationPreparer(ctx context.Context
|
|||
// SetFlowLogConfigurationSender sends the SetFlowLogConfiguration request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client WatchersClient) SetFlowLogConfigurationSender(req *http.Request) (future WatchersSetFlowLogConfigurationFuture, 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
|
||||
}
|
||||
|
||||
|
@ -1152,9 +1184,10 @@ func (client WatchersClient) SetFlowLogConfigurationResponder(resp *http.Respons
|
|||
}
|
||||
|
||||
// UpdateTags updates a network watcher tags.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher.
|
||||
// parameters is parameters supplied to update network watcher tags.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// networkWatcherName - the name of the network watcher.
|
||||
// parameters - parameters supplied to update network watcher tags.
|
||||
func (client WatchersClient) UpdateTags(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters TagsObject) (result Watcher, err error) {
|
||||
req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, networkWatcherName, parameters)
|
||||
if err != nil {
|
||||
|
@ -1221,9 +1254,10 @@ func (client WatchersClient) UpdateTagsResponder(resp *http.Response) (result Wa
|
|||
}
|
||||
|
||||
// VerifyIPFlow verify IP flow from the specified VM to a location given the currently configured NSG rules.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. networkWatcherName is the name of the network watcher.
|
||||
// parameters is parameters that define the IP flow to be verified.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group.
|
||||
// networkWatcherName - the name of the network watcher.
|
||||
// parameters - parameters that define the IP flow to be verified.
|
||||
func (client WatchersClient) VerifyIPFlow(ctx context.Context, resourceGroupName string, networkWatcherName string, parameters VerificationIPFlowParameters) (result WatchersVerifyIPFlowFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -1276,15 +1310,17 @@ func (client WatchersClient) VerifyIPFlowPreparer(ctx context.Context, resourceG
|
|||
// VerifyIPFlowSender sends the VerifyIPFlow request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client WatchersClient) VerifyIPFlowSender(req *http.Request) (future WatchersVerifyIPFlowFuture, 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
|
||||
}
|
||||
|
||||
|
|
|
@ -42,8 +42,8 @@ func NewClientWithBaseURI(baseURI string) Client {
|
|||
}
|
||||
|
||||
// Get gets details about a specified subscription.
|
||||
//
|
||||
// subscriptionID is the ID of the target subscription.
|
||||
// Parameters:
|
||||
// subscriptionID - the ID of the target subscription.
|
||||
func (client Client) Get(ctx context.Context, subscriptionID string) (result Subscription, err error) {
|
||||
req, err := client.GetPreparer(ctx, subscriptionID)
|
||||
if err != nil {
|
||||
|
@ -193,8 +193,8 @@ func (client Client) ListComplete(ctx context.Context) (result ListResultIterato
|
|||
|
||||
// ListLocations this operation provides all the locations that are available for resource providers; however, each
|
||||
// resource provider may support a subset of this list.
|
||||
//
|
||||
// subscriptionID is the ID of the target subscription.
|
||||
// Parameters:
|
||||
// subscriptionID - the ID of the target subscription.
|
||||
func (client Client) ListLocations(ctx context.Context, subscriptionID string) (result LocationListResult, err error) {
|
||||
req, err := client.ListLocationsPreparer(ctx, subscriptionID)
|
||||
if err != nil {
|
||||
|
|
|
@ -41,9 +41,10 @@ func NewDeploymentOperationsClientWithBaseURI(baseURI string, subscriptionID str
|
|||
}
|
||||
|
||||
// Get gets a deployments operation.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of
|
||||
// the deployment. operationID is the ID of the operation to get.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group. The name is case insensitive.
|
||||
// deploymentName - the name of the deployment.
|
||||
// operationID - the ID of the operation to get.
|
||||
func (client DeploymentOperationsClient) Get(ctx context.Context, resourceGroupName string, deploymentName string, operationID string) (result DeploymentOperation, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -121,9 +122,10 @@ func (client DeploymentOperationsClient) GetResponder(resp *http.Response) (resu
|
|||
}
|
||||
|
||||
// List gets all deployments operations for a deployment.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of
|
||||
// the deployment with the operation to get. top is the number of results to return.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group. The name is case insensitive.
|
||||
// deploymentName - the name of the deployment with the operation to get.
|
||||
// top - the number of results to return.
|
||||
func (client DeploymentOperationsClient) List(ctx context.Context, resourceGroupName string, deploymentName string, top *int32) (result DeploymentOperationsListResultPage, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
|
|
@ -43,9 +43,9 @@ func NewDeploymentsClientWithBaseURI(baseURI string, subscriptionID string) Depl
|
|||
// Cancel you can cancel a deployment only if the provisioningState is Accepted or Running. After the deployment is
|
||||
// canceled, the provisioningState is set to Canceled. Canceling a template deployment stops the currently running
|
||||
// template deployment and leaves the resource group partially deployed.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of
|
||||
// the deployment to cancel.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group. The name is case insensitive.
|
||||
// deploymentName - the name of the deployment to cancel.
|
||||
func (client DeploymentsClient) Cancel(ctx context.Context, resourceGroupName string, deploymentName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -121,9 +121,10 @@ func (client DeploymentsClient) CancelResponder(resp *http.Response) (result aut
|
|||
}
|
||||
|
||||
// CheckExistence checks whether the deployment exists.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group with the deployment to check. The name is case insensitive.
|
||||
// deploymentName is the name of the deployment to check.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group with the deployment to check. The name is case
|
||||
// insensitive.
|
||||
// deploymentName - the name of the deployment to check.
|
||||
func (client DeploymentsClient) CheckExistence(ctx context.Context, resourceGroupName string, deploymentName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -199,10 +200,11 @@ func (client DeploymentsClient) CheckExistenceResponder(resp *http.Response) (re
|
|||
}
|
||||
|
||||
// CreateOrUpdate you can provide the template and parameters directly in the request or link to JSON files.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to deploy the resources to. The name is case insensitive.
|
||||
// The resource group must already exist. deploymentName is the name of the deployment. parameters is additional
|
||||
// parameters supplied to the operation.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group to deploy the resources to. The name is case insensitive.
|
||||
// The resource group must already exist.
|
||||
// deploymentName - the name of the deployment.
|
||||
// parameters - additional parameters supplied to the operation.
|
||||
func (client DeploymentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment) (result DeploymentsCreateOrUpdateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -264,15 +266,17 @@ func (client DeploymentsClient) 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 DeploymentsClient) CreateOrUpdateSender(req *http.Request) (future DeploymentsCreateOrUpdateFuture, 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
|
||||
}
|
||||
|
||||
|
@ -296,9 +300,10 @@ func (client DeploymentsClient) CreateOrUpdateResponder(resp *http.Response) (re
|
|||
// process is running, a call to the URI in the Location header returns a status of 202. When the process finishes, the
|
||||
// URI in the Location header returns a status of 204 on success. If the asynchronous request failed, the URI in the
|
||||
// Location header returns an error-level status code.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group with the deployment to delete. The name is case insensitive.
|
||||
// deploymentName is the name of the deployment to delete.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group with the deployment to delete. The name is case
|
||||
// insensitive.
|
||||
// deploymentName - the name of the deployment to delete.
|
||||
func (client DeploymentsClient) Delete(ctx context.Context, resourceGroupName string, deploymentName string) (result DeploymentsDeleteFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -351,15 +356,17 @@ func (client DeploymentsClient) 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 DeploymentsClient) DeleteSender(req *http.Request) (future DeploymentsDeleteFuture, 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
|
||||
}
|
||||
|
||||
|
@ -376,9 +383,9 @@ func (client DeploymentsClient) DeleteResponder(resp *http.Response) (result aut
|
|||
}
|
||||
|
||||
// ExportTemplate exports the template used for specified deployment.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of
|
||||
// the deployment from which to get the template.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group. The name is case insensitive.
|
||||
// deploymentName - the name of the deployment from which to get the template.
|
||||
func (client DeploymentsClient) ExportTemplate(ctx context.Context, resourceGroupName string, deploymentName string) (result DeploymentExportResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -455,9 +462,9 @@ func (client DeploymentsClient) ExportTemplateResponder(resp *http.Response) (re
|
|||
}
|
||||
|
||||
// Get gets a deployment.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group. The name is case insensitive. deploymentName is the name of
|
||||
// the deployment to get.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group. The name is case insensitive.
|
||||
// deploymentName - the name of the deployment to get.
|
||||
func (client DeploymentsClient) Get(ctx context.Context, resourceGroupName string, deploymentName string) (result DeploymentExtended, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -534,10 +541,12 @@ func (client DeploymentsClient) GetResponder(resp *http.Response) (result Deploy
|
|||
}
|
||||
|
||||
// ListByResourceGroup get all the deployments for a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group with the deployments to get. The name is case insensitive.
|
||||
// filter is the filter to apply on the operation. For example, you can use $filter=provisioningState eq '{state}'.
|
||||
// top is the number of results to get. If null is passed, returns all deployments.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group with the deployments to get. The name is case
|
||||
// insensitive.
|
||||
// filter - the filter to apply on the operation. For example, you can use $filter=provisioningState eq
|
||||
// '{state}'.
|
||||
// top - the number of results to get. If null is passed, returns all deployments.
|
||||
func (client DeploymentsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, top *int32) (result DeploymentListResultPage, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -644,9 +653,11 @@ func (client DeploymentsClient) ListByResourceGroupComplete(ctx context.Context,
|
|||
|
||||
// Validate validates whether the specified template is syntactically correct and will be accepted by Azure Resource
|
||||
// Manager..
|
||||
//
|
||||
// resourceGroupName is the name of the resource group the template will be deployed to. The name is case
|
||||
// insensitive. deploymentName is the name of the deployment. parameters is parameters to validate.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group the template will be deployed to. The name is case
|
||||
// insensitive.
|
||||
// deploymentName - the name of the deployment.
|
||||
// parameters - parameters to validate.
|
||||
func (client DeploymentsClient) Validate(ctx context.Context, resourceGroupName string, deploymentName string, parameters Deployment) (result DeploymentValidateResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
|
|
@ -41,8 +41,8 @@ func NewGroupsClientWithBaseURI(baseURI string, subscriptionID string) GroupsCli
|
|||
}
|
||||
|
||||
// CheckExistence checks whether a resource group exists.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to check. The name is case insensitive.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group to check. The name is case insensitive.
|
||||
func (client GroupsClient) CheckExistence(ctx context.Context, resourceGroupName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -113,9 +113,9 @@ func (client GroupsClient) CheckExistenceResponder(resp *http.Response) (result
|
|||
}
|
||||
|
||||
// CreateOrUpdate creates or updates a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to create or update. parameters is parameters supplied to
|
||||
// the create or update a resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group to create or update.
|
||||
// parameters - parameters supplied to the create or update a resource group.
|
||||
func (client GroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, parameters Group) (result Group, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -192,8 +192,8 @@ func (client GroupsClient) CreateOrUpdateResponder(resp *http.Response) (result
|
|||
|
||||
// Delete when you delete a resource group, all of its resources are also deleted. Deleting a resource group deletes
|
||||
// all of its template deployments and currently stored operations.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to delete. The name is case insensitive.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group to delete. The name is case insensitive.
|
||||
func (client GroupsClient) Delete(ctx context.Context, resourceGroupName string) (result GroupsDeleteFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -241,15 +241,17 @@ func (client GroupsClient) 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 GroupsClient) DeleteSender(req *http.Request) (future GroupsDeleteFuture, 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
|
||||
}
|
||||
|
||||
|
@ -266,9 +268,9 @@ func (client GroupsClient) DeleteResponder(resp *http.Response) (result autorest
|
|||
}
|
||||
|
||||
// ExportTemplate captures the specified resource group as a template.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to export as a template. parameters is parameters for
|
||||
// exporting the template.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group to export as a template.
|
||||
// parameters - parameters for exporting the template.
|
||||
func (client GroupsClient) ExportTemplate(ctx context.Context, resourceGroupName string, parameters ExportTemplateRequest) (result GroupExportResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -342,8 +344,8 @@ func (client GroupsClient) ExportTemplateResponder(resp *http.Response) (result
|
|||
}
|
||||
|
||||
// Get gets a resource group.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to get. The name is case insensitive.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group to get. The name is case insensitive.
|
||||
func (client GroupsClient) Get(ctx context.Context, resourceGroupName string) (result Group, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -415,9 +417,9 @@ func (client GroupsClient) GetResponder(resp *http.Response) (result Group, err
|
|||
}
|
||||
|
||||
// List gets all the resource groups for a subscription.
|
||||
//
|
||||
// filter is the filter to apply on the operation. top is the number of results to return. If null is passed,
|
||||
// returns all resource groups.
|
||||
// Parameters:
|
||||
// filter - the filter to apply on the operation.
|
||||
// top - the number of results to return. If null is passed, returns all resource groups.
|
||||
func (client GroupsClient) List(ctx context.Context, filter string, top *int32) (result GroupListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, filter, top)
|
||||
|
@ -515,9 +517,9 @@ func (client GroupsClient) ListComplete(ctx context.Context, filter string, top
|
|||
|
||||
// Update resource groups can be updated through a simple PATCH operation to a group address. The format of the request
|
||||
// is the same as that for creating a resource group. If a field is unspecified, the current value is retained.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group to update. The name is case insensitive. parameters is
|
||||
// parameters supplied to update a resource group.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group to update. The name is case insensitive.
|
||||
// parameters - parameters supplied to update a resource group.
|
||||
func (client GroupsClient) Update(ctx context.Context, resourceGroupName string, parameters GroupPatchable) (result Group, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
|
|
@ -104,12 +104,11 @@ type BasicDependency struct {
|
|||
// CreateOrUpdateByIDFuture an abstraction for monitoring and retrieving the results of a long-running operation.
|
||||
type CreateOrUpdateByIDFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future CreateOrUpdateByIDFuture) Result(client Client) (gr GenericResource, err error) {
|
||||
func (future *CreateOrUpdateByIDFuture) Result(client Client) (gr GenericResource, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
|
@ -117,34 +116,15 @@ func (future CreateOrUpdateByIDFuture) Result(client Client) (gr GenericResource
|
|||
return
|
||||
}
|
||||
if !done {
|
||||
return gr, azure.NewAsyncOpIncompleteError("resources.CreateOrUpdateByIDFuture")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
gr, err = client.CreateOrUpdateByIDResponder(future.Response())
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateByIDFuture", "Result", future.Response(), "Failure responding to request")
|
||||
}
|
||||
err = azure.NewAsyncOpIncompleteError("resources.CreateOrUpdateByIDFuture")
|
||||
return
|
||||
}
|
||||
var req *http.Request
|
||||
var resp *http.Response
|
||||
if future.PollingURL() != "" {
|
||||
req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
|
||||
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
|
||||
gr, err = client.CreateOrUpdateByIDResponder(gr.Response.Response)
|
||||
if err != nil {
|
||||
return
|
||||
err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateByIDFuture", "Result", gr.Response.Response, "Failure responding to request")
|
||||
}
|
||||
} else {
|
||||
req = autorest.ChangeToGet(future.req)
|
||||
}
|
||||
resp, err = autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateByIDFuture", "Result", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
gr, err = client.CreateOrUpdateByIDResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateByIDFuture", "Result", resp, "Failure responding to request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -152,12 +132,11 @@ func (future CreateOrUpdateByIDFuture) Result(client Client) (gr GenericResource
|
|||
// CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
|
||||
type CreateOrUpdateFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future CreateOrUpdateFuture) Result(client Client) (gr GenericResource, err error) {
|
||||
func (future *CreateOrUpdateFuture) Result(client Client) (gr GenericResource, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
|
@ -165,34 +144,15 @@ func (future CreateOrUpdateFuture) Result(client Client) (gr GenericResource, er
|
|||
return
|
||||
}
|
||||
if !done {
|
||||
return gr, azure.NewAsyncOpIncompleteError("resources.CreateOrUpdateFuture")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
gr, err = client.CreateOrUpdateResponder(future.Response())
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request")
|
||||
}
|
||||
err = azure.NewAsyncOpIncompleteError("resources.CreateOrUpdateFuture")
|
||||
return
|
||||
}
|
||||
var req *http.Request
|
||||
var resp *http.Response
|
||||
if future.PollingURL() != "" {
|
||||
req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
|
||||
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
|
||||
gr, err = client.CreateOrUpdateResponder(gr.Response.Response)
|
||||
if err != nil {
|
||||
return
|
||||
err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateFuture", "Result", gr.Response.Response, "Failure responding to request")
|
||||
}
|
||||
} else {
|
||||
req = autorest.ChangeToGet(future.req)
|
||||
}
|
||||
resp, err = autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateFuture", "Result", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
gr, err = client.CreateOrUpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.CreateOrUpdateFuture", "Result", resp, "Failure responding to request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -206,12 +166,11 @@ type DebugSetting struct {
|
|||
// DeleteByIDFuture an abstraction for monitoring and retrieving the results of a long-running operation.
|
||||
type DeleteByIDFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future DeleteByIDFuture) Result(client Client) (ar autorest.Response, err error) {
|
||||
func (future *DeleteByIDFuture) Result(client Client) (ar autorest.Response, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
|
@ -219,47 +178,21 @@ func (future DeleteByIDFuture) Result(client Client) (ar autorest.Response, err
|
|||
return
|
||||
}
|
||||
if !done {
|
||||
return ar, azure.NewAsyncOpIncompleteError("resources.DeleteByIDFuture")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
ar, err = client.DeleteByIDResponder(future.Response())
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.DeleteByIDFuture", "Result", future.Response(), "Failure responding to request")
|
||||
}
|
||||
err = azure.NewAsyncOpIncompleteError("resources.DeleteByIDFuture")
|
||||
return
|
||||
}
|
||||
var req *http.Request
|
||||
var resp *http.Response
|
||||
if future.PollingURL() != "" {
|
||||
req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
req = autorest.ChangeToGet(future.req)
|
||||
}
|
||||
resp, err = autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.DeleteByIDFuture", "Result", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
ar, err = client.DeleteByIDResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.DeleteByIDFuture", "Result", resp, "Failure responding to request")
|
||||
}
|
||||
ar.Response = future.Response()
|
||||
return
|
||||
}
|
||||
|
||||
// DeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
|
||||
type DeleteFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future DeleteFuture) Result(client Client) (ar autorest.Response, err error) {
|
||||
func (future *DeleteFuture) Result(client Client) (ar autorest.Response, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
|
@ -267,35 +200,10 @@ func (future DeleteFuture) Result(client Client) (ar autorest.Response, err erro
|
|||
return
|
||||
}
|
||||
if !done {
|
||||
return ar, azure.NewAsyncOpIncompleteError("resources.DeleteFuture")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
ar, err = client.DeleteResponder(future.Response())
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.DeleteFuture", "Result", future.Response(), "Failure responding to request")
|
||||
}
|
||||
err = azure.NewAsyncOpIncompleteError("resources.DeleteFuture")
|
||||
return
|
||||
}
|
||||
var req *http.Request
|
||||
var resp *http.Response
|
||||
if future.PollingURL() != "" {
|
||||
req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
req = autorest.ChangeToGet(future.req)
|
||||
}
|
||||
resp, err = autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.DeleteFuture", "Result", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
ar, err = client.DeleteResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.DeleteFuture", "Result", resp, "Failure responding to request")
|
||||
}
|
||||
ar.Response = future.Response()
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -628,12 +536,11 @@ type DeploymentPropertiesExtended struct {
|
|||
// operation.
|
||||
type DeploymentsCreateOrUpdateFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future DeploymentsCreateOrUpdateFuture) Result(client DeploymentsClient) (de DeploymentExtended, err error) {
|
||||
func (future *DeploymentsCreateOrUpdateFuture) Result(client DeploymentsClient) (de DeploymentExtended, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
|
@ -641,34 +548,15 @@ func (future DeploymentsCreateOrUpdateFuture) Result(client DeploymentsClient) (
|
|||
return
|
||||
}
|
||||
if !done {
|
||||
return de, azure.NewAsyncOpIncompleteError("resources.DeploymentsCreateOrUpdateFuture")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
de, err = client.CreateOrUpdateResponder(future.Response())
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.DeploymentsCreateOrUpdateFuture", "Result", future.Response(), "Failure responding to request")
|
||||
}
|
||||
err = azure.NewAsyncOpIncompleteError("resources.DeploymentsCreateOrUpdateFuture")
|
||||
return
|
||||
}
|
||||
var req *http.Request
|
||||
var resp *http.Response
|
||||
if future.PollingURL() != "" {
|
||||
req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
|
||||
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if de.Response.Response, err = future.GetResult(sender); err == nil && de.Response.Response.StatusCode != http.StatusNoContent {
|
||||
de, err = client.CreateOrUpdateResponder(de.Response.Response)
|
||||
if err != nil {
|
||||
return
|
||||
err = autorest.NewErrorWithError(err, "resources.DeploymentsCreateOrUpdateFuture", "Result", de.Response.Response, "Failure responding to request")
|
||||
}
|
||||
} else {
|
||||
req = autorest.ChangeToGet(future.req)
|
||||
}
|
||||
resp, err = autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.DeploymentsCreateOrUpdateFuture", "Result", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
de, err = client.CreateOrUpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.DeploymentsCreateOrUpdateFuture", "Result", resp, "Failure responding to request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -676,12 +564,11 @@ func (future DeploymentsCreateOrUpdateFuture) Result(client DeploymentsClient) (
|
|||
// DeploymentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
|
||||
type DeploymentsDeleteFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future DeploymentsDeleteFuture) Result(client DeploymentsClient) (ar autorest.Response, err error) {
|
||||
func (future *DeploymentsDeleteFuture) Result(client DeploymentsClient) (ar autorest.Response, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
|
@ -689,35 +576,10 @@ func (future DeploymentsDeleteFuture) Result(client DeploymentsClient) (ar autor
|
|||
return
|
||||
}
|
||||
if !done {
|
||||
return ar, azure.NewAsyncOpIncompleteError("resources.DeploymentsDeleteFuture")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
ar, err = client.DeleteResponder(future.Response())
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.DeploymentsDeleteFuture", "Result", future.Response(), "Failure responding to request")
|
||||
}
|
||||
err = azure.NewAsyncOpIncompleteError("resources.DeploymentsDeleteFuture")
|
||||
return
|
||||
}
|
||||
var req *http.Request
|
||||
var resp *http.Response
|
||||
if future.PollingURL() != "" {
|
||||
req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
req = autorest.ChangeToGet(future.req)
|
||||
}
|
||||
resp, err = autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.DeploymentsDeleteFuture", "Result", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
ar, err = client.DeleteResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.DeploymentsDeleteFuture", "Result", resp, "Failure responding to request")
|
||||
}
|
||||
ar.Response = future.Response()
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -1009,12 +871,11 @@ type GroupProperties struct {
|
|||
// GroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation.
|
||||
type GroupsDeleteFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future GroupsDeleteFuture) Result(client GroupsClient) (ar autorest.Response, err error) {
|
||||
func (future *GroupsDeleteFuture) Result(client GroupsClient) (ar autorest.Response, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
|
@ -1022,35 +883,10 @@ func (future GroupsDeleteFuture) Result(client GroupsClient) (ar autorest.Respon
|
|||
return
|
||||
}
|
||||
if !done {
|
||||
return ar, azure.NewAsyncOpIncompleteError("resources.GroupsDeleteFuture")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
ar, err = client.DeleteResponder(future.Response())
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupsDeleteFuture", "Result", future.Response(), "Failure responding to request")
|
||||
}
|
||||
err = azure.NewAsyncOpIncompleteError("resources.GroupsDeleteFuture")
|
||||
return
|
||||
}
|
||||
var req *http.Request
|
||||
var resp *http.Response
|
||||
if future.PollingURL() != "" {
|
||||
req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
req = autorest.ChangeToGet(future.req)
|
||||
}
|
||||
resp, err = autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupsDeleteFuture", "Result", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
ar, err = client.DeleteResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.GroupsDeleteFuture", "Result", resp, "Failure responding to request")
|
||||
}
|
||||
ar.Response = future.Response()
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -1195,12 +1031,11 @@ type MoveInfo struct {
|
|||
// MoveResourcesFuture an abstraction for monitoring and retrieving the results of a long-running operation.
|
||||
type MoveResourcesFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future MoveResourcesFuture) Result(client Client) (ar autorest.Response, err error) {
|
||||
func (future *MoveResourcesFuture) Result(client Client) (ar autorest.Response, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
|
@ -1208,35 +1043,10 @@ func (future MoveResourcesFuture) Result(client Client) (ar autorest.Response, e
|
|||
return
|
||||
}
|
||||
if !done {
|
||||
return ar, azure.NewAsyncOpIncompleteError("resources.MoveResourcesFuture")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
ar, err = client.MoveResourcesResponder(future.Response())
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.MoveResourcesFuture", "Result", future.Response(), "Failure responding to request")
|
||||
}
|
||||
err = azure.NewAsyncOpIncompleteError("resources.MoveResourcesFuture")
|
||||
return
|
||||
}
|
||||
var req *http.Request
|
||||
var resp *http.Response
|
||||
if future.PollingURL() != "" {
|
||||
req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
req = autorest.ChangeToGet(future.req)
|
||||
}
|
||||
resp, err = autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.MoveResourcesFuture", "Result", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
ar, err = client.MoveResourcesResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.MoveResourcesFuture", "Result", resp, "Failure responding to request")
|
||||
}
|
||||
ar.Response = future.Response()
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -1656,12 +1466,11 @@ type TemplateLink struct {
|
|||
// UpdateByIDFuture an abstraction for monitoring and retrieving the results of a long-running operation.
|
||||
type UpdateByIDFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future UpdateByIDFuture) Result(client Client) (gr GenericResource, err error) {
|
||||
func (future *UpdateByIDFuture) Result(client Client) (gr GenericResource, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
|
@ -1669,34 +1478,15 @@ func (future UpdateByIDFuture) Result(client Client) (gr GenericResource, err er
|
|||
return
|
||||
}
|
||||
if !done {
|
||||
return gr, azure.NewAsyncOpIncompleteError("resources.UpdateByIDFuture")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
gr, err = client.UpdateByIDResponder(future.Response())
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.UpdateByIDFuture", "Result", future.Response(), "Failure responding to request")
|
||||
}
|
||||
err = azure.NewAsyncOpIncompleteError("resources.UpdateByIDFuture")
|
||||
return
|
||||
}
|
||||
var req *http.Request
|
||||
var resp *http.Response
|
||||
if future.PollingURL() != "" {
|
||||
req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
|
||||
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
|
||||
gr, err = client.UpdateByIDResponder(gr.Response.Response)
|
||||
if err != nil {
|
||||
return
|
||||
err = autorest.NewErrorWithError(err, "resources.UpdateByIDFuture", "Result", gr.Response.Response, "Failure responding to request")
|
||||
}
|
||||
} else {
|
||||
req = autorest.ChangeToGet(future.req)
|
||||
}
|
||||
resp, err = autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.UpdateByIDFuture", "Result", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
gr, err = client.UpdateByIDResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.UpdateByIDFuture", "Result", resp, "Failure responding to request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -1704,12 +1494,11 @@ func (future UpdateByIDFuture) Result(client Client) (gr GenericResource, err er
|
|||
// UpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
|
||||
type UpdateFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future UpdateFuture) Result(client Client) (gr GenericResource, err error) {
|
||||
func (future *UpdateFuture) Result(client Client) (gr GenericResource, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
|
@ -1717,34 +1506,15 @@ func (future UpdateFuture) Result(client Client) (gr GenericResource, err error)
|
|||
return
|
||||
}
|
||||
if !done {
|
||||
return gr, azure.NewAsyncOpIncompleteError("resources.UpdateFuture")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
gr, err = client.UpdateResponder(future.Response())
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.UpdateFuture", "Result", future.Response(), "Failure responding to request")
|
||||
}
|
||||
err = azure.NewAsyncOpIncompleteError("resources.UpdateFuture")
|
||||
return
|
||||
}
|
||||
var req *http.Request
|
||||
var resp *http.Response
|
||||
if future.PollingURL() != "" {
|
||||
req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
|
||||
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if gr.Response.Response, err = future.GetResult(sender); err == nil && gr.Response.Response.StatusCode != http.StatusNoContent {
|
||||
gr, err = client.UpdateResponder(gr.Response.Response)
|
||||
if err != nil {
|
||||
return
|
||||
err = autorest.NewErrorWithError(err, "resources.UpdateFuture", "Result", gr.Response.Response, "Failure responding to request")
|
||||
}
|
||||
} else {
|
||||
req = autorest.ChangeToGet(future.req)
|
||||
}
|
||||
resp, err = autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.UpdateFuture", "Result", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
gr, err = client.UpdateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.UpdateFuture", "Result", resp, "Failure responding to request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
@ -1753,12 +1523,11 @@ func (future UpdateFuture) Result(client Client) (gr GenericResource, err error)
|
|||
// operation.
|
||||
type ValidateMoveResourcesFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future ValidateMoveResourcesFuture) Result(client Client) (ar autorest.Response, err error) {
|
||||
func (future *ValidateMoveResourcesFuture) Result(client Client) (ar autorest.Response, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
|
@ -1766,34 +1535,9 @@ func (future ValidateMoveResourcesFuture) Result(client Client) (ar autorest.Res
|
|||
return
|
||||
}
|
||||
if !done {
|
||||
return ar, azure.NewAsyncOpIncompleteError("resources.ValidateMoveResourcesFuture")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
ar, err = client.ValidateMoveResourcesResponder(future.Response())
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.ValidateMoveResourcesFuture", "Result", future.Response(), "Failure responding to request")
|
||||
}
|
||||
err = azure.NewAsyncOpIncompleteError("resources.ValidateMoveResourcesFuture")
|
||||
return
|
||||
}
|
||||
var req *http.Request
|
||||
var resp *http.Response
|
||||
if future.PollingURL() != "" {
|
||||
req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
} else {
|
||||
req = autorest.ChangeToGet(future.req)
|
||||
}
|
||||
resp, err = autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.ValidateMoveResourcesFuture", "Result", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
ar, err = client.ValidateMoveResourcesResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "resources.ValidateMoveResourcesFuture", "Result", resp, "Failure responding to request")
|
||||
}
|
||||
ar.Response = future.Response()
|
||||
return
|
||||
}
|
||||
|
|
|
@ -40,9 +40,10 @@ func NewProvidersClientWithBaseURI(baseURI string, subscriptionID string) Provid
|
|||
}
|
||||
|
||||
// Get gets the specified resource provider.
|
||||
//
|
||||
// resourceProviderNamespace is the namespace of the resource provider. expand is the $expand query parameter. For
|
||||
// example, to include property aliases in response, use $expand=resourceTypes/aliases.
|
||||
// Parameters:
|
||||
// resourceProviderNamespace - the namespace of the resource provider.
|
||||
// expand - the $expand query parameter. For example, to include property aliases in response, use
|
||||
// $expand=resourceTypes/aliases.
|
||||
func (client ProvidersClient) Get(ctx context.Context, resourceProviderNamespace string, expand string) (result Provider, err error) {
|
||||
req, err := client.GetPreparer(ctx, resourceProviderNamespace, expand)
|
||||
if err != nil {
|
||||
|
@ -109,10 +110,11 @@ func (client ProvidersClient) GetResponder(resp *http.Response) (result Provider
|
|||
}
|
||||
|
||||
// List gets all resource providers for a subscription.
|
||||
//
|
||||
// top is the number of results to return. If null is passed returns all deployments. expand is the properties to
|
||||
// include in the results. For example, use &$expand=metadata in the query string to retrieve resource provider
|
||||
// metadata. To include property aliases in response, use $expand=resourceTypes/aliases.
|
||||
// Parameters:
|
||||
// top - the number of results to return. If null is passed returns all deployments.
|
||||
// expand - the properties to include in the results. For example, use &$expand=metadata in the query string to
|
||||
// retrieve resource provider metadata. To include property aliases in response, use
|
||||
// $expand=resourceTypes/aliases.
|
||||
func (client ProvidersClient) List(ctx context.Context, top *int32, expand string) (result ProviderListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, top, expand)
|
||||
|
@ -209,8 +211,8 @@ func (client ProvidersClient) ListComplete(ctx context.Context, top *int32, expa
|
|||
}
|
||||
|
||||
// Register registers a subscription with a resource provider.
|
||||
//
|
||||
// resourceProviderNamespace is the namespace of the resource provider to register.
|
||||
// Parameters:
|
||||
// resourceProviderNamespace - the namespace of the resource provider to register.
|
||||
func (client ProvidersClient) Register(ctx context.Context, resourceProviderNamespace string) (result Provider, err error) {
|
||||
req, err := client.RegisterPreparer(ctx, resourceProviderNamespace)
|
||||
if err != nil {
|
||||
|
@ -274,8 +276,8 @@ func (client ProvidersClient) RegisterResponder(resp *http.Response) (result Pro
|
|||
}
|
||||
|
||||
// Unregister unregisters a subscription from a resource provider.
|
||||
//
|
||||
// resourceProviderNamespace is the namespace of the resource provider to unregister.
|
||||
// Parameters:
|
||||
// resourceProviderNamespace - the namespace of the resource provider to unregister.
|
||||
func (client ProvidersClient) Unregister(ctx context.Context, resourceProviderNamespace string) (result Provider, err error) {
|
||||
req, err := client.UnregisterPreparer(ctx, resourceProviderNamespace)
|
||||
if err != nil {
|
||||
|
|
|
@ -41,11 +41,13 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client {
|
|||
}
|
||||
|
||||
// CheckExistence checks whether a resource exists.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group containing the resource to check. The name is case
|
||||
// insensitive. resourceProviderNamespace is the resource provider of the resource to check. parentResourcePath is
|
||||
// the parent resource identity. resourceType is the resource type. resourceName is the name of the resource to
|
||||
// check whether it exists.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group containing the resource to check. The name is case
|
||||
// insensitive.
|
||||
// resourceProviderNamespace - the resource provider of the resource to check.
|
||||
// parentResourcePath - the parent resource identity.
|
||||
// resourceType - the resource type.
|
||||
// resourceName - the name of the resource to check whether it exists.
|
||||
func (client Client) CheckExistence(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -120,8 +122,8 @@ func (client Client) CheckExistenceResponder(resp *http.Response) (result autore
|
|||
}
|
||||
|
||||
// CheckExistenceByID checks by ID whether a resource exists.
|
||||
//
|
||||
// resourceID is the fully qualified ID of the resource, including the resource name and resource type. Use the
|
||||
// Parameters:
|
||||
// resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the
|
||||
// format,
|
||||
// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
||||
func (client Client) CheckExistenceByID(ctx context.Context, resourceID string) (result autorest.Response, err error) {
|
||||
|
@ -185,11 +187,13 @@ func (client Client) CheckExistenceByIDResponder(resp *http.Response) (result au
|
|||
}
|
||||
|
||||
// CreateOrUpdate creates a resource.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group for the resource. The name is case insensitive.
|
||||
// resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the parent resource
|
||||
// identity. resourceType is the resource type of the resource to create. resourceName is the name of the resource
|
||||
// to create. parameters is parameters for creating or updating the resource.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group for the resource. The name is case insensitive.
|
||||
// resourceProviderNamespace - the namespace of the resource provider.
|
||||
// parentResourcePath - the parent resource identity.
|
||||
// resourceType - the resource type of the resource to create.
|
||||
// resourceName - the name of the resource to create.
|
||||
// parameters - parameters for creating or updating the resource.
|
||||
func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result CreateOrUpdateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -246,15 +250,17 @@ func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupNa
|
|||
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) CreateOrUpdateSender(req *http.Request) (future CreateOrUpdateFuture, 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, http.StatusAccepted))
|
||||
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -272,11 +278,11 @@ func (client Client) CreateOrUpdateResponder(resp *http.Response) (result Generi
|
|||
}
|
||||
|
||||
// CreateOrUpdateByID create a resource by ID.
|
||||
//
|
||||
// resourceID is the fully qualified ID of the resource, including the resource name and resource type. Use the
|
||||
// Parameters:
|
||||
// resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the
|
||||
// format,
|
||||
// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
||||
// parameters is create or update resource parameters.
|
||||
// parameters - create or update resource parameters.
|
||||
func (client Client) CreateOrUpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result CreateOrUpdateByIDFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: parameters,
|
||||
|
@ -324,15 +330,17 @@ func (client Client) CreateOrUpdateByIDPreparer(ctx context.Context, resourceID
|
|||
// CreateOrUpdateByIDSender sends the CreateOrUpdateByID request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) CreateOrUpdateByIDSender(req *http.Request) (future CreateOrUpdateByIDFuture, err error) {
|
||||
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
future.Future = azure.NewFuture(req)
|
||||
future.req = req
|
||||
_, err = future.Done(sender)
|
||||
var resp *http.Response
|
||||
resp, err = autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
err = autorest.Respond(future.Response(),
|
||||
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted))
|
||||
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -350,10 +358,13 @@ func (client Client) CreateOrUpdateByIDResponder(resp *http.Response) (result Ge
|
|||
}
|
||||
|
||||
// Delete deletes a resource.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group that contains the resource to delete. The name is case
|
||||
// insensitive. resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the
|
||||
// parent resource identity. resourceType is the resource type. resourceName is the name of the resource to delete.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group that contains the resource to delete. The name is case
|
||||
// insensitive.
|
||||
// resourceProviderNamespace - the namespace of the resource provider.
|
||||
// parentResourcePath - the parent resource identity.
|
||||
// resourceType - the resource type.
|
||||
// resourceName - the name of the resource to delete.
|
||||
func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result DeleteFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -405,15 +416,17 @@ func (client Client) DeletePreparer(ctx context.Context, resourceGroupName strin
|
|||
// DeleteSender sends the Delete request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) DeleteSender(req *http.Request) (future DeleteFuture, 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
|
||||
}
|
||||
|
||||
|
@ -430,8 +443,8 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo
|
|||
}
|
||||
|
||||
// DeleteByID deletes a resource by ID.
|
||||
//
|
||||
// resourceID is the fully qualified ID of the resource, including the resource name and resource type. Use the
|
||||
// Parameters:
|
||||
// resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the
|
||||
// format,
|
||||
// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
||||
func (client Client) DeleteByID(ctx context.Context, resourceID string) (result DeleteByIDFuture, err error) {
|
||||
|
@ -472,15 +485,17 @@ func (client Client) DeleteByIDPreparer(ctx context.Context, resourceID string)
|
|||
// DeleteByIDSender sends the DeleteByID request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) DeleteByIDSender(req *http.Request) (future DeleteByIDFuture, err error) {
|
||||
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
future.Future = azure.NewFuture(req)
|
||||
future.req = req
|
||||
_, err = future.Done(sender)
|
||||
var resp *http.Response
|
||||
resp, err = autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
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
|
||||
}
|
||||
|
||||
|
@ -497,11 +512,13 @@ func (client Client) DeleteByIDResponder(resp *http.Response) (result autorest.R
|
|||
}
|
||||
|
||||
// Get gets a resource.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group containing the resource to get. The name is case
|
||||
// insensitive. resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the
|
||||
// parent resource identity. resourceType is the resource type of the resource. resourceName is the name of the
|
||||
// resource to get.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group containing the resource to get. The name is case
|
||||
// insensitive.
|
||||
// resourceProviderNamespace - the namespace of the resource provider.
|
||||
// parentResourcePath - the parent resource identity.
|
||||
// resourceType - the resource type of the resource.
|
||||
// resourceName - the name of the resource to get.
|
||||
func (client Client) Get(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result GenericResource, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -577,8 +594,8 @@ func (client Client) GetResponder(resp *http.Response) (result GenericResource,
|
|||
}
|
||||
|
||||
// GetByID gets a resource by ID.
|
||||
//
|
||||
// resourceID is the fully qualified ID of the resource, including the resource name and resource type. Use the
|
||||
// Parameters:
|
||||
// resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the
|
||||
// format,
|
||||
// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
||||
func (client Client) GetByID(ctx context.Context, resourceID string) (result GenericResource, err error) {
|
||||
|
@ -643,9 +660,10 @@ func (client Client) GetByIDResponder(resp *http.Response) (result GenericResour
|
|||
}
|
||||
|
||||
// List get all the resources in a subscription.
|
||||
//
|
||||
// filter is the filter to apply on the operation. expand is the $expand query parameter. top is the number of
|
||||
// results to return. If null is passed, returns all resource groups.
|
||||
// Parameters:
|
||||
// filter - the filter to apply on the operation.
|
||||
// expand - the $expand query parameter.
|
||||
// top - the number of results to return. If null is passed, returns all resource groups.
|
||||
func (client Client) List(ctx context.Context, filter string, expand string, top *int32) (result ListResultPage, err error) {
|
||||
result.fn = client.listNextResults
|
||||
req, err := client.ListPreparer(ctx, filter, expand, top)
|
||||
|
@ -745,10 +763,11 @@ func (client Client) ListComplete(ctx context.Context, filter string, expand str
|
|||
}
|
||||
|
||||
// ListByResourceGroup get all the resources for a resource group.
|
||||
//
|
||||
// resourceGroupName is the resource group with the resources to get. filter is the filter to apply on the
|
||||
// operation. expand is the $expand query parameter top is the number of results to return. If null is passed,
|
||||
// returns all resources.
|
||||
// Parameters:
|
||||
// resourceGroupName - the resource group with the resources to get.
|
||||
// filter - the filter to apply on the operation.
|
||||
// expand - the $expand query parameter
|
||||
// top - the number of results to return. If null is passed, returns all resources.
|
||||
func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, expand string, top *int32) (result ListResultPage, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -859,9 +878,9 @@ func (client Client) ListByResourceGroupComplete(ctx context.Context, resourceGr
|
|||
// MoveResources the resources to move must be in the same source resource group. The target resource group may be in a
|
||||
// different subscription. When moving resources, both the source group and the target group are locked for the
|
||||
// duration of the operation. Write and delete operations are blocked on the groups until the move completes.
|
||||
//
|
||||
// sourceResourceGroupName is the name of the resource group containing the resources to move. parameters is
|
||||
// parameters for moving resources.
|
||||
// Parameters:
|
||||
// sourceResourceGroupName - the name of the resource group containing the resources to move.
|
||||
// parameters - parameters for moving resources.
|
||||
func (client Client) MoveResources(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo) (result MoveResourcesFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: sourceResourceGroupName,
|
||||
|
@ -911,15 +930,17 @@ func (client Client) MoveResourcesPreparer(ctx context.Context, sourceResourceGr
|
|||
// MoveResourcesSender sends the MoveResources request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) MoveResourcesSender(req *http.Request) (future MoveResourcesFuture, 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
|
||||
}
|
||||
|
||||
|
@ -936,11 +957,13 @@ func (client Client) MoveResourcesResponder(resp *http.Response) (result autores
|
|||
}
|
||||
|
||||
// Update updates a resource.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group for the resource. The name is case insensitive.
|
||||
// resourceProviderNamespace is the namespace of the resource provider. parentResourcePath is the parent resource
|
||||
// identity. resourceType is the resource type of the resource to update. resourceName is the name of the resource
|
||||
// to update. parameters is parameters for updating the resource.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group for the resource. The name is case insensitive.
|
||||
// resourceProviderNamespace - the namespace of the resource provider.
|
||||
// parentResourcePath - the parent resource identity.
|
||||
// resourceType - the resource type of the resource to update.
|
||||
// resourceName - the name of the resource to update.
|
||||
// parameters - parameters for updating the resource.
|
||||
func (client Client) Update(ctx context.Context, resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result UpdateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -994,15 +1017,17 @@ func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName strin
|
|||
// UpdateSender sends the Update request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) UpdateSender(req *http.Request) (future UpdateFuture, 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
|
||||
}
|
||||
|
||||
|
@ -1020,11 +1045,11 @@ func (client Client) UpdateResponder(resp *http.Response) (result GenericResourc
|
|||
}
|
||||
|
||||
// UpdateByID updates a resource by ID.
|
||||
//
|
||||
// resourceID is the fully qualified ID of the resource, including the resource name and resource type. Use the
|
||||
// Parameters:
|
||||
// resourceID - the fully qualified ID of the resource, including the resource name and resource type. Use the
|
||||
// format,
|
||||
// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
||||
// parameters is update resource parameters.
|
||||
// parameters - update resource parameters.
|
||||
func (client Client) UpdateByID(ctx context.Context, resourceID string, parameters GenericResource) (result UpdateByIDFuture, err error) {
|
||||
req, err := client.UpdateByIDPreparer(ctx, resourceID, parameters)
|
||||
if err != nil {
|
||||
|
@ -1065,15 +1090,17 @@ func (client Client) UpdateByIDPreparer(ctx context.Context, resourceID string,
|
|||
// UpdateByIDSender sends the UpdateByID request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) UpdateByIDSender(req *http.Request) (future UpdateByIDFuture, err error) {
|
||||
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
future.Future = azure.NewFuture(req)
|
||||
future.req = req
|
||||
_, err = future.Done(sender)
|
||||
var resp *http.Response
|
||||
resp, err = autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
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
|
||||
}
|
||||
|
||||
|
@ -1095,9 +1122,9 @@ func (client Client) UpdateByIDResponder(resp *http.Response) (result GenericRes
|
|||
// subscription. If validation succeeds, it returns HTTP response code 204 (no content). If validation fails, it
|
||||
// returns HTTP response code 409 (Conflict) with an error message. Retrieve the URL in the Location header value to
|
||||
// check the result of the long-running operation.
|
||||
//
|
||||
// sourceResourceGroupName is the name of the resource group containing the resources to validate for move.
|
||||
// parameters is parameters for moving resources.
|
||||
// Parameters:
|
||||
// sourceResourceGroupName - the name of the resource group containing the resources to validate for move.
|
||||
// parameters - parameters for moving resources.
|
||||
func (client Client) ValidateMoveResources(ctx context.Context, sourceResourceGroupName string, parameters MoveInfo) (result ValidateMoveResourcesFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: sourceResourceGroupName,
|
||||
|
@ -1147,15 +1174,17 @@ func (client Client) ValidateMoveResourcesPreparer(ctx context.Context, sourceRe
|
|||
// ValidateMoveResourcesSender sends the ValidateMoveResources request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client Client) ValidateMoveResourcesSender(req *http.Request) (future ValidateMoveResourcesFuture, 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, http.StatusConflict))
|
||||
err = autorest.Respond(resp, azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent, http.StatusConflict))
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
future.Future, err = azure.NewFutureFromResponse(resp)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
@ -41,8 +41,8 @@ func NewTagsClientWithBaseURI(baseURI string, subscriptionID string) TagsClient
|
|||
|
||||
// CreateOrUpdate the tag name can have a maximum of 512 characters and is case insensitive. Tag names created by Azure
|
||||
// have prefixes of microsoft, azure, or windows. You cannot create tags with one of these prefixes.
|
||||
//
|
||||
// tagName is the name of the tag to create.
|
||||
// Parameters:
|
||||
// tagName - the name of the tag to create.
|
||||
func (client TagsClient) CreateOrUpdate(ctx context.Context, tagName string) (result TagDetails, err error) {
|
||||
req, err := client.CreateOrUpdatePreparer(ctx, tagName)
|
||||
if err != nil {
|
||||
|
@ -106,8 +106,9 @@ func (client TagsClient) CreateOrUpdateResponder(resp *http.Response) (result Ta
|
|||
}
|
||||
|
||||
// CreateOrUpdateValue creates a tag value. The name of the tag must already exist.
|
||||
//
|
||||
// tagName is the name of the tag. tagValue is the value of the tag to create.
|
||||
// Parameters:
|
||||
// tagName - the name of the tag.
|
||||
// tagValue - the value of the tag to create.
|
||||
func (client TagsClient) CreateOrUpdateValue(ctx context.Context, tagName string, tagValue string) (result TagValue, err error) {
|
||||
req, err := client.CreateOrUpdateValuePreparer(ctx, tagName, tagValue)
|
||||
if err != nil {
|
||||
|
@ -172,8 +173,8 @@ func (client TagsClient) CreateOrUpdateValueResponder(resp *http.Response) (resu
|
|||
}
|
||||
|
||||
// Delete you must remove all values from a resource tag before you can delete it.
|
||||
//
|
||||
// tagName is the name of the tag.
|
||||
// Parameters:
|
||||
// tagName - the name of the tag.
|
||||
func (client TagsClient) Delete(ctx context.Context, tagName string) (result autorest.Response, err error) {
|
||||
req, err := client.DeletePreparer(ctx, tagName)
|
||||
if err != nil {
|
||||
|
@ -236,8 +237,9 @@ func (client TagsClient) DeleteResponder(resp *http.Response) (result autorest.R
|
|||
}
|
||||
|
||||
// DeleteValue deletes a tag value.
|
||||
//
|
||||
// tagName is the name of the tag. tagValue is the value of the tag to delete.
|
||||
// Parameters:
|
||||
// tagName - the name of the tag.
|
||||
// tagValue - the value of the tag to delete.
|
||||
func (client TagsClient) DeleteValue(ctx context.Context, tagName string, tagValue string) (result autorest.Response, err error) {
|
||||
req, err := client.DeleteValuePreparer(ctx, tagName, tagValue)
|
||||
if err != nil {
|
||||
|
|
|
@ -41,9 +41,9 @@ func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) Account
|
|||
}
|
||||
|
||||
// CheckNameAvailability checks that the storage account name is valid and is not already in use.
|
||||
//
|
||||
// accountName is the name of the storage account within the specified resource group. Storage account names must
|
||||
// be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// Parameters:
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
func (client AccountsClient) CheckNameAvailability(ctx context.Context, accountName AccountCheckNameAvailabilityParameters) (result CheckNameAvailabilityResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: accountName,
|
||||
|
@ -118,11 +118,12 @@ func (client AccountsClient) CheckNameAvailabilityResponder(resp *http.Response)
|
|||
// and a subsequent create request is issued with different properties, the account properties will be updated. If an
|
||||
// account is already created and a subsequent create or update request is issued with the exact same set of
|
||||
// properties, the request will succeed.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive. accountName is the name of the storage account within the specified resource group. Storage account
|
||||
// names must be between 3 and 24 characters in length and use numbers and lower-case letters only. parameters is
|
||||
// the parameters to provide for the created account.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// parameters - the parameters to provide for the created account.
|
||||
func (client AccountsClient) Create(ctx context.Context, resourceGroupName string, accountName string, parameters AccountCreateParameters) (result AccountsCreateFuture, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -185,15 +186,17 @@ func (client AccountsClient) CreatePreparer(ctx context.Context, resourceGroupNa
|
|||
// CreateSender sends the Create request. The method will close the
|
||||
// http.Response Body if it receives an error.
|
||||
func (client AccountsClient) CreateSender(req *http.Request) (future AccountsCreateFuture, 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
|
||||
}
|
||||
|
||||
|
@ -211,10 +214,11 @@ func (client AccountsClient) CreateResponder(resp *http.Response) (result Accoun
|
|||
}
|
||||
|
||||
// Delete deletes a storage account in Microsoft Azure.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive. accountName is the name of the storage account within the specified resource group. Storage account
|
||||
// names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
func (client AccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -290,10 +294,11 @@ func (client AccountsClient) DeleteResponder(resp *http.Response) (result autore
|
|||
|
||||
// GetProperties returns the properties for the specified storage account including but not limited to name, SKU name,
|
||||
// location, and account status. The ListKeys operation should be used to retrieve storage keys.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive. accountName is the name of the storage account within the specified resource group. Storage account
|
||||
// names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
func (client AccountsClient) GetProperties(ctx context.Context, resourceGroupName string, accountName string) (result Account, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -432,11 +437,12 @@ func (client AccountsClient) ListResponder(resp *http.Response) (result AccountL
|
|||
}
|
||||
|
||||
// ListAccountSAS list SAS credentials of a storage account.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive. accountName is the name of the storage account within the specified resource group. Storage account
|
||||
// names must be between 3 and 24 characters in length and use numbers and lower-case letters only. parameters is
|
||||
// the parameters to provide to list SAS credentials for the storage account.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// parameters - the parameters to provide to list SAS credentials for the storage account.
|
||||
func (client AccountsClient) ListAccountSAS(ctx context.Context, resourceGroupName string, accountName string, parameters AccountSasParameters) (result ListAccountSasResponse, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -517,8 +523,8 @@ func (client AccountsClient) ListAccountSASResponder(resp *http.Response) (resul
|
|||
|
||||
// ListByResourceGroup lists all the storage accounts available under the given resource group. Note that storage keys
|
||||
// are not returned; use the ListKeys operation for this.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group within the user's subscription. The name is case
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
func (client AccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AccountListResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
|
@ -591,10 +597,11 @@ func (client AccountsClient) ListByResourceGroupResponder(resp *http.Response) (
|
|||
}
|
||||
|
||||
// ListKeys lists the access keys for the specified storage account.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive. accountName is the name of the storage account within the specified resource group. Storage account
|
||||
// names must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
func (client AccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result AccountListKeysResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -670,11 +677,12 @@ func (client AccountsClient) ListKeysResponder(resp *http.Response) (result Acco
|
|||
}
|
||||
|
||||
// ListServiceSAS list service SAS credentials of a specific resource.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive. accountName is the name of the storage account within the specified resource group. Storage account
|
||||
// names must be between 3 and 24 characters in length and use numbers and lower-case letters only. parameters is
|
||||
// the parameters to provide to list service SAS credentials.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// parameters - the parameters to provide to list service SAS credentials.
|
||||
func (client AccountsClient) ListServiceSAS(ctx context.Context, resourceGroupName string, accountName string, parameters ServiceSasParameters) (result ListServiceSasResponse, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -756,11 +764,12 @@ func (client AccountsClient) ListServiceSASResponder(resp *http.Response) (resul
|
|||
}
|
||||
|
||||
// RegenerateKey regenerates one of the access keys for the specified storage account.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive. accountName is the name of the storage account within the specified resource group. Storage account
|
||||
// names must be between 3 and 24 characters in length and use numbers and lower-case letters only. regenerateKey
|
||||
// is specifies name of the key which should be regenerated -- key1 or key2.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// regenerateKey - specifies name of the key which should be regenerated -- key1 or key2.
|
||||
func (client AccountsClient) RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters) (result AccountListKeysResult, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
@ -845,11 +854,12 @@ func (client AccountsClient) RegenerateKeyResponder(resp *http.Response) (result
|
|||
// must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This
|
||||
// call does not change the storage keys for the account. If you want to change the storage account keys, use the
|
||||
// regenerate keys operation. The location and name of the storage account cannot be changed after creation.
|
||||
//
|
||||
// resourceGroupName is the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive. accountName is the name of the storage account within the specified resource group. Storage account
|
||||
// names must be between 3 and 24 characters in length and use numbers and lower-case letters only. parameters is
|
||||
// the parameters to provide for the updated account.
|
||||
// Parameters:
|
||||
// resourceGroupName - the name of the resource group within the user's subscription. The name is case
|
||||
// insensitive.
|
||||
// accountName - the name of the storage account within the specified resource group. Storage account names
|
||||
// must be between 3 and 24 characters in length and use numbers and lower-case letters only.
|
||||
// parameters - the parameters to provide for the updated account.
|
||||
func (client AccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, parameters AccountUpdateParameters) (result Account, err error) {
|
||||
if err := validation.Validate([]validation.Validation{
|
||||
{TargetValue: resourceGroupName,
|
||||
|
|
|
@ -755,12 +755,11 @@ type AccountSasParameters struct {
|
|||
// AccountsCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation.
|
||||
type AccountsCreateFuture struct {
|
||||
azure.Future
|
||||
req *http.Request
|
||||
}
|
||||
|
||||
// Result returns the result of the asynchronous operation.
|
||||
// If the operation has not completed it will return an error.
|
||||
func (future AccountsCreateFuture) Result(client AccountsClient) (a Account, err error) {
|
||||
func (future *AccountsCreateFuture) Result(client AccountsClient) (a Account, err error) {
|
||||
var done bool
|
||||
done, err = future.Done(client)
|
||||
if err != nil {
|
||||
|
@ -768,34 +767,15 @@ func (future AccountsCreateFuture) Result(client AccountsClient) (a Account, err
|
|||
return
|
||||
}
|
||||
if !done {
|
||||
return a, azure.NewAsyncOpIncompleteError("storage.AccountsCreateFuture")
|
||||
}
|
||||
if future.PollingMethod() == azure.PollingLocation {
|
||||
a, err = client.CreateResponder(future.Response())
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.AccountsCreateFuture", "Result", future.Response(), "Failure responding to request")
|
||||
}
|
||||
err = azure.NewAsyncOpIncompleteError("storage.AccountsCreateFuture")
|
||||
return
|
||||
}
|
||||
var req *http.Request
|
||||
var resp *http.Response
|
||||
if future.PollingURL() != "" {
|
||||
req, err = http.NewRequest(http.MethodGet, future.PollingURL(), nil)
|
||||
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent {
|
||||
a, err = client.CreateResponder(a.Response.Response)
|
||||
if err != nil {
|
||||
return
|
||||
err = autorest.NewErrorWithError(err, "storage.AccountsCreateFuture", "Result", a.Response.Response, "Failure responding to request")
|
||||
}
|
||||
} else {
|
||||
req = autorest.ChangeToGet(future.req)
|
||||
}
|
||||
resp, err = autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.AccountsCreateFuture", "Result", resp, "Failure sending request")
|
||||
return
|
||||
}
|
||||
a, err = client.CreateResponder(resp)
|
||||
if err != nil {
|
||||
err = autorest.NewErrorWithError(err, "storage.AccountsCreateFuture", "Result", resp, "Failure responding to request")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
# 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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
@ -880,6 +881,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
|
||||
|
@ -128,7 +128,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 +160,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})
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ func (s *Share) CreateIfNotExists(options *FileRequestOptions) (bool, error) {
|
|||
params := prepareOptions(options)
|
||||
resp, err := s.fsc.createResourceNoClose(s.buildPath(), resourceShare, params, extraheaders)
|
||||
if resp != nil {
|
||||
defer readAndCloseBody(resp.Body)
|
||||
defer drainRespBody(resp)
|
||||
if resp.StatusCode == http.StatusCreated || resp.StatusCode == http.StatusConflict {
|
||||
if resp.StatusCode == http.StatusCreated {
|
||||
s.updateEtagAndLastModified(resp.Header)
|
||||
|
@ -103,7 +103,7 @@ func (s *Share) Delete(options *FileRequestOptions) error {
|
|||
func (s *Share) DeleteIfExists(options *FileRequestOptions) (bool, error) {
|
||||
resp, err := s.fsc.deleteResourceNoClose(s.buildPath(), resourceShare, 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
|
||||
}
|
||||
|
|
|
@ -126,6 +126,6 @@ func (c Client) setServiceProperties(props ServiceProperties, service string, au
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer readAndCloseBody(resp.Body)
|
||||
defer drainRespBody(resp)
|
||||
return checkRespCode(resp, []int{http.StatusAccepted})
|
||||
}
|
||||
|
|
|
@ -186,7 +186,7 @@ func (t *Table) Delete(timeout uint, options *TableOptions) error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer readAndCloseBody(resp.Body)
|
||||
defer drainRespBody(resp)
|
||||
|
||||
return checkRespCode(resp, []int{http.StatusNoContent})
|
||||
}
|
||||
|
@ -269,7 +269,7 @@ func (t *Table) SetPermissions(tap []TableAccessPolicy, timeout uint, options *T
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer readAndCloseBody(resp.Body)
|
||||
defer drainRespBody(resp)
|
||||
|
||||
return checkRespCode(resp, []int{http.StatusNoContent})
|
||||
}
|
||||
|
|
|
@ -163,7 +163,7 @@ func (t *TableBatch) ExecuteBatch() error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer readAndCloseBody(resp.resp.Body)
|
||||
defer drainRespBody(resp.resp)
|
||||
|
||||
if err = checkRespCode(resp.resp, []int{http.StatusAccepted}); err != nil {
|
||||
|
||||
|
|
|
@ -18,4 +18,4 @@ package version
|
|||
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
|
||||
// Number contains the semantic version of this SDK.
|
||||
const Number = "v15.0.0"
|
||||
const Number = "v17.3.1"
|
||||
|
|
|
@ -26,10 +26,10 @@ const (
|
|||
// OAuthConfig represents the endpoints needed
|
||||
// in OAuth operations
|
||||
type OAuthConfig struct {
|
||||
AuthorityEndpoint url.URL
|
||||
AuthorizeEndpoint url.URL
|
||||
TokenEndpoint url.URL
|
||||
DeviceCodeEndpoint url.URL
|
||||
AuthorityEndpoint url.URL `json:"authorityEndpoint"`
|
||||
AuthorizeEndpoint url.URL `json:"authorizeEndpoint"`
|
||||
TokenEndpoint url.URL `json:"tokenEndpoint"`
|
||||
DeviceCodeEndpoint url.URL `json:"deviceCodeEndpoint"`
|
||||
}
|
||||
|
||||
// IsZero returns true if the OAuthConfig object is zero-initialized.
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
// +build !windows
|
||||
|
||||
package adal
|
||||
|
||||
// Copyright 2017 Microsoft Corporation
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// msiPath is the path to the MSI Extension settings file (to discover the endpoint)
|
||||
var msiPath = "/var/lib/waagent/ManagedIdentity-Settings"
|
|
@ -1,25 +0,0 @@
|
|||
// +build windows
|
||||
|
||||
package adal
|
||||
|
||||
// Copyright 2017 Microsoft Corporation
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import (
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// msiPath is the path to the MSI Extension settings file (to discover the endpoint)
|
||||
var msiPath = strings.Join([]string{os.Getenv("SystemDrive"), "WindowsAzure/Config/ManagedIdentity-Settings"}, "/")
|
|
@ -15,14 +15,18 @@ package adal
|
|||
// limitations under the License.
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"crypto/rsa"
|
||||
"crypto/sha1"
|
||||
"crypto/x509"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"math"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
|
@ -54,6 +58,12 @@ const (
|
|||
|
||||
// metadataHeader is the header required by MSI extension
|
||||
metadataHeader = "Metadata"
|
||||
|
||||
// msiEndpoint is the well known endpoint for getting MSI authentications tokens
|
||||
msiEndpoint = "http://169.254.169.254/metadata/identity/oauth2/token"
|
||||
|
||||
// the default number of attempts to refresh an MSI authentication token
|
||||
defaultMaxMSIRefreshAttempts = 5
|
||||
)
|
||||
|
||||
// OAuthTokenProvider is an interface which should be implemented by an access token retriever
|
||||
|
@ -74,6 +84,13 @@ type Refresher interface {
|
|||
EnsureFresh() error
|
||||
}
|
||||
|
||||
// RefresherWithContext is an interface for token refresh functionality
|
||||
type RefresherWithContext interface {
|
||||
RefreshWithContext(ctx context.Context) error
|
||||
RefreshExchangeWithContext(ctx context.Context, resource string) error
|
||||
EnsureFreshWithContext(ctx context.Context) error
|
||||
}
|
||||
|
||||
// TokenRefreshCallback is the type representing callbacks that will be called after
|
||||
// a successful token refresh
|
||||
type TokenRefreshCallback func(Token) error
|
||||
|
@ -124,6 +141,12 @@ func (t *Token) OAuthToken() string {
|
|||
return t.AccessToken
|
||||
}
|
||||
|
||||
// ServicePrincipalSecret is an interface that allows various secret mechanism to fill the form
|
||||
// that is submitted when acquiring an oAuth token.
|
||||
type ServicePrincipalSecret interface {
|
||||
SetAuthenticationValues(spt *ServicePrincipalToken, values *url.Values) error
|
||||
}
|
||||
|
||||
// ServicePrincipalNoSecret represents a secret type that contains no secret
|
||||
// meaning it is not valid for fetching a fresh token. This is used by Manual
|
||||
type ServicePrincipalNoSecret struct {
|
||||
|
@ -135,15 +158,19 @@ func (noSecret *ServicePrincipalNoSecret) SetAuthenticationValues(spt *ServicePr
|
|||
return fmt.Errorf("Manually created ServicePrincipalToken does not contain secret material to retrieve a new access token")
|
||||
}
|
||||
|
||||
// ServicePrincipalSecret is an interface that allows various secret mechanism to fill the form
|
||||
// that is submitted when acquiring an oAuth token.
|
||||
type ServicePrincipalSecret interface {
|
||||
SetAuthenticationValues(spt *ServicePrincipalToken, values *url.Values) error
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (noSecret ServicePrincipalNoSecret) MarshalJSON() ([]byte, error) {
|
||||
type tokenType struct {
|
||||
Type string `json:"type"`
|
||||
}
|
||||
return json.Marshal(tokenType{
|
||||
Type: "ServicePrincipalNoSecret",
|
||||
})
|
||||
}
|
||||
|
||||
// ServicePrincipalTokenSecret implements ServicePrincipalSecret for client_secret type authorization.
|
||||
type ServicePrincipalTokenSecret struct {
|
||||
ClientSecret string
|
||||
ClientSecret string `json:"value"`
|
||||
}
|
||||
|
||||
// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
|
||||
|
@ -153,49 +180,24 @@ func (tokenSecret *ServicePrincipalTokenSecret) SetAuthenticationValues(spt *Ser
|
|||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (tokenSecret ServicePrincipalTokenSecret) MarshalJSON() ([]byte, error) {
|
||||
type tokenType struct {
|
||||
Type string `json:"type"`
|
||||
Value string `json:"value"`
|
||||
}
|
||||
return json.Marshal(tokenType{
|
||||
Type: "ServicePrincipalTokenSecret",
|
||||
Value: tokenSecret.ClientSecret,
|
||||
})
|
||||
}
|
||||
|
||||
// ServicePrincipalCertificateSecret implements ServicePrincipalSecret for generic RSA cert auth with signed JWTs.
|
||||
type ServicePrincipalCertificateSecret struct {
|
||||
Certificate *x509.Certificate
|
||||
PrivateKey *rsa.PrivateKey
|
||||
}
|
||||
|
||||
// ServicePrincipalMSISecret implements ServicePrincipalSecret for machines running the MSI Extension.
|
||||
type ServicePrincipalMSISecret struct {
|
||||
}
|
||||
|
||||
// ServicePrincipalUsernamePasswordSecret implements ServicePrincipalSecret for username and password auth.
|
||||
type ServicePrincipalUsernamePasswordSecret struct {
|
||||
Username string
|
||||
Password string
|
||||
}
|
||||
|
||||
// ServicePrincipalAuthorizationCodeSecret implements ServicePrincipalSecret for authorization code auth.
|
||||
type ServicePrincipalAuthorizationCodeSecret struct {
|
||||
ClientSecret string
|
||||
AuthorizationCode string
|
||||
RedirectURI string
|
||||
}
|
||||
|
||||
// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
|
||||
func (secret *ServicePrincipalAuthorizationCodeSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error {
|
||||
v.Set("code", secret.AuthorizationCode)
|
||||
v.Set("client_secret", secret.ClientSecret)
|
||||
v.Set("redirect_uri", secret.RedirectURI)
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
|
||||
func (secret *ServicePrincipalUsernamePasswordSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error {
|
||||
v.Set("username", secret.Username)
|
||||
v.Set("password", secret.Password)
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
|
||||
func (msiSecret *ServicePrincipalMSISecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// SignJwt returns the JWT signed with the certificate's private key.
|
||||
func (secret *ServicePrincipalCertificateSecret) SignJwt(spt *ServicePrincipalToken) (string, error) {
|
||||
hasher := sha1.New()
|
||||
|
@ -216,9 +218,9 @@ func (secret *ServicePrincipalCertificateSecret) SignJwt(spt *ServicePrincipalTo
|
|||
token := jwt.New(jwt.SigningMethodRS256)
|
||||
token.Header["x5t"] = thumbprint
|
||||
token.Claims = jwt.MapClaims{
|
||||
"aud": spt.oauthConfig.TokenEndpoint.String(),
|
||||
"iss": spt.clientID,
|
||||
"sub": spt.clientID,
|
||||
"aud": spt.inner.OauthConfig.TokenEndpoint.String(),
|
||||
"iss": spt.inner.ClientID,
|
||||
"sub": spt.inner.ClientID,
|
||||
"jti": base64.URLEncoding.EncodeToString(jti),
|
||||
"nbf": time.Now().Unix(),
|
||||
"exp": time.Now().Add(time.Hour * 24).Unix(),
|
||||
|
@ -241,19 +243,151 @@ func (secret *ServicePrincipalCertificateSecret) SetAuthenticationValues(spt *Se
|
|||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (secret ServicePrincipalCertificateSecret) MarshalJSON() ([]byte, error) {
|
||||
return nil, errors.New("marshalling ServicePrincipalCertificateSecret is not supported")
|
||||
}
|
||||
|
||||
// ServicePrincipalMSISecret implements ServicePrincipalSecret for machines running the MSI Extension.
|
||||
type ServicePrincipalMSISecret struct {
|
||||
}
|
||||
|
||||
// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
|
||||
func (msiSecret *ServicePrincipalMSISecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (msiSecret ServicePrincipalMSISecret) MarshalJSON() ([]byte, error) {
|
||||
return nil, errors.New("marshalling ServicePrincipalMSISecret is not supported")
|
||||
}
|
||||
|
||||
// ServicePrincipalUsernamePasswordSecret implements ServicePrincipalSecret for username and password auth.
|
||||
type ServicePrincipalUsernamePasswordSecret struct {
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
|
||||
// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
|
||||
func (secret *ServicePrincipalUsernamePasswordSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error {
|
||||
v.Set("username", secret.Username)
|
||||
v.Set("password", secret.Password)
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (secret ServicePrincipalUsernamePasswordSecret) MarshalJSON() ([]byte, error) {
|
||||
type tokenType struct {
|
||||
Type string `json:"type"`
|
||||
Username string `json:"username"`
|
||||
Password string `json:"password"`
|
||||
}
|
||||
return json.Marshal(tokenType{
|
||||
Type: "ServicePrincipalUsernamePasswordSecret",
|
||||
Username: secret.Username,
|
||||
Password: secret.Password,
|
||||
})
|
||||
}
|
||||
|
||||
// ServicePrincipalAuthorizationCodeSecret implements ServicePrincipalSecret for authorization code auth.
|
||||
type ServicePrincipalAuthorizationCodeSecret struct {
|
||||
ClientSecret string `json:"value"`
|
||||
AuthorizationCode string `json:"authCode"`
|
||||
RedirectURI string `json:"redirect"`
|
||||
}
|
||||
|
||||
// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.
|
||||
func (secret *ServicePrincipalAuthorizationCodeSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error {
|
||||
v.Set("code", secret.AuthorizationCode)
|
||||
v.Set("client_secret", secret.ClientSecret)
|
||||
v.Set("redirect_uri", secret.RedirectURI)
|
||||
return nil
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (secret ServicePrincipalAuthorizationCodeSecret) MarshalJSON() ([]byte, error) {
|
||||
type tokenType struct {
|
||||
Type string `json:"type"`
|
||||
Value string `json:"value"`
|
||||
AuthCode string `json:"authCode"`
|
||||
Redirect string `json:"redirect"`
|
||||
}
|
||||
return json.Marshal(tokenType{
|
||||
Type: "ServicePrincipalAuthorizationCodeSecret",
|
||||
Value: secret.ClientSecret,
|
||||
AuthCode: secret.AuthorizationCode,
|
||||
Redirect: secret.RedirectURI,
|
||||
})
|
||||
}
|
||||
|
||||
// ServicePrincipalToken encapsulates a Token created for a Service Principal.
|
||||
type ServicePrincipalToken struct {
|
||||
token Token
|
||||
secret ServicePrincipalSecret
|
||||
oauthConfig OAuthConfig
|
||||
clientID string
|
||||
resource string
|
||||
autoRefresh bool
|
||||
inner servicePrincipalToken
|
||||
refreshLock *sync.RWMutex
|
||||
refreshWithin time.Duration
|
||||
sender Sender
|
||||
|
||||
refreshCallbacks []TokenRefreshCallback
|
||||
// MaxMSIRefreshAttempts is the maximum number of attempts to refresh an MSI token.
|
||||
MaxMSIRefreshAttempts int
|
||||
}
|
||||
|
||||
// MarshalTokenJSON returns the marshalled inner token.
|
||||
func (spt ServicePrincipalToken) MarshalTokenJSON() ([]byte, error) {
|
||||
return json.Marshal(spt.inner.Token)
|
||||
}
|
||||
|
||||
// SetRefreshCallbacks replaces any existing refresh callbacks with the specified callbacks.
|
||||
func (spt *ServicePrincipalToken) SetRefreshCallbacks(callbacks []TokenRefreshCallback) {
|
||||
spt.refreshCallbacks = callbacks
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface.
|
||||
func (spt ServicePrincipalToken) MarshalJSON() ([]byte, error) {
|
||||
return json.Marshal(spt.inner)
|
||||
}
|
||||
|
||||
// UnmarshalJSON implements the json.Unmarshaler interface.
|
||||
func (spt *ServicePrincipalToken) UnmarshalJSON(data []byte) error {
|
||||
// need to determine the token type
|
||||
raw := map[string]interface{}{}
|
||||
err := json.Unmarshal(data, &raw)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
secret := raw["secret"].(map[string]interface{})
|
||||
switch secret["type"] {
|
||||
case "ServicePrincipalNoSecret":
|
||||
spt.inner.Secret = &ServicePrincipalNoSecret{}
|
||||
case "ServicePrincipalTokenSecret":
|
||||
spt.inner.Secret = &ServicePrincipalTokenSecret{}
|
||||
case "ServicePrincipalCertificateSecret":
|
||||
return errors.New("unmarshalling ServicePrincipalCertificateSecret is not supported")
|
||||
case "ServicePrincipalMSISecret":
|
||||
return errors.New("unmarshalling ServicePrincipalMSISecret is not supported")
|
||||
case "ServicePrincipalUsernamePasswordSecret":
|
||||
spt.inner.Secret = &ServicePrincipalUsernamePasswordSecret{}
|
||||
case "ServicePrincipalAuthorizationCodeSecret":
|
||||
spt.inner.Secret = &ServicePrincipalAuthorizationCodeSecret{}
|
||||
default:
|
||||
return fmt.Errorf("unrecognized token type '%s'", secret["type"])
|
||||
}
|
||||
err = json.Unmarshal(data, &spt.inner)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
spt.refreshLock = &sync.RWMutex{}
|
||||
spt.sender = &http.Client{}
|
||||
return nil
|
||||
}
|
||||
|
||||
// internal type used for marshalling/unmarshalling
|
||||
type servicePrincipalToken struct {
|
||||
Token Token `json:"token"`
|
||||
Secret ServicePrincipalSecret `json:"secret"`
|
||||
OauthConfig OAuthConfig `json:"oauth"`
|
||||
ClientID string `json:"clientID"`
|
||||
Resource string `json:"resource"`
|
||||
AutoRefresh bool `json:"autoRefresh"`
|
||||
RefreshWithin time.Duration `json:"refreshWithin"`
|
||||
}
|
||||
|
||||
func validateOAuthConfig(oac OAuthConfig) error {
|
||||
|
@ -278,13 +412,15 @@ func NewServicePrincipalTokenWithSecret(oauthConfig OAuthConfig, id string, reso
|
|||
return nil, fmt.Errorf("parameter 'secret' cannot be nil")
|
||||
}
|
||||
spt := &ServicePrincipalToken{
|
||||
oauthConfig: oauthConfig,
|
||||
secret: secret,
|
||||
clientID: id,
|
||||
resource: resource,
|
||||
autoRefresh: true,
|
||||
inner: servicePrincipalToken{
|
||||
OauthConfig: oauthConfig,
|
||||
Secret: secret,
|
||||
ClientID: id,
|
||||
Resource: resource,
|
||||
AutoRefresh: true,
|
||||
RefreshWithin: defaultRefresh,
|
||||
},
|
||||
refreshLock: &sync.RWMutex{},
|
||||
refreshWithin: defaultRefresh,
|
||||
sender: &http.Client{},
|
||||
refreshCallbacks: callbacks,
|
||||
}
|
||||
|
@ -315,7 +451,39 @@ func NewServicePrincipalTokenFromManualToken(oauthConfig OAuthConfig, clientID s
|
|||
return nil, err
|
||||
}
|
||||
|
||||
spt.token = token
|
||||
spt.inner.Token = token
|
||||
|
||||
return spt, nil
|
||||
}
|
||||
|
||||
// NewServicePrincipalTokenFromManualTokenSecret creates a ServicePrincipalToken using the supplied token and secret
|
||||
func NewServicePrincipalTokenFromManualTokenSecret(oauthConfig OAuthConfig, clientID string, resource string, token Token, secret ServicePrincipalSecret, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) {
|
||||
if err := validateOAuthConfig(oauthConfig); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := validateStringParam(clientID, "clientID"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := validateStringParam(resource, "resource"); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if secret == nil {
|
||||
return nil, fmt.Errorf("parameter 'secret' cannot be nil")
|
||||
}
|
||||
if token.IsZero() {
|
||||
return nil, fmt.Errorf("parameter 'token' cannot be zero-initialized")
|
||||
}
|
||||
spt, err := NewServicePrincipalTokenWithSecret(
|
||||
oauthConfig,
|
||||
clientID,
|
||||
resource,
|
||||
secret,
|
||||
callbacks...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
spt.inner.Token = token
|
||||
|
||||
return spt, nil
|
||||
}
|
||||
|
@ -441,24 +609,7 @@ func NewServicePrincipalTokenFromAuthorizationCode(oauthConfig OAuthConfig, clie
|
|||
|
||||
// GetMSIVMEndpoint gets the MSI endpoint on Virtual Machines.
|
||||
func GetMSIVMEndpoint() (string, error) {
|
||||
return getMSIVMEndpoint(msiPath)
|
||||
}
|
||||
|
||||
func getMSIVMEndpoint(path string) (string, error) {
|
||||
// Read MSI settings
|
||||
bytes, err := ioutil.ReadFile(path)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
msiSettings := struct {
|
||||
URL string `json:"url"`
|
||||
}{}
|
||||
err = json.Unmarshal(bytes, &msiSettings)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
return msiSettings.URL, nil
|
||||
return msiEndpoint, nil
|
||||
}
|
||||
|
||||
// NewServicePrincipalTokenFromMSI creates a ServicePrincipalToken via the MSI VM Extension.
|
||||
|
@ -491,24 +642,32 @@ func newServicePrincipalTokenFromMSI(msiEndpoint, resource string, userAssignedI
|
|||
return nil, err
|
||||
}
|
||||
|
||||
oauthConfig, err := NewOAuthConfig(msiEndpointURL.String(), "")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
v := url.Values{}
|
||||
v.Set("resource", resource)
|
||||
v.Set("api-version", "2018-02-01")
|
||||
if userAssignedID != nil {
|
||||
v.Set("client_id", *userAssignedID)
|
||||
}
|
||||
msiEndpointURL.RawQuery = v.Encode()
|
||||
|
||||
spt := &ServicePrincipalToken{
|
||||
oauthConfig: *oauthConfig,
|
||||
secret: &ServicePrincipalMSISecret{},
|
||||
resource: resource,
|
||||
autoRefresh: true,
|
||||
inner: servicePrincipalToken{
|
||||
OauthConfig: OAuthConfig{
|
||||
TokenEndpoint: *msiEndpointURL,
|
||||
},
|
||||
Secret: &ServicePrincipalMSISecret{},
|
||||
Resource: resource,
|
||||
AutoRefresh: true,
|
||||
RefreshWithin: defaultRefresh,
|
||||
},
|
||||
refreshLock: &sync.RWMutex{},
|
||||
refreshWithin: defaultRefresh,
|
||||
sender: &http.Client{},
|
||||
refreshCallbacks: callbacks,
|
||||
MaxMSIRefreshAttempts: defaultMaxMSIRefreshAttempts,
|
||||
}
|
||||
|
||||
if userAssignedID != nil {
|
||||
spt.clientID = *userAssignedID
|
||||
spt.inner.ClientID = *userAssignedID
|
||||
}
|
||||
|
||||
return spt, nil
|
||||
|
@ -537,12 +696,18 @@ func newTokenRefreshError(message string, resp *http.Response) TokenRefreshError
|
|||
// EnsureFresh will refresh the token if it will expire within the refresh window (as set by
|
||||
// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use.
|
||||
func (spt *ServicePrincipalToken) EnsureFresh() error {
|
||||
if spt.autoRefresh && spt.token.WillExpireIn(spt.refreshWithin) {
|
||||
return spt.EnsureFreshWithContext(context.Background())
|
||||
}
|
||||
|
||||
// EnsureFreshWithContext will refresh the token if it will expire within the refresh window (as set by
|
||||
// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use.
|
||||
func (spt *ServicePrincipalToken) EnsureFreshWithContext(ctx context.Context) error {
|
||||
if spt.inner.AutoRefresh && spt.inner.Token.WillExpireIn(spt.inner.RefreshWithin) {
|
||||
// take the write lock then check to see if the token was already refreshed
|
||||
spt.refreshLock.Lock()
|
||||
defer spt.refreshLock.Unlock()
|
||||
if spt.token.WillExpireIn(spt.refreshWithin) {
|
||||
return spt.refreshInternal(spt.resource)
|
||||
if spt.inner.Token.WillExpireIn(spt.inner.RefreshWithin) {
|
||||
return spt.refreshInternal(ctx, spt.inner.Resource)
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
@ -552,7 +717,7 @@ func (spt *ServicePrincipalToken) EnsureFresh() error {
|
|||
func (spt *ServicePrincipalToken) InvokeRefreshCallbacks(token Token) error {
|
||||
if spt.refreshCallbacks != nil {
|
||||
for _, callback := range spt.refreshCallbacks {
|
||||
err := callback(spt.token)
|
||||
err := callback(spt.inner.Token)
|
||||
if err != nil {
|
||||
return fmt.Errorf("adal: TokenRefreshCallback handler failed. Error = '%v'", err)
|
||||
}
|
||||
|
@ -564,21 +729,33 @@ func (spt *ServicePrincipalToken) InvokeRefreshCallbacks(token Token) error {
|
|||
// Refresh obtains a fresh token for the Service Principal.
|
||||
// This method is not safe for concurrent use and should be syncrhonized.
|
||||
func (spt *ServicePrincipalToken) Refresh() error {
|
||||
return spt.RefreshWithContext(context.Background())
|
||||
}
|
||||
|
||||
// RefreshWithContext obtains a fresh token for the Service Principal.
|
||||
// This method is not safe for concurrent use and should be syncrhonized.
|
||||
func (spt *ServicePrincipalToken) RefreshWithContext(ctx context.Context) error {
|
||||
spt.refreshLock.Lock()
|
||||
defer spt.refreshLock.Unlock()
|
||||
return spt.refreshInternal(spt.resource)
|
||||
return spt.refreshInternal(ctx, spt.inner.Resource)
|
||||
}
|
||||
|
||||
// RefreshExchange refreshes the token, but for a different resource.
|
||||
// This method is not safe for concurrent use and should be syncrhonized.
|
||||
func (spt *ServicePrincipalToken) RefreshExchange(resource string) error {
|
||||
return spt.RefreshExchangeWithContext(context.Background(), resource)
|
||||
}
|
||||
|
||||
// RefreshExchangeWithContext refreshes the token, but for a different resource.
|
||||
// This method is not safe for concurrent use and should be syncrhonized.
|
||||
func (spt *ServicePrincipalToken) RefreshExchangeWithContext(ctx context.Context, resource string) error {
|
||||
spt.refreshLock.Lock()
|
||||
defer spt.refreshLock.Unlock()
|
||||
return spt.refreshInternal(resource)
|
||||
return spt.refreshInternal(ctx, resource)
|
||||
}
|
||||
|
||||
func (spt *ServicePrincipalToken) getGrantType() string {
|
||||
switch spt.secret.(type) {
|
||||
switch spt.inner.Secret.(type) {
|
||||
case *ServicePrincipalUsernamePasswordSecret:
|
||||
return OAuthGrantTypeUserPass
|
||||
case *ServicePrincipalAuthorizationCodeSecret:
|
||||
|
@ -588,17 +765,39 @@ func (spt *ServicePrincipalToken) getGrantType() string {
|
|||
}
|
||||
}
|
||||
|
||||
func (spt *ServicePrincipalToken) refreshInternal(resource string) error {
|
||||
func isIMDS(u url.URL) bool {
|
||||
imds, err := url.Parse(msiEndpoint)
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
return u.Host == imds.Host && u.Path == imds.Path
|
||||
}
|
||||
|
||||
func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource string) error {
|
||||
req, err := http.NewRequest(http.MethodPost, spt.inner.OauthConfig.TokenEndpoint.String(), nil)
|
||||
if err != nil {
|
||||
return fmt.Errorf("adal: Failed to build the refresh request. Error = '%v'", err)
|
||||
}
|
||||
req = req.WithContext(ctx)
|
||||
if !isIMDS(spt.inner.OauthConfig.TokenEndpoint) {
|
||||
v := url.Values{}
|
||||
v.Set("client_id", spt.clientID)
|
||||
v.Set("client_id", spt.inner.ClientID)
|
||||
v.Set("resource", resource)
|
||||
|
||||
if spt.token.RefreshToken != "" {
|
||||
if spt.inner.Token.RefreshToken != "" {
|
||||
v.Set("grant_type", OAuthGrantTypeRefreshToken)
|
||||
v.Set("refresh_token", spt.token.RefreshToken)
|
||||
v.Set("refresh_token", spt.inner.Token.RefreshToken)
|
||||
// web apps must specify client_secret when refreshing tokens
|
||||
// see https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-oauth-code#refreshing-the-access-tokens
|
||||
if spt.getGrantType() == OAuthGrantTypeAuthorizationCode {
|
||||
err := spt.inner.Secret.SetAuthenticationValues(spt, &v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
} else {
|
||||
v.Set("grant_type", spt.getGrantType())
|
||||
err := spt.secret.SetAuthenticationValues(spt, &v)
|
||||
err := spt.inner.Secret.SetAuthenticationValues(spt, &v)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
@ -606,19 +805,24 @@ func (spt *ServicePrincipalToken) refreshInternal(resource string) error {
|
|||
|
||||
s := v.Encode()
|
||||
body := ioutil.NopCloser(strings.NewReader(s))
|
||||
req, err := http.NewRequest(http.MethodPost, spt.oauthConfig.TokenEndpoint.String(), body)
|
||||
if err != nil {
|
||||
return fmt.Errorf("adal: Failed to build the refresh request. Error = '%v'", err)
|
||||
}
|
||||
|
||||
req.ContentLength = int64(len(s))
|
||||
req.Header.Set(contentType, mimeTypeFormPost)
|
||||
if _, ok := spt.secret.(*ServicePrincipalMSISecret); ok {
|
||||
req.Body = body
|
||||
}
|
||||
|
||||
if _, ok := spt.inner.Secret.(*ServicePrincipalMSISecret); ok {
|
||||
req.Method = http.MethodGet
|
||||
req.Header.Set(metadataHeader, "true")
|
||||
}
|
||||
resp, err := spt.sender.Do(req)
|
||||
|
||||
var resp *http.Response
|
||||
if isIMDS(spt.inner.OauthConfig.TokenEndpoint) {
|
||||
resp, err = retryForIMDS(spt.sender, req, spt.MaxMSIRefreshAttempts)
|
||||
} else {
|
||||
resp, err = spt.sender.Do(req)
|
||||
}
|
||||
if err != nil {
|
||||
return fmt.Errorf("adal: Failed to execute the refresh request. Error = '%v'", err)
|
||||
return newTokenRefreshError(fmt.Sprintf("adal: Failed to execute the refresh request. Error = '%v'", err), nil)
|
||||
}
|
||||
|
||||
defer resp.Body.Close()
|
||||
|
@ -626,11 +830,15 @@ func (spt *ServicePrincipalToken) refreshInternal(resource string) error {
|
|||
|
||||
if resp.StatusCode != http.StatusOK {
|
||||
if err != nil {
|
||||
return newTokenRefreshError(fmt.Sprintf("adal: Refresh request failed. Status Code = '%d'. Failed reading response body", resp.StatusCode), resp)
|
||||
return newTokenRefreshError(fmt.Sprintf("adal: Refresh request failed. Status Code = '%d'. Failed reading response body: %v", resp.StatusCode, err), resp)
|
||||
}
|
||||
return newTokenRefreshError(fmt.Sprintf("adal: Refresh request failed. Status Code = '%d'. Response body: %s", resp.StatusCode, string(rb)), resp)
|
||||
}
|
||||
|
||||
// for the following error cases don't return a TokenRefreshError. the operation succeeded
|
||||
// but some transient failure happened during deserialization. by returning a generic error
|
||||
// the retry logic will kick in (we don't retry on TokenRefreshError).
|
||||
|
||||
if err != nil {
|
||||
return fmt.Errorf("adal: Failed to read a new service principal token during refresh. Error = '%v'", err)
|
||||
}
|
||||
|
@ -643,20 +851,99 @@ func (spt *ServicePrincipalToken) refreshInternal(resource string) error {
|
|||
return fmt.Errorf("adal: Failed to unmarshal the service principal token during refresh. Error = '%v' JSON = '%s'", err, string(rb))
|
||||
}
|
||||
|
||||
spt.token = token
|
||||
spt.inner.Token = token
|
||||
|
||||
return spt.InvokeRefreshCallbacks(token)
|
||||
}
|
||||
|
||||
// retry logic specific to retrieving a token from the IMDS endpoint
|
||||
func retryForIMDS(sender Sender, req *http.Request, maxAttempts int) (resp *http.Response, err error) {
|
||||
// copied from client.go due to circular dependency
|
||||
retries := []int{
|
||||
http.StatusRequestTimeout, // 408
|
||||
http.StatusTooManyRequests, // 429
|
||||
http.StatusInternalServerError, // 500
|
||||
http.StatusBadGateway, // 502
|
||||
http.StatusServiceUnavailable, // 503
|
||||
http.StatusGatewayTimeout, // 504
|
||||
}
|
||||
// extra retry status codes specific to IMDS
|
||||
retries = append(retries,
|
||||
http.StatusNotFound,
|
||||
http.StatusGone,
|
||||
// all remaining 5xx
|
||||
http.StatusNotImplemented,
|
||||
http.StatusHTTPVersionNotSupported,
|
||||
http.StatusVariantAlsoNegotiates,
|
||||
http.StatusInsufficientStorage,
|
||||
http.StatusLoopDetected,
|
||||
http.StatusNotExtended,
|
||||
http.StatusNetworkAuthenticationRequired)
|
||||
|
||||
// see https://docs.microsoft.com/en-us/azure/active-directory/managed-service-identity/how-to-use-vm-token#retry-guidance
|
||||
|
||||
const maxDelay time.Duration = 60 * time.Second
|
||||
|
||||
attempt := 0
|
||||
delay := time.Duration(0)
|
||||
|
||||
for attempt < maxAttempts {
|
||||
resp, err = sender.Do(req)
|
||||
// retry on temporary network errors, e.g. transient network failures.
|
||||
// if we don't receive a response then assume we can't connect to the
|
||||
// endpoint so we're likely not running on an Azure VM so don't retry.
|
||||
if (err != nil && !isTemporaryNetworkError(err)) || resp == nil || resp.StatusCode == http.StatusOK || !containsInt(retries, resp.StatusCode) {
|
||||
return
|
||||
}
|
||||
|
||||
// perform exponential backoff with a cap.
|
||||
// must increment attempt before calculating delay.
|
||||
attempt++
|
||||
// the base value of 2 is the "delta backoff" as specified in the guidance doc
|
||||
delay += (time.Duration(math.Pow(2, float64(attempt))) * time.Second)
|
||||
if delay > maxDelay {
|
||||
delay = maxDelay
|
||||
}
|
||||
|
||||
select {
|
||||
case <-time.After(delay):
|
||||
// intentionally left blank
|
||||
case <-req.Context().Done():
|
||||
err = req.Context().Err()
|
||||
return
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// returns true if the specified error is a temporary network error or false if it's not.
|
||||
// if the error doesn't implement the net.Error interface the return value is true.
|
||||
func isTemporaryNetworkError(err error) bool {
|
||||
if netErr, ok := err.(net.Error); !ok || (ok && netErr.Temporary()) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// returns true if slice ints contains the value n
|
||||
func containsInt(ints []int, n int) bool {
|
||||
for _, i := range ints {
|
||||
if i == n {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// SetAutoRefresh enables or disables automatic refreshing of stale tokens.
|
||||
func (spt *ServicePrincipalToken) SetAutoRefresh(autoRefresh bool) {
|
||||
spt.autoRefresh = autoRefresh
|
||||
spt.inner.AutoRefresh = autoRefresh
|
||||
}
|
||||
|
||||
// SetRefreshWithin sets the interval within which if the token will expire, EnsureFresh will
|
||||
// refresh the token.
|
||||
func (spt *ServicePrincipalToken) SetRefreshWithin(d time.Duration) {
|
||||
spt.refreshWithin = d
|
||||
spt.inner.RefreshWithin = d
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -668,12 +955,12 @@ func (spt *ServicePrincipalToken) SetSender(s Sender) { spt.sender = s }
|
|||
func (spt *ServicePrincipalToken) OAuthToken() string {
|
||||
spt.refreshLock.RLock()
|
||||
defer spt.refreshLock.RUnlock()
|
||||
return spt.token.OAuthToken()
|
||||
return spt.inner.Token.OAuthToken()
|
||||
}
|
||||
|
||||
// Token returns a copy of the current token.
|
||||
func (spt *ServicePrincipalToken) Token() Token {
|
||||
spt.refreshLock.RLock()
|
||||
defer spt.refreshLock.RUnlock()
|
||||
return spt.token
|
||||
return spt.inner.Token
|
||||
}
|
||||
|
|
|
@ -113,9 +113,12 @@ func (ba *BearerAuthorizer) WithAuthorization() PrepareDecorator {
|
|||
return PreparerFunc(func(r *http.Request) (*http.Request, error) {
|
||||
r, err := p.Prepare(r)
|
||||
if err == nil {
|
||||
refresher, ok := ba.tokenProvider.(adal.Refresher)
|
||||
if ok {
|
||||
err := refresher.EnsureFresh()
|
||||
// the ordering is important here, prefer RefresherWithContext if available
|
||||
if refresher, ok := ba.tokenProvider.(adal.RefresherWithContext); ok {
|
||||
err = refresher.EnsureFreshWithContext(r.Context())
|
||||
} else if refresher, ok := ba.tokenProvider.(adal.Refresher); ok {
|
||||
err = refresher.EnsureFresh()
|
||||
}
|
||||
if err != nil {
|
||||
var resp *http.Response
|
||||
if tokError, ok := err.(adal.TokenRefreshError); ok {
|
||||
|
@ -124,7 +127,6 @@ func (ba *BearerAuthorizer) WithAuthorization() PrepareDecorator {
|
|||
return r, NewErrorWithError(err, "azure.BearerAuthorizer", "WithAuthorization", resp,
|
||||
"Failed to refresh the Token for request to %s", r.URL)
|
||||
}
|
||||
}
|
||||
return Prepare(r, WithHeader(headerAuthorization, fmt.Sprintf("Bearer %s", ba.tokenProvider.OAuthToken())))
|
||||
}
|
||||
return r, err
|
||||
|
|
|
@ -72,6 +72,7 @@ package autorest
|
|||
// limitations under the License.
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
@ -130,3 +131,20 @@ func NewPollingRequest(resp *http.Response, cancel <-chan struct{}) (*http.Reque
|
|||
|
||||
return req, nil
|
||||
}
|
||||
|
||||
// NewPollingRequestWithContext allocates and returns a new http.Request with the specified context to poll for the passed response.
|
||||
func NewPollingRequestWithContext(ctx context.Context, resp *http.Response) (*http.Request, error) {
|
||||
location := GetLocation(resp)
|
||||
if location == "" {
|
||||
return nil, NewErrorWithResponse("autorest", "NewPollingRequestWithContext", resp, "Location header missing from response that requires polling")
|
||||
}
|
||||
|
||||
req, err := Prepare((&http.Request{}).WithContext(ctx),
|
||||
AsGet(),
|
||||
WithBaseURL(location))
|
||||
if err != nil {
|
||||
return nil, NewErrorWithError(err, "autorest", "NewPollingRequestWithContext", nil, "Failure creating poll request to %s", location)
|
||||
}
|
||||
|
||||
return req, nil
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -279,16 +279,29 @@ func WithErrorUnlessStatusCode(codes ...int) autorest.RespondDecorator {
|
|||
resp.Body = ioutil.NopCloser(&b)
|
||||
if decodeErr != nil {
|
||||
return fmt.Errorf("autorest/azure: error response cannot be parsed: %q error: %v", b.String(), decodeErr)
|
||||
} else if e.ServiceError == nil {
|
||||
}
|
||||
if e.ServiceError == nil {
|
||||
// Check if error is unwrapped ServiceError
|
||||
if err := json.Unmarshal(b.Bytes(), &e.ServiceError); err != nil || e.ServiceError.Message == "" {
|
||||
if err := json.Unmarshal(b.Bytes(), &e.ServiceError); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
if e.ServiceError.Message == "" {
|
||||
// if we're here it means the returned error wasn't OData v4 compliant.
|
||||
// try to unmarshal the body as raw JSON in hopes of getting something.
|
||||
rawBody := map[string]interface{}{}
|
||||
if err := json.Unmarshal(b.Bytes(), &rawBody); err != nil {
|
||||
return err
|
||||
}
|
||||
e.ServiceError = &ServiceError{
|
||||
Code: "Unknown",
|
||||
Message: "Unknown service error",
|
||||
}
|
||||
if len(rawBody) > 0 {
|
||||
e.ServiceError.Details = []map[string]interface{}{rawBody}
|
||||
}
|
||||
}
|
||||
|
||||
e.Response = resp
|
||||
e.RequestID = ExtractRequestID(resp)
|
||||
if e.StatusCode == nil {
|
||||
e.StatusCode = resp.StatusCode
|
||||
|
|
|
@ -64,7 +64,7 @@ func DoRetryWithRegistration(client autorest.Client) autorest.SendDecorator {
|
|||
}
|
||||
}
|
||||
}
|
||||
return resp, fmt.Errorf("failed request: %s", err)
|
||||
return resp, err
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -115,7 +115,7 @@ func register(client autorest.Client, originalReq *http.Request, re RequestError
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
req.Cancel = originalReq.Cancel
|
||||
req = req.WithContext(originalReq.Context())
|
||||
|
||||
resp, err := autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...),
|
||||
|
@ -154,7 +154,7 @@ func register(client autorest.Client, originalReq *http.Request, re RequestError
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
req.Cancel = originalReq.Cancel
|
||||
req = req.WithContext(originalReq.Context())
|
||||
|
||||
resp, err := autorest.SendWithSender(client, req,
|
||||
autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...),
|
||||
|
@ -178,9 +178,9 @@ func register(client autorest.Client, originalReq *http.Request, re RequestError
|
|||
break
|
||||
}
|
||||
|
||||
delayed := autorest.DelayWithRetryAfter(resp, originalReq.Cancel)
|
||||
if !delayed {
|
||||
autorest.DelayForBackoff(client.PollingDelay, 0, originalReq.Cancel)
|
||||
delayed := autorest.DelayWithRetryAfter(resp, originalReq.Context().Done())
|
||||
if !delayed && !autorest.DelayForBackoff(client.PollingDelay, 0, originalReq.Context().Done()) {
|
||||
return originalReq.Context().Err()
|
||||
}
|
||||
}
|
||||
if !(time.Since(now) < client.PollingDuration) {
|
||||
|
|
|
@ -5,6 +5,20 @@ time.Time types. And both convert to time.Time through a ToTime method.
|
|||
*/
|
||||
package date
|
||||
|
||||
// Copyright 2017 Microsoft Corporation
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
|
|
@ -1,5 +1,19 @@
|
|||
package date
|
||||
|
||||
// Copyright 2017 Microsoft Corporation
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"time"
|
||||
|
|
|
@ -1,5 +1,19 @@
|
|||
package date
|
||||
|
||||
// Copyright 2017 Microsoft Corporation
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
|
|
|
@ -1,5 +1,19 @@
|
|||
package date
|
||||
|
||||
// Copyright 2017 Microsoft Corporation
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/binary"
|
||||
|
|
|
@ -1,5 +1,19 @@
|
|||
package date
|
||||
|
||||
// Copyright 2017 Microsoft Corporation
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"time"
|
||||
|
|
|
@ -86,7 +86,7 @@ func SendWithSender(s Sender, r *http.Request, decorators ...SendDecorator) (*ht
|
|||
func AfterDelay(d time.Duration) SendDecorator {
|
||||
return func(s Sender) Sender {
|
||||
return SenderFunc(func(r *http.Request) (*http.Response, error) {
|
||||
if !DelayForBackoff(d, 0, r.Cancel) {
|
||||
if !DelayForBackoff(d, 0, r.Context().Done()) {
|
||||
return nil, fmt.Errorf("autorest: AfterDelay canceled before full delay")
|
||||
}
|
||||
return s.Do(r)
|
||||
|
@ -165,7 +165,7 @@ func DoPollForStatusCodes(duration time.Duration, delay time.Duration, codes ...
|
|||
resp, err = s.Do(r)
|
||||
|
||||
if err == nil && ResponseHasStatusCode(resp, codes...) {
|
||||
r, err = NewPollingRequest(resp, r.Cancel)
|
||||
r, err = NewPollingRequestWithContext(r.Context(), resp)
|
||||
|
||||
for err == nil && ResponseHasStatusCode(resp, codes...) {
|
||||
Respond(resp,
|
||||
|
@ -198,7 +198,9 @@ func DoRetryForAttempts(attempts int, backoff time.Duration) SendDecorator {
|
|||
if err == nil {
|
||||
return resp, err
|
||||
}
|
||||
DelayForBackoff(backoff, attempt, r.Cancel)
|
||||
if !DelayForBackoff(backoff, attempt, r.Context().Done()) {
|
||||
return nil, r.Context().Err()
|
||||
}
|
||||
}
|
||||
return resp, err
|
||||
})
|
||||
|
@ -221,14 +223,18 @@ func DoRetryForStatusCodes(attempts int, backoff time.Duration, codes ...int) Se
|
|||
return resp, err
|
||||
}
|
||||
resp, err = s.Do(rr.Request())
|
||||
// if the error isn't temporary don't bother retrying
|
||||
if err != nil && !IsTemporaryNetworkError(err) {
|
||||
return nil, err
|
||||
}
|
||||
// we want to retry if err is not nil (e.g. transient network failure). note that for failed authentication
|
||||
// resp and err will both have a value, so in this case we don't want to retry as it will never succeed.
|
||||
if err == nil && !ResponseHasStatusCode(resp, codes...) || IsTokenRefreshError(err) {
|
||||
return resp, err
|
||||
}
|
||||
delayed := DelayWithRetryAfter(resp, r.Cancel)
|
||||
if !delayed {
|
||||
DelayForBackoff(backoff, attempt, r.Cancel)
|
||||
delayed := DelayWithRetryAfter(resp, r.Context().Done())
|
||||
if !delayed && !DelayForBackoff(backoff, attempt, r.Context().Done()) {
|
||||
return nil, r.Context().Err()
|
||||
}
|
||||
// don't count a 429 against the number of attempts
|
||||
// so that we continue to retry until it succeeds
|
||||
|
@ -277,7 +283,9 @@ func DoRetryForDuration(d time.Duration, backoff time.Duration) SendDecorator {
|
|||
if err == nil {
|
||||
return resp, err
|
||||
}
|
||||
DelayForBackoff(backoff, attempt, r.Cancel)
|
||||
if !DelayForBackoff(backoff, attempt, r.Context().Done()) {
|
||||
return nil, r.Context().Err()
|
||||
}
|
||||
}
|
||||
return resp, err
|
||||
})
|
||||
|
|
|
@ -3,6 +3,20 @@ Package to provides helpers to ease working with pointer values of marshalled st
|
|||
*/
|
||||
package to
|
||||
|
||||
// Copyright 2017 Microsoft Corporation
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
// String returns a string value for the passed string pointer. It returns the empty string if the
|
||||
// pointer is nil.
|
||||
func String(s *string) string {
|
||||
|
|
|
@ -20,6 +20,7 @@ import (
|
|||
"encoding/xml"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"reflect"
|
||||
|
@ -216,3 +217,12 @@ func IsTokenRefreshError(err error) bool {
|
|||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// IsTemporaryNetworkError returns true if the specified error is a temporary network error or false
|
||||
// if it's not. If the error doesn't implement the net.Error interface the return value is true.
|
||||
func IsTemporaryNetworkError(err error) bool {
|
||||
if netErr, ok := err.(net.Error); !ok || (ok && netErr.Temporary()) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue