provier/azurerm: update Azure SDK to 3.2 Beta

Based on SDK: bfc5b4af08f3d3745d908af36b7ed5b9060f0258

| api                         | version             | note      |
|:----------------------------|:--------------------|:----------|
| arm/mediaservices           | 2015-10-01          | new       |
| arm/keyvault                | 2015-06-01          | new       |
| arm/iothub                  | 2016-02-03          | new       |
| arm/datalake-store          | 2015-12-01          | new       |
| arm/network                 | 2016-06-01          | updated   |
| arm/resources/resources     | 2016-07-01          | updated   |
| arm/resources/policy        | 2016-04-01          | updated   |
| arm/servicebus              | 2015-08-01          | updated   |

- arm: uses go-autorest version v7.1.0.
- storage: fix for operating on blobs names containing special characters.
- storage: add SetBlobProperties(), update BlobProperties response fields.
- storage: make storage client work correctly with read-only secondary account.
- storage: add Azure Storage Emulator support.
This commit is contained in:
Peter McAtominey 2016-08-12 11:44:23 +01:00
parent e251d5c7bd
commit 7c4426b674
71 changed files with 1508 additions and 238 deletions

View File

@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Copyright 2016 Microsoft Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@ -46,9 +46,14 @@ type ManagementClient struct {
// New creates an instance of the ManagementClient client.
func New(subscriptionID string) ManagementClient {
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewWithBaseURI creates an instance of the ManagementClient client.
func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: DefaultBaseURI,
BaseURI: baseURI,
APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}

View File

@ -36,7 +36,13 @@ type CustomDomainsClient struct {
// NewCustomDomainsClient creates an instance of the CustomDomainsClient
// client.
func NewCustomDomainsClient(subscriptionID string) CustomDomainsClient {
return CustomDomainsClient{New(subscriptionID)}
return NewCustomDomainsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewCustomDomainsClientWithBaseURI creates an instance of the
// CustomDomainsClient client.
func NewCustomDomainsClientWithBaseURI(baseURI string, subscriptionID string) CustomDomainsClient {
return CustomDomainsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Create sends the create request. This method may poll for completion.

View File

@ -19,10 +19,9 @@ package cdn
// regenerated.
import (
"net/http"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
)
// EndpointsClient is the use these APIs to manage Azure CDN resources through
@ -36,7 +35,13 @@ type EndpointsClient struct {
// NewEndpointsClient creates an instance of the EndpointsClient client.
func NewEndpointsClient(subscriptionID string) EndpointsClient {
return EndpointsClient{New(subscriptionID)}
return NewEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewEndpointsClientWithBaseURI creates an instance of the EndpointsClient
// client.
func NewEndpointsClientWithBaseURI(baseURI string, subscriptionID string) EndpointsClient {
return EndpointsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Create sends the create request. This method may poll for completion.

View File

@ -36,7 +36,13 @@ type NameAvailabilityClient struct {
// NewNameAvailabilityClient creates an instance of the NameAvailabilityClient
// client.
func NewNameAvailabilityClient(subscriptionID string) NameAvailabilityClient {
return NameAvailabilityClient{New(subscriptionID)}
return NewNameAvailabilityClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewNameAvailabilityClientWithBaseURI creates an instance of the
// NameAvailabilityClient client.
func NewNameAvailabilityClientWithBaseURI(baseURI string, subscriptionID string) NameAvailabilityClient {
return NameAvailabilityClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CheckNameAvailability sends the check name availability request.

View File

@ -35,7 +35,13 @@ type OperationsClient struct {
// NewOperationsClient creates an instance of the OperationsClient client.
func NewOperationsClient(subscriptionID string) OperationsClient {
return OperationsClient{New(subscriptionID)}
return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewOperationsClientWithBaseURI creates an instance of the OperationsClient
// client.
func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// List sends the list request.

View File

@ -35,7 +35,12 @@ type OriginsClient struct {
// NewOriginsClient creates an instance of the OriginsClient client.
func NewOriginsClient(subscriptionID string) OriginsClient {
return OriginsClient{New(subscriptionID)}
return NewOriginsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewOriginsClientWithBaseURI creates an instance of the OriginsClient client.
func NewOriginsClientWithBaseURI(baseURI string, subscriptionID string) OriginsClient {
return OriginsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Create sends the create request. This method may poll for completion.

View File

@ -35,7 +35,13 @@ type ProfilesClient struct {
// NewProfilesClient creates an instance of the ProfilesClient client.
func NewProfilesClient(subscriptionID string) ProfilesClient {
return ProfilesClient{New(subscriptionID)}
return NewProfilesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewProfilesClientWithBaseURI creates an instance of the ProfilesClient
// client.
func NewProfilesClientWithBaseURI(baseURI string, subscriptionID string) ProfilesClient {
return ProfilesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Create sends the create request. This method may poll for completion.

View File

@ -24,7 +24,7 @@ import (
const (
major = "3"
minor = "0"
minor = "2"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"

View File

@ -32,7 +32,13 @@ type AvailabilitySetsClient struct {
// NewAvailabilitySetsClient creates an instance of the AvailabilitySetsClient
// client.
func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient {
return AvailabilitySetsClient{New(subscriptionID)}
return NewAvailabilitySetsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewAvailabilitySetsClientWithBaseURI creates an instance of the
// AvailabilitySetsClient client.
func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string) AvailabilitySetsClient {
return AvailabilitySetsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the operation to create or update the availability set.

View File

@ -44,9 +44,14 @@ type ManagementClient struct {
// New creates an instance of the ManagementClient client.
func New(subscriptionID string) ManagementClient {
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewWithBaseURI creates an instance of the ManagementClient client.
func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: DefaultBaseURI,
BaseURI: baseURI,
APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}

View File

@ -333,10 +333,10 @@ const (
StandardGS5 VirtualMachineSizeTypes = "Standard_GS5"
)
// AdditionalUnattendContent is gets or sets additional XML formatted
// information that can be included in the Unattend.xml file, which is used
// by Windows Setup. Contents are defined by setting name, component name,
// and the pass in which the content is a applied.
// AdditionalUnattendContent is additional XML formatted information that can
// be included in the Unattend.xml file, which is used by Windows Setup.
// Contents are defined by setting name, component name, and the pass in
// which the content is a applied.
type AdditionalUnattendContent struct {
PassName PassNames `json:"passName,omitempty"`
ComponentName ComponentNames `json:"componentName,omitempty"`
@ -487,7 +487,7 @@ type LinuxConfiguration struct {
type ListUsagesResult struct {
autorest.Response `json:"-"`
Value *[]Usage `json:"value,omitempty"`
NextLink *string `json:",omitempty"`
NextLink *string `json:"nextLink,omitempty"`
}
// ListUsagesResultPreparer prepares a request to retrieve the next set of results. It returns
@ -910,7 +910,7 @@ type VirtualMachineScaleSetIPConfigurationProperties struct {
type VirtualMachineScaleSetListResult struct {
autorest.Response `json:"-"`
Value *[]VirtualMachineScaleSet `json:"value,omitempty"`
NextLink *string `json:",omitempty"`
NextLink *string `json:"nextLink,omitempty"`
}
// VirtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. It returns
@ -930,7 +930,7 @@ func (client VirtualMachineScaleSetListResult) VirtualMachineScaleSetListResultP
type VirtualMachineScaleSetListSkusResult struct {
autorest.Response `json:"-"`
Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"`
NextLink *string `json:",omitempty"`
NextLink *string `json:"nextLink,omitempty"`
}
// VirtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. It returns
@ -1095,7 +1095,7 @@ type VirtualMachineScaleSetVMInstanceView struct {
type VirtualMachineScaleSetVMListResult struct {
autorest.Response `json:"-"`
Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"`
NextLink *string `json:",omitempty"`
NextLink *string `json:"nextLink,omitempty"`
}
// VirtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. It returns

View File

@ -32,7 +32,13 @@ type UsageOperationsClient struct {
// NewUsageOperationsClient creates an instance of the UsageOperationsClient
// client.
func NewUsageOperationsClient(subscriptionID string) UsageOperationsClient {
return UsageOperationsClient{New(subscriptionID)}
return NewUsageOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewUsageOperationsClientWithBaseURI creates an instance of the
// UsageOperationsClient client.
func NewUsageOperationsClientWithBaseURI(baseURI string, subscriptionID string) UsageOperationsClient {
return UsageOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// List lists compute usages for a subscription.

View File

@ -24,7 +24,7 @@ import (
const (
major = "3"
minor = "0"
minor = "2"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"

View File

@ -32,7 +32,13 @@ type VirtualMachineExtensionImagesClient struct {
// NewVirtualMachineExtensionImagesClient creates an instance of the
// VirtualMachineExtensionImagesClient client.
func NewVirtualMachineExtensionImagesClient(subscriptionID string) VirtualMachineExtensionImagesClient {
return VirtualMachineExtensionImagesClient{New(subscriptionID)}
return NewVirtualMachineExtensionImagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualMachineExtensionImagesClientWithBaseURI creates an instance of
// the VirtualMachineExtensionImagesClient client.
func NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionImagesClient {
return VirtualMachineExtensionImagesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Get gets a virtual machine extension image.

View File

@ -32,7 +32,13 @@ type VirtualMachineExtensionsClient struct {
// NewVirtualMachineExtensionsClient creates an instance of the
// VirtualMachineExtensionsClient client.
func NewVirtualMachineExtensionsClient(subscriptionID string) VirtualMachineExtensionsClient {
return VirtualMachineExtensionsClient{New(subscriptionID)}
return NewVirtualMachineExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualMachineExtensionsClientWithBaseURI creates an instance of the
// VirtualMachineExtensionsClient client.
func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionsClient {
return VirtualMachineExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the operation to create or update the extension. This method

View File

@ -32,7 +32,13 @@ type VirtualMachineImagesClient struct {
// NewVirtualMachineImagesClient creates an instance of the
// VirtualMachineImagesClient client.
func NewVirtualMachineImagesClient(subscriptionID string) VirtualMachineImagesClient {
return VirtualMachineImagesClient{New(subscriptionID)}
return NewVirtualMachineImagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualMachineImagesClientWithBaseURI creates an instance of the
// VirtualMachineImagesClient client.
func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineImagesClient {
return VirtualMachineImagesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Get gets a virtual machine image.

View File

@ -32,7 +32,13 @@ type VirtualMachinesClient struct {
// NewVirtualMachinesClient creates an instance of the VirtualMachinesClient
// client.
func NewVirtualMachinesClient(subscriptionID string) VirtualMachinesClient {
return VirtualMachinesClient{New(subscriptionID)}
return NewVirtualMachinesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualMachinesClientWithBaseURI creates an instance of the
// VirtualMachinesClient client.
func NewVirtualMachinesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachinesClient {
return VirtualMachinesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Capture captures the VM by copying virtual hard disks of the VM and outputs
@ -501,6 +507,30 @@ func (client VirtualMachinesClient) ListResponder(resp *http.Response) (result V
return
}
// ListNextResults retrieves the next set of results, if any.
func (client VirtualMachinesClient) ListNextResults(lastResults VirtualMachineListResult) (result VirtualMachineListResult, err error) {
req, err := lastResults.VirtualMachineListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "List", resp, "Failure responding to next results request request")
}
return
}
// ListAll gets the list of Virtual Machines in the subscription. Use nextLink
// property in the response to get the next page of Virtual Machines. Do this
// till nextLink is not null to fetch all the Virtual Machines.

View File

@ -32,7 +32,13 @@ type VirtualMachineScaleSetsClient struct {
// NewVirtualMachineScaleSetsClient creates an instance of the
// VirtualMachineScaleSetsClient client.
func NewVirtualMachineScaleSetsClient(subscriptionID string) VirtualMachineScaleSetsClient {
return VirtualMachineScaleSetsClient{New(subscriptionID)}
return NewVirtualMachineScaleSetsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualMachineScaleSetsClientWithBaseURI creates an instance of the
// VirtualMachineScaleSetsClient client.
func NewVirtualMachineScaleSetsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetsClient {
return VirtualMachineScaleSetsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate allows you to create or update a virtual machine scale set

View File

@ -32,15 +32,21 @@ type VirtualMachineScaleSetVMsClient struct {
// NewVirtualMachineScaleSetVMsClient creates an instance of the
// VirtualMachineScaleSetVMsClient client.
func NewVirtualMachineScaleSetVMsClient(subscriptionID string) VirtualMachineScaleSetVMsClient {
return VirtualMachineScaleSetVMsClient{New(subscriptionID)}
return NewVirtualMachineScaleSetVMsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// Deallocate allows you to deallocate a virtual machine virtual machine scale
// set.Shuts down the virtual machine and releases the compute resources. You
// are not billed for the compute resources that this virtual machine uses.
// This method may poll for completion. Polling can be canceled by passing
// the cancel channel argument. The channel will be used to cancel polling
// and any outstanding HTTP requests.
// NewVirtualMachineScaleSetVMsClientWithBaseURI creates an instance of the
// VirtualMachineScaleSetVMsClient client.
func NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMsClient {
return VirtualMachineScaleSetVMsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Deallocate allows you to deallocate a virtual machine scale set virtual
// machine. Shuts down the virtual machine and releases the compute
// resources. You are not billed for the compute resources that this virtual
// machine uses. This method may poll for completion. Polling can be canceled
// by passing the cancel channel argument. The channel will be used to cancel
// polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. instanceID is the instance id of

View File

@ -32,7 +32,13 @@ type VirtualMachineSizesClient struct {
// NewVirtualMachineSizesClient creates an instance of the
// VirtualMachineSizesClient client.
func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient {
return VirtualMachineSizesClient{New(subscriptionID)}
return NewVirtualMachineSizesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualMachineSizesClientWithBaseURI creates an instance of the
// VirtualMachineSizesClient client.
func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineSizesClient {
return VirtualMachineSizesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// List lists all available virtual machine sizes for a subscription in a

View File

@ -36,7 +36,13 @@ type ApplicationGatewaysClient struct {
// NewApplicationGatewaysClient creates an instance of the
// ApplicationGatewaysClient client.
func NewApplicationGatewaysClient(subscriptionID string) ApplicationGatewaysClient {
return ApplicationGatewaysClient{New(subscriptionID)}
return NewApplicationGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewApplicationGatewaysClientWithBaseURI creates an instance of the
// ApplicationGatewaysClient client.
func NewApplicationGatewaysClientWithBaseURI(baseURI string, subscriptionID string) ApplicationGatewaysClient {
return ApplicationGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the Put ApplicationGateway operation creates/updates a
@ -240,7 +246,7 @@ func (client ApplicationGatewaysClient) GetResponder(resp *http.Response) (resul
return
}
// List the List ApplicationGateway opertion retrieves all the
// List the List ApplicationGateway operation retrieves all the
// applicationgateways in a resource group.
//
// resourceGroupName is the name of the resource group.
@ -326,7 +332,7 @@ func (client ApplicationGatewaysClient) ListNextResults(lastResults ApplicationG
return
}
// ListAll the List applicationgateway opertion retrieves all the
// ListAll the List applicationgateway operation retrieves all the
// applicationgateways in a subscription.
func (client ApplicationGatewaysClient) ListAll() (result ApplicationGatewayListResult, err error) {
req, err := client.ListAllPreparer()

View File

@ -1,5 +1,5 @@
// Package network implements the Azure ARM Network service API version
// 2016-03-30.
// 2016-06-01.
//
// The Microsoft Azure Network management API provides a RESTful set of web
// services that interact with Microsoft Azure Networks service to manage
@ -33,7 +33,7 @@ import (
const (
// APIVersion is the version of the Network
APIVersion = "2016-03-30"
APIVersion = "2016-06-01"
// DefaultBaseURI is the default URI used for the service Network
DefaultBaseURI = "https://management.azure.com"
@ -49,9 +49,14 @@ type ManagementClient struct {
// New creates an instance of the ManagementClient client.
func New(subscriptionID string) ManagementClient {
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewWithBaseURI creates an instance of the ManagementClient client.
func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: DefaultBaseURI,
BaseURI: baseURI,
APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}

View File

@ -36,7 +36,13 @@ type ExpressRouteCircuitAuthorizationsClient struct {
// NewExpressRouteCircuitAuthorizationsClient creates an instance of the
// ExpressRouteCircuitAuthorizationsClient client.
func NewExpressRouteCircuitAuthorizationsClient(subscriptionID string) ExpressRouteCircuitAuthorizationsClient {
return ExpressRouteCircuitAuthorizationsClient{New(subscriptionID)}
return NewExpressRouteCircuitAuthorizationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewExpressRouteCircuitAuthorizationsClientWithBaseURI creates an instance
// of the ExpressRouteCircuitAuthorizationsClient client.
func NewExpressRouteCircuitAuthorizationsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitAuthorizationsClient {
return ExpressRouteCircuitAuthorizationsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the Put Authorization operation creates/updates an

View File

@ -36,7 +36,13 @@ type ExpressRouteCircuitPeeringsClient struct {
// NewExpressRouteCircuitPeeringsClient creates an instance of the
// ExpressRouteCircuitPeeringsClient client.
func NewExpressRouteCircuitPeeringsClient(subscriptionID string) ExpressRouteCircuitPeeringsClient {
return ExpressRouteCircuitPeeringsClient{New(subscriptionID)}
return NewExpressRouteCircuitPeeringsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewExpressRouteCircuitPeeringsClientWithBaseURI creates an instance of the
// ExpressRouteCircuitPeeringsClient client.
func NewExpressRouteCircuitPeeringsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitPeeringsClient {
return ExpressRouteCircuitPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the Put Pering operation creates/updates an peering in the

View File

@ -36,7 +36,13 @@ type ExpressRouteCircuitsClient struct {
// NewExpressRouteCircuitsClient creates an instance of the
// ExpressRouteCircuitsClient client.
func NewExpressRouteCircuitsClient(subscriptionID string) ExpressRouteCircuitsClient {
return ExpressRouteCircuitsClient{New(subscriptionID)}
return NewExpressRouteCircuitsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewExpressRouteCircuitsClientWithBaseURI creates an instance of the
// ExpressRouteCircuitsClient client.
func NewExpressRouteCircuitsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitsClient {
return ExpressRouteCircuitsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the Put ExpressRouteCircuit operation creates/updates a
@ -240,7 +246,7 @@ func (client ExpressRouteCircuitsClient) GetResponder(resp *http.Response) (resu
return
}
// GetPeeringStats the Liststats ExpressRouteCircuit opertion retrieves all
// GetPeeringStats the Liststats ExpressRouteCircuit operation retrieves all
// the stats from a ExpressRouteCircuits in a resource group.
//
// resourceGroupName is the name of the resource group. circuitName is the
@ -305,8 +311,8 @@ func (client ExpressRouteCircuitsClient) GetPeeringStatsResponder(resp *http.Res
return
}
// GetStats the Liststats ExpressRouteCircuit opertion retrieves all the stats
// from a ExpressRouteCircuits in a resource group.
// GetStats the Liststats ExpressRouteCircuit operation retrieves all the
// stats from a ExpressRouteCircuits in a resource group.
//
// resourceGroupName is the name of the resource group. circuitName is the
// name of the circuit.
@ -369,7 +375,7 @@ func (client ExpressRouteCircuitsClient) GetStatsResponder(resp *http.Response)
return
}
// List the List ExpressRouteCircuit opertion retrieves all the
// List the List ExpressRouteCircuit operation retrieves all the
// ExpressRouteCircuits in a resource group.
//
// resourceGroupName is the name of the resource group.
@ -455,7 +461,7 @@ func (client ExpressRouteCircuitsClient) ListNextResults(lastResults ExpressRout
return
}
// ListAll the List ExpressRouteCircuit opertion retrieves all the
// ListAll the List ExpressRouteCircuit operation retrieves all the
// ExpressRouteCircuits in a subscription.
func (client ExpressRouteCircuitsClient) ListAll() (result ExpressRouteCircuitListResult, err error) {
req, err := client.ListAllPreparer()
@ -538,7 +544,7 @@ func (client ExpressRouteCircuitsClient) ListAllNextResults(lastResults ExpressR
return
}
// ListArpTable the ListArpTable from ExpressRouteCircuit opertion retrieves
// ListArpTable the ListArpTable from ExpressRouteCircuit operation retrieves
// the currently advertised arp table associated with the
// ExpressRouteCircuits in a resource group. This method may poll for
// completion. Polling can be canceled by passing the cancel channel
@ -610,7 +616,7 @@ func (client ExpressRouteCircuitsClient) ListArpTableResponder(resp *http.Respon
return
}
// ListRoutesTable the ListRoutesTable from ExpressRouteCircuit opertion
// ListRoutesTable the ListRoutesTable from ExpressRouteCircuit operation
// retrieves the currently advertised routes table associated with the
// ExpressRouteCircuits in a resource group. This method may poll for
// completion. Polling can be canceled by passing the cancel channel
@ -683,7 +689,7 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableResponder(resp *http.Res
}
// ListRoutesTableSummary the ListRoutesTable from ExpressRouteCircuit
// opertion retrieves the currently advertised routes table associated with
// operation retrieves the currently advertised routes table associated with
// the ExpressRouteCircuits in a resource group. This method may poll for
// completion. Polling can be canceled by passing the cancel channel
// argument. The channel will be used to cancel polling and any outstanding

View File

@ -36,10 +36,16 @@ type ExpressRouteServiceProvidersClient struct {
// NewExpressRouteServiceProvidersClient creates an instance of the
// ExpressRouteServiceProvidersClient client.
func NewExpressRouteServiceProvidersClient(subscriptionID string) ExpressRouteServiceProvidersClient {
return ExpressRouteServiceProvidersClient{New(subscriptionID)}
return NewExpressRouteServiceProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// List the List ExpressRouteServiceProvider opertion retrieves all the
// NewExpressRouteServiceProvidersClientWithBaseURI creates an instance of the
// ExpressRouteServiceProvidersClient client.
func NewExpressRouteServiceProvidersClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteServiceProvidersClient {
return ExpressRouteServiceProvidersClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// List the List ExpressRouteServiceProvider operation retrieves all the
// available ExpressRouteServiceProviders.
func (client ExpressRouteServiceProvidersClient) List() (result ExpressRouteServiceProviderListResult, err error) {
req, err := client.ListPreparer()

View File

@ -35,7 +35,13 @@ type InterfacesClient struct {
// NewInterfacesClient creates an instance of the InterfacesClient client.
func NewInterfacesClient(subscriptionID string) InterfacesClient {
return InterfacesClient{New(subscriptionID)}
return NewInterfacesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewInterfacesClientWithBaseURI creates an instance of the InterfacesClient
// client.
func NewInterfacesClientWithBaseURI(baseURI string, subscriptionID string) InterfacesClient {
return InterfacesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the Put NetworkInterface operation creates/updates a
@ -243,6 +249,74 @@ func (client InterfacesClient) GetResponder(resp *http.Response) (result Interfa
return
}
// GetEffectiveRouteTable the get effective routetable operation retrieves all
// the route tables applied on a networkInterface. This method may poll for
// completion. Polling can be canceled by passing the cancel channel
// argument. The channel will be used to cancel polling and any outstanding
// HTTP requests.
//
// resourceGroupName is the name of the resource group. networkInterfaceName
// is the name of the network interface.
func (client InterfacesClient) GetEffectiveRouteTable(resourceGroupName string, networkInterfaceName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.GetEffectiveRouteTablePreparer(resourceGroupName, networkInterfaceName, cancel)
if err != nil {
return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "GetEffectiveRouteTable", nil, "Failure preparing request")
}
resp, err := client.GetEffectiveRouteTableSender(req)
if err != nil {
result.Response = resp
return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "GetEffectiveRouteTable", resp, "Failure sending request")
}
result, err = client.GetEffectiveRouteTableResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.InterfacesClient", "GetEffectiveRouteTable", resp, "Failure responding to request")
}
return
}
// GetEffectiveRouteTablePreparer prepares the GetEffectiveRouteTable request.
func (client InterfacesClient) GetEffectiveRouteTablePreparer(resourceGroupName string, networkInterfaceName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"networkInterfaceName": autorest.Encode("path", networkInterfaceName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveRouteTable", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// 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) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// GetEffectiveRouteTableResponder handles the response to the GetEffectiveRouteTable request. The method always
// closes the http.Response Body.
func (client InterfacesClient) GetEffectiveRouteTableResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
// GetVirtualMachineScaleSetNetworkInterface the Get ntework interface
// operation retreives information about the specified network interface in a
// virtual machine scale set.
@ -315,7 +389,7 @@ func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfaceResponde
return
}
// List the List networkInterfaces opertion retrieves all the
// List the List networkInterfaces operation retrieves all the
// networkInterfaces in a resource group.
//
// resourceGroupName is the name of the resource group.
@ -401,7 +475,7 @@ func (client InterfacesClient) ListNextResults(lastResults InterfaceListResult)
return
}
// ListAll the List networkInterfaces opertion retrieves all the
// ListAll the List networkInterfaces operation retrieves all the
// networkInterfaces in a subscription.
func (client InterfacesClient) ListAll() (result InterfaceListResult, err error) {
req, err := client.ListAllPreparer()
@ -484,6 +558,74 @@ func (client InterfacesClient) ListAllNextResults(lastResults InterfaceListResul
return
}
// ListEffectiveNetworkSecurityGroups the list effective network security
// group operation retrieves all the network security groups applied on a
// networkInterface. This method may poll for completion. Polling can be
// canceled by passing the cancel channel argument. The channel will be used
// to cancel polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. networkInterfaceName
// is the name of the network interface.
func (client InterfacesClient) ListEffectiveNetworkSecurityGroups(resourceGroupName string, networkInterfaceName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.ListEffectiveNetworkSecurityGroupsPreparer(resourceGroupName, networkInterfaceName, cancel)
if err != nil {
return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListEffectiveNetworkSecurityGroups", nil, "Failure preparing request")
}
resp, err := client.ListEffectiveNetworkSecurityGroupsSender(req)
if err != nil {
result.Response = resp
return result, autorest.NewErrorWithError(err, "network.InterfacesClient", "ListEffectiveNetworkSecurityGroups", resp, "Failure sending request")
}
result, err = client.ListEffectiveNetworkSecurityGroupsResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.InterfacesClient", "ListEffectiveNetworkSecurityGroups", resp, "Failure responding to request")
}
return
}
// ListEffectiveNetworkSecurityGroupsPreparer prepares the ListEffectiveNetworkSecurityGroups request.
func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsPreparer(resourceGroupName string, networkInterfaceName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"networkInterfaceName": autorest.Encode("path", networkInterfaceName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}/effectiveNetworkSecurityGroups", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// 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) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// ListEffectiveNetworkSecurityGroupsResponder handles the response to the ListEffectiveNetworkSecurityGroups request. The method always
// closes the http.Response Body.
func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
// ListVirtualMachineScaleSetNetworkInterfaces the list network interface
// operation retrieves information about all network interfaces in a virtual
// machine scale set.

View File

@ -36,7 +36,13 @@ type LoadBalancersClient struct {
// NewLoadBalancersClient creates an instance of the LoadBalancersClient
// client.
func NewLoadBalancersClient(subscriptionID string) LoadBalancersClient {
return LoadBalancersClient{New(subscriptionID)}
return NewLoadBalancersClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewLoadBalancersClientWithBaseURI creates an instance of the
// LoadBalancersClient client.
func NewLoadBalancersClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancersClient {
return LoadBalancersClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the Put LoadBalancer operation creates/updates a
@ -243,7 +249,7 @@ func (client LoadBalancersClient) GetResponder(resp *http.Response) (result Load
return
}
// List the List loadBalancer opertion retrieves all the loadbalancers in a
// List the List loadBalancer operation retrieves all the loadbalancers in a
// resource group.
//
// resourceGroupName is the name of the resource group.
@ -329,8 +335,8 @@ func (client LoadBalancersClient) ListNextResults(lastResults LoadBalancerListRe
return
}
// ListAll the List loadBalancer opertion retrieves all the loadbalancers in a
// subscription.
// ListAll the List loadBalancer operation retrieves all the loadbalancers in
// a subscription.
func (client LoadBalancersClient) ListAll() (result LoadBalancerListResult, err error) {
req, err := client.ListAllPreparer()
if err != nil {

View File

@ -36,7 +36,13 @@ type LocalNetworkGatewaysClient struct {
// NewLocalNetworkGatewaysClient creates an instance of the
// LocalNetworkGatewaysClient client.
func NewLocalNetworkGatewaysClient(subscriptionID string) LocalNetworkGatewaysClient {
return LocalNetworkGatewaysClient{New(subscriptionID)}
return NewLocalNetworkGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewLocalNetworkGatewaysClientWithBaseURI creates an instance of the
// LocalNetworkGatewaysClient client.
func NewLocalNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID string) LocalNetworkGatewaysClient {
return LocalNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the Put LocalNetworkGateway operation creates/updates a
@ -243,8 +249,8 @@ func (client LocalNetworkGatewaysClient) GetResponder(resp *http.Response) (resu
return
}
// List the List LocalNetworkGateways opertion retrieves all the local network
// gateways stored.
// List the List LocalNetworkGateways operation retrieves all the local
// network gateways stored.
//
// resourceGroupName is the name of the resource group.
func (client LocalNetworkGatewaysClient) List(resourceGroupName string) (result LocalNetworkGatewayListResult, err error) {

View File

@ -96,6 +96,22 @@ const (
StandardSmall ApplicationGatewaySkuName = "Standard_Small"
)
// ApplicationGatewaySslProtocol enumerates the values for application gateway
// ssl protocol.
type ApplicationGatewaySslProtocol string
const (
// TLSv10 specifies the tl sv 10 state for application gateway ssl
// protocol.
TLSv10 ApplicationGatewaySslProtocol = "TLSv1_0"
// TLSv11 specifies the tl sv 11 state for application gateway ssl
// protocol.
TLSv11 ApplicationGatewaySslProtocol = "TLSv1_1"
// TLSv12 specifies the tl sv 12 state for application gateway ssl
// protocol.
TLSv12 ApplicationGatewaySslProtocol = "TLSv1_2"
)
// ApplicationGatewayTier enumerates the values for application gateway tier.
type ApplicationGatewayTier string
@ -114,6 +130,34 @@ const (
InUse AuthorizationUseStatus = "InUse"
)
// EffectiveRouteSource enumerates the values for effective route source.
type EffectiveRouteSource string
const (
// EffectiveRouteSourceDefault specifies the effective route source
// default state for effective route source.
EffectiveRouteSourceDefault EffectiveRouteSource = "Default"
// EffectiveRouteSourceUnknown specifies the effective route source
// unknown state for effective route source.
EffectiveRouteSourceUnknown EffectiveRouteSource = "Unknown"
// EffectiveRouteSourceUser specifies the effective route source user
// state for effective route source.
EffectiveRouteSourceUser EffectiveRouteSource = "User"
// EffectiveRouteSourceVirtualNetworkGateway specifies the effective route
// source virtual network gateway state for effective route source.
EffectiveRouteSourceVirtualNetworkGateway EffectiveRouteSource = "VirtualNetworkGateway"
)
// EffectiveRouteState enumerates the values for effective route state.
type EffectiveRouteState string
const (
// Active specifies the active state for effective route state.
Active EffectiveRouteState = "Active"
// Invalid specifies the invalid state for effective route state.
Invalid EffectiveRouteState = "Invalid"
)
// ExpressRouteCircuitPeeringAdvertisedPublicPrefixState enumerates the values
// for express route circuit peering advertised public prefix state.
type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string
@ -426,6 +470,22 @@ const (
VirtualNetworkGatewayTypeVpn VirtualNetworkGatewayType = "Vpn"
)
// VirtualNetworkPeeringState enumerates the values for virtual network
// peering state.
type VirtualNetworkPeeringState string
const (
// VirtualNetworkPeeringStateConnected specifies the virtual network
// peering state connected state for virtual network peering state.
VirtualNetworkPeeringStateConnected VirtualNetworkPeeringState = "Connected"
// VirtualNetworkPeeringStateDisconnected specifies the virtual network
// peering state disconnected state for virtual network peering state.
VirtualNetworkPeeringStateDisconnected VirtualNetworkPeeringState = "Disconnected"
// VirtualNetworkPeeringStateInitiated specifies the virtual network
// peering state initiated state for virtual network peering state.
VirtualNetworkPeeringStateInitiated VirtualNetworkPeeringState = "Initiated"
)
// VpnType enumerates the values for vpn type.
type VpnType string
@ -454,6 +514,22 @@ type ApplicationGateway struct {
Etag *string `json:"etag,omitempty"`
}
// ApplicationGatewayAuthenticationCertificate is authentication certificates
// of application gateway
type ApplicationGatewayAuthenticationCertificate struct {
ID *string `json:"id,omitempty"`
Properties *ApplicationGatewayAuthenticationCertificatePropertiesFormat `json:"properties,omitempty"`
Name *string `json:"name,omitempty"`
Etag *string `json:"etag,omitempty"`
}
// ApplicationGatewayAuthenticationCertificatePropertiesFormat is properties
// of Authentication certificates of application gateway
type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct {
Data *string `json:"data,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
// ApplicationGatewayBackendAddress is backend Address of application gateway
type ApplicationGatewayBackendAddress struct {
Fqdn *string `json:"fqdn,omitempty"`
@ -489,12 +565,13 @@ type ApplicationGatewayBackendHTTPSettings struct {
// ApplicationGatewayBackendHTTPSettingsPropertiesFormat is properties of
// Backend address pool settings of application gateway
type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct {
Port *int32 `json:"port,omitempty"`
Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"`
CookieBasedAffinity ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"`
RequestTimeout *int32 `json:"requestTimeout,omitempty"`
Probe *SubResource `json:"probe,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
Port *int32 `json:"port,omitempty"`
Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"`
CookieBasedAffinity ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"`
RequestTimeout *int32 `json:"requestTimeout,omitempty"`
Probe *SubResource `json:"probe,omitempty"`
AuthenticationCertificates *[]SubResource `json:"authenticationCertificates,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
// ApplicationGatewayFrontendIPConfiguration is frontend IP configuration of
@ -566,8 +643,8 @@ type ApplicationGatewayIPConfigurationPropertiesFormat struct {
ProvisioningState *string `json:"provisioningState,omitempty"`
}
// ApplicationGatewayListResult is response for ListLoadBalancers Api service
// call
// ApplicationGatewayListResult is response for ListApplicationGateways Api
// service call
type ApplicationGatewayListResult struct {
autorest.Response `json:"-"`
Value *[]ApplicationGateway `json:"value,omitempty"`
@ -626,20 +703,22 @@ type ApplicationGatewayProbePropertiesFormat struct {
// ApplicationGatewayPropertiesFormat is properties of Application Gateway
type ApplicationGatewayPropertiesFormat struct {
Sku *ApplicationGatewaySku `json:"sku,omitempty"`
OperationalState ApplicationGatewayOperationalState `json:"operationalState,omitempty"`
GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"`
SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"`
FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"`
FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"`
Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"`
BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"`
BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"`
HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"`
URLPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"`
RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"`
ResourceGUID *string `json:"resourceGuid,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
Sku *ApplicationGatewaySku `json:"sku,omitempty"`
SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"`
OperationalState ApplicationGatewayOperationalState `json:"operationalState,omitempty"`
GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"`
AuthenticationCertificates *[]ApplicationGatewayAuthenticationCertificate `json:"authenticationCertificates,omitempty"`
SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"`
FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"`
FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"`
Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"`
BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"`
BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"`
HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"`
URLPathMaps *[]ApplicationGatewayURLPathMap `json:"urlPathMaps,omitempty"`
RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"`
ResourceGUID *string `json:"resourceGuid,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
// ApplicationGatewayRequestRoutingRule is request routing rule of application
@ -686,6 +765,11 @@ type ApplicationGatewaySslCertificatePropertiesFormat struct {
ProvisioningState *string `json:"provisioningState,omitempty"`
}
// ApplicationGatewaySslPolicy is application gateway SSL policy
type ApplicationGatewaySslPolicy struct {
DisabledSslProtocols *[]ApplicationGatewaySslProtocol `json:"disabledSslProtocols,omitempty"`
}
// ApplicationGatewayURLPathMap is urlPathMap of application gateway
type ApplicationGatewayURLPathMap struct {
ID *string `json:"id,omitempty"`
@ -694,7 +778,7 @@ type ApplicationGatewayURLPathMap struct {
Etag *string `json:"etag,omitempty"`
}
// ApplicationGatewayURLPathMapPropertiesFormat is properties of probe of
// ApplicationGatewayURLPathMapPropertiesFormat is properties of UrlPathMap of
// application gateway
type ApplicationGatewayURLPathMapPropertiesFormat struct {
DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"`
@ -799,6 +883,61 @@ type DNSNameAvailabilityResult struct {
Available *bool `json:"available,omitempty"`
}
// EffectiveNetworkSecurityGroup is effective NetworkSecurityGroup
type EffectiveNetworkSecurityGroup struct {
NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"`
Association *EffectiveNetworkSecurityGroupAssociation `json:"association,omitempty"`
EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"`
}
// EffectiveNetworkSecurityGroupAssociation is effective NetworkSecurityGroup
// association
type EffectiveNetworkSecurityGroupAssociation struct {
Subnet *SubResource `json:"subnet,omitempty"`
NetworkInterface *SubResource `json:"networkInterface,omitempty"`
}
// EffectiveNetworkSecurityGroupListResult is response for list effective
// network security groups api servive call
type EffectiveNetworkSecurityGroupListResult struct {
autorest.Response `json:"-"`
Value *[]EffectiveNetworkSecurityGroup `json:"value,omitempty"`
NextLink *string `json:"nextLink,omitempty"`
}
// EffectiveNetworkSecurityRule is effective NetworkSecurityRules
type EffectiveNetworkSecurityRule struct {
Name *string `json:"name,omitempty"`
Protocol SecurityRuleProtocol `json:"protocol,omitempty"`
SourcePortRange *string `json:"sourcePortRange,omitempty"`
DestinationPortRange *string `json:"destinationPortRange,omitempty"`
SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"`
DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"`
ExpandedSourceAddressPrefix *[]string `json:"expandedSourceAddressPrefix,omitempty"`
ExpandedDestinationAddressPrefix *[]string `json:"expandedDestinationAddressPrefix,omitempty"`
Access SecurityRuleAccess `json:"access,omitempty"`
Priority *int32 `json:"priority,omitempty"`
Direction SecurityRuleDirection `json:"direction,omitempty"`
}
// EffectiveRoute is effective Route
type EffectiveRoute struct {
Name *string `json:"name,omitempty"`
Source EffectiveRouteSource `json:"source,omitempty"`
State EffectiveRouteState `json:"state,omitempty"`
AddressPrefix *[]string `json:"addressPrefix,omitempty"`
NextHopIPAddress *[]string `json:"nextHopIpAddress,omitempty"`
NextHopType RouteNextHopType `json:"nextHopType,omitempty"`
}
// EffectiveRouteListResult is response for list effective route api servive
// call
type EffectiveRouteListResult struct {
autorest.Response `json:"-"`
Value *[]EffectiveRoute `json:"value,omitempty"`
NextLink *string `json:"nextLink,omitempty"`
}
// Error is
type Error struct {
Code *string `json:"code,omitempty"`
@ -919,6 +1058,8 @@ type ExpressRouteCircuitPeeringPropertiesFormat struct {
MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"`
Stats *ExpressRouteCircuitStats `json:"stats,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"`
LastModifiedBy *string `json:"lastModifiedBy,omitempty"`
}
// ExpressRouteCircuitPropertiesFormat is properties of ExpressRouteCircuit
@ -932,6 +1073,7 @@ type ExpressRouteCircuitPropertiesFormat struct {
ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"`
ServiceProviderProperties *ExpressRouteCircuitServiceProviderProperties `json:"serviceProviderProperties,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"`
}
// ExpressRouteCircuitRoutesTable is the routes table associated with the
@ -1119,7 +1261,7 @@ type Interface struct {
Etag *string `json:"etag,omitempty"`
}
// InterfaceDNSSettings is dns Settings of a network interface
// InterfaceDNSSettings is dns settings of a network interface
type InterfaceDNSSettings struct {
DNSServers *[]string `json:"dnsServers,omitempty"`
AppliedDNSServers *[]string `json:"appliedDnsServers,omitempty"`
@ -1182,6 +1324,14 @@ type InterfacePropertiesFormat struct {
ProvisioningState *string `json:"provisioningState,omitempty"`
}
// IPAddressAvailabilityResult is response for CheckIPAddressAvailability Api
// service call
type IPAddressAvailabilityResult struct {
autorest.Response `json:"-"`
Available *bool `json:"available,omitempty"`
AvailableIPAddresses *[]string `json:"availableIPAddresses,omitempty"`
}
// IPConfiguration is iPConfiguration
type IPConfiguration struct {
ID *string `json:"id,omitempty"`
@ -1402,6 +1552,21 @@ type Resource struct {
Tags *map[string]*string `json:"tags,omitempty"`
}
// ResourceNavigationLink is resourceNavigationLink resource
type ResourceNavigationLink struct {
ID *string `json:"id,omitempty"`
Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"`
Name *string `json:"name,omitempty"`
Etag *string `json:"etag,omitempty"`
}
// ResourceNavigationLinkFormat is properties of ResourceNavigationLink
type ResourceNavigationLinkFormat struct {
LinkedResourceType *string `json:"linkedResourceType,omitempty"`
Link *string `json:"link,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
// Route is route resource
type Route struct {
autorest.Response `json:"-"`
@ -1598,11 +1763,12 @@ func (client SubnetListResult) SubnetListResultPreparer() (*http.Request, error)
// SubnetPropertiesFormat is
type SubnetPropertiesFormat struct {
AddressPrefix *string `json:"addressPrefix,omitempty"`
NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"`
RouteTable *RouteTable `json:"routeTable,omitempty"`
IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
AddressPrefix *string `json:"addressPrefix,omitempty"`
NetworkSecurityGroup *SecurityGroup `json:"networkSecurityGroup,omitempty"`
RouteTable *RouteTable `json:"routeTable,omitempty"`
IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"`
ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
// SubResource is
@ -1628,7 +1794,7 @@ type UsageName struct {
type UsagesListResult struct {
autorest.Response `json:"-"`
Value *[]Usage `json:"value,omitempty"`
NextLink *string `json:",omitempty"`
NextLink *string `json:"nextLink,omitempty"`
}
// UsagesListResultPreparer prepares a request to retrieve the next set of results. It returns
@ -1731,7 +1897,6 @@ type VirtualNetworkGatewayIPConfiguration struct {
// VirtualNetworkGatewayIPConfigurationPropertiesFormat is properties of
// VirtualNetworkGatewayIPConfiguration
type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct {
PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
Subnet *SubResource `json:"subnet,omitempty"`
PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"`
@ -1799,13 +1964,54 @@ func (client VirtualNetworkListResult) VirtualNetworkListResultPreparer() (*http
autorest.WithBaseURL(to.String(client.NextLink)))
}
// VirtualNetworkPeering is peerings in a VirtualNework resource
type VirtualNetworkPeering struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Properties *VirtualNetworkPeeringPropertiesFormat `json:"properties,omitempty"`
Name *string `json:"name,omitempty"`
Etag *string `json:"etag,omitempty"`
}
// VirtualNetworkPeeringListResult is response for ListSubnets Api service
// callRetrieves all subnet that belongs to a virtual network
type VirtualNetworkPeeringListResult struct {
autorest.Response `json:"-"`
Value *[]VirtualNetworkPeering `json:"value,omitempty"`
NextLink *string `json:"nextLink,omitempty"`
}
// VirtualNetworkPeeringListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client VirtualNetworkPeeringListResult) VirtualNetworkPeeringListResultPreparer() (*http.Request, error) {
if client.NextLink == nil || len(to.String(client.NextLink)) <= 0 {
return nil, nil
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(to.String(client.NextLink)))
}
// VirtualNetworkPeeringPropertiesFormat is
type VirtualNetworkPeeringPropertiesFormat struct {
AllowVirtualNetworkAccess *bool `json:"allowVirtualNetworkAccess,omitempty"`
AllowForwardedTraffic *bool `json:"allowForwardedTraffic,omitempty"`
AllowGatewayTransit *bool `json:"allowGatewayTransit,omitempty"`
UseRemoteGateways *bool `json:"useRemoteGateways,omitempty"`
RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"`
PeeringState VirtualNetworkPeeringState `json:"peeringState,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
// VirtualNetworkPropertiesFormat is
type VirtualNetworkPropertiesFormat struct {
AddressSpace *AddressSpace `json:"addressSpace,omitempty"`
DhcpOptions *DhcpOptions `json:"dhcpOptions,omitempty"`
Subnets *[]Subnet `json:"subnets,omitempty"`
ResourceGUID *string `json:"resourceGuid,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
AddressSpace *AddressSpace `json:"addressSpace,omitempty"`
DhcpOptions *DhcpOptions `json:"dhcpOptions,omitempty"`
Subnets *[]Subnet `json:"subnets,omitempty"`
VirtualNetworkPeerings *[]VirtualNetworkPeering `json:"VirtualNetworkPeerings,omitempty"`
ResourceGUID *string `json:"resourceGuid,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
// VpnClientConfiguration is vpnClientConfiguration for P2S client

View File

@ -36,7 +36,13 @@ type PublicIPAddressesClient struct {
// NewPublicIPAddressesClient creates an instance of the
// PublicIPAddressesClient client.
func NewPublicIPAddressesClient(subscriptionID string) PublicIPAddressesClient {
return PublicIPAddressesClient{New(subscriptionID)}
return NewPublicIPAddressesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewPublicIPAddressesClientWithBaseURI creates an instance of the
// PublicIPAddressesClient client.
func NewPublicIPAddressesClientWithBaseURI(baseURI string, subscriptionID string) PublicIPAddressesClient {
return PublicIPAddressesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the Put PublicIPAddress operation creates/updates a
@ -243,7 +249,7 @@ func (client PublicIPAddressesClient) GetResponder(resp *http.Response) (result
return
}
// List the List publicIpAddress opertion retrieves all the publicIpAddresses
// List the List publicIpAddress operation retrieves all the publicIpAddresses
// in a resource group.
//
// resourceGroupName is the name of the resource group.
@ -329,7 +335,7 @@ func (client PublicIPAddressesClient) ListNextResults(lastResults PublicIPAddres
return
}
// ListAll the List publicIpAddress opertion retrieves all the
// ListAll the List publicIpAddress operation retrieves all the
// publicIpAddresses in a subscription.
func (client PublicIPAddressesClient) ListAll() (result PublicIPAddressListResult, err error) {
req, err := client.ListAllPreparer()

View File

@ -35,7 +35,12 @@ type RoutesClient struct {
// NewRoutesClient creates an instance of the RoutesClient client.
func NewRoutesClient(subscriptionID string) RoutesClient {
return RoutesClient{New(subscriptionID)}
return NewRoutesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewRoutesClientWithBaseURI creates an instance of the RoutesClient client.
func NewRoutesClientWithBaseURI(baseURI string, subscriptionID string) RoutesClient {
return RoutesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the Put route operation creates/updates a route in the
@ -242,7 +247,7 @@ func (client RoutesClient) GetResponder(resp *http.Response) (result Route, err
return
}
// List the List network security rule opertion retrieves all the routes in a
// List the List network security rule operation retrieves all the routes in a
// route table.
//
// resourceGroupName is the name of the resource group. routeTableName is the

View File

@ -35,7 +35,13 @@ type RouteTablesClient struct {
// NewRouteTablesClient creates an instance of the RouteTablesClient client.
func NewRouteTablesClient(subscriptionID string) RouteTablesClient {
return RouteTablesClient{New(subscriptionID)}
return NewRouteTablesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewRouteTablesClientWithBaseURI creates an instance of the
// RouteTablesClient client.
func NewRouteTablesClientWithBaseURI(baseURI string, subscriptionID string) RouteTablesClient {
return RouteTablesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the Put RouteTable operation creates/updates a route tablein

View File

@ -36,7 +36,13 @@ type SecurityGroupsClient struct {
// NewSecurityGroupsClient creates an instance of the SecurityGroupsClient
// client.
func NewSecurityGroupsClient(subscriptionID string) SecurityGroupsClient {
return SecurityGroupsClient{New(subscriptionID)}
return NewSecurityGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewSecurityGroupsClientWithBaseURI creates an instance of the
// SecurityGroupsClient client.
func NewSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string) SecurityGroupsClient {
return SecurityGroupsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the Put NetworkSecurityGroup operation creates/updates a

View File

@ -36,7 +36,13 @@ type SecurityRulesClient struct {
// NewSecurityRulesClient creates an instance of the SecurityRulesClient
// client.
func NewSecurityRulesClient(subscriptionID string) SecurityRulesClient {
return SecurityRulesClient{New(subscriptionID)}
return NewSecurityRulesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewSecurityRulesClientWithBaseURI creates an instance of the
// SecurityRulesClient client.
func NewSecurityRulesClientWithBaseURI(baseURI string, subscriptionID string) SecurityRulesClient {
return SecurityRulesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the Put network security rule operation creates/updates a
@ -248,7 +254,7 @@ func (client SecurityRulesClient) GetResponder(resp *http.Response) (result Secu
return
}
// List the List network security rule opertion retrieves all the security
// List the List network security rule operation retrieves all the security
// rules in a network security group.
//
// resourceGroupName is the name of the resource group.

View File

@ -35,7 +35,12 @@ type SubnetsClient struct {
// NewSubnetsClient creates an instance of the SubnetsClient client.
func NewSubnetsClient(subscriptionID string) SubnetsClient {
return SubnetsClient{New(subscriptionID)}
return NewSubnetsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewSubnetsClientWithBaseURI creates an instance of the SubnetsClient client.
func NewSubnetsClientWithBaseURI(baseURI string, subscriptionID string) SubnetsClient {
return SubnetsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the Put Subnet operation creates/updates a subnet in
@ -247,7 +252,7 @@ func (client SubnetsClient) GetResponder(resp *http.Response) (result Subnet, er
return
}
// List the List subnets opertion retrieves all the subnets in a virtual
// List the List subnets operation retrieves all the subnets in a virtual
// network.
//
// resourceGroupName is the name of the resource group. virtualNetworkName is

View File

@ -35,7 +35,12 @@ type UsagesClient struct {
// NewUsagesClient creates an instance of the UsagesClient client.
func NewUsagesClient(subscriptionID string) UsagesClient {
return UsagesClient{New(subscriptionID)}
return NewUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewUsagesClientWithBaseURI creates an instance of the UsagesClient client.
func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesClient {
return UsagesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// List lists compute usages for a subscription.

View File

@ -24,7 +24,7 @@ import (
const (
major = "3"
minor = "0"
minor = "2"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"
@ -34,7 +34,7 @@ const (
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
return fmt.Sprintf(userAgentFormat, Version(), "network", "2016-03-30")
return fmt.Sprintf(userAgentFormat, Version(), "network", "2016-06-01")
}
// Version returns the semantic version (see http://semver.org) of the client.

View File

@ -36,7 +36,13 @@ type VirtualNetworkGatewayConnectionsClient struct {
// NewVirtualNetworkGatewayConnectionsClient creates an instance of the
// VirtualNetworkGatewayConnectionsClient client.
func NewVirtualNetworkGatewayConnectionsClient(subscriptionID string) VirtualNetworkGatewayConnectionsClient {
return VirtualNetworkGatewayConnectionsClient{New(subscriptionID)}
return NewVirtualNetworkGatewayConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualNetworkGatewayConnectionsClientWithBaseURI creates an instance of
// the VirtualNetworkGatewayConnectionsClient client.
func NewVirtualNetworkGatewayConnectionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkGatewayConnectionsClient {
return VirtualNetworkGatewayConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the Put VirtualNetworkGatewayConnection operation

View File

@ -36,7 +36,13 @@ type VirtualNetworkGatewaysClient struct {
// NewVirtualNetworkGatewaysClient creates an instance of the
// VirtualNetworkGatewaysClient client.
func NewVirtualNetworkGatewaysClient(subscriptionID string) VirtualNetworkGatewaysClient {
return VirtualNetworkGatewaysClient{New(subscriptionID)}
return NewVirtualNetworkGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualNetworkGatewaysClientWithBaseURI creates an instance of the
// VirtualNetworkGatewaysClient client.
func NewVirtualNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkGatewaysClient {
return VirtualNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the Put VirtualNetworkGateway operation creates/updates a
@ -312,7 +318,7 @@ func (client VirtualNetworkGatewaysClient) GetResponder(resp *http.Response) (re
return
}
// List the List VirtualNetworkGateways opertion retrieves all the virtual
// List the List VirtualNetworkGateways operation retrieves all the virtual
// network gateways stored.
//
// resourceGroupName is the name of the resource group.

View File

@ -0,0 +1,342 @@
package network
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
)
// VirtualNetworkPeeringsClient is the the Microsoft Azure Network management
// API provides a RESTful set of web services that interact with Microsoft
// Azure Networks service to manage your network resrources. The API has
// entities that capture the relationship between an end user and the
// Microsoft Azure Networks service.
type VirtualNetworkPeeringsClient struct {
ManagementClient
}
// NewVirtualNetworkPeeringsClient creates an instance of the
// VirtualNetworkPeeringsClient client.
func NewVirtualNetworkPeeringsClient(subscriptionID string) VirtualNetworkPeeringsClient {
return NewVirtualNetworkPeeringsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualNetworkPeeringsClientWithBaseURI creates an instance of the
// VirtualNetworkPeeringsClient client.
func NewVirtualNetworkPeeringsClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkPeeringsClient {
return VirtualNetworkPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the Put virtual network peering operation creates/updates a
// peering in the specified virtual network This method may poll for
// completion. Polling can be canceled by passing the cancel channel
// argument. The channel will be used to cancel polling and any outstanding
// HTTP requests.
//
// resourceGroupName is the name of the resource group. virtualNetworkName is
// the name of the virtual network. virtualNetworkPeeringName is the name of
// the peering. virtualNetworkPeeringParameters is parameters supplied to the
// create/update virtual network peering operation
func (client VirtualNetworkPeeringsClient) CreateOrUpdate(resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.CreateOrUpdatePreparer(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, virtualNetworkPeeringParameters, cancel)
if err != nil {
return result, autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
result.Response = resp
return result, autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client VirtualNetworkPeeringsClient) CreateOrUpdatePreparer(resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, virtualNetworkPeeringParameters VirtualNetworkPeering, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkName": autorest.Encode("path", virtualNetworkName),
"virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName),
}
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", pathParameters),
autorest.WithJSON(virtualNetworkPeeringParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworkPeeringsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
func (client VirtualNetworkPeeringsClient) CreateOrUpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByClosing())
result.Response = resp
return
}
// Delete the delete virtual network peering operation deletes the specified
// peering. This method may poll for completion. Polling can be canceled by
// passing the cancel channel argument. The channel will be used to cancel
// polling and any outstanding HTTP requests.
//
// resourceGroupName is the name of the resource group. virtualNetworkName is
// the name of the virtual network. virtualNetworkPeeringName is the name of
// the virtual network peering.
func (client VirtualNetworkPeeringsClient) Delete(resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName, cancel)
if err != nil {
return result, autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
return result, autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
func (client VirtualNetworkPeeringsClient) DeletePreparer(resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkName": autorest.Encode("path", virtualNetworkName),
"virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName),
}
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworkPeeringsClient) DeleteSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client VirtualNetworkPeeringsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
// Get the Get virtual network peering operation retreives information about
// 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.
func (client VirtualNetworkPeeringsClient) Get(resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string) (result VirtualNetworkPeering, err error) {
req, err := client.GetPreparer(resourceGroupName, virtualNetworkName, virtualNetworkPeeringName)
if err != nil {
return result, autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client VirtualNetworkPeeringsClient) GetPreparer(resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkName": autorest.Encode("path", virtualNetworkName),
"virtualNetworkPeeringName": autorest.Encode("path", virtualNetworkPeeringName),
}
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings/{virtualNetworkPeeringName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworkPeeringsClient) GetSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetResponder handles the response to the Get request. The method always
// closes the http.Response Body.
func (client VirtualNetworkPeeringsClient) GetResponder(resp *http.Response) (result VirtualNetworkPeering, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// List the List virtual network peerings operation retrieves all the peerings
// in a virtual network.
//
// resourceGroupName is the name of the resource group. virtualNetworkName is
// the name of the virtual network.
func (client VirtualNetworkPeeringsClient) List(resourceGroupName string, virtualNetworkName string) (result VirtualNetworkPeeringListResult, err error) {
req, err := client.ListPreparer(resourceGroupName, virtualNetworkName)
if err != nil {
return result, autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client VirtualNetworkPeeringsClient) ListPreparer(resourceGroupName string, virtualNetworkName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkName": autorest.Encode("path", virtualNetworkName),
}
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/virtualNetworkPeerings", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworkPeeringsClient) ListSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// ListResponder handles the response to the List request. The method always
// closes the http.Response Body.
func (client VirtualNetworkPeeringsClient) ListResponder(resp *http.Response) (result VirtualNetworkPeeringListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListNextResults retrieves the next set of results, if any.
func (client VirtualNetworkPeeringsClient) ListNextResults(lastResults VirtualNetworkPeeringListResult) (result VirtualNetworkPeeringListResult, err error) {
req, err := lastResults.VirtualNetworkPeeringListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", nil, "Failure preparing next results request request")
}
if req == nil {
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworkPeeringsClient", "List", resp, "Failure responding to next results request request")
}
return
}

View File

@ -36,7 +36,81 @@ type VirtualNetworksClient struct {
// NewVirtualNetworksClient creates an instance of the VirtualNetworksClient
// client.
func NewVirtualNetworksClient(subscriptionID string) VirtualNetworksClient {
return VirtualNetworksClient{New(subscriptionID)}
return NewVirtualNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualNetworksClientWithBaseURI creates an instance of the
// VirtualNetworksClient client.
func NewVirtualNetworksClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworksClient {
return VirtualNetworksClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CheckIPAddressAvailability checks whether a private Ip address is available
// for use.
//
// resourceGroupName is the name of the resource group. virtualNetworkName is
// the name of the virtual network. ipAddress is the private IP address to be
// verified.
func (client VirtualNetworksClient) CheckIPAddressAvailability(resourceGroupName string, virtualNetworkName string, ipAddress string) (result IPAddressAvailabilityResult, err error) {
req, err := client.CheckIPAddressAvailabilityPreparer(resourceGroupName, virtualNetworkName, ipAddress)
if err != nil {
return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "CheckIPAddressAvailability", nil, "Failure preparing request")
}
resp, err := client.CheckIPAddressAvailabilitySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "CheckIPAddressAvailability", resp, "Failure sending request")
}
result, err = client.CheckIPAddressAvailabilityResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.VirtualNetworksClient", "CheckIPAddressAvailability", resp, "Failure responding to request")
}
return
}
// CheckIPAddressAvailabilityPreparer prepares the CheckIPAddressAvailability request.
func (client VirtualNetworksClient) CheckIPAddressAvailabilityPreparer(resourceGroupName string, virtualNetworkName string, ipAddress string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkName": autorest.Encode("path", virtualNetworkName),
}
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
if len(ipAddress) > 0 {
queryParameters["ipAddress"] = autorest.Encode("query", ipAddress)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/CheckIPAddressAvailability", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CheckIPAddressAvailabilitySender sends the CheckIPAddressAvailability request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualNetworksClient) CheckIPAddressAvailabilitySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// CheckIPAddressAvailabilityResponder handles the response to the CheckIPAddressAvailability request. The method always
// closes the http.Response Body.
func (client VirtualNetworksClient) CheckIPAddressAvailabilityResponder(resp *http.Response) (result IPAddressAvailabilityResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// CreateOrUpdate the Put VirtualNetwork operation creates/updates a virtual

View File

@ -1,5 +1,5 @@
// Package resources implements the Azure ARM Resources service API version
// 2016-02-01.
// 2016-07-01.
//
package resources
@ -29,7 +29,7 @@ import (
const (
// APIVersion is the version of the Resources
APIVersion = "2016-02-01"
APIVersion = "2016-07-01"
// DefaultBaseURI is the default URI used for the service Resources
DefaultBaseURI = "https://management.azure.com"
@ -45,9 +45,14 @@ type ManagementClient struct {
// New creates an instance of the ManagementClient client.
func New(subscriptionID string) ManagementClient {
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewWithBaseURI creates an instance of the ManagementClient client.
func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: DefaultBaseURI,
BaseURI: baseURI,
APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}
@ -328,10 +333,11 @@ func (client ManagementClient) GetResponder(resp *http.Response) (result Generic
// List get all of the resources under a subscription.
//
// filter is the filter to apply on the operation. top is query parameters. If
// null is passed returns all resource groups.
func (client ManagementClient) List(filter string, top *int32) (result ResourceListResult, err error) {
req, err := client.ListPreparer(filter, top)
// filter is the filter to apply on the operation. expand is the $expand query
// parameter. top is query parameters. If null is passed returns all resource
// groups.
func (client ManagementClient) List(filter string, expand string, top *int32) (result ResourceListResult, err error) {
req, err := client.ListPreparer(filter, expand, top)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.ManagementClient", "List", nil, "Failure preparing request")
}
@ -351,7 +357,7 @@ func (client ManagementClient) List(filter string, top *int32) (result ResourceL
}
// ListPreparer prepares the List request.
func (client ManagementClient) ListPreparer(filter string, top *int32) (*http.Request, error) {
func (client ManagementClient) ListPreparer(filter string, expand string, top *int32) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
@ -362,6 +368,9 @@ func (client ManagementClient) ListPreparer(filter string, top *int32) (*http.Re
if len(filter) > 0 {
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if len(expand) > 0 {
queryParameters["$expand"] = autorest.Encode("query", expand)
}
if top != nil {
queryParameters["$top"] = autorest.Encode("query", *top)
}

View File

@ -33,7 +33,13 @@ type DeploymentOperationsClient struct {
// NewDeploymentOperationsClient creates an instance of the
// DeploymentOperationsClient client.
func NewDeploymentOperationsClient(subscriptionID string) DeploymentOperationsClient {
return DeploymentOperationsClient{New(subscriptionID)}
return NewDeploymentOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewDeploymentOperationsClientWithBaseURI creates an instance of the
// DeploymentOperationsClient client.
func NewDeploymentOperationsClientWithBaseURI(baseURI string, subscriptionID string) DeploymentOperationsClient {
return DeploymentOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Get get a list of deployments operations.

View File

@ -32,7 +32,13 @@ type DeploymentsClient struct {
// NewDeploymentsClient creates an instance of the DeploymentsClient client.
func NewDeploymentsClient(subscriptionID string) DeploymentsClient {
return DeploymentsClient{New(subscriptionID)}
return NewDeploymentsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewDeploymentsClientWithBaseURI creates an instance of the
// DeploymentsClient client.
func NewDeploymentsClientWithBaseURI(baseURI string, subscriptionID string) DeploymentsClient {
return DeploymentsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Cancel cancel a currently running template deployment.

View File

@ -31,7 +31,12 @@ type GroupsClient struct {
// NewGroupsClient creates an instance of the GroupsClient client.
func NewGroupsClient(subscriptionID string) GroupsClient {
return GroupsClient{New(subscriptionID)}
return NewGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewGroupsClientWithBaseURI creates an instance of the GroupsClient client.
func NewGroupsClientWithBaseURI(baseURI string, subscriptionID string) GroupsClient {
return GroupsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CheckExistence checks whether resource group exists.
@ -446,10 +451,11 @@ func (client GroupsClient) ListNextResults(lastResults ResourceGroupListResult)
// ListResources get all of the resources under a subscription.
//
// resourceGroupName is query parameters. If null is passed returns all
// resource groups. filter is the filter to apply on the operation. top is
// query parameters. If null is passed returns all resource groups.
func (client GroupsClient) ListResources(resourceGroupName string, filter string, top *int32) (result ResourceListResult, err error) {
req, err := client.ListResourcesPreparer(resourceGroupName, filter, top)
// resource groups. filter is the filter to apply on the operation. expand is
// the $expand query parameter top is query parameters. If null is passed
// returns all resource groups.
func (client GroupsClient) ListResources(resourceGroupName string, filter string, expand string, top *int32) (result ResourceListResult, err error) {
req, err := client.ListResourcesPreparer(resourceGroupName, filter, expand, top)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "ListResources", nil, "Failure preparing request")
}
@ -469,7 +475,7 @@ func (client GroupsClient) ListResources(resourceGroupName string, filter string
}
// ListResourcesPreparer prepares the ListResources request.
func (client GroupsClient) ListResourcesPreparer(resourceGroupName string, filter string, top *int32) (*http.Request, error) {
func (client GroupsClient) ListResourcesPreparer(resourceGroupName string, filter string, expand string, top *int32) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
@ -481,6 +487,9 @@ func (client GroupsClient) ListResourcesPreparer(resourceGroupName string, filte
if len(filter) > 0 {
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if len(expand) > 0 {
queryParameters["$expand"] = autorest.Encode("query", expand)
}
if top != nil {
queryParameters["$top"] = autorest.Encode("query", *top)
}

View File

@ -44,6 +44,18 @@ const (
SystemAssigned ResourceIdentityType = "SystemAssigned"
)
// AliasPathType is the type of the paths for alias.
type AliasPathType struct {
Path *string `json:"path,omitempty"`
APIVersions *[]string `json:"apiVersions,omitempty"`
}
// AliasType is the alias type.
type AliasType struct {
Name *string `json:"name,omitempty"`
Paths *[]AliasPathType `json:"paths,omitempty"`
}
// BasicDependency is deployment dependency information.
type BasicDependency struct {
ID *string `json:"id,omitempty"`
@ -69,7 +81,7 @@ type Deployment struct {
Properties *DeploymentProperties `json:"properties,omitempty"`
}
// DeploymentExportResult is
// DeploymentExportResult is the deployment export result.
type DeploymentExportResult struct {
autorest.Response `json:"-"`
Template *map[string]interface{} `json:"template,omitempty"`
@ -208,7 +220,6 @@ type GenericResourceFilter struct {
ResourceType *string `json:"resourceType,omitempty"`
Tagname *string `json:"tagname,omitempty"`
Tagvalue *string `json:"tagvalue,omitempty"`
Expand *string `json:"expand,omitempty"`
}
// HTTPMessage is
@ -276,7 +287,9 @@ func (client ProviderListResult) ProviderListResultPreparer() (*http.Request, er
type ProviderResourceType struct {
ResourceType *string `json:"resourceType,omitempty"`
Locations *[]string `json:"locations,omitempty"`
Aliases *[]AliasType `json:"aliases,omitempty"`
APIVersions *[]string `json:"apiVersions,omitempty"`
ZoneMappings *[]ZoneMappingType `json:"zoneMappings,omitempty"`
Properties *map[string]*string `json:"properties,omitempty"`
}
@ -442,3 +455,9 @@ type TemplateLink struct {
URI *string `json:"uri,omitempty"`
ContentVersion *string `json:"contentVersion,omitempty"`
}
// ZoneMappingType is zone mapping type.
type ZoneMappingType struct {
Location *string `json:"location,omitempty"`
Zones *[]string `json:"zones,omitempty"`
}

View File

@ -32,14 +32,22 @@ type ProvidersClient struct {
// NewProvidersClient creates an instance of the ProvidersClient client.
func NewProvidersClient(subscriptionID string) ProvidersClient {
return ProvidersClient{New(subscriptionID)}
return NewProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewProvidersClientWithBaseURI creates an instance of the ProvidersClient
// client.
func NewProvidersClientWithBaseURI(baseURI string, subscriptionID string) ProvidersClient {
return ProvidersClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Get gets a resource provider.
//
// resourceProviderNamespace is namespace of the resource provider.
func (client ProvidersClient) Get(resourceProviderNamespace string) (result Provider, err error) {
req, err := client.GetPreparer(resourceProviderNamespace)
// resourceProviderNamespace is namespace of the resource provider. expand is
// the $expand query parameter. e.g. To include property aliases in response,
// use $expand=resourceTypes/aliases.
func (client ProvidersClient) Get(resourceProviderNamespace string, expand string) (result Provider, err error) {
req, err := client.GetPreparer(resourceProviderNamespace, expand)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.ProvidersClient", "Get", nil, "Failure preparing request")
}
@ -59,7 +67,7 @@ func (client ProvidersClient) Get(resourceProviderNamespace string) (result Prov
}
// GetPreparer prepares the Get request.
func (client ProvidersClient) GetPreparer(resourceProviderNamespace string) (*http.Request, error) {
func (client ProvidersClient) GetPreparer(resourceProviderNamespace string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
@ -68,6 +76,9 @@ func (client ProvidersClient) GetPreparer(resourceProviderNamespace string) (*ht
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
if len(expand) > 0 {
queryParameters["$expand"] = autorest.Encode("query", expand)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
@ -98,9 +109,11 @@ func (client ProvidersClient) GetResponder(resp *http.Response) (result Provider
// List gets a list of resource providers.
//
// top is query parameters. If null is passed returns all deployments.
func (client ProvidersClient) List(top *int32) (result ProviderListResult, err error) {
req, err := client.ListPreparer(top)
// top is query parameters. If null is passed returns all deployments. expand
// is the $expand query parameter. e.g. To include property aliases in
// response, use $expand=resourceTypes/aliases.
func (client ProvidersClient) List(top *int32, expand string) (result ProviderListResult, err error) {
req, err := client.ListPreparer(top, expand)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.ProvidersClient", "List", nil, "Failure preparing request")
}
@ -120,7 +133,7 @@ func (client ProvidersClient) List(top *int32) (result ProviderListResult, err e
}
// ListPreparer prepares the List request.
func (client ProvidersClient) ListPreparer(top *int32) (*http.Request, error) {
func (client ProvidersClient) ListPreparer(top *int32, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
@ -131,6 +144,9 @@ func (client ProvidersClient) ListPreparer(top *int32) (*http.Request, error) {
if top != nil {
queryParameters["$top"] = autorest.Encode("query", *top)
}
if len(expand) > 0 {
queryParameters["$expand"] = autorest.Encode("query", expand)
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),

View File

@ -31,7 +31,12 @@ type Client struct {
// NewClient creates an instance of the Client client.
func NewClient(subscriptionID string) Client {
return Client{New(subscriptionID)}
return NewClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewClientWithBaseURI creates an instance of the Client client.
func NewClientWithBaseURI(baseURI string, subscriptionID string) Client {
return Client{NewWithBaseURI(baseURI, subscriptionID)}
}
// CheckExistence checks whether resource exists.
@ -309,10 +314,11 @@ func (client Client) GetResponder(resp *http.Response) (result GenericResource,
// List get all of the resources under a subscription.
//
// filter is the filter to apply on the operation. top is query parameters. If
// null is passed returns all resource groups.
func (client Client) List(filter string, top *int32) (result ResourceListResult, err error) {
req, err := client.ListPreparer(filter, top)
// filter is the filter to apply on the operation. expand is the $expand query
// parameter. top is query parameters. If null is passed returns all resource
// groups.
func (client Client) List(filter string, expand string, top *int32) (result ResourceListResult, err error) {
req, err := client.ListPreparer(filter, expand, top)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.Client", "List", nil, "Failure preparing request")
}
@ -332,7 +338,7 @@ func (client Client) List(filter string, top *int32) (result ResourceListResult,
}
// ListPreparer prepares the List request.
func (client Client) ListPreparer(filter string, top *int32) (*http.Request, error) {
func (client Client) ListPreparer(filter string, expand string, top *int32) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
@ -343,6 +349,9 @@ func (client Client) ListPreparer(filter string, top *int32) (*http.Request, err
if len(filter) > 0 {
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if len(expand) > 0 {
queryParameters["$expand"] = autorest.Encode("query", expand)
}
if top != nil {
queryParameters["$top"] = autorest.Encode("query", *top)
}

View File

@ -31,7 +31,12 @@ type TagsClient struct {
// NewTagsClient creates an instance of the TagsClient client.
func NewTagsClient(subscriptionID string) TagsClient {
return TagsClient{New(subscriptionID)}
return NewTagsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewTagsClientWithBaseURI creates an instance of the TagsClient client.
func NewTagsClientWithBaseURI(baseURI string, subscriptionID string) TagsClient {
return TagsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate create a subscription resource tag.

View File

@ -24,7 +24,7 @@ import (
const (
major = "3"
minor = "0"
minor = "2"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"
@ -34,7 +34,7 @@ const (
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
return fmt.Sprintf(userAgentFormat, Version(), "resources", "2016-02-01")
return fmt.Sprintf(userAgentFormat, Version(), "resources", "2016-07-01")
}
// Version returns the semantic version (see http://semver.org) of the client.

View File

@ -43,9 +43,14 @@ type ManagementClient struct {
// New creates an instance of the ManagementClient client.
func New(subscriptionID string) ManagementClient {
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewWithBaseURI creates an instance of the ManagementClient client.
func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: DefaultBaseURI,
BaseURI: baseURI,
APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}

View File

@ -33,7 +33,13 @@ type JobCollectionsClient struct {
// NewJobCollectionsClient creates an instance of the JobCollectionsClient
// client.
func NewJobCollectionsClient(subscriptionID string) JobCollectionsClient {
return JobCollectionsClient{New(subscriptionID)}
return NewJobCollectionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewJobCollectionsClientWithBaseURI creates an instance of the
// JobCollectionsClient client.
func NewJobCollectionsClientWithBaseURI(baseURI string, subscriptionID string) JobCollectionsClient {
return JobCollectionsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate provisions a new job collection or updates an existing job

View File

@ -31,7 +31,12 @@ type JobsClient struct {
// NewJobsClient creates an instance of the JobsClient client.
func NewJobsClient(subscriptionID string) JobsClient {
return JobsClient{New(subscriptionID)}
return NewJobsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewJobsClientWithBaseURI creates an instance of the JobsClient client.
func NewJobsClientWithBaseURI(baseURI string, subscriptionID string) JobsClient {
return JobsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate provisions a new job or updates an existing job.

View File

@ -24,7 +24,7 @@ import (
const (
major = "3"
minor = "0"
minor = "2"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"

View File

@ -19,10 +19,9 @@ package storage
// regenerated.
import (
"net/http"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
)
// AccountsClient is the the Storage Management Client.
@ -32,7 +31,13 @@ type AccountsClient struct {
// NewAccountsClient creates an instance of the AccountsClient client.
func NewAccountsClient(subscriptionID string) AccountsClient {
return AccountsClient{New(subscriptionID)}
return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewAccountsClientWithBaseURI creates an instance of the AccountsClient
// client.
func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient {
return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CheckNameAvailability checks that account name is valid and is not in use.

View File

@ -44,9 +44,14 @@ type ManagementClient struct {
// New creates an instance of the ManagementClient client.
func New(subscriptionID string) ManagementClient {
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewWithBaseURI creates an instance of the ManagementClient client.
func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: DefaultBaseURI,
BaseURI: baseURI,
APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}

View File

@ -32,7 +32,13 @@ type UsageOperationsClient struct {
// NewUsageOperationsClient creates an instance of the UsageOperationsClient
// client.
func NewUsageOperationsClient(subscriptionID string) UsageOperationsClient {
return UsageOperationsClient{New(subscriptionID)}
return NewUsageOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewUsageOperationsClientWithBaseURI creates an instance of the
// UsageOperationsClient client.
func NewUsageOperationsClientWithBaseURI(baseURI string, subscriptionID string) UsageOperationsClient {
return UsageOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// List gets the current usage count and the limit for the resources under the

View File

@ -24,7 +24,7 @@ import (
const (
major = "3"
minor = "0"
minor = "2"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"

View File

@ -43,9 +43,14 @@ type ManagementClient struct {
// New creates an instance of the ManagementClient client.
func New(subscriptionID string) ManagementClient {
return NewWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewWithBaseURI creates an instance of the ManagementClient client.
func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: DefaultBaseURI,
BaseURI: baseURI,
APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}

View File

@ -32,7 +32,13 @@ type EndpointsClient struct {
// NewEndpointsClient creates an instance of the EndpointsClient client.
func NewEndpointsClient(subscriptionID string) EndpointsClient {
return EndpointsClient{New(subscriptionID)}
return NewEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewEndpointsClientWithBaseURI creates an instance of the EndpointsClient
// client.
func NewEndpointsClientWithBaseURI(baseURI string, subscriptionID string) EndpointsClient {
return EndpointsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate create or update a Traffic Manager endpoint.

View File

@ -36,7 +36,7 @@ type DNSConfig struct {
TTL *int64 `json:"ttl,omitempty"`
}
// Endpoint is class respresenting a Traffic Manager endpoint.
// Endpoint is class representing a Traffic Manager endpoint.
type Endpoint struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
@ -45,7 +45,7 @@ type Endpoint struct {
Properties *EndpointProperties `json:"properties,omitempty"`
}
// EndpointProperties is class respresenting a Traffic Manager endpoint
// EndpointProperties is class representing a Traffic Manager endpoint
// properties.
type EndpointProperties struct {
TargetResourceID *string `json:"targetResourceId,omitempty"`

View File

@ -32,7 +32,13 @@ type ProfilesClient struct {
// NewProfilesClient creates an instance of the ProfilesClient client.
func NewProfilesClient(subscriptionID string) ProfilesClient {
return ProfilesClient{New(subscriptionID)}
return NewProfilesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewProfilesClientWithBaseURI creates an instance of the ProfilesClient
// client.
func NewProfilesClientWithBaseURI(baseURI string, subscriptionID string) ProfilesClient {
return ProfilesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CheckTrafficManagerRelativeDNSNameAvailability checks the availability of a

View File

@ -24,7 +24,7 @@ import (
const (
major = "3"
minor = "0"
minor = "2"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"

View File

@ -22,7 +22,7 @@ func NewVMConfiguration(name string, roleSize string) vm.Role {
}
}
// ConfigureForLinux adds configuration for when deploying a generalized Linux
// ConfigureForLinux adds configuration when deploying a generalized Linux
// image. If "password" is left empty, SSH password security will be disabled by
// default. Certificates with SSH public keys should already be uploaded to the
// cloud service where the VM will be deployed and referenced here only by their
@ -57,7 +57,7 @@ func ConfigureForLinux(role *vm.Role, hostname, user, password string, sshPubkey
return nil
}
// ConfigureForWindows adds configuration for when deploying a generalized
// ConfigureForWindows adds configuration when deploying a generalized
// Windows image. timeZone can be left empty. For a complete list of supported
// time zone entries, you can either refer to the values listed in the registry
// entry "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time
@ -80,6 +80,35 @@ func ConfigureForWindows(role *vm.Role, hostname, user, password string, enableA
return nil
}
// ConfigureWithCustomDataForLinux configures custom data for Linux-based images.
// The customData contains either cloud-init or shell script to be executed upon start.
//
// The function expects the customData to be base64-encoded.
func ConfigureWithCustomDataForLinux(role *vm.Role, customData string) error {
return configureWithCustomData(role, customData, vm.ConfigurationSetTypeLinuxProvisioning)
}
// ConfigureWithCustomDataForWindows configures custom data for Windows-based images.
// The customData contains either cloud-init or shell script to be executed upon start.
//
// The function expects the customData to be base64-encoded.
func ConfigureWithCustomDataForWindows(role *vm.Role, customData string) error {
return configureWithCustomData(role, customData, vm.ConfigurationSetTypeWindowsProvisioning)
}
func configureWithCustomData(role *vm.Role, customData string, typ vm.ConfigurationSetType) error {
if role == nil {
return fmt.Errorf(errParamNotSpecified, "role")
}
role.ConfigurationSets = updateOrAddConfig(role.ConfigurationSets, typ,
func(config *vm.ConfigurationSet) {
config.CustomData = customData
})
return nil
}
// ConfigureWindowsToJoinDomain adds configuration to join a new Windows vm to a
// domain. "username" must be in UPN form (user@domain.com), "machineOU" can be
// left empty

View File

@ -111,6 +111,8 @@ type BlobProperties struct {
ContentLength int64 `xml:"Content-Length"`
ContentType string `xml:"Content-Type"`
ContentEncoding string `xml:"Content-Encoding"`
CacheControl string `xml:"Cache-Control"`
ContentLanguage string `xml:"Cache-Language"`
BlobType BlobType `xml:"x-ms-blob-blob-type"`
SequenceNumber int64 `xml:"x-ms-blob-sequence-number"`
CopyID string `xml:"CopyId"`
@ -122,6 +124,16 @@ type BlobProperties struct {
LeaseStatus string `xml:"LeaseStatus"`
}
// BlobHeaders contains various properties of a blob and is an entry
// in SetBlobProperties
type BlobHeaders struct {
ContentMD5 string `header:"x-ms-blob-content-md5"`
ContentLanguage string `header:"x-ms-blob-content-language"`
ContentEncoding string `header:"x-ms-blob-content-encoding"`
ContentType string `header:"x-ms-blob-content-type"`
CacheControl string `header:"x-ms-blob-cache-control"`
}
// BlobListResponse contains the response fields from ListBlobs call.
//
// See https://msdn.microsoft.com/en-us/library/azure/dd135734.aspx
@ -474,7 +486,6 @@ func (b BlobStorageClient) ListBlobs(container string, params ListBlobsParameter
func (b BlobStorageClient) BlobExists(container, name string) (bool, error) {
verb := "HEAD"
uri := b.client.getEndpoint(blobServiceName, pathForBlob(container, name), url.Values{})
headers := b.client.getStandardHeaders()
resp, err := b.client.exec(verb, uri, headers, nil)
if resp != nil {
@ -590,6 +601,9 @@ func (b BlobStorageClient) GetBlobProperties(container, name string) (*BlobPrope
ContentMD5: resp.headers.Get("Content-MD5"),
ContentLength: contentLength,
ContentEncoding: resp.headers.Get("Content-Encoding"),
ContentType: resp.headers.Get("Content-Type"),
CacheControl: resp.headers.Get("Cache-Control"),
ContentLanguage: resp.headers.Get("Content-Language"),
SequenceNumber: sequenceNum,
CopyCompletionTime: resp.headers.Get("x-ms-copy-completion-time"),
CopyStatusDescription: resp.headers.Get("x-ms-copy-status-description"),
@ -602,6 +616,34 @@ func (b BlobStorageClient) GetBlobProperties(container, name string) (*BlobPrope
}, nil
}
// SetBlobProperties replaces the BlobHeaders for the specified blob.
//
// Some keys may be converted to Camel-Case before sending. All keys
// are returned in lower case by GetBlobProperties. HTTP header names
// are case-insensitive so case munging should not matter to other
// applications either.
//
// See https://msdn.microsoft.com/en-us/library/azure/ee691966.aspx
func (b BlobStorageClient) SetBlobProperties(container, name string, blobHeaders BlobHeaders) error {
params := url.Values{"comp": {"properties"}}
uri := b.client.getEndpoint(blobServiceName, pathForBlob(container, name), params)
headers := b.client.getStandardHeaders()
extraHeaders := headersFromStruct(blobHeaders)
for k, v := range extraHeaders {
headers[k] = v
}
resp, err := b.client.exec("PUT", uri, headers, nil)
if err != nil {
return err
}
defer resp.body.Close()
return checkRespCode(resp.statusCode, []int{http.StatusOK})
}
// SetBlobMetadata replaces the metadata for the specified blob.
//
// Some keys may be converted to Camel-Case before sending. All keys
@ -1033,9 +1075,24 @@ func (b BlobStorageClient) GetBlobSASURI(container, name string, expiry time.Tim
blobURL = b.GetBlobURL(container, name)
)
canonicalizedResource, err := b.client.buildCanonicalizedResource(blobURL)
if err != nil {
return "", err
}
// "The canonicalizedresouce portion of the string is a canonical path to the signed resource.
// It must include the service name (blob, table, queue or file) for version 2015-02-21 or
// later, the storage account name, and the resource name, and must be URL-decoded.
// -- https://msdn.microsoft.com/en-us/library/azure/dn140255.aspx
// We need to replace + with %2b first to avoid being treated as a space (which is correct for query strings, but not the path component).
canonicalizedResource = strings.Replace(canonicalizedResource, "+", "%2b", -1)
canonicalizedResource, err = url.QueryUnescape(canonicalizedResource)
if err != nil {
return "", err
}
signedExpiry := expiry.UTC().Format(time.RFC3339)
signedResource := "b"

View File

@ -29,10 +29,20 @@ const (
defaultUseHTTPS = true
// StorageEmulatorAccountName is the fixed storage account used by Azure Storage Emulator
StorageEmulatorAccountName = "devstoreaccount1"
// StorageEmulatorAccountKey is the the fixed storage account used by Azure Storage Emulator
StorageEmulatorAccountKey = "Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="
blobServiceName = "blob"
tableServiceName = "table"
queueServiceName = "queue"
fileServiceName = "file"
storageEmulatorBlob = "127.0.0.1:10000"
storageEmulatorTable = "127.0.0.1:10002"
storageEmulatorQueue = "127.0.0.1:10001"
)
// Client is the object that needs to be constructed to perform
@ -114,9 +124,18 @@ func (e UnexpectedStatusCodeError) Got() int {
// NewBasicClient constructs a Client with given storage service name and
// key.
func NewBasicClient(accountName, accountKey string) (Client, error) {
if accountName == StorageEmulatorAccountName {
return NewEmulatorClient()
}
return NewClient(accountName, accountKey, DefaultBaseURL, DefaultAPIVersion, defaultUseHTTPS)
}
//NewEmulatorClient contructs a Client intended to only work with Azure
//Storage Emulator
func NewEmulatorClient() (Client, error) {
return NewClient(StorageEmulatorAccountName, StorageEmulatorAccountKey, DefaultBaseURL, DefaultAPIVersion, false)
}
// NewClient constructs a Client. This should be used if the caller wants
// to specify whether to use HTTPS, a specific REST API version or a custom
// storage endpoint than Azure Public Cloud.
@ -149,8 +168,19 @@ func (c Client) getBaseURL(service string) string {
if c.useHTTPS {
scheme = "https"
}
host := fmt.Sprintf("%s.%s.%s", c.accountName, service, c.baseURL)
host := ""
if c.accountName == StorageEmulatorAccountName {
switch service {
case blobServiceName:
host = storageEmulatorBlob
case tableServiceName:
host = storageEmulatorTable
case queueServiceName:
host = storageEmulatorQueue
}
} else {
host = fmt.Sprintf("%s.%s.%s", c.accountName, service, c.baseURL)
}
u := &url.URL{
Scheme: scheme,
@ -165,8 +195,13 @@ func (c Client) getEndpoint(service, path string, params url.Values) string {
panic(err)
}
if path == "" {
path = "/" // API doesn't accept path segments not starting with '/'
// API doesn't accept path segments not starting with '/'
if !strings.HasPrefix(path, "/") {
path = fmt.Sprintf("/%v", path)
}
if c.accountName == StorageEmulatorAccountName {
path = fmt.Sprintf("/%v%v", StorageEmulatorAccountName, path)
}
u.Path = path
@ -200,7 +235,7 @@ func (c Client) GetFileService() FileServiceClient {
func (c Client) createAuthorizationHeader(canonicalizedString string) string {
signature := c.computeHmac256(canonicalizedString)
return fmt.Sprintf("%s %s:%s", "SharedKey", c.accountName, signature)
return fmt.Sprintf("%s %s:%s", "SharedKey", c.getCanonicalizedAccountName(), signature)
}
func (c Client) getAuthorizationHeader(verb, url string, headers map[string]string) (string, error) {
@ -220,6 +255,12 @@ func (c Client) getStandardHeaders() map[string]string {
}
}
func (c Client) getCanonicalizedAccountName() string {
// since we may be trying to access a secondary storage account, we need to
// remove the -secondary part of the storage name
return strings.TrimSuffix(c.accountName, "-secondary")
}
func (c Client) buildCanonicalizedHeader(headers map[string]string) string {
cm := make(map[string]string)
@ -261,7 +302,7 @@ func (c Client) buildCanonicalizedResourceTable(uri string) (string, error) {
return "", fmt.Errorf(errMsg, err.Error())
}
cr := "/" + c.accountName
cr := "/" + c.getCanonicalizedAccountName()
if len(u.Path) > 0 {
cr += u.Path
@ -277,10 +318,13 @@ func (c Client) buildCanonicalizedResource(uri string) (string, error) {
return "", fmt.Errorf(errMsg, err.Error())
}
cr := "/" + c.accountName
cr := "/" + c.getCanonicalizedAccountName()
if len(u.Path) > 0 {
cr += u.Path
// Any portion of the CanonicalizedResource string that is derived from
// the resource's URI should be encoded exactly as it is in the URI.
// -- https://msdn.microsoft.com/en-gb/library/azure/dd179428.aspx
cr += u.EscapedPath()
}
params, err := url.ParseQuery(u.RawQuery)
@ -343,7 +387,6 @@ func (c Client) exec(verb, url string, headers map[string]string, body io.Reader
return nil, err
}
headers["Authorization"] = authHeader
if err != nil {
return nil, err
}

View File

@ -47,6 +47,9 @@ func (f FileServiceClient) CreateShareIfNotExists(name string) (bool, error) {
// CreateShare creates a Azure File Share and returns its response
func (f FileServiceClient) createShare(name string) (*storageResponse, error) {
if err := f.checkForStorageEmulator(); err != nil {
return nil, err
}
uri := f.client.getEndpoint(fileServiceName, pathForFileShare(name), url.Values{"restype": {"share"}})
headers := f.client.getStandardHeaders()
return f.client.exec("PUT", uri, headers, nil)
@ -86,6 +89,18 @@ func (f FileServiceClient) DeleteShareIfExists(name string) (bool, error) {
// deleteShare makes the call to Delete Share operation endpoint and returns
// the response
func (f FileServiceClient) deleteShare(name string) (*storageResponse, error) {
if err := f.checkForStorageEmulator(); err != nil {
return nil, err
}
uri := f.client.getEndpoint(fileServiceName, pathForFileShare(name), url.Values{"restype": {"share"}})
return f.client.exec("DELETE", uri, f.client.getStandardHeaders(), nil)
}
//checkForStorageEmulator determines if the client is setup for use with
//Azure Storage Emulator, and returns a relevant error
func (f FileServiceClient) checkForStorageEmulator() error {
if f.client.accountName == StorageEmulatorAccountName {
return fmt.Errorf("Error: File service is not currently supported by Azure Storage Emulator")
}
return nil
}

View File

@ -11,6 +11,7 @@ import (
"io/ioutil"
"net/http"
"net/url"
"reflect"
"time"
)
@ -69,3 +70,16 @@ func xmlMarshal(v interface{}) (io.Reader, int, error) {
}
return bytes.NewReader(b), len(b), nil
}
func headersFromStruct(v interface{}) map[string]string {
headers := make(map[string]string)
value := reflect.ValueOf(v)
for i := 0; i < value.NumField(); i++ {
key := value.Type().Field(i).Tag.Get("header")
val := value.Field(i).String()
if val != "" {
headers[key] = val
}
}
return headers
}

110
vendor/vendor.json vendored
View File

@ -3,164 +3,164 @@
"ignore": "appengine test",
"package": [
{
"checksumSHA1": "rJgU6MbpmtRBZH6JNByWvzNNKlM=",
"checksumSHA1": "wdXWOKasg/7Apy5AVOHZHpSAZhc=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/arm/cdn",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "akhrj2PzJv19enRg4Ar6rE6FWLk=",
"checksumSHA1": "88TAbW2kN6NighEaL9X8IKNp3Go=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/arm/compute",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "opJ3PtP7GCxGbMGTdqDIvAL30X0=",
"checksumSHA1": "AdWY+YN439QSBtAFqG/dIV93J38=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/arm/network",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "hBg0HREYbzIAzab2qpevBiYQ8V4=",
"checksumSHA1": "EdND5GRzWDkSwl18UVWJJgsnOG4=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/arm/resources/resources",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "HTn8BviQEiF6Tp98QWlov90du90=",
"checksumSHA1": "iFV4QVdtS6bx3fNhjDAyS/Eiw+Y=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/arm/scheduler",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "XtI6atfC23rgxiObn0Da6fvXL94=",
"checksumSHA1": "jh7wjswBwwVeY/P8wtqtqBR58y4=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/arm/storage",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "2qCsDmxUSe6LzkuC9+rTK9wEPBg=",
"checksumSHA1": "PLyDrzfgTsbkk7HsuJxbj8QmTC4=",
"path": "github.com/Azure/azure-sdk-for-go/arm/trafficmanager",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "Q+0Zz0iylSKMck4JhYc8XR83i8M=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/core/http",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "F2fqk+OPM3drSkK0G6So5ASayyA=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/core/tls",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "SGOuRzxuQpJChBvq6SsNojKvcKw=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "TcQ6KXoBkvUhCYeggJ/bwcz+QaQ=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/affinitygroup",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "HfjyhRfmKBsVgWLTOfWVcxe8Z88=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/hostedservice",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "4otMhU6xZ41HfmiGZFYtV93GdcI=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/location",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "hxivwm3D13cqFGOlOS3q8HD7DN0=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/networksecuritygroup",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "2USoeYg8k1tA1QNLRByEnP/asqs=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/osimage",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "hzwziaU5QlMlFcFPdbEmW18oV3Y=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/sql",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "YoAhDE0X6hSFuPpXbpfqcTC0Zvw=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/storageservice",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "6xEiZL4a9rr5YbnY0RdzuzhEF1Q=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/virtualmachine",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "xcBM3zQtfcE3VHNBACJJGEesCBI=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/virtualmachinedisk",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "0bfdkDZ2JFV7bol6GQFfC0g+lP4=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/virtualmachineimage",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "IhjDqm84VDVSIoHyiGvUzuljG3s=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/virtualnetwork",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "KkKaKnxZ+I5qG0V0eg8vjNctI+E=",
"checksumSHA1": "+ykSkHo40/f6VK6/zXDqzF8Lh14=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/vmutils",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "O6OHu5bxX1FAHpKt0TDSwPLvmzA=",
"checksumSHA1": "w1X4Sxcdx4WhCqVZdPWoUuMPn9U=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/storage",
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
"revision": "bfc5b4af08f3d3745d908af36b7ed5b9060f0258",
"revisionTime": "2016-08-11T22:07:13Z"
},
{
"checksumSHA1": "pi00alAztMy9MGxJmvg9qC+tsGk=",