Commit 47215674 authored by Huamin Chen's avatar Huamin Chen

update vendor pkg to support azure disk provisioning

Signed-off-by: 's avatarHuamin Chen <hchen@redhat.com>
parent 634df041
...@@ -30,13 +30,23 @@ ...@@ -30,13 +30,23 @@
}, },
{ {
"ImportPath": "github.com/Azure/azure-sdk-for-go/arm/compute", "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/compute",
"Comment": "v3.0.0-beta", "Comment": "v3.2.0-beta",
"Rev": "2cdbb8553a20830507e4178b4d0803794136dde7" "Rev": "8316b9060f9c2443ba0864663245695d570a7fa2"
}, },
{ {
"ImportPath": "github.com/Azure/azure-sdk-for-go/arm/network", "ImportPath": "github.com/Azure/azure-sdk-for-go/arm/network",
"Comment": "v3.0.0-beta", "Comment": "v3.2.0-beta",
"Rev": "2cdbb8553a20830507e4178b4d0803794136dde7" "Rev": "8316b9060f9c2443ba0864663245695d570a7fa2"
},
{
"ImportPath": "github.com/Azure/azure-sdk-for-go/arm/storage",
"Comment": "v3.2.0-beta",
"Rev": "8316b9060f9c2443ba0864663245695d570a7fa2"
},
{
"ImportPath": "github.com/Azure/azure-sdk-for-go/storage",
"Comment": "v3.2.0-beta",
"Rev": "8316b9060f9c2443ba0864663245695d570a7fa2"
}, },
{ {
"ImportPath": "github.com/Azure/go-ansiterm", "ImportPath": "github.com/Azure/go-ansiterm",
...@@ -2075,6 +2085,10 @@ ...@@ -2075,6 +2085,10 @@
"Rev": "783cfcb01fb00c48f740c9de79122bd410294149" "Rev": "783cfcb01fb00c48f740c9de79122bd410294149"
}, },
{ {
"ImportPath": "github.com/rubiojr/go-vhd/vhd",
"Rev": "0bfd3b39853cdde5762efda92289f14b0ac0491b"
},
{
"ImportPath": "github.com/russross/blackfriday", "ImportPath": "github.com/russross/blackfriday",
"Comment": "v1.4-2-g300106c", "Comment": "v1.4-2-g300106c",
"Rev": "300106c228d52c8941d4b3de6054a6062a86dda3" "Rev": "300106c228d52c8941d4b3de6054a6062a86dda3"
......
...@@ -187,7 +187,7 @@ ...@@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier same "printed page" as the copyright notice for easier
identification within third-party archives. 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"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
......
...@@ -32,7 +32,13 @@ type AvailabilitySetsClient struct { ...@@ -32,7 +32,13 @@ type AvailabilitySetsClient struct {
// NewAvailabilitySetsClient creates an instance of the AvailabilitySetsClient // NewAvailabilitySetsClient creates an instance of the AvailabilitySetsClient
// client. // client.
func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient { func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient {
return 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. // CreateOrUpdate the operation to create or update the availability set.
......
...@@ -44,9 +44,14 @@ type ManagementClient struct { ...@@ -44,9 +44,14 @@ type ManagementClient struct {
// New creates an instance of the ManagementClient client. // New creates an instance of the ManagementClient client.
func New(subscriptionID string) ManagementClient { 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{ return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()), Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: DefaultBaseURI, BaseURI: baseURI,
APIVersion: APIVersion, APIVersion: APIVersion,
SubscriptionID: subscriptionID, SubscriptionID: subscriptionID,
} }
......
...@@ -333,10 +333,10 @@ const ( ...@@ -333,10 +333,10 @@ const (
StandardGS5 VirtualMachineSizeTypes = "Standard_GS5" StandardGS5 VirtualMachineSizeTypes = "Standard_GS5"
) )
// AdditionalUnattendContent is gets or sets additional XML formatted // AdditionalUnattendContent is additional XML formatted information that can
// information that can be included in the Unattend.xml file, which is used // be included in the Unattend.xml file, which is used by Windows Setup.
// by Windows Setup. Contents are defined by setting name, component name, // Contents are defined by setting name, component name, and the pass in
// and the pass in which the content is a applied. // which the content is a applied.
type AdditionalUnattendContent struct { type AdditionalUnattendContent struct {
PassName PassNames `json:"passName,omitempty"` PassName PassNames `json:"passName,omitempty"`
ComponentName ComponentNames `json:"componentName,omitempty"` ComponentName ComponentNames `json:"componentName,omitempty"`
...@@ -487,7 +487,7 @@ type LinuxConfiguration struct { ...@@ -487,7 +487,7 @@ type LinuxConfiguration struct {
type ListUsagesResult struct { type ListUsagesResult struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
Value *[]Usage `json:"value,omitempty"` 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 // ListUsagesResultPreparer prepares a request to retrieve the next set of results. It returns
...@@ -910,7 +910,7 @@ type VirtualMachineScaleSetIPConfigurationProperties struct { ...@@ -910,7 +910,7 @@ type VirtualMachineScaleSetIPConfigurationProperties struct {
type VirtualMachineScaleSetListResult struct { type VirtualMachineScaleSetListResult struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
Value *[]VirtualMachineScaleSet `json:"value,omitempty"` 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 // VirtualMachineScaleSetListResultPreparer prepares a request to retrieve the next set of results. It returns
...@@ -930,7 +930,7 @@ func (client VirtualMachineScaleSetListResult) VirtualMachineScaleSetListResultP ...@@ -930,7 +930,7 @@ func (client VirtualMachineScaleSetListResult) VirtualMachineScaleSetListResultP
type VirtualMachineScaleSetListSkusResult struct { type VirtualMachineScaleSetListSkusResult struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
Value *[]VirtualMachineScaleSetSku `json:"value,omitempty"` 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 // VirtualMachineScaleSetListSkusResultPreparer prepares a request to retrieve the next set of results. It returns
...@@ -1095,7 +1095,7 @@ type VirtualMachineScaleSetVMInstanceView struct { ...@@ -1095,7 +1095,7 @@ type VirtualMachineScaleSetVMInstanceView struct {
type VirtualMachineScaleSetVMListResult struct { type VirtualMachineScaleSetVMListResult struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
Value *[]VirtualMachineScaleSetVM `json:"value,omitempty"` 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 // VirtualMachineScaleSetVMListResultPreparer prepares a request to retrieve the next set of results. It returns
......
...@@ -32,7 +32,13 @@ type UsageOperationsClient struct { ...@@ -32,7 +32,13 @@ type UsageOperationsClient struct {
// NewUsageOperationsClient creates an instance of the UsageOperationsClient // NewUsageOperationsClient creates an instance of the UsageOperationsClient
// client. // client.
func NewUsageOperationsClient(subscriptionID string) UsageOperationsClient { 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. // List lists compute usages for a subscription.
......
...@@ -24,7 +24,7 @@ import ( ...@@ -24,7 +24,7 @@ import (
const ( const (
major = "3" major = "3"
minor = "0" minor = "2"
patch = "0" patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org) // Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta" tag = "-beta"
......
...@@ -32,7 +32,13 @@ type VirtualMachineExtensionImagesClient struct { ...@@ -32,7 +32,13 @@ type VirtualMachineExtensionImagesClient struct {
// NewVirtualMachineExtensionImagesClient creates an instance of the // NewVirtualMachineExtensionImagesClient creates an instance of the
// VirtualMachineExtensionImagesClient client. // VirtualMachineExtensionImagesClient client.
func NewVirtualMachineExtensionImagesClient(subscriptionID string) VirtualMachineExtensionImagesClient { func NewVirtualMachineExtensionImagesClient(subscriptionID string) VirtualMachineExtensionImagesClient {
return 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. // Get gets a virtual machine extension image.
......
...@@ -32,7 +32,13 @@ type VirtualMachineExtensionsClient struct { ...@@ -32,7 +32,13 @@ type VirtualMachineExtensionsClient struct {
// NewVirtualMachineExtensionsClient creates an instance of the // NewVirtualMachineExtensionsClient creates an instance of the
// VirtualMachineExtensionsClient client. // VirtualMachineExtensionsClient client.
func NewVirtualMachineExtensionsClient(subscriptionID string) VirtualMachineExtensionsClient { func NewVirtualMachineExtensionsClient(subscriptionID string) VirtualMachineExtensionsClient {
return 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 // CreateOrUpdate the operation to create or update the extension. This method
......
...@@ -32,7 +32,13 @@ type VirtualMachineImagesClient struct { ...@@ -32,7 +32,13 @@ type VirtualMachineImagesClient struct {
// NewVirtualMachineImagesClient creates an instance of the // NewVirtualMachineImagesClient creates an instance of the
// VirtualMachineImagesClient client. // VirtualMachineImagesClient client.
func NewVirtualMachineImagesClient(subscriptionID string) VirtualMachineImagesClient { func NewVirtualMachineImagesClient(subscriptionID string) VirtualMachineImagesClient {
return 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. // Get gets a virtual machine image.
......
...@@ -32,7 +32,13 @@ type VirtualMachinesClient struct { ...@@ -32,7 +32,13 @@ type VirtualMachinesClient struct {
// NewVirtualMachinesClient creates an instance of the VirtualMachinesClient // NewVirtualMachinesClient creates an instance of the VirtualMachinesClient
// client. // client.
func NewVirtualMachinesClient(subscriptionID string) VirtualMachinesClient { 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 // 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 ...@@ -501,6 +507,30 @@ func (client VirtualMachinesClient) ListResponder(resp *http.Response) (result V
return 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 // 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 // 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. // till nextLink is not null to fetch all the Virtual Machines.
......
...@@ -32,7 +32,13 @@ type VirtualMachineScaleSetsClient struct { ...@@ -32,7 +32,13 @@ type VirtualMachineScaleSetsClient struct {
// NewVirtualMachineScaleSetsClient creates an instance of the // NewVirtualMachineScaleSetsClient creates an instance of the
// VirtualMachineScaleSetsClient client. // VirtualMachineScaleSetsClient client.
func NewVirtualMachineScaleSetsClient(subscriptionID string) VirtualMachineScaleSetsClient { 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 // CreateOrUpdate allows you to create or update a virtual machine scale set
......
...@@ -32,15 +32,21 @@ type VirtualMachineScaleSetVMsClient struct { ...@@ -32,15 +32,21 @@ type VirtualMachineScaleSetVMsClient struct {
// NewVirtualMachineScaleSetVMsClient creates an instance of the // NewVirtualMachineScaleSetVMsClient creates an instance of the
// VirtualMachineScaleSetVMsClient client. // VirtualMachineScaleSetVMsClient client.
func NewVirtualMachineScaleSetVMsClient(subscriptionID string) VirtualMachineScaleSetVMsClient { func NewVirtualMachineScaleSetVMsClient(subscriptionID string) VirtualMachineScaleSetVMsClient {
return VirtualMachineScaleSetVMsClient{New(subscriptionID)} return NewVirtualMachineScaleSetVMsClientWithBaseURI(DefaultBaseURI, subscriptionID)
} }
// Deallocate allows you to deallocate a virtual machine virtual machine scale // NewVirtualMachineScaleSetVMsClientWithBaseURI creates an instance of the
// set.Shuts down the virtual machine and releases the compute resources. You // VirtualMachineScaleSetVMsClient client.
// are not billed for the compute resources that this virtual machine uses. func NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMsClient {
// This method may poll for completion. Polling can be canceled by passing return VirtualMachineScaleSetVMsClient{NewWithBaseURI(baseURI, subscriptionID)}
// the cancel channel argument. The channel will be used to cancel polling }
// and any outstanding HTTP requests.
// 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 // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. instanceID is the instance id of // name of the virtual machine scale set. instanceID is the instance id of
......
...@@ -32,7 +32,13 @@ type VirtualMachineSizesClient struct { ...@@ -32,7 +32,13 @@ type VirtualMachineSizesClient struct {
// NewVirtualMachineSizesClient creates an instance of the // NewVirtualMachineSizesClient creates an instance of the
// VirtualMachineSizesClient client. // VirtualMachineSizesClient client.
func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient { func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient {
return 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 // List lists all available virtual machine sizes for a subscription in a
......
...@@ -36,7 +36,13 @@ type ApplicationGatewaysClient struct { ...@@ -36,7 +36,13 @@ type ApplicationGatewaysClient struct {
// NewApplicationGatewaysClient creates an instance of the // NewApplicationGatewaysClient creates an instance of the
// ApplicationGatewaysClient client. // ApplicationGatewaysClient client.
func NewApplicationGatewaysClient(subscriptionID string) ApplicationGatewaysClient { 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 // CreateOrUpdate the Put ApplicationGateway operation creates/updates a
...@@ -240,7 +246,7 @@ func (client ApplicationGatewaysClient) GetResponder(resp *http.Response) (resul ...@@ -240,7 +246,7 @@ func (client ApplicationGatewaysClient) GetResponder(resp *http.Response) (resul
return return
} }
// List the List ApplicationGateway opertion retrieves all the // List the List ApplicationGateway operation retrieves all the
// applicationgateways in a resource group. // applicationgateways in a resource group.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
...@@ -326,7 +332,7 @@ func (client ApplicationGatewaysClient) ListNextResults(lastResults ApplicationG ...@@ -326,7 +332,7 @@ func (client ApplicationGatewaysClient) ListNextResults(lastResults ApplicationG
return return
} }
// ListAll the List applicationgateway opertion retrieves all the // ListAll the List applicationgateway operation retrieves all the
// applicationgateways in a subscription. // applicationgateways in a subscription.
func (client ApplicationGatewaysClient) ListAll() (result ApplicationGatewayListResult, err error) { func (client ApplicationGatewaysClient) ListAll() (result ApplicationGatewayListResult, err error) {
req, err := client.ListAllPreparer() req, err := client.ListAllPreparer()
......
// Package network implements the Azure ARM Network service API version // 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 // The Microsoft Azure Network management API provides a RESTful set of web
// services that interact with Microsoft Azure Networks service to manage // services that interact with Microsoft Azure Networks service to manage
...@@ -33,7 +33,7 @@ import ( ...@@ -33,7 +33,7 @@ import (
const ( const (
// APIVersion is the version of the Network // 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 is the default URI used for the service Network
DefaultBaseURI = "https://management.azure.com" DefaultBaseURI = "https://management.azure.com"
...@@ -49,9 +49,14 @@ type ManagementClient struct { ...@@ -49,9 +49,14 @@ type ManagementClient struct {
// New creates an instance of the ManagementClient client. // New creates an instance of the ManagementClient client.
func New(subscriptionID string) ManagementClient { 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{ return ManagementClient{
Client: autorest.NewClientWithUserAgent(UserAgent()), Client: autorest.NewClientWithUserAgent(UserAgent()),
BaseURI: DefaultBaseURI, BaseURI: baseURI,
APIVersion: APIVersion, APIVersion: APIVersion,
SubscriptionID: subscriptionID, SubscriptionID: subscriptionID,
} }
......
...@@ -36,7 +36,13 @@ type ExpressRouteCircuitAuthorizationsClient struct { ...@@ -36,7 +36,13 @@ type ExpressRouteCircuitAuthorizationsClient struct {
// NewExpressRouteCircuitAuthorizationsClient creates an instance of the // NewExpressRouteCircuitAuthorizationsClient creates an instance of the
// ExpressRouteCircuitAuthorizationsClient client. // ExpressRouteCircuitAuthorizationsClient client.
func NewExpressRouteCircuitAuthorizationsClient(subscriptionID string) ExpressRouteCircuitAuthorizationsClient { 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 // CreateOrUpdate the Put Authorization operation creates/updates an
......
...@@ -36,7 +36,13 @@ type ExpressRouteCircuitPeeringsClient struct { ...@@ -36,7 +36,13 @@ type ExpressRouteCircuitPeeringsClient struct {
// NewExpressRouteCircuitPeeringsClient creates an instance of the // NewExpressRouteCircuitPeeringsClient creates an instance of the
// ExpressRouteCircuitPeeringsClient client. // ExpressRouteCircuitPeeringsClient client.
func NewExpressRouteCircuitPeeringsClient(subscriptionID string) ExpressRouteCircuitPeeringsClient { func NewExpressRouteCircuitPeeringsClient(subscriptionID string) ExpressRouteCircuitPeeringsClient {
return 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 // CreateOrUpdate the Put Pering operation creates/updates an peering in the
......
...@@ -36,7 +36,13 @@ type ExpressRouteCircuitsClient struct { ...@@ -36,7 +36,13 @@ type ExpressRouteCircuitsClient struct {
// NewExpressRouteCircuitsClient creates an instance of the // NewExpressRouteCircuitsClient creates an instance of the
// ExpressRouteCircuitsClient client. // ExpressRouteCircuitsClient client.
func NewExpressRouteCircuitsClient(subscriptionID string) ExpressRouteCircuitsClient { 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 // CreateOrUpdate the Put ExpressRouteCircuit operation creates/updates a
...@@ -240,7 +246,7 @@ func (client ExpressRouteCircuitsClient) GetResponder(resp *http.Response) (resu ...@@ -240,7 +246,7 @@ func (client ExpressRouteCircuitsClient) GetResponder(resp *http.Response) (resu
return return
} }
// GetPeeringStats the Liststats ExpressRouteCircuit opertion retrieves all // GetPeeringStats the Liststats ExpressRouteCircuit operation retrieves all
// the stats from a ExpressRouteCircuits in a resource group. // the stats from a ExpressRouteCircuits in a resource group.
// //
// resourceGroupName is the name of the resource group. circuitName is the // resourceGroupName is the name of the resource group. circuitName is the
...@@ -305,8 +311,8 @@ func (client ExpressRouteCircuitsClient) GetPeeringStatsResponder(resp *http.Res ...@@ -305,8 +311,8 @@ func (client ExpressRouteCircuitsClient) GetPeeringStatsResponder(resp *http.Res
return return
} }
// GetStats the Liststats ExpressRouteCircuit opertion retrieves all the stats // GetStats the Liststats ExpressRouteCircuit operation retrieves all the
// from a ExpressRouteCircuits in a resource group. // stats from a ExpressRouteCircuits in a resource group.
// //
// resourceGroupName is the name of the resource group. circuitName is the // resourceGroupName is the name of the resource group. circuitName is the
// name of the circuit. // name of the circuit.
...@@ -369,7 +375,7 @@ func (client ExpressRouteCircuitsClient) GetStatsResponder(resp *http.Response) ...@@ -369,7 +375,7 @@ func (client ExpressRouteCircuitsClient) GetStatsResponder(resp *http.Response)
return return
} }
// List the List ExpressRouteCircuit opertion retrieves all the // List the List ExpressRouteCircuit operation retrieves all the
// ExpressRouteCircuits in a resource group. // ExpressRouteCircuits in a resource group.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
...@@ -455,7 +461,7 @@ func (client ExpressRouteCircuitsClient) ListNextResults(lastResults ExpressRout ...@@ -455,7 +461,7 @@ func (client ExpressRouteCircuitsClient) ListNextResults(lastResults ExpressRout
return return
} }
// ListAll the List ExpressRouteCircuit opertion retrieves all the // ListAll the List ExpressRouteCircuit operation retrieves all the
// ExpressRouteCircuits in a subscription. // ExpressRouteCircuits in a subscription.
func (client ExpressRouteCircuitsClient) ListAll() (result ExpressRouteCircuitListResult, err error) { func (client ExpressRouteCircuitsClient) ListAll() (result ExpressRouteCircuitListResult, err error) {
req, err := client.ListAllPreparer() req, err := client.ListAllPreparer()
...@@ -538,7 +544,7 @@ func (client ExpressRouteCircuitsClient) ListAllNextResults(lastResults ExpressR ...@@ -538,7 +544,7 @@ func (client ExpressRouteCircuitsClient) ListAllNextResults(lastResults ExpressR
return return
} }
// ListArpTable the ListArpTable from ExpressRouteCircuit opertion retrieves // ListArpTable the ListArpTable from ExpressRouteCircuit operation retrieves
// the currently advertised arp table associated with the // the currently advertised arp table associated with the
// ExpressRouteCircuits in a resource group. This method may poll for // ExpressRouteCircuits in a resource group. This method may poll for
// completion. Polling can be canceled by passing the cancel channel // completion. Polling can be canceled by passing the cancel channel
...@@ -610,7 +616,7 @@ func (client ExpressRouteCircuitsClient) ListArpTableResponder(resp *http.Respon ...@@ -610,7 +616,7 @@ func (client ExpressRouteCircuitsClient) ListArpTableResponder(resp *http.Respon
return return
} }
// ListRoutesTable the ListRoutesTable from ExpressRouteCircuit opertion // ListRoutesTable the ListRoutesTable from ExpressRouteCircuit operation
// retrieves the currently advertised routes table associated with the // retrieves the currently advertised routes table associated with the
// ExpressRouteCircuits in a resource group. This method may poll for // ExpressRouteCircuits in a resource group. This method may poll for
// completion. Polling can be canceled by passing the cancel channel // completion. Polling can be canceled by passing the cancel channel
...@@ -683,7 +689,7 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableResponder(resp *http.Res ...@@ -683,7 +689,7 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableResponder(resp *http.Res
} }
// ListRoutesTableSummary the ListRoutesTable from ExpressRouteCircuit // 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 // the ExpressRouteCircuits in a resource group. This method may poll for
// completion. Polling can be canceled by passing the cancel channel // completion. Polling can be canceled by passing the cancel channel
// argument. The channel will be used to cancel polling and any outstanding // argument. The channel will be used to cancel polling and any outstanding
......
...@@ -36,10 +36,16 @@ type ExpressRouteServiceProvidersClient struct { ...@@ -36,10 +36,16 @@ type ExpressRouteServiceProvidersClient struct {
// NewExpressRouteServiceProvidersClient creates an instance of the // NewExpressRouteServiceProvidersClient creates an instance of the
// ExpressRouteServiceProvidersClient client. // ExpressRouteServiceProvidersClient client.
func NewExpressRouteServiceProvidersClient(subscriptionID string) ExpressRouteServiceProvidersClient { func NewExpressRouteServiceProvidersClient(subscriptionID string) ExpressRouteServiceProvidersClient {
return 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. // available ExpressRouteServiceProviders.
func (client ExpressRouteServiceProvidersClient) List() (result ExpressRouteServiceProviderListResult, err error) { func (client ExpressRouteServiceProvidersClient) List() (result ExpressRouteServiceProviderListResult, err error) {
req, err := client.ListPreparer() req, err := client.ListPreparer()
......
...@@ -35,7 +35,13 @@ type InterfacesClient struct { ...@@ -35,7 +35,13 @@ type InterfacesClient struct {
// NewInterfacesClient creates an instance of the InterfacesClient client. // NewInterfacesClient creates an instance of the InterfacesClient client.
func NewInterfacesClient(subscriptionID string) InterfacesClient { 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 // CreateOrUpdate the Put NetworkInterface operation creates/updates a
...@@ -243,6 +249,74 @@ func (client InterfacesClient) GetResponder(resp *http.Response) (result Interfa ...@@ -243,6 +249,74 @@ func (client InterfacesClient) GetResponder(resp *http.Response) (result Interfa
return 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 // GetVirtualMachineScaleSetNetworkInterface the Get ntework interface
// operation retreives information about the specified network interface in a // operation retreives information about the specified network interface in a
// virtual machine scale set. // virtual machine scale set.
...@@ -315,7 +389,7 @@ func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfaceResponde ...@@ -315,7 +389,7 @@ func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfaceResponde
return return
} }
// List the List networkInterfaces opertion retrieves all the // List the List networkInterfaces operation retrieves all the
// networkInterfaces in a resource group. // networkInterfaces in a resource group.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
...@@ -401,7 +475,7 @@ func (client InterfacesClient) ListNextResults(lastResults InterfaceListResult) ...@@ -401,7 +475,7 @@ func (client InterfacesClient) ListNextResults(lastResults InterfaceListResult)
return return
} }
// ListAll the List networkInterfaces opertion retrieves all the // ListAll the List networkInterfaces operation retrieves all the
// networkInterfaces in a subscription. // networkInterfaces in a subscription.
func (client InterfacesClient) ListAll() (result InterfaceListResult, err error) { func (client InterfacesClient) ListAll() (result InterfaceListResult, err error) {
req, err := client.ListAllPreparer() req, err := client.ListAllPreparer()
...@@ -484,6 +558,74 @@ func (client InterfacesClient) ListAllNextResults(lastResults InterfaceListResul ...@@ -484,6 +558,74 @@ func (client InterfacesClient) ListAllNextResults(lastResults InterfaceListResul
return 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 // ListVirtualMachineScaleSetNetworkInterfaces the list network interface
// operation retrieves information about all network interfaces in a virtual // operation retrieves information about all network interfaces in a virtual
// machine scale set. // machine scale set.
......
...@@ -36,7 +36,13 @@ type LoadBalancersClient struct { ...@@ -36,7 +36,13 @@ type LoadBalancersClient struct {
// NewLoadBalancersClient creates an instance of the LoadBalancersClient // NewLoadBalancersClient creates an instance of the LoadBalancersClient
// client. // client.
func NewLoadBalancersClient(subscriptionID string) LoadBalancersClient { func NewLoadBalancersClient(subscriptionID string) LoadBalancersClient {
return 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 // CreateOrUpdate the Put LoadBalancer operation creates/updates a
...@@ -243,7 +249,7 @@ func (client LoadBalancersClient) GetResponder(resp *http.Response) (result Load ...@@ -243,7 +249,7 @@ func (client LoadBalancersClient) GetResponder(resp *http.Response) (result Load
return 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. // resource group.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
...@@ -329,8 +335,8 @@ func (client LoadBalancersClient) ListNextResults(lastResults LoadBalancerListRe ...@@ -329,8 +335,8 @@ func (client LoadBalancersClient) ListNextResults(lastResults LoadBalancerListRe
return return
} }
// ListAll the List loadBalancer opertion retrieves all the loadbalancers in a // ListAll the List loadBalancer operation retrieves all the loadbalancers in
// subscription. // a subscription.
func (client LoadBalancersClient) ListAll() (result LoadBalancerListResult, err error) { func (client LoadBalancersClient) ListAll() (result LoadBalancerListResult, err error) {
req, err := client.ListAllPreparer() req, err := client.ListAllPreparer()
if err != nil { if err != nil {
......
...@@ -36,7 +36,13 @@ type LocalNetworkGatewaysClient struct { ...@@ -36,7 +36,13 @@ type LocalNetworkGatewaysClient struct {
// NewLocalNetworkGatewaysClient creates an instance of the // NewLocalNetworkGatewaysClient creates an instance of the
// LocalNetworkGatewaysClient client. // LocalNetworkGatewaysClient client.
func NewLocalNetworkGatewaysClient(subscriptionID string) LocalNetworkGatewaysClient { func NewLocalNetworkGatewaysClient(subscriptionID string) LocalNetworkGatewaysClient {
return 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 // CreateOrUpdate the Put LocalNetworkGateway operation creates/updates a
...@@ -243,8 +249,8 @@ func (client LocalNetworkGatewaysClient) GetResponder(resp *http.Response) (resu ...@@ -243,8 +249,8 @@ func (client LocalNetworkGatewaysClient) GetResponder(resp *http.Response) (resu
return return
} }
// List the List LocalNetworkGateways opertion retrieves all the local network // List the List LocalNetworkGateways operation retrieves all the local
// gateways stored. // network gateways stored.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
func (client LocalNetworkGatewaysClient) List(resourceGroupName string) (result LocalNetworkGatewayListResult, err error) { func (client LocalNetworkGatewaysClient) List(resourceGroupName string) (result LocalNetworkGatewayListResult, err error) {
......
...@@ -36,7 +36,13 @@ type PublicIPAddressesClient struct { ...@@ -36,7 +36,13 @@ type PublicIPAddressesClient struct {
// NewPublicIPAddressesClient creates an instance of the // NewPublicIPAddressesClient creates an instance of the
// PublicIPAddressesClient client. // PublicIPAddressesClient client.
func NewPublicIPAddressesClient(subscriptionID string) PublicIPAddressesClient { 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 // CreateOrUpdate the Put PublicIPAddress operation creates/updates a
...@@ -243,7 +249,7 @@ func (client PublicIPAddressesClient) GetResponder(resp *http.Response) (result ...@@ -243,7 +249,7 @@ func (client PublicIPAddressesClient) GetResponder(resp *http.Response) (result
return return
} }
// List the List publicIpAddress opertion retrieves all the publicIpAddresses // List the List publicIpAddress operation retrieves all the publicIpAddresses
// in a resource group. // in a resource group.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
...@@ -329,7 +335,7 @@ func (client PublicIPAddressesClient) ListNextResults(lastResults PublicIPAddres ...@@ -329,7 +335,7 @@ func (client PublicIPAddressesClient) ListNextResults(lastResults PublicIPAddres
return return
} }
// ListAll the List publicIpAddress opertion retrieves all the // ListAll the List publicIpAddress operation retrieves all the
// publicIpAddresses in a subscription. // publicIpAddresses in a subscription.
func (client PublicIPAddressesClient) ListAll() (result PublicIPAddressListResult, err error) { func (client PublicIPAddressesClient) ListAll() (result PublicIPAddressListResult, err error) {
req, err := client.ListAllPreparer() req, err := client.ListAllPreparer()
......
...@@ -35,7 +35,12 @@ type RoutesClient struct { ...@@ -35,7 +35,12 @@ type RoutesClient struct {
// NewRoutesClient creates an instance of the RoutesClient client. // NewRoutesClient creates an instance of the RoutesClient client.
func NewRoutesClient(subscriptionID string) RoutesClient { 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 // 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 ...@@ -242,7 +247,7 @@ func (client RoutesClient) GetResponder(resp *http.Response) (result Route, err
return 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. // route table.
// //
// resourceGroupName is the name of the resource group. routeTableName is the // resourceGroupName is the name of the resource group. routeTableName is the
......
...@@ -35,7 +35,13 @@ type RouteTablesClient struct { ...@@ -35,7 +35,13 @@ type RouteTablesClient struct {
// NewRouteTablesClient creates an instance of the RouteTablesClient client. // NewRouteTablesClient creates an instance of the RouteTablesClient client.
func NewRouteTablesClient(subscriptionID string) RouteTablesClient { 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 // CreateOrUpdate the Put RouteTable operation creates/updates a route tablein
......
...@@ -36,7 +36,13 @@ type SecurityGroupsClient struct { ...@@ -36,7 +36,13 @@ type SecurityGroupsClient struct {
// NewSecurityGroupsClient creates an instance of the SecurityGroupsClient // NewSecurityGroupsClient creates an instance of the SecurityGroupsClient
// client. // client.
func NewSecurityGroupsClient(subscriptionID string) SecurityGroupsClient { 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 // CreateOrUpdate the Put NetworkSecurityGroup operation creates/updates a
......
...@@ -36,7 +36,13 @@ type SecurityRulesClient struct { ...@@ -36,7 +36,13 @@ type SecurityRulesClient struct {
// NewSecurityRulesClient creates an instance of the SecurityRulesClient // NewSecurityRulesClient creates an instance of the SecurityRulesClient
// client. // client.
func NewSecurityRulesClient(subscriptionID string) SecurityRulesClient { 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 // CreateOrUpdate the Put network security rule operation creates/updates a
...@@ -248,7 +254,7 @@ func (client SecurityRulesClient) GetResponder(resp *http.Response) (result Secu ...@@ -248,7 +254,7 @@ func (client SecurityRulesClient) GetResponder(resp *http.Response) (result Secu
return 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. // rules in a network security group.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
......
...@@ -35,7 +35,12 @@ type SubnetsClient struct { ...@@ -35,7 +35,12 @@ type SubnetsClient struct {
// NewSubnetsClient creates an instance of the SubnetsClient client. // NewSubnetsClient creates an instance of the SubnetsClient client.
func NewSubnetsClient(subscriptionID string) SubnetsClient { 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 // CreateOrUpdate the Put Subnet operation creates/updates a subnet in
...@@ -247,7 +252,7 @@ func (client SubnetsClient) GetResponder(resp *http.Response) (result Subnet, er ...@@ -247,7 +252,7 @@ func (client SubnetsClient) GetResponder(resp *http.Response) (result Subnet, er
return 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. // network.
// //
// resourceGroupName is the name of the resource group. virtualNetworkName is // resourceGroupName is the name of the resource group. virtualNetworkName is
......
...@@ -35,7 +35,12 @@ type UsagesClient struct { ...@@ -35,7 +35,12 @@ type UsagesClient struct {
// NewUsagesClient creates an instance of the UsagesClient client. // NewUsagesClient creates an instance of the UsagesClient client.
func NewUsagesClient(subscriptionID string) UsagesClient { 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. // List lists compute usages for a subscription.
......
...@@ -24,7 +24,7 @@ import ( ...@@ -24,7 +24,7 @@ import (
const ( const (
major = "3" major = "3"
minor = "0" minor = "2"
patch = "0" patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org) // Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta" tag = "-beta"
...@@ -34,7 +34,7 @@ const ( ...@@ -34,7 +34,7 @@ const (
// UserAgent returns the UserAgent string to use when sending http.Requests. // UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string { func UserAgent() string {
return 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. // Version returns the semantic version (see http://semver.org) of the client.
......
...@@ -36,7 +36,13 @@ type VirtualNetworkGatewayConnectionsClient struct { ...@@ -36,7 +36,13 @@ type VirtualNetworkGatewayConnectionsClient struct {
// NewVirtualNetworkGatewayConnectionsClient creates an instance of the // NewVirtualNetworkGatewayConnectionsClient creates an instance of the
// VirtualNetworkGatewayConnectionsClient client. // VirtualNetworkGatewayConnectionsClient client.
func NewVirtualNetworkGatewayConnectionsClient(subscriptionID string) VirtualNetworkGatewayConnectionsClient { 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 // CreateOrUpdate the Put VirtualNetworkGatewayConnection operation
......
...@@ -36,7 +36,13 @@ type VirtualNetworkGatewaysClient struct { ...@@ -36,7 +36,13 @@ type VirtualNetworkGatewaysClient struct {
// NewVirtualNetworkGatewaysClient creates an instance of the // NewVirtualNetworkGatewaysClient creates an instance of the
// VirtualNetworkGatewaysClient client. // VirtualNetworkGatewaysClient client.
func NewVirtualNetworkGatewaysClient(subscriptionID string) VirtualNetworkGatewaysClient { 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 // CreateOrUpdate the Put VirtualNetworkGateway operation creates/updates a
...@@ -312,7 +318,7 @@ func (client VirtualNetworkGatewaysClient) GetResponder(resp *http.Response) (re ...@@ -312,7 +318,7 @@ func (client VirtualNetworkGatewaysClient) GetResponder(resp *http.Response) (re
return return
} }
// List the List VirtualNetworkGateways opertion retrieves all the virtual // List the List VirtualNetworkGateways operation retrieves all the virtual
// network gateways stored. // network gateways stored.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
......
...@@ -36,7 +36,81 @@ type VirtualNetworksClient struct { ...@@ -36,7 +36,81 @@ type VirtualNetworksClient struct {
// NewVirtualNetworksClient creates an instance of the VirtualNetworksClient // NewVirtualNetworksClient creates an instance of the VirtualNetworksClient
// client. // client.
func NewVirtualNetworksClient(subscriptionID string) VirtualNetworksClient { 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 // CreateOrUpdate the Put VirtualNetwork operation creates/updates a virtual
......
// Package storage implements the Azure ARM Storage service API version
// 2016-01-01.
//
// The Storage Management Client.
package storage
// 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"
)
const (
// APIVersion is the version of the Storage
APIVersion = "2016-01-01"
// DefaultBaseURI is the default URI used for the service Storage
DefaultBaseURI = "https://management.azure.com"
)
// ManagementClient is the base client for Storage.
type ManagementClient struct {
autorest.Client
BaseURI string
APIVersion string
SubscriptionID string
}
// 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: baseURI,
APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}
}
package storage
// 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"
)
// UsageOperationsClient is the the Storage Management Client.
type UsageOperationsClient struct {
ManagementClient
}
// NewUsageOperationsClient creates an instance of the UsageOperationsClient
// client.
func NewUsageOperationsClient(subscriptionID string) UsageOperationsClient {
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
// subscription.
func (client UsageOperationsClient) List() (result UsageListResult, err error) {
req, err := client.ListPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "storage.UsageOperationsClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "storage.UsageOperationsClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "storage.UsageOperationsClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client UsageOperationsClient) ListPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages", 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 UsageOperationsClient) 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 UsageOperationsClient) ListResponder(resp *http.Response) (result UsageListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
package storage
// 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 (
"fmt"
)
const (
major = "3"
minor = "2"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"
semVerFormat = "%s.%s.%s%s"
userAgentFormat = "Azure-SDK-for-Go/%s arm-%s/%s"
)
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
return fmt.Sprintf(userAgentFormat, Version(), "storage", "2016-01-01")
}
// Version returns the semantic version (see http://semver.org) of the client.
func Version() string {
return fmt.Sprintf(semVerFormat, major, minor, patch, tag)
}
package storage
import (
"fmt"
"net/http"
"net/url"
)
// FileServiceClient contains operations for Microsoft Azure File Service.
type FileServiceClient struct {
client Client
}
// pathForFileShare returns the URL path segment for a File Share resource
func pathForFileShare(name string) string {
return fmt.Sprintf("/%s", name)
}
// CreateShare operation creates a new share under the specified account. If the
// share with the same name already exists, the operation fails.
//
// See https://msdn.microsoft.com/en-us/library/azure/dn167008.aspx
func (f FileServiceClient) CreateShare(name string) error {
resp, err := f.createShare(name)
if err != nil {
return err
}
defer resp.body.Close()
return checkRespCode(resp.statusCode, []int{http.StatusCreated})
}
// CreateShareIfNotExists creates a new share under the specified account if
// it does not exist. Returns true if container is newly created or false if
// container already exists.
//
// See https://msdn.microsoft.com/en-us/library/azure/dn167008.aspx
func (f FileServiceClient) CreateShareIfNotExists(name string) (bool, error) {
resp, err := f.createShare(name)
if resp != nil {
defer resp.body.Close()
if resp.statusCode == http.StatusCreated || resp.statusCode == http.StatusConflict {
return resp.statusCode == http.StatusCreated, nil
}
}
return false, err
}
// 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)
}
// DeleteShare operation marks the specified share for deletion. The share
// and any files contained within it are later deleted during garbage
// collection.
//
// See https://msdn.microsoft.com/en-us/library/azure/dn689090.aspx
func (f FileServiceClient) DeleteShare(name string) error {
resp, err := f.deleteShare(name)
if err != nil {
return err
}
defer resp.body.Close()
return checkRespCode(resp.statusCode, []int{http.StatusAccepted})
}
// DeleteShareIfExists operation marks the specified share for deletion if it
// exists. The share and any files contained within it are later deleted during
// garbage collection. Returns true if share existed and deleted with this call,
// false otherwise.
//
// See https://msdn.microsoft.com/en-us/library/azure/dn689090.aspx
func (f FileServiceClient) DeleteShareIfExists(name string) (bool, error) {
resp, err := f.deleteShare(name)
if resp != nil {
defer resp.body.Close()
if resp.statusCode == http.StatusAccepted || resp.statusCode == http.StatusNotFound {
return resp.statusCode == http.StatusAccepted, nil
}
}
return false, err
}
// 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
}
package storage
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"net/url"
)
// TableServiceClient contains operations for Microsoft Azure Table Storage
// Service.
type TableServiceClient struct {
client Client
}
// AzureTable is the typedef of the Azure Table name
type AzureTable string
const (
tablesURIPath = "/Tables"
)
type createTableRequest struct {
TableName string `json:"TableName"`
}
func pathForTable(table AzureTable) string { return fmt.Sprintf("%s", table) }
func (c *TableServiceClient) getStandardHeaders() map[string]string {
return map[string]string{
"x-ms-version": "2015-02-21",
"x-ms-date": currentTimeRfc1123Formatted(),
"Accept": "application/json;odata=nometadata",
"Accept-Charset": "UTF-8",
"Content-Type": "application/json",
}
}
// QueryTables returns the tables created in the
// *TableServiceClient storage account.
func (c *TableServiceClient) QueryTables() ([]AzureTable, error) {
uri := c.client.getEndpoint(tableServiceName, tablesURIPath, url.Values{})
headers := c.getStandardHeaders()
headers["Content-Length"] = "0"
resp, err := c.client.execTable("GET", uri, headers, nil)
if err != nil {
return nil, err
}
defer resp.body.Close()
if err := checkRespCode(resp.statusCode, []int{http.StatusOK}); err != nil {
return nil, err
}
buf := new(bytes.Buffer)
buf.ReadFrom(resp.body)
var respArray queryTablesResponse
if err := json.Unmarshal(buf.Bytes(), &respArray); err != nil {
return nil, err
}
s := make([]AzureTable, len(respArray.TableName))
for i, elem := range respArray.TableName {
s[i] = AzureTable(elem.TableName)
}
return s, nil
}
// CreateTable creates the table given the specific
// name. This function fails if the name is not compliant
// with the specification or the tables already exists.
func (c *TableServiceClient) CreateTable(table AzureTable) error {
uri := c.client.getEndpoint(tableServiceName, tablesURIPath, url.Values{})
headers := c.getStandardHeaders()
req := createTableRequest{TableName: string(table)}
buf := new(bytes.Buffer)
if err := json.NewEncoder(buf).Encode(req); err != nil {
return err
}
headers["Content-Length"] = fmt.Sprintf("%d", buf.Len())
resp, err := c.client.execTable("POST", uri, headers, buf)
if err != nil {
return err
}
defer resp.body.Close()
if err := checkRespCode(resp.statusCode, []int{http.StatusCreated}); err != nil {
return err
}
return nil
}
// DeleteTable deletes the table given the specific
// name. This function fails if the table is not present.
// Be advised: DeleteTable deletes all the entries
// that may be present.
func (c *TableServiceClient) DeleteTable(table AzureTable) error {
uri := c.client.getEndpoint(tableServiceName, tablesURIPath, url.Values{})
uri += fmt.Sprintf("('%s')", string(table))
headers := c.getStandardHeaders()
headers["Content-Length"] = "0"
resp, err := c.client.execTable("DELETE", uri, headers, nil)
if err != nil {
return err
}
defer resp.body.Close()
if err := checkRespCode(resp.statusCode, []int{http.StatusNoContent}); err != nil {
return err
}
return nil
}
package storage
import (
"bytes"
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"encoding/xml"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"reflect"
"time"
)
func (c Client) computeHmac256(message string) string {
h := hmac.New(sha256.New, c.accountKey)
h.Write([]byte(message))
return base64.StdEncoding.EncodeToString(h.Sum(nil))
}
func currentTimeRfc1123Formatted() string {
return timeRfc1123Formatted(time.Now().UTC())
}
func timeRfc1123Formatted(t time.Time) string {
return t.Format(http.TimeFormat)
}
func mergeParams(v1, v2 url.Values) url.Values {
out := url.Values{}
for k, v := range v1 {
out[k] = v
}
for k, v := range v2 {
vals, ok := out[k]
if ok {
vals = append(vals, v...)
out[k] = vals
} else {
out[k] = v
}
}
return out
}
func prepareBlockListRequest(blocks []Block) string {
s := `<?xml version="1.0" encoding="utf-8"?><BlockList>`
for _, v := range blocks {
s += fmt.Sprintf("<%s>%s</%s>", v.Status, v.ID, v.Status)
}
s += `</BlockList>`
return s
}
func xmlUnmarshal(body io.Reader, v interface{}) error {
data, err := ioutil.ReadAll(body)
if err != nil {
return err
}
return xml.Unmarshal(data, v)
}
func xmlMarshal(v interface{}) (io.Reader, int, error) {
b, err := xml.Marshal(v)
if err != nil {
return nil, 0, err
}
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
}
The MIT License (MIT)
Copyright (c) 2015 Sergio Rubio
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
package vhd
import (
"encoding/binary"
"encoding/hex"
"fmt"
"os"
"strings"
"unicode/utf16"
"unicode/utf8"
)
// https://groups.google.com/forum/#!msg/golang-nuts/d0nF_k4dSx4/rPGgfXv6QCoJ
func uuidgen() string {
b := uuidgenBytes()
return fmt.Sprintf("%x-%x-%x-%x-%x",
b[0:4], b[4:6], b[6:8], b[8:10], b[10:])
}
func fmtField(name, value string) {
fmt.Printf("%-25s%s\n", name+":", value)
}
func uuidgenBytes() []byte {
f, err := os.Open("/dev/urandom")
check(err)
b := make([]byte, 16)
f.Read(b)
return b
}
func check(e error) {
if e != nil {
panic(e)
}
}
func hexs(a []byte) string {
return "0x" + hex.EncodeToString(a[:])
}
func uuid(a []byte) string {
return fmt.Sprintf("%08x-%04x-%04x-%04x-%04x",
a[:4],
a[4:6],
a[6:8],
a[8:10],
a[10:16])
}
func uuidToBytes(uuid string) []byte {
s := strings.Replace(uuid, "-", "", -1)
h, err := hex.DecodeString(s)
check(err)
return h
}
/*
utf16BytesToString converts UTF-16 encoded bytes, in big or
little endian byte order, to a UTF-8 encoded string.
http://stackoverflow.com/a/15794113
*/
func utf16BytesToString(b []byte, o binary.ByteOrder) string {
utf := make([]uint16, (len(b)+(2-1))/2)
for i := 0; i+(2-1) < len(b); i += 2 {
utf[i/2] = o.Uint16(b[i:])
}
if len(b)/2 < len(utf) {
utf[len(utf)-1] = utf8.RuneError
}
return string(utf16.Decode(utf))
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment