provider/azurerm: Bump azure-sdk-for-go to 3.0.0-beta (#7420)

provider/azurerm: Bump azure-sdk-for-go to 3.0.0-beta
This commit is contained in:
Paul Stack 2016-06-30 15:36:08 +01:00 committed by GitHub
parent 0ce80707ad
commit 079e1f9a56
101 changed files with 3869 additions and 4524 deletions

View File

@ -321,8 +321,8 @@ func (c *Config) getArmClient() (*ArmClient, error) {
}
func (armClient *ArmClient) getKeyForStorageAccount(resourceGroupName, storageAccountName string) (string, bool, error) {
keys, err := armClient.storageServiceClient.ListKeys(resourceGroupName, storageAccountName)
if keys.StatusCode == http.StatusNotFound {
accountKeys, err := armClient.storageServiceClient.ListKeys(resourceGroupName, storageAccountName)
if accountKeys.StatusCode == http.StatusNotFound {
return "", false, nil
}
if err != nil {
@ -331,11 +331,12 @@ func (armClient *ArmClient) getKeyForStorageAccount(resourceGroupName, storageAc
return "", true, fmt.Errorf("Error retrieving keys for storage account %q: %s", storageAccountName, err)
}
if keys.Key1 == nil {
if accountKeys.Keys == nil {
return "", false, fmt.Errorf("Nil key returned for storage account %q", storageAccountName)
}
return *keys.Key1, true, nil
keys := *accountKeys.Keys
return *keys[0].Value, true, nil
}
func (armClient *ArmClient) getBlobStorageClientForStorageAccount(resourceGroupName, storageAccountName string) (*mainStorage.BlobStorageClient, bool, error) {

View File

@ -66,6 +66,7 @@ func resourceArmCdnEndpoint() *schema.Resource {
"origin": {
Type: schema.TypeSet,
Required: true,
ForceNew: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"name": {
@ -149,7 +150,7 @@ func resourceArmCdnEndpointCreate(d *schema.ResourceData, meta interface{}) erro
caching_behaviour := d.Get("querystring_caching_behaviour").(string)
tags := d.Get("tags").(map[string]interface{})
properties := cdn.EndpointPropertiesCreateUpdateParameters{
properties := cdn.EndpointPropertiesCreateParameters{
IsHTTPAllowed: &http_allowed,
IsHTTPSAllowed: &https_allowed,
IsCompressionEnabled: &compression_enabled,
@ -270,23 +271,13 @@ func resourceArmCdnEndpointUpdate(d *schema.ResourceData, meta interface{}) erro
caching_behaviour := d.Get("querystring_caching_behaviour").(string)
newTags := d.Get("tags").(map[string]interface{})
properties := cdn.EndpointPropertiesCreateUpdateParameters{
properties := cdn.EndpointPropertiesUpdateParameters{
IsHTTPAllowed: &http_allowed,
IsHTTPSAllowed: &https_allowed,
IsCompressionEnabled: &compression_enabled,
QueryStringCachingBehavior: cdn.QueryStringCachingBehavior(caching_behaviour),
}
if d.HasChange("origin") {
origins, originsErr := expandAzureRmCdnEndpointOrigins(d)
if originsErr != nil {
return fmt.Errorf("Error Building list of CDN Endpoint Origins: %s", originsErr)
}
if len(origins) > 0 {
properties.Origins = &origins
}
}
if d.HasChange("origin_host_header") {
host_header := d.Get("origin_host_header").(string)
properties.OriginHostHeader = &host_header
@ -313,7 +304,7 @@ func resourceArmCdnEndpointUpdate(d *schema.ResourceData, meta interface{}) erro
Properties: &properties,
}
_, err := cdnEndpointsClient.Update(name, updateProps, profileName, resGroup)
_, err := cdnEndpointsClient.Update(name, updateProps, profileName, resGroup, make(chan struct{}))
if err != nil {
return fmt.Errorf("Error issuing Azure ARM update request to update CDN Endpoint %q: %s", name, err)
}

View File

@ -131,7 +131,7 @@ resource "azurerm_cdn_profile" "test" {
name = "acctestcdnprof%d"
location = "West US"
resource_group_name = "${azurerm_resource_group.test.name}"
sku = "Standard"
sku = "Standard_Verizon"
}
resource "azurerm_cdn_endpoint" "test" {
@ -158,7 +158,7 @@ resource "azurerm_cdn_profile" "test" {
name = "acctestcdnprof%d"
location = "West US"
resource_group_name = "${azurerm_resource_group.test.name}"
sku = "Standard"
sku = "Standard_Verizon"
}
resource "azurerm_cdn_endpoint" "test" {
@ -190,7 +190,7 @@ resource "azurerm_cdn_profile" "test" {
name = "acctestcdnprof%d"
location = "West US"
resource_group_name = "${azurerm_resource_group.test.name}"
sku = "Standard"
sku = "Standard_Verizon"
}
resource "azurerm_cdn_endpoint" "test" {

View File

@ -4,6 +4,7 @@ import (
"fmt"
"log"
"net/http"
"strings"
"github.com/Azure/azure-sdk-for-go/arm/cdn"
@ -61,18 +62,14 @@ func resourceArmCdnProfileCreate(d *schema.ResourceData, meta interface{}) error
sku := d.Get("sku").(string)
tags := d.Get("tags").(map[string]interface{})
properties := cdn.ProfilePropertiesCreateParameters{
cdnProfile := cdn.ProfileCreateParameters{
Location: &location,
Tags: expandTags(tags),
Sku: &cdn.Sku{
Name: cdn.SkuName(sku),
},
}
cdnProfile := cdn.ProfileCreateParameters{
Location: &location,
Properties: &properties,
Tags: expandTags(tags),
}
_, err := cdnProfilesClient.Create(name, cdnProfile, resGroup, make(chan struct{}))
if err != nil {
return err
@ -110,8 +107,8 @@ func resourceArmCdnProfileRead(d *schema.ResourceData, meta interface{}) error {
return fmt.Errorf("Error making Read request on Azure CDN Profile %s: %s", name, err)
}
if resp.Properties != nil && resp.Properties.Sku != nil {
d.Set("sku", string(resp.Properties.Sku.Name))
if resp.Sku != nil {
d.Set("sku", string(resp.Sku.Name))
}
flattenAndSetTags(d, resp.Tags)
@ -134,7 +131,7 @@ func resourceArmCdnProfileUpdate(d *schema.ResourceData, meta interface{}) error
Tags: expandTags(newTags),
}
_, err := cdnProfilesClient.Update(name, props, resGroup)
_, err := cdnProfilesClient.Update(name, props, resGroup, make(chan struct{}))
if err != nil {
return fmt.Errorf("Error issuing Azure ARM update request to update CDN Profile %q: %s", name, err)
}
@ -160,12 +157,13 @@ func resourceArmCdnProfileDelete(d *schema.ResourceData, meta interface{}) error
func validateCdnProfileSku(v interface{}, k string) (ws []string, errors []error) {
value := strings.ToLower(v.(string))
skus := map[string]bool{
"standard": true,
"premium": true,
"standard_akamai": true,
"premium_verizon": true,
"standard_verizon": true,
}
if !skus[value] {
errors = append(errors, fmt.Errorf("CDN Profile SKU can only be Standard or Premium"))
errors = append(errors, fmt.Errorf("CDN Profile SKU can only be Premium_Verizon, Standard_Verizon or Standard_Akamai"))
}
return
}

View File

@ -20,19 +20,23 @@ func TestResourceAzureRMCdnProfileSKU_validation(t *testing.T) {
ErrCount: 1,
},
{
Value: "Standard",
Value: "Standard_Verizon",
ErrCount: 0,
},
{
Value: "Premium",
Value: "Premium_Verizon",
ErrCount: 0,
},
{
Value: "STANDARD",
Value: "Standard_Akamai",
ErrCount: 0,
},
{
Value: "PREMIUM",
Value: "STANDARD_AKAMAI",
ErrCount: 0,
},
{
Value: "standard_akamai",
ErrCount: 0,
},
}
@ -167,7 +171,7 @@ resource "azurerm_cdn_profile" "test" {
name = "acctestcdnprof%d"
location = "West US"
resource_group_name = "${azurerm_resource_group.test.name}"
sku = "Standard"
sku = "Standard_Verizon"
}
`
@ -180,7 +184,7 @@ resource "azurerm_cdn_profile" "test" {
name = "acctestcdnprof%d"
location = "West US"
resource_group_name = "${azurerm_resource_group.test.name}"
sku = "Standard"
sku = "Standard_Verizon"
tags {
environment = "Production"
@ -198,7 +202,7 @@ resource "azurerm_cdn_profile" "test" {
name = "acctestcdnprof%d"
location = "West US"
resource_group_name = "${azurerm_resource_group.test.name}"
sku = "Standard"
sku = "Standard_Verizon"
tags {
environment = "staging"

View File

@ -114,12 +114,14 @@ func resourceArmStorageAccountCreate(d *schema.ResourceData, meta interface{}) e
location := d.Get("location").(string)
tags := d.Get("tags").(map[string]interface{})
sku := storage.Sku{
Name: storage.SkuName(accountType),
}
opts := storage.AccountCreateParameters{
Location: &location,
Properties: &storage.AccountPropertiesCreateParameters{
AccountType: storage.AccountType(accountType),
},
Tags: expandTags(tags),
Sku: &sku,
Tags: expandTags(tags),
}
_, err := client.Create(resourceGroupName, storageAccountName, opts, make(chan struct{}))
@ -159,10 +161,12 @@ func resourceArmStorageAccountUpdate(d *schema.ResourceData, meta interface{}) e
if d.HasChange("account_type") {
accountType := d.Get("account_type").(string)
sku := storage.Sku{
Name: storage.SkuName(accountType),
}
opts := storage.AccountUpdateParameters{
Properties: &storage.AccountPropertiesUpdateParameters{
AccountType: storage.AccountType(accountType),
},
Sku: &sku,
}
_, err := client.Update(resourceGroupName, storageAccountName, opts)
if err != nil {
@ -215,10 +219,11 @@ func resourceArmStorageAccountRead(d *schema.ResourceData, meta interface{}) err
return err
}
d.Set("primary_access_key", keys.Key1)
d.Set("secondary_access_key", keys.Key2)
accessKeys := *keys.Keys
d.Set("primary_access_key", accessKeys[0].KeyName)
d.Set("secondary_access_key", accessKeys[1].KeyName)
d.Set("location", resp.Location)
d.Set("account_type", resp.Properties.AccountType)
d.Set("account_type", resp.Sku.Name)
d.Set("primary_location", resp.Properties.PrimaryLocation)
d.Set("secondary_location", resp.Properties.SecondaryLocation)

View File

@ -81,11 +81,12 @@ func getStorageAccountAccessKey(conf map[string]string, resourceGroupName, stora
return "", fmt.Errorf("Error retrieving keys for storage account %q: %s", storageAccountName, err)
}
if keys.Key1 == nil {
if keys.Keys == nil {
return "", fmt.Errorf("Nil key returned for storage account %q", storageAccountName)
}
return *keys.Key1, nil
accessKeys := *keys.Keys
return *accessKeys[0].KeyName, nil
}
func getCredentialsFromConf(conf map[string]string) (*riviera.AzureResourceManagerCredentials, error) {

View File

@ -1,4 +1,4 @@
// Package cdn implements the Azure ARM Cdn service API version 2015-06-01.
// Package cdn implements the Azure ARM Cdn service API version 2016-04-02.
//
// Use these APIs to manage Azure CDN resources through the Azure Resource
// Manager. You must make sure that requests made to these resources are
@ -20,7 +20,7 @@ package cdn
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -30,7 +30,7 @@ import (
const (
// APIVersion is the version of the Cdn
APIVersion = "2015-06-01"
APIVersion = "2016-04-02"
// DefaultBaseURI is the default URI used for the service Cdn
DefaultBaseURI = "https://management.azure.com"
@ -40,19 +40,16 @@ const (
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,
BaseURI: DefaultBaseURI,
APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}
}

View File

@ -14,7 +14,7 @@ package cdn
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// CustomDomainsClient is the use these APIs to manage Azure CDN resources
@ -37,24 +36,18 @@ type CustomDomainsClient struct {
// NewCustomDomainsClient creates an instance of the CustomDomainsClient
// client.
func NewCustomDomainsClient(subscriptionID string) CustomDomainsClient {
return NewCustomDomainsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewCustomDomainsClientWithBaseURI creates an instance of the
// CustomDomainsClient client.
func NewCustomDomainsClientWithBaseURI(baseURI string, subscriptionID string) CustomDomainsClient {
return CustomDomainsClient{NewWithBaseURI(baseURI, subscriptionID)}
return CustomDomainsClient{New(subscriptionID)}
}
// Create sends the create request. 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.
//
// customDomainName is name of the custom domain within an endpoint
// customDomainProperties is custom domain properties required for creation
// endpointName is name of the endpoint within the CDN profile profileName is
// name of the CDN profile within the resource group resourceGroupName is
// name of the resource group within the Azure subscription
// customDomainName is name of the custom domain within an endpoint.
// customDomainProperties is custom domain properties required for creation.
// endpointName is name of the endpoint within the CDN profile. profileName
// is name of the CDN profile within the resource group. resourceGroupName is
// name of the resource group within the Azure subscription.
func (client CustomDomainsClient) Create(customDomainName string, customDomainProperties CustomDomainParameters, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.CreatePreparer(customDomainName, customDomainProperties, endpointName, profileName, resourceGroupName, cancel)
if err != nil {
@ -78,25 +71,25 @@ func (client CustomDomainsClient) Create(customDomainName string, customDomainPr
// CreatePreparer prepares the Create request.
func (client CustomDomainsClient) CreatePreparer(customDomainName string, customDomainProperties CustomDomainParameters, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"customDomainName": url.QueryEscape(customDomainName),
"endpointName": url.QueryEscape(endpointName),
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"customDomainName": autorest.Encode("path", customDomainName),
"endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}", pathParameters),
autorest.WithJSON(customDomainProperties),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateSender sends the Create request. The method will close the
@ -124,10 +117,10 @@ func (client CustomDomainsClient) CreateResponder(resp *http.Response) (result a
// argument. The channel will be used to cancel polling and any outstanding
// HTTP requests.
//
// customDomainName is name of the custom domain within an endpoint
// endpointName is name of the endpoint within the CDN profile profileName is
// name of the CDN profile within the resource group resourceGroupName is
// name of the resource group within the Azure subscription
// customDomainName is name of the custom domain within an endpoint.
// endpointName is name of the endpoint within the CDN profile. profileName
// is name of the CDN profile within the resource group. resourceGroupName is
// name of the resource group within the Azure subscription.
func (client CustomDomainsClient) DeleteIfExists(customDomainName string, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.DeleteIfExistsPreparer(customDomainName, endpointName, profileName, resourceGroupName, cancel)
if err != nil {
@ -151,24 +144,23 @@ func (client CustomDomainsClient) DeleteIfExists(customDomainName string, endpoi
// DeleteIfExistsPreparer prepares the DeleteIfExists request.
func (client CustomDomainsClient) DeleteIfExistsPreparer(customDomainName string, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"customDomainName": url.QueryEscape(customDomainName),
"endpointName": url.QueryEscape(endpointName),
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"customDomainName": autorest.Encode("path", customDomainName),
"endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteIfExistsSender sends the DeleteIfExists request. The method will close the
@ -193,10 +185,10 @@ func (client CustomDomainsClient) DeleteIfExistsResponder(resp *http.Response) (
// Get sends the get request.
//
// customDomainName is name of the custom domain within an endpoint
// endpointName is name of the endpoint within the CDN profile profileName is
// name of the CDN profile within the resource group resourceGroupName is
// name of the resource group within the Azure subscription
// customDomainName is name of the custom domain within an endpoint.
// endpointName is name of the endpoint within the CDN profile. profileName
// is name of the CDN profile within the resource group. resourceGroupName is
// name of the resource group within the Azure subscription.
func (client CustomDomainsClient) Get(customDomainName string, endpointName string, profileName string, resourceGroupName string) (result CustomDomain, err error) {
req, err := client.GetPreparer(customDomainName, endpointName, profileName, resourceGroupName)
if err != nil {
@ -220,24 +212,23 @@ func (client CustomDomainsClient) Get(customDomainName string, endpointName stri
// GetPreparer prepares the Get request.
func (client CustomDomainsClient) GetPreparer(customDomainName string, endpointName string, profileName string, resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"customDomainName": url.QueryEscape(customDomainName),
"endpointName": url.QueryEscape(endpointName),
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"customDomainName": autorest.Encode("path", customDomainName),
"endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -261,9 +252,9 @@ func (client CustomDomainsClient) GetResponder(resp *http.Response) (result Cust
// ListByEndpoint sends the list by endpoint request.
//
// endpointName is name of the endpoint within the CDN profile profileName is
// name of the CDN profile within the resource group resourceGroupName is
// name of the resource group within the Azure subscription
// endpointName is name of the endpoint within the CDN profile. profileName is
// name of the CDN profile within the resource group. resourceGroupName is
// name of the resource group within the Azure subscription.
func (client CustomDomainsClient) ListByEndpoint(endpointName string, profileName string, resourceGroupName string) (result CustomDomainListResult, err error) {
req, err := client.ListByEndpointPreparer(endpointName, profileName, resourceGroupName)
if err != nil {
@ -287,23 +278,22 @@ func (client CustomDomainsClient) ListByEndpoint(endpointName string, profileNam
// ListByEndpointPreparer prepares the ListByEndpoint request.
func (client CustomDomainsClient) ListByEndpointPreparer(endpointName string, profileName string, resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"endpointName": url.QueryEscape(endpointName),
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListByEndpointSender sends the ListByEndpoint request. The method will close the
@ -327,11 +317,11 @@ func (client CustomDomainsClient) ListByEndpointResponder(resp *http.Response) (
// Update sends the update request.
//
// customDomainName is name of the custom domain within an endpoint
// customDomainProperties is custom domain properties to update endpointName
// is name of the endpoint within the CDN profile profileName is name of the
// CDN profile within the resource group resourceGroupName is name of the
// resource group within the Azure subscription
// customDomainName is name of the custom domain within an endpoint.
// customDomainProperties is custom domain properties to update. endpointName
// is name of the endpoint within the CDN profile. profileName is name of the
// CDN profile within the resource group. resourceGroupName is name of the
// resource group within the Azure subscription.
func (client CustomDomainsClient) Update(customDomainName string, customDomainProperties CustomDomainParameters, endpointName string, profileName string, resourceGroupName string) (result ErrorResponse, err error) {
req, err := client.UpdatePreparer(customDomainName, customDomainProperties, endpointName, profileName, resourceGroupName)
if err != nil {
@ -355,25 +345,25 @@ func (client CustomDomainsClient) Update(customDomainName string, customDomainPr
// UpdatePreparer prepares the Update request.
func (client CustomDomainsClient) UpdatePreparer(customDomainName string, customDomainProperties CustomDomainParameters, endpointName string, profileName string, resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"customDomainName": url.QueryEscape(customDomainName),
"endpointName": url.QueryEscape(endpointName),
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"customDomainName": autorest.Encode("path", customDomainName),
"endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}", pathParameters),
autorest.WithJSON(customDomainProperties),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// UpdateSender sends the Update request. The method will close the

View File

@ -14,15 +14,15 @@ package cdn
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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 (
"net/http"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// EndpointsClient is the use these APIs to manage Azure CDN resources through
@ -36,23 +36,17 @@ type EndpointsClient struct {
// NewEndpointsClient creates an instance of the EndpointsClient client.
func NewEndpointsClient(subscriptionID string) EndpointsClient {
return NewEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewEndpointsClientWithBaseURI creates an instance of the EndpointsClient
// client.
func NewEndpointsClientWithBaseURI(baseURI string, subscriptionID string) EndpointsClient {
return EndpointsClient{NewWithBaseURI(baseURI, subscriptionID)}
return EndpointsClient{New(subscriptionID)}
}
// Create sends the create request. 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.
//
// endpointName is name of the endpoint within the CDN profile
// endpointName is name of the endpoint within the CDN profile.
// endpointProperties is endpoint properties profileName is name of the CDN
// profile within the resource group resourceGroupName is name of the
// resource group within the Azure subscription
// profile within the resource group. resourceGroupName is name of the
// resource group within the Azure subscription.
func (client EndpointsClient) Create(endpointName string, endpointProperties EndpointCreateParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.CreatePreparer(endpointName, endpointProperties, profileName, resourceGroupName, cancel)
if err != nil {
@ -76,24 +70,24 @@ func (client EndpointsClient) Create(endpointName string, endpointProperties End
// CreatePreparer prepares the Create request.
func (client EndpointsClient) CreatePreparer(endpointName string, endpointProperties EndpointCreateParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"endpointName": url.QueryEscape(endpointName),
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", pathParameters),
autorest.WithJSON(endpointProperties),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateSender sends the Create request. The method will close the
@ -121,9 +115,9 @@ func (client EndpointsClient) CreateResponder(resp *http.Response) (result autor
// argument. The channel will be used to cancel polling and any outstanding
// HTTP requests.
//
// endpointName is name of the endpoint within the CDN profile profileName is
// name of the CDN profile within the resource group resourceGroupName is
// name of the resource group within the Azure subscription
// endpointName is name of the endpoint within the CDN profile. profileName is
// name of the CDN profile within the resource group. resourceGroupName is
// name of the resource group within the Azure subscription.
func (client EndpointsClient) DeleteIfExists(endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.DeleteIfExistsPreparer(endpointName, profileName, resourceGroupName, cancel)
if err != nil {
@ -147,23 +141,22 @@ func (client EndpointsClient) DeleteIfExists(endpointName string, profileName st
// DeleteIfExistsPreparer prepares the DeleteIfExists request.
func (client EndpointsClient) DeleteIfExistsPreparer(endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"endpointName": url.QueryEscape(endpointName),
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteIfExistsSender sends the DeleteIfExists request. The method will close the
@ -188,9 +181,9 @@ func (client EndpointsClient) DeleteIfExistsResponder(resp *http.Response) (resu
// Get sends the get request.
//
// endpointName is name of the endpoint within the CDN profile profileName is
// name of the CDN profile within the resource group resourceGroupName is
// name of the resource group within the Azure subscription
// endpointName is name of the endpoint within the CDN profile. profileName is
// name of the CDN profile within the resource group. resourceGroupName is
// name of the resource group within the Azure subscription.
func (client EndpointsClient) Get(endpointName string, profileName string, resourceGroupName string) (result Endpoint, err error) {
req, err := client.GetPreparer(endpointName, profileName, resourceGroupName)
if err != nil {
@ -214,23 +207,22 @@ func (client EndpointsClient) Get(endpointName string, profileName string, resou
// GetPreparer prepares the Get request.
func (client EndpointsClient) GetPreparer(endpointName string, profileName string, resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"endpointName": url.QueryEscape(endpointName),
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -254,9 +246,9 @@ func (client EndpointsClient) GetResponder(resp *http.Response) (result Endpoint
// ListByProfile sends the list by profile request.
//
// profileName is name of the CDN profile within the resource group
// profileName is name of the CDN profile within the resource group.
// resourceGroupName is name of the resource group within the Azure
// subscription
// subscription.
func (client EndpointsClient) ListByProfile(profileName string, resourceGroupName string) (result EndpointListResult, err error) {
req, err := client.ListByProfilePreparer(profileName, resourceGroupName)
if err != nil {
@ -280,22 +272,21 @@ func (client EndpointsClient) ListByProfile(profileName string, resourceGroupNam
// ListByProfilePreparer prepares the ListByProfile request.
func (client EndpointsClient) ListByProfilePreparer(profileName string, resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListByProfileSender sends the ListByProfile request. The method will close the
@ -322,11 +313,11 @@ func (client EndpointsClient) ListByProfileResponder(resp *http.Response) (resul
// argument. The channel will be used to cancel polling and any outstanding
// HTTP requests.
//
// endpointName is name of the endpoint within the CDN profile
// endpointName is name of the endpoint within the CDN profile.
// contentFilePaths is the path to the content to be loaded. Path should
// describe a file. profileName is name of the CDN profile within the
// resource group resourceGroupName is name of the resource group within the
// Azure subscription
// resource group. resourceGroupName is name of the resource group within the
// Azure subscription.
func (client EndpointsClient) LoadContent(endpointName string, contentFilePaths LoadParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.LoadContentPreparer(endpointName, contentFilePaths, profileName, resourceGroupName, cancel)
if err != nil {
@ -350,24 +341,24 @@ func (client EndpointsClient) LoadContent(endpointName string, contentFilePaths
// LoadContentPreparer prepares the LoadContent request.
func (client EndpointsClient) LoadContentPreparer(endpointName string, contentFilePaths LoadParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"endpointName": url.QueryEscape(endpointName),
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/load"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/load", pathParameters),
autorest.WithJSON(contentFilePaths),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// LoadContentSender sends the LoadContent request. The method will close the
@ -395,11 +386,11 @@ func (client EndpointsClient) LoadContentResponder(resp *http.Response) (result
// argument. The channel will be used to cancel polling and any outstanding
// HTTP requests.
//
// endpointName is name of the endpoint within the CDN profile
// endpointName is name of the endpoint within the CDN profile.
// contentFilePaths is the path to the content to be purged. Path can
// describe a file or directory. profileName is name of the CDN profile
// within the resource group resourceGroupName is name of the resource group
// within the Azure subscription
// within the resource group. resourceGroupName is name of the resource group
// within the Azure subscription.
func (client EndpointsClient) PurgeContent(endpointName string, contentFilePaths PurgeParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.PurgeContentPreparer(endpointName, contentFilePaths, profileName, resourceGroupName, cancel)
if err != nil {
@ -423,24 +414,24 @@ func (client EndpointsClient) PurgeContent(endpointName string, contentFilePaths
// PurgeContentPreparer prepares the PurgeContent request.
func (client EndpointsClient) PurgeContentPreparer(endpointName string, contentFilePaths PurgeParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"endpointName": url.QueryEscape(endpointName),
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/purge"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/purge", pathParameters),
autorest.WithJSON(contentFilePaths),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// PurgeContentSender sends the PurgeContent request. The method will close the
@ -467,9 +458,9 @@ func (client EndpointsClient) PurgeContentResponder(resp *http.Response) (result
// can be canceled by passing the cancel channel argument. The channel will
// be used to cancel polling and any outstanding HTTP requests.
//
// endpointName is name of the endpoint within the CDN profile profileName is
// name of the CDN profile within the resource group resourceGroupName is
// name of the resource group within the Azure subscription
// endpointName is name of the endpoint within the CDN profile. profileName is
// name of the CDN profile within the resource group. resourceGroupName is
// name of the resource group within the Azure subscription.
func (client EndpointsClient) Start(endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.StartPreparer(endpointName, profileName, resourceGroupName, cancel)
if err != nil {
@ -493,23 +484,22 @@ func (client EndpointsClient) Start(endpointName string, profileName string, res
// StartPreparer prepares the Start request.
func (client EndpointsClient) StartPreparer(endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"endpointName": url.QueryEscape(endpointName),
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/start"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/start", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// StartSender sends the Start request. The method will close the
@ -536,9 +526,9 @@ func (client EndpointsClient) StartResponder(resp *http.Response) (result autore
// can be canceled by passing the cancel channel argument. The channel will
// be used to cancel polling and any outstanding HTTP requests.
//
// endpointName is name of the endpoint within the CDN profile profileName is
// name of the CDN profile within the resource group resourceGroupName is
// name of the resource group within the Azure subscription
// endpointName is name of the endpoint within the CDN profile. profileName is
// name of the CDN profile within the resource group. resourceGroupName is
// name of the resource group within the Azure subscription.
func (client EndpointsClient) Stop(endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.StopPreparer(endpointName, profileName, resourceGroupName, cancel)
if err != nil {
@ -562,23 +552,22 @@ func (client EndpointsClient) Stop(endpointName string, profileName string, reso
// StopPreparer prepares the Stop request.
func (client EndpointsClient) StopPreparer(endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"endpointName": url.QueryEscape(endpointName),
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/stop"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/stop", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// StopSender sends the Stop request. The method will close the
@ -601,21 +590,23 @@ func (client EndpointsClient) StopResponder(resp *http.Response) (result autores
return
}
// Update sends the update request.
// Update sends the update request. 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.
//
// endpointName is name of the endpoint within the CDN profile
// endpointName is name of the endpoint within the CDN profile.
// endpointProperties is endpoint properties profileName is name of the CDN
// profile within the resource group resourceGroupName is name of the
// resource group within the Azure subscription
func (client EndpointsClient) Update(endpointName string, endpointProperties EndpointUpdateParameters, profileName string, resourceGroupName string) (result Endpoint, err error) {
req, err := client.UpdatePreparer(endpointName, endpointProperties, profileName, resourceGroupName)
// profile within the resource group. resourceGroupName is name of the
// resource group within the Azure subscription.
func (client EndpointsClient) Update(endpointName string, endpointProperties EndpointUpdateParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.UpdatePreparer(endpointName, endpointProperties, profileName, resourceGroupName, cancel)
if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Update", nil, "Failure preparing request")
}
resp, err := client.UpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
result.Response = resp
return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Update", resp, "Failure sending request")
}
@ -628,53 +619,54 @@ func (client EndpointsClient) Update(endpointName string, endpointProperties End
}
// UpdatePreparer prepares the Update request.
func (client EndpointsClient) UpdatePreparer(endpointName string, endpointProperties EndpointUpdateParameters, profileName string, resourceGroupName string) (*http.Request, error) {
func (client EndpointsClient) UpdatePreparer(endpointName string, endpointProperties EndpointUpdateParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"endpointName": url.QueryEscape(endpointName),
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", pathParameters),
autorest.WithJSON(endpointProperties),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
func (client EndpointsClient) UpdateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// UpdateResponder handles the response to the Update request. The method always
// closes the http.Response Body.
func (client EndpointsClient) UpdateResponder(resp *http.Response) (result Endpoint, err error) {
func (client EndpointsClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
result.Response = resp
return
}
// ValidateCustomDomain sends the validate custom domain request.
//
// endpointName is name of the endpoint within the CDN profile
// customDomainProperties is custom domain to validate profileName is name of
// the CDN profile within the resource group resourceGroupName is name of the
// resource group within the Azure subscription
// endpointName is name of the endpoint within the CDN profile.
// customDomainProperties is custom domain to validate. profileName is name
// of the CDN profile within the resource group. resourceGroupName is name of
// the resource group within the Azure subscription.
func (client EndpointsClient) ValidateCustomDomain(endpointName string, customDomainProperties ValidateCustomDomainInput, profileName string, resourceGroupName string) (result ValidateCustomDomainOutput, err error) {
req, err := client.ValidateCustomDomainPreparer(endpointName, customDomainProperties, profileName, resourceGroupName)
if err != nil {
@ -698,24 +690,24 @@ func (client EndpointsClient) ValidateCustomDomain(endpointName string, customDo
// ValidateCustomDomainPreparer prepares the ValidateCustomDomain request.
func (client EndpointsClient) ValidateCustomDomainPreparer(endpointName string, customDomainProperties ValidateCustomDomainInput, profileName string, resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"endpointName": url.QueryEscape(endpointName),
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/validateCustomDomain"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/validateCustomDomain", pathParameters),
autorest.WithJSON(customDomainProperties),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ValidateCustomDomainSender sends the ValidateCustomDomain request. The method will close the

View File

@ -14,7 +14,7 @@ package cdn
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -138,19 +138,23 @@ const (
type SkuName string
const (
// Premium specifies the premium state for sku name.
Premium SkuName = "Premium"
// Standard specifies the standard state for sku name.
Standard SkuName = "Standard"
// CustomVerizon specifies the custom verizon state for sku name.
CustomVerizon SkuName = "Custom_Verizon"
// PremiumVerizon specifies the premium verizon state for sku name.
PremiumVerizon SkuName = "Premium_Verizon"
// StandardAkamai specifies the standard akamai state for sku name.
StandardAkamai SkuName = "Standard_Akamai"
// StandardVerizon specifies the standard verizon state for sku name.
StandardVerizon SkuName = "Standard_Verizon"
)
// CheckNameAvailabilityInput is input of check name availability API
// CheckNameAvailabilityInput is input of CheckNameAvailability API.
type CheckNameAvailabilityInput struct {
Name *string `json:"name,omitempty"`
Type ResourceType `json:"type,omitempty"`
}
// CheckNameAvailabilityOutput is output of check name availability API
// CheckNameAvailabilityOutput is output of check name availability API.
type CheckNameAvailabilityOutput struct {
autorest.Response `json:"-"`
NameAvailable *bool `json:"NameAvailable,omitempty"`
@ -159,8 +163,8 @@ type CheckNameAvailabilityOutput struct {
}
// CustomDomain is cDN CustomDomain represents a mapping between a user
// specified domain name and an Endpoint. It is a common practice to use
// custom domain names to represent the URLs for branding purposes.
// specified domain name and a CDN endpoint. This is to use custom domain
// names to represent the URLs for branding purposes.
type CustomDomain struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
@ -176,7 +180,7 @@ type CustomDomainListResult struct {
}
// CustomDomainParameters is customDomain properties required for custom
// domain creation or update
// domain creation or update.
type CustomDomainParameters struct {
Properties *CustomDomainPropertiesParameters `json:"properties,omitempty"`
}
@ -193,23 +197,23 @@ type CustomDomainPropertiesParameters struct {
HostName *string `json:"hostName,omitempty"`
}
// DeepCreatedOrigin is deep created origins within a CDN endpoint
// DeepCreatedOrigin is deep created origins within a CDN endpoint.
type DeepCreatedOrigin struct {
Name *string `json:"name,omitempty"`
Properties *DeepCreatedOriginProperties `json:"properties,omitempty"`
}
// DeepCreatedOriginProperties is properties of deep created origin on a CDN
// endpoint
// endpoint.
type DeepCreatedOriginProperties struct {
HostName *string `json:"hostName,omitempty"`
HTTPPort *int32 `json:"httpPort,omitempty"`
HTTPSPort *int32 `json:"httpsPort,omitempty"`
}
// Endpoint is cDN Endpoint is the entity within a CDN Profile containing
// Endpoint is cDN endpoint is the entity within a CDN profile containing
// configuration information regarding caching behaviors and origins. The CDN
// Endpoint is exposed using the URL format <endpointname>.azureedge.net by
// endpoint is exposed using the URL format <endpointname>.azureedge.net by
// default, but custom domains can also be created.
type Endpoint struct {
autorest.Response `json:"-"`
@ -222,11 +226,11 @@ type Endpoint struct {
}
// EndpointCreateParameters is endpoint properties required for new endpoint
// creation
// creation.
type EndpointCreateParameters struct {
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Properties *EndpointPropertiesCreateUpdateParameters `json:"properties,omitempty"`
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Properties *EndpointPropertiesCreateParameters `json:"properties,omitempty"`
}
// EndpointListResult is
@ -250,8 +254,8 @@ type EndpointProperties struct {
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
}
// EndpointPropertiesCreateUpdateParameters is
type EndpointPropertiesCreateUpdateParameters struct {
// EndpointPropertiesCreateParameters is
type EndpointPropertiesCreateParameters struct {
OriginHostHeader *string `json:"originHostHeader,omitempty"`
OriginPath *string `json:"originPath,omitempty"`
ContentTypesToCompress *[]string `json:"contentTypesToCompress,omitempty"`
@ -262,11 +266,22 @@ type EndpointPropertiesCreateUpdateParameters struct {
Origins *[]DeepCreatedOrigin `json:"origins,omitempty"`
}
// EndpointPropertiesUpdateParameters is
type EndpointPropertiesUpdateParameters struct {
OriginHostHeader *string `json:"originHostHeader,omitempty"`
OriginPath *string `json:"originPath,omitempty"`
ContentTypesToCompress *[]string `json:"contentTypesToCompress,omitempty"`
IsCompressionEnabled *bool `json:"isCompressionEnabled,omitempty"`
IsHTTPAllowed *bool `json:"isHttpAllowed,omitempty"`
IsHTTPSAllowed *bool `json:"isHttpsAllowed,omitempty"`
QueryStringCachingBehavior QueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"`
}
// EndpointUpdateParameters is endpoint properties required for new endpoint
// creation
// creation.
type EndpointUpdateParameters struct {
Tags *map[string]*string `json:"tags,omitempty"`
Properties *EndpointPropertiesCreateUpdateParameters `json:"properties,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Properties *EndpointPropertiesUpdateParameters `json:"properties,omitempty"`
}
// ErrorResponse is
@ -276,7 +291,7 @@ type ErrorResponse struct {
Message *string `json:"message,omitempty"`
}
// LoadParameters is parameters required for endpoint load
// LoadParameters is parameters required for endpoint load.
type LoadParameters struct {
ContentPaths *[]string `json:"contentPaths,omitempty"`
}
@ -300,10 +315,10 @@ type OperationListResult struct {
Value *[]Operation `json:"value,omitempty"`
}
// Origin is cDN Origin is the source of the content being delivered via CDN.
// When the edge nodes represented by an Endpoint do not have the requested
// Origin is cDN origin is the source of the content being delivered via CDN.
// When the edge nodes represented by an endpoint do not have the requested
// content cached, they attempt to fetch it from one or more of the
// configured Origins.
// configured origins.
type Origin struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
@ -318,7 +333,7 @@ type OriginListResult struct {
Value *[]Origin `json:"value,omitempty"`
}
// OriginParameters is origin properties needed for origin creation or update
// OriginParameters is origin properties needed for origin creation or update.
type OriginParameters struct {
Properties *OriginPropertiesParameters `json:"properties,omitempty"`
}
@ -350,14 +365,15 @@ type Profile struct {
Type *string `json:"type,omitempty"`
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Sku *Sku `json:"sku,omitempty"`
Properties *ProfileProperties `json:"properties,omitempty"`
}
// ProfileCreateParameters is profile properties required for profile creation
// ProfileCreateParameters is profile properties required for profile creation.
type ProfileCreateParameters struct {
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Properties *ProfilePropertiesCreateParameters `json:"properties,omitempty"`
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Sku *Sku `json:"sku,omitempty"`
}
// ProfileListResult is
@ -368,22 +384,16 @@ type ProfileListResult struct {
// ProfileProperties is
type ProfileProperties struct {
Sku *Sku `json:"sku,omitempty"`
ResourceState ProfileResourceState `json:"resourceState,omitempty"`
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
}
// ProfilePropertiesCreateParameters is
type ProfilePropertiesCreateParameters struct {
Sku *Sku `json:"sku,omitempty"`
}
// ProfileUpdateParameters is profile properties required for profile update
// ProfileUpdateParameters is profile properties required for profile update.
type ProfileUpdateParameters struct {
Tags *map[string]*string `json:"tags,omitempty"`
}
// PurgeParameters is parameters required for endpoint purge
// PurgeParameters is parameters required for endpoint purge.
type PurgeParameters struct {
ContentPaths *[]string `json:"contentPaths,omitempty"`
}
@ -395,15 +405,15 @@ type Resource struct {
Type *string `json:"type,omitempty"`
}
// Sku is defines a pricing tier for a profile
// Sku is the SKU (pricing tier) of the CDN profile.
type Sku struct {
Name SkuName `json:"name,omitempty"`
}
// SsoURI is sso uri required to login to third party web portal
// SsoURI is sSO URI required to login to third party web portal.
type SsoURI struct {
autorest.Response `json:"-"`
SsoURIProperty *string `json:"ssoUri,omitempty"`
SsoURIValue *string `json:"ssoUriValue,omitempty"`
}
// TrackedResource is aRM tracked resource
@ -415,15 +425,15 @@ type TrackedResource struct {
Tags *map[string]*string `json:"tags,omitempty"`
}
// ValidateCustomDomainInput is input of the custom domain to be validated
// ValidateCustomDomainInput is input of the custom domain to be validated.
type ValidateCustomDomainInput struct {
HostName *string `json:"hostName,omitempty"`
}
// ValidateCustomDomainOutput is output of custom domain validation
// ValidateCustomDomainOutput is output of custom domain validation.
type ValidateCustomDomainOutput struct {
autorest.Response `json:"-"`
CustomDomainValidated *bool `json:"CustomDomainValidated,omitempty"`
Reason *string `json:"Reason,omitempty"`
Message *string `json:"Message,omitempty"`
CustomDomainValidated *bool `json:"customDomainValidated,omitempty"`
Reason *string `json:"reason,omitempty"`
Message *string `json:"message,omitempty"`
}

View File

@ -14,7 +14,7 @@ package cdn
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -36,18 +36,12 @@ type NameAvailabilityClient struct {
// NewNameAvailabilityClient creates an instance of the NameAvailabilityClient
// client.
func NewNameAvailabilityClient(subscriptionID string) NameAvailabilityClient {
return NewNameAvailabilityClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewNameAvailabilityClientWithBaseURI creates an instance of the
// NameAvailabilityClient client.
func NewNameAvailabilityClientWithBaseURI(baseURI string, subscriptionID string) NameAvailabilityClient {
return NameAvailabilityClient{NewWithBaseURI(baseURI, subscriptionID)}
return NameAvailabilityClient{New(subscriptionID)}
}
// CheckNameAvailability sends the check name availability request.
//
// checkNameAvailabilityInput is input to check
// checkNameAvailabilityInput is input to check.
func (client NameAvailabilityClient) CheckNameAvailability(checkNameAvailabilityInput CheckNameAvailabilityInput) (result CheckNameAvailabilityOutput, err error) {
req, err := client.CheckNameAvailabilityPreparer(checkNameAvailabilityInput)
if err != nil {
@ -71,16 +65,17 @@ func (client NameAvailabilityClient) CheckNameAvailability(checkNameAvailability
// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request.
func (client NameAvailabilityClient) CheckNameAvailabilityPreparer(checkNameAvailabilityInput CheckNameAvailabilityInput) (*http.Request, error) {
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/providers/Microsoft.Cdn/checkNameAvailability"),
autorest.WithJSON(checkNameAvailabilityInput),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the

View File

@ -14,7 +14,7 @@ package cdn
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -35,13 +35,7 @@ type OperationsClient struct {
// NewOperationsClient creates an instance of the OperationsClient client.
func NewOperationsClient(subscriptionID string) OperationsClient {
return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewOperationsClientWithBaseURI creates an instance of the OperationsClient
// client.
func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient {
return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
return OperationsClient{New(subscriptionID)}
}
// List sends the list request.
@ -68,15 +62,15 @@ func (client OperationsClient) List() (result OperationListResult, err error) {
// ListPreparer prepares the List request.
func (client OperationsClient) ListPreparer() (*http.Request, error) {
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/providers/Microsoft.Cdn/operations"),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the

View File

@ -14,7 +14,7 @@ package cdn
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// OriginsClient is the use these APIs to manage Azure CDN resources through
@ -36,12 +35,7 @@ type OriginsClient struct {
// NewOriginsClient creates an instance of the OriginsClient client.
func NewOriginsClient(subscriptionID string) OriginsClient {
return NewOriginsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewOriginsClientWithBaseURI creates an instance of the OriginsClient client.
func NewOriginsClientWithBaseURI(baseURI string, subscriptionID string) OriginsClient {
return OriginsClient{NewWithBaseURI(baseURI, subscriptionID)}
return OriginsClient{New(subscriptionID)}
}
// Create sends the create request. This method may poll for completion.
@ -50,9 +44,9 @@ func NewOriginsClientWithBaseURI(baseURI string, subscriptionID string) OriginsC
//
// originName is name of the origin, an arbitrary value but it needs to be
// unique under endpoint originProperties is origin properties endpointName
// is name of the endpoint within the CDN profile profileName is name of the
// CDN profile within the resource group resourceGroupName is name of the
// resource group within the Azure subscription
// is name of the endpoint within the CDN profile. profileName is name of the
// CDN profile within the resource group. resourceGroupName is name of the
// resource group within the Azure subscription.
func (client OriginsClient) Create(originName string, originProperties OriginParameters, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.CreatePreparer(originName, originProperties, endpointName, profileName, resourceGroupName, cancel)
if err != nil {
@ -76,25 +70,25 @@ func (client OriginsClient) Create(originName string, originProperties OriginPar
// CreatePreparer prepares the Create request.
func (client OriginsClient) CreatePreparer(originName string, originProperties OriginParameters, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"endpointName": url.QueryEscape(endpointName),
"originName": url.QueryEscape(originName),
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"endpointName": autorest.Encode("path", endpointName),
"originName": autorest.Encode("path", originName),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}", pathParameters),
autorest.WithJSON(originProperties),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateSender sends the Create request. The method will close the
@ -122,11 +116,10 @@ func (client OriginsClient) CreateResponder(resp *http.Response) (result autores
// argument. The channel will be used to cancel polling and any outstanding
// HTTP requests.
//
// originName is name of the origin, an arbitrary value but it needs to be
// unique under endpoint endpointName is name of the endpoint within the CDN
// profile profileName is name of the CDN profile within the resource group
// resourceGroupName is name of the resource group within the Azure
// subscription
// originName is name of the origin. Must be unique within endpoint.
// endpointName is name of the endpoint within the CDN profile. profileName
// is name of the CDN profile within the resource group. resourceGroupName is
// name of the resource group within the Azure subscription.
func (client OriginsClient) DeleteIfExists(originName string, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.DeleteIfExistsPreparer(originName, endpointName, profileName, resourceGroupName, cancel)
if err != nil {
@ -150,24 +143,23 @@ func (client OriginsClient) DeleteIfExists(originName string, endpointName strin
// DeleteIfExistsPreparer prepares the DeleteIfExists request.
func (client OriginsClient) DeleteIfExistsPreparer(originName string, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"endpointName": url.QueryEscape(endpointName),
"originName": url.QueryEscape(originName),
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"endpointName": autorest.Encode("path", endpointName),
"originName": autorest.Encode("path", originName),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteIfExistsSender sends the DeleteIfExists request. The method will close the
@ -194,9 +186,9 @@ func (client OriginsClient) DeleteIfExistsResponder(resp *http.Response) (result
//
// originName is name of the origin, an arbitrary value but it needs to be
// unique under endpoint endpointName is name of the endpoint within the CDN
// profile profileName is name of the CDN profile within the resource group
// profile. profileName is name of the CDN profile within the resource group.
// resourceGroupName is name of the resource group within the Azure
// subscription
// subscription.
func (client OriginsClient) Get(originName string, endpointName string, profileName string, resourceGroupName string) (result Origin, err error) {
req, err := client.GetPreparer(originName, endpointName, profileName, resourceGroupName)
if err != nil {
@ -220,24 +212,23 @@ func (client OriginsClient) Get(originName string, endpointName string, profileN
// GetPreparer prepares the Get request.
func (client OriginsClient) GetPreparer(originName string, endpointName string, profileName string, resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"endpointName": url.QueryEscape(endpointName),
"originName": url.QueryEscape(originName),
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"endpointName": autorest.Encode("path", endpointName),
"originName": autorest.Encode("path", originName),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -261,9 +252,9 @@ func (client OriginsClient) GetResponder(resp *http.Response) (result Origin, er
// ListByEndpoint sends the list by endpoint request.
//
// endpointName is name of the endpoint within the CDN profile profileName is
// name of the CDN profile within the resource group resourceGroupName is
// name of the resource group within the Azure subscription
// endpointName is name of the endpoint within the CDN profile. profileName is
// name of the CDN profile within the resource group. resourceGroupName is
// name of the resource group within the Azure subscription.
func (client OriginsClient) ListByEndpoint(endpointName string, profileName string, resourceGroupName string) (result OriginListResult, err error) {
req, err := client.ListByEndpointPreparer(endpointName, profileName, resourceGroupName)
if err != nil {
@ -287,23 +278,22 @@ func (client OriginsClient) ListByEndpoint(endpointName string, profileName stri
// ListByEndpointPreparer prepares the ListByEndpoint request.
func (client OriginsClient) ListByEndpointPreparer(endpointName string, profileName string, resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"endpointName": url.QueryEscape(endpointName),
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListByEndpointSender sends the ListByEndpoint request. The method will close the
@ -325,22 +315,24 @@ func (client OriginsClient) ListByEndpointResponder(resp *http.Response) (result
return
}
// Update sends the update request.
// Update sends the update request. 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.
//
// originName is name of the origin, an arbitrary value but it needs to be
// unique under endpoint originProperties is origin properties endpointName
// is name of the endpoint within the CDN profile profileName is name of the
// CDN profile within the resource group resourceGroupName is name of the
// resource group within the Azure subscription
func (client OriginsClient) Update(originName string, originProperties OriginParameters, endpointName string, profileName string, resourceGroupName string) (result Origin, err error) {
req, err := client.UpdatePreparer(originName, originProperties, endpointName, profileName, resourceGroupName)
// originName is name of the origin. Must be unique within endpoint.
// originProperties is origin properties endpointName is name of the endpoint
// within the CDN profile. profileName is name of the CDN profile within the
// resource group. resourceGroupName is name of the resource group within the
// Azure subscription.
func (client OriginsClient) Update(originName string, originProperties OriginParameters, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.UpdatePreparer(originName, originProperties, endpointName, profileName, resourceGroupName, cancel)
if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "Update", nil, "Failure preparing request")
}
resp, err := client.UpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
result.Response = resp
return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "Update", resp, "Failure sending request")
}
@ -353,44 +345,45 @@ func (client OriginsClient) Update(originName string, originProperties OriginPar
}
// UpdatePreparer prepares the Update request.
func (client OriginsClient) UpdatePreparer(originName string, originProperties OriginParameters, endpointName string, profileName string, resourceGroupName string) (*http.Request, error) {
func (client OriginsClient) UpdatePreparer(originName string, originProperties OriginParameters, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"endpointName": url.QueryEscape(endpointName),
"originName": url.QueryEscape(originName),
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"endpointName": autorest.Encode("path", endpointName),
"originName": autorest.Encode("path", originName),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}", pathParameters),
autorest.WithJSON(originProperties),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
func (client OriginsClient) UpdateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// UpdateResponder handles the response to the Update request. The method always
// closes the http.Response Body.
func (client OriginsClient) UpdateResponder(resp *http.Response) (result Origin, err error) {
func (client OriginsClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
result.Response = resp
return
}

View File

@ -14,7 +14,7 @@ package cdn
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// ProfilesClient is the use these APIs to manage Azure CDN resources through
@ -36,23 +35,17 @@ type ProfilesClient struct {
// NewProfilesClient creates an instance of the ProfilesClient client.
func NewProfilesClient(subscriptionID string) ProfilesClient {
return NewProfilesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewProfilesClientWithBaseURI creates an instance of the ProfilesClient
// client.
func NewProfilesClientWithBaseURI(baseURI string, subscriptionID string) ProfilesClient {
return ProfilesClient{NewWithBaseURI(baseURI, subscriptionID)}
return ProfilesClient{New(subscriptionID)}
}
// Create sends the create request. 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.
//
// profileName is name of the CDN profile within the resource group
// profileProperties is profile properties needed for creation
// profileName is name of the CDN profile within the resource group.
// profileProperties is profile properties needed for creation.
// resourceGroupName is name of the resource group within the Azure
// subscription
// subscription.
func (client ProfilesClient) Create(profileName string, profileProperties ProfileCreateParameters, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.CreatePreparer(profileName, profileProperties, resourceGroupName, cancel)
if err != nil {
@ -76,23 +69,23 @@ func (client ProfilesClient) Create(profileName string, profileProperties Profil
// CreatePreparer prepares the Create request.
func (client ProfilesClient) CreatePreparer(profileName string, profileProperties ProfileCreateParameters, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", pathParameters),
autorest.WithJSON(profileProperties),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateSender sends the Create request. The method will close the
@ -120,9 +113,9 @@ func (client ProfilesClient) CreateResponder(resp *http.Response) (result autore
// argument. The channel will be used to cancel polling and any outstanding
// HTTP requests.
//
// profileName is name of the CDN profile within the resource group
// profileName is name of the CDN profile within the resource group.
// resourceGroupName is name of the resource group within the Azure
// subscription
// subscription.
func (client ProfilesClient) DeleteIfExists(profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.DeleteIfExistsPreparer(profileName, resourceGroupName, cancel)
if err != nil {
@ -146,22 +139,21 @@ func (client ProfilesClient) DeleteIfExists(profileName string, resourceGroupNam
// DeleteIfExistsPreparer prepares the DeleteIfExists request.
func (client ProfilesClient) DeleteIfExistsPreparer(profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteIfExistsSender sends the DeleteIfExists request. The method will close the
@ -186,9 +178,9 @@ func (client ProfilesClient) DeleteIfExistsResponder(resp *http.Response) (resul
// GenerateSsoURI sends the generate sso uri request.
//
// profileName is name of the CDN profile within the resource group
// profileName is name of the CDN profile within the resource group.
// resourceGroupName is name of the resource group within the Azure
// subscription
// subscription.
func (client ProfilesClient) GenerateSsoURI(profileName string, resourceGroupName string) (result SsoURI, err error) {
req, err := client.GenerateSsoURIPreparer(profileName, resourceGroupName)
if err != nil {
@ -212,22 +204,21 @@ func (client ProfilesClient) GenerateSsoURI(profileName string, resourceGroupNam
// GenerateSsoURIPreparer prepares the GenerateSsoURI request.
func (client ProfilesClient) GenerateSsoURIPreparer(profileName string, resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/generateSsoUri"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/generateSsoUri", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GenerateSsoURISender sends the GenerateSsoURI request. The method will close the
@ -251,9 +242,9 @@ func (client ProfilesClient) GenerateSsoURIResponder(resp *http.Response) (resul
// Get sends the get request.
//
// profileName is name of the CDN profile within the resource group
// profileName is name of the CDN profile within the resource group.
// resourceGroupName is name of the resource group within the Azure
// subscription
// subscription.
func (client ProfilesClient) Get(profileName string, resourceGroupName string) (result Profile, err error) {
req, err := client.GetPreparer(profileName, resourceGroupName)
if err != nil {
@ -277,22 +268,21 @@ func (client ProfilesClient) Get(profileName string, resourceGroupName string) (
// GetPreparer prepares the Get request.
func (client ProfilesClient) GetPreparer(profileName string, resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -317,7 +307,7 @@ func (client ProfilesClient) GetResponder(resp *http.Response) (result Profile,
// ListByResourceGroup sends the list by resource group request.
//
// resourceGroupName is name of the resource group within the Azure
// subscription
// subscription.
func (client ProfilesClient) ListByResourceGroup(resourceGroupName string) (result ProfileListResult, err error) {
req, err := client.ListByResourceGroupPreparer(resourceGroupName)
if err != nil {
@ -341,21 +331,20 @@ func (client ProfilesClient) ListByResourceGroup(resourceGroupName string) (resu
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
func (client ProfilesClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
@ -401,20 +390,19 @@ func (client ProfilesClient) ListBySubscriptionID() (result ProfileListResult, e
// ListBySubscriptionIDPreparer prepares the ListBySubscriptionID request.
func (client ProfilesClient) ListBySubscriptionIDPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/profiles"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/profiles", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListBySubscriptionIDSender sends the ListBySubscriptionID request. The method will close the
@ -436,21 +424,23 @@ func (client ProfilesClient) ListBySubscriptionIDResponder(resp *http.Response)
return
}
// Update sends the update request.
// Update sends the update request. 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.
//
// profileName is name of the CDN profile within the resource group
// profileProperties is profile properties needed for update
// profileName is name of the CDN profile within the resource group.
// profileProperties is profile properties needed for update.
// resourceGroupName is name of the resource group within the Azure
// subscription
func (client ProfilesClient) Update(profileName string, profileProperties ProfileUpdateParameters, resourceGroupName string) (result Profile, err error) {
req, err := client.UpdatePreparer(profileName, profileProperties, resourceGroupName)
// subscription.
func (client ProfilesClient) Update(profileName string, profileProperties ProfileUpdateParameters, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.UpdatePreparer(profileName, profileProperties, resourceGroupName, cancel)
if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Update", nil, "Failure preparing request")
}
resp, err := client.UpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
result.Response = resp
return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Update", resp, "Failure sending request")
}
@ -463,42 +453,43 @@ func (client ProfilesClient) Update(profileName string, profileProperties Profil
}
// UpdatePreparer prepares the Update request.
func (client ProfilesClient) UpdatePreparer(profileName string, profileProperties ProfileUpdateParameters, resourceGroupName string) (*http.Request, error) {
func (client ProfilesClient) UpdatePreparer(profileName string, profileProperties ProfileUpdateParameters, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"profileName": url.QueryEscape(profileName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", pathParameters),
autorest.WithJSON(profileProperties),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
func (client ProfilesClient) UpdateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// UpdateResponder handles the response to the Update request. The method always
// closes the http.Response Body.
func (client ProfilesClient) UpdateResponder(resp *http.Response) (result Profile, err error) {
func (client ProfilesClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
result.Response = resp
return
}

View File

@ -14,7 +14,7 @@ package cdn
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -23,9 +23,9 @@ import (
)
const (
major = "2"
minor = "1"
patch = "1"
major = "3"
minor = "0"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"
semVerFormat = "%s.%s.%s%s"
@ -34,7 +34,7 @@ const (
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
return fmt.Sprintf(userAgentFormat, Version(), "cdn", "2015-06-01")
return fmt.Sprintf(userAgentFormat, Version(), "cdn", "2016-04-02")
}
// Version returns the semantic version (see http://semver.org) of the client.

View File

@ -14,7 +14,7 @@ package compute
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// AvailabilitySetsClient is the the Compute Management Client.
@ -33,13 +32,7 @@ type AvailabilitySetsClient struct {
// NewAvailabilitySetsClient creates an instance of the AvailabilitySetsClient
// client.
func NewAvailabilitySetsClient(subscriptionID string) AvailabilitySetsClient {
return NewAvailabilitySetsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewAvailabilitySetsClientWithBaseURI creates an instance of the
// AvailabilitySetsClient client.
func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string) AvailabilitySetsClient {
return AvailabilitySetsClient{NewWithBaseURI(baseURI, subscriptionID)}
return AvailabilitySetsClient{New(subscriptionID)}
}
// CreateOrUpdate the operation to create or update the availability set.
@ -70,23 +63,23 @@ func (client AvailabilitySetsClient) CreateOrUpdate(resourceGroupName string, na
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client AvailabilitySetsClient) CreateOrUpdatePreparer(resourceGroupName string, name string, parameters AvailabilitySet) (*http.Request, error) {
pathParameters := map[string]interface{}{
"name": url.QueryEscape(name),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"name": autorest.Encode("path", name),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{name}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{name}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -135,22 +128,21 @@ func (client AvailabilitySetsClient) Delete(resourceGroupName string, availabili
// DeletePreparer prepares the Delete request.
func (client AvailabilitySetsClient) DeletePreparer(resourceGroupName string, availabilitySetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"availabilitySetName": url.QueryEscape(availabilitySetName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"availabilitySetName": autorest.Encode("path", availabilitySetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// DeleteSender sends the Delete request. The method will close the
@ -165,7 +157,7 @@ func (client AvailabilitySetsClient) DeleteResponder(resp *http.Response) (resul
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusNoContent, http.StatusOK),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
@ -198,22 +190,21 @@ func (client AvailabilitySetsClient) Get(resourceGroupName string, availabilityS
// GetPreparer prepares the Get request.
func (client AvailabilitySetsClient) GetPreparer(resourceGroupName string, availabilitySetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"availabilitySetName": url.QueryEscape(availabilitySetName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"availabilitySetName": autorest.Encode("path", availabilitySetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -261,21 +252,20 @@ func (client AvailabilitySetsClient) List(resourceGroupName string) (result Avai
// ListPreparer prepares the List request.
func (client AvailabilitySetsClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -297,32 +287,8 @@ func (client AvailabilitySetsClient) ListResponder(resp *http.Response) (result
return
}
// ListNextResults retrieves the next set of results, if any.
func (client AvailabilitySetsClient) ListNextResults(lastResults AvailabilitySetListResult) (result AvailabilitySetListResult, err error) {
req, err := lastResults.AvailabilitySetListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "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.AvailabilitySetsClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "List", resp, "Failure responding to next results request request")
}
return
}
// ListAvailableSizes lists virtual-machine-sizes available to be used for an
// availability set.
// ListAvailableSizes lists all available virtual machine sizes that can be
// used to create a new virtual machine in an existing availability set.
//
// resourceGroupName is the name of the resource group. availabilitySetName is
// the name of the availability set.
@ -349,22 +315,21 @@ func (client AvailabilitySetsClient) ListAvailableSizes(resourceGroupName string
// ListAvailableSizesPreparer prepares the ListAvailableSizes request.
func (client AvailabilitySetsClient) ListAvailableSizesPreparer(resourceGroupName string, availabilitySetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"availabilitySetName": url.QueryEscape(availabilitySetName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"availabilitySetName": autorest.Encode("path", availabilitySetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/availabilitySets/{availabilitySetName}/vmSizes", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListAvailableSizesSender sends the ListAvailableSizes request. The method will close the
@ -385,27 +350,3 @@ func (client AvailabilitySetsClient) ListAvailableSizesResponder(resp *http.Resp
result.Response = autorest.Response{Response: resp}
return
}
// ListAvailableSizesNextResults retrieves the next set of results, if any.
func (client AvailabilitySetsClient) ListAvailableSizesNextResults(lastResults VirtualMachineSizeListResult) (result VirtualMachineSizeListResult, err error) {
req, err := lastResults.VirtualMachineSizeListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", nil, "Failure preparing next results request request")
}
if req == nil {
return
}
resp, err := client.ListAvailableSizesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure sending next results request request")
}
result, err = client.ListAvailableSizesResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.AvailabilitySetsClient", "ListAvailableSizes", resp, "Failure responding to next results request request")
}
return
}

View File

@ -1,5 +1,5 @@
// Package compute implements the Azure ARM Compute service API version
// 2015-06-15.
// 2016-03-30.
//
// The Compute Management Client.
package compute
@ -18,7 +18,7 @@ package compute
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -28,7 +28,7 @@ import (
const (
// APIVersion is the version of the Compute
APIVersion = "2015-06-15"
APIVersion = "2016-03-30"
// DefaultBaseURI is the default URI used for the service Compute
DefaultBaseURI = "https://management.azure.com"
@ -38,19 +38,16 @@ const (
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,
BaseURI: DefaultBaseURI,
APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}
}

View File

@ -14,7 +14,7 @@ package compute
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -58,6 +58,14 @@ const (
FromImage DiskCreateOptionTypes = "fromImage"
)
// InstanceViewTypes enumerates the values for instance view types.
type InstanceViewTypes string
const (
// InstanceView specifies the instance view state for instance view types.
InstanceView InstanceViewTypes = "instanceView"
)
// OperatingSystemTypes enumerates the values for operating system types.
type OperatingSystemTypes string
@ -68,36 +76,6 @@ const (
Windows OperatingSystemTypes = "Windows"
)
// OperationStatus enumerates the values for operation status.
type OperationStatus string
const (
// Failed specifies the failed state for operation status.
Failed OperationStatus = "Failed"
// InProgress specifies the in progress state for operation status.
InProgress OperationStatus = "InProgress"
// Succeeded specifies the succeeded state for operation status.
Succeeded OperationStatus = "Succeeded"
)
// OperationStatusEnum enumerates the values for operation status enum.
type OperationStatusEnum string
const (
// OperationStatusEnumFailed specifies the operation status enum failed
// state for operation status enum.
OperationStatusEnumFailed OperationStatusEnum = "Failed"
// OperationStatusEnumInProgress specifies the operation status enum in
// progress state for operation status enum.
OperationStatusEnumInProgress OperationStatusEnum = "InProgress"
// OperationStatusEnumPreempted specifies the operation status enum
// preempted state for operation status enum.
OperationStatusEnumPreempted OperationStatusEnum = "Preempted"
// OperationStatusEnumSucceeded specifies the operation status enum
// succeeded state for operation status enum.
OperationStatusEnumSucceeded OperationStatusEnum = "Succeeded"
)
// PassNames enumerates the values for pass names.
type PassNames string
@ -149,14 +127,6 @@ const (
Manual UpgradeMode = "Manual"
)
// UsageUnit enumerates the values for usage unit.
type UsageUnit string
const (
// Count specifies the count state for usage unit.
Count UsageUnit = "Count"
)
// VirtualMachineScaleSetSkuScaleType enumerates the values for virtual
// machine scale set sku scale type.
type VirtualMachineScaleSetSkuScaleType string
@ -250,6 +220,9 @@ const (
// StandardD14V2 specifies the standard d14v2 state for virtual machine
// size types.
StandardD14V2 VirtualMachineSizeTypes = "Standard_D14_v2"
// StandardD15V2 specifies the standard d15v2 state for virtual machine
// size types.
StandardD15V2 VirtualMachineSizeTypes = "Standard_D15_v2"
// StandardD1V2 specifies the standard d1v2 state for virtual machine size
// types.
StandardD1V2 VirtualMachineSizeTypes = "Standard_D1_v2"
@ -280,24 +253,54 @@ const (
// StandardDS11 specifies the standard ds11 state for virtual machine size
// types.
StandardDS11 VirtualMachineSizeTypes = "Standard_DS11"
// StandardDS11V2 specifies the standard ds11v2 state for virtual machine
// size types.
StandardDS11V2 VirtualMachineSizeTypes = "Standard_DS11_v2"
// StandardDS12 specifies the standard ds12 state for virtual machine size
// types.
StandardDS12 VirtualMachineSizeTypes = "Standard_DS12"
// StandardDS12V2 specifies the standard ds12v2 state for virtual machine
// size types.
StandardDS12V2 VirtualMachineSizeTypes = "Standard_DS12_v2"
// StandardDS13 specifies the standard ds13 state for virtual machine size
// types.
StandardDS13 VirtualMachineSizeTypes = "Standard_DS13"
// StandardDS13V2 specifies the standard ds13v2 state for virtual machine
// size types.
StandardDS13V2 VirtualMachineSizeTypes = "Standard_DS13_v2"
// StandardDS14 specifies the standard ds14 state for virtual machine size
// types.
StandardDS14 VirtualMachineSizeTypes = "Standard_DS14"
// StandardDS14V2 specifies the standard ds14v2 state for virtual machine
// size types.
StandardDS14V2 VirtualMachineSizeTypes = "Standard_DS14_v2"
// StandardDS15V2 specifies the standard ds15v2 state for virtual machine
// size types.
StandardDS15V2 VirtualMachineSizeTypes = "Standard_DS15_v2"
// StandardDS1V2 specifies the standard ds1v2 state for virtual machine
// size types.
StandardDS1V2 VirtualMachineSizeTypes = "Standard_DS1_v2"
// StandardDS2 specifies the standard ds2 state for virtual machine size
// types.
StandardDS2 VirtualMachineSizeTypes = "Standard_DS2"
// StandardDS2V2 specifies the standard ds2v2 state for virtual machine
// size types.
StandardDS2V2 VirtualMachineSizeTypes = "Standard_DS2_v2"
// StandardDS3 specifies the standard ds3 state for virtual machine size
// types.
StandardDS3 VirtualMachineSizeTypes = "Standard_DS3"
// StandardDS3V2 specifies the standard ds3v2 state for virtual machine
// size types.
StandardDS3V2 VirtualMachineSizeTypes = "Standard_DS3_v2"
// StandardDS4 specifies the standard ds4 state for virtual machine size
// types.
StandardDS4 VirtualMachineSizeTypes = "Standard_DS4"
// StandardDS4V2 specifies the standard ds4v2 state for virtual machine
// size types.
StandardDS4V2 VirtualMachineSizeTypes = "Standard_DS4_v2"
// StandardDS5V2 specifies the standard ds5v2 state for virtual machine
// size types.
StandardDS5V2 VirtualMachineSizeTypes = "Standard_DS5_v2"
// StandardG1 specifies the standard g1 state for virtual machine size
// types.
StandardG1 VirtualMachineSizeTypes = "Standard_G1"
@ -377,19 +380,6 @@ type AvailabilitySet struct {
type AvailabilitySetListResult struct {
autorest.Response `json:"-"`
Value *[]AvailabilitySet `json:"value,omitempty"`
NextLink *string `json:",omitempty"`
}
// AvailabilitySetListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client AvailabilitySetListResult) AvailabilitySetListResultPreparer() (*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)))
}
// AvailabilitySetProperties is the instance view of a resource.
@ -429,15 +419,6 @@ type DataDiskImage struct {
Lun *int32 `json:"lun,omitempty"`
}
// DeleteOperationResult is the compute long running operation response.
type DeleteOperationResult struct {
OperationID *string `json:"operationId,omitempty"`
Status OperationStatus `json:"status,omitempty"`
StartTime *date.Time `json:"startTime,omitempty"`
EndTime *date.Time `json:"endTime,omitempty"`
Error *APIError `json:"error,omitempty"`
}
// DiagnosticsProfile is describes a diagnostics profile.
type DiagnosticsProfile struct {
BootDiagnostics *BootDiagnostics `json:"bootDiagnostics,omitempty"`
@ -447,6 +428,7 @@ type DiagnosticsProfile struct {
type DiskEncryptionSettings struct {
DiskEncryptionKey *KeyVaultSecretReference `json:"diskEncryptionKey,omitempty"`
KeyEncryptionKey *KeyVaultKeyReference `json:"keyEncryptionKey,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
}
// DiskInstanceView is the instance view of the disk.
@ -520,6 +502,12 @@ func (client ListUsagesResult) ListUsagesResultPreparer() (*http.Request, error)
autorest.WithBaseURL(to.String(client.NextLink)))
}
// ListVirtualMachineExtensionImage is
type ListVirtualMachineExtensionImage struct {
autorest.Response `json:"-"`
Value *[]VirtualMachineExtensionImage `json:"value,omitempty"`
}
// ListVirtualMachineImageResource is
type ListVirtualMachineImageResource struct {
autorest.Response `json:"-"`
@ -532,17 +520,6 @@ type LongRunningOperationProperties struct {
Output *map[string]interface{} `json:"output,omitempty"`
}
// LongRunningOperationResult is the Compute service response for long-running
// operations.
type LongRunningOperationResult struct {
OperationID *string `json:"operationId,omitempty"`
Status OperationStatusEnum `json:"status,omitempty"`
StartTime *date.Time `json:"startTime,omitempty"`
EndTime *date.Time `json:"endTime,omitempty"`
Properties *LongRunningOperationProperties `json:"properties,omitempty"`
Error *APIError `json:"error,omitempty"`
}
// NetworkInterfaceReference is describes a network interface reference.
type NetworkInterfaceReference struct {
ID *string `json:"id,omitempty"`
@ -651,7 +628,7 @@ type UpgradePolicy struct {
// Usage is describes Compute Resource Usage.
type Usage struct {
Unit UsageUnit `json:"unit,omitempty"`
Unit *string `json:"unit,omitempty"`
CurrentValue *int32 `json:"currentValue,omitempty"`
Limit *int64 `json:"limit,omitempty"`
Name *UsageName `json:"name,omitempty"`
@ -746,10 +723,11 @@ type VirtualMachineExtensionHandlerInstanceView struct {
type VirtualMachineExtensionImage struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Properties *VirtualMachineExtensionImageProperties `json:"properties,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Properties *VirtualMachineExtensionImageProperties `json:"properties,omitempty"`
}
// VirtualMachineExtensionImageProperties is describes the properties of a
@ -775,6 +753,7 @@ type VirtualMachineExtensionInstanceView struct {
// VirtualMachineExtensionProperties is describes the properties of a Virtual
// Machine Extension.
type VirtualMachineExtensionProperties struct {
ForceUpdateTag *string `json:"forceUpdateTag,omitempty"`
Publisher *string `json:"publisher,omitempty"`
Type *string `json:"type,omitempty"`
TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"`
@ -789,10 +768,10 @@ type VirtualMachineExtensionProperties struct {
type VirtualMachineImage struct {
autorest.Response `json:"-"`
ID *string `json:"id,omitempty"`
Properties *VirtualMachineImageProperties `json:"properties,omitempty"`
Name *string `json:"name,omitempty"`
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Properties *VirtualMachineImageProperties `json:"properties,omitempty"`
}
// VirtualMachineImageProperties is describes the properties of a Virtual
@ -852,6 +831,8 @@ type VirtualMachineProperties struct {
AvailabilitySet *SubResource `json:"availabilitySet,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"`
LicenseType *string `json:"licenseType,omitempty"`
VMID *string `json:"vmId,omitempty"`
}
// VirtualMachineScaleSet is describes a Virtual Machine Scale Set.
@ -918,8 +899,10 @@ type VirtualMachineScaleSetIPConfiguration struct {
// VirtualMachineScaleSetIPConfigurationProperties is describes a virtual
// machine scale set network profile's IP configuration properties.
type VirtualMachineScaleSetIPConfigurationProperties struct {
Subnet *APIEntityReference `json:"subnet,omitempty"`
LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"`
Subnet *APIEntityReference `json:"subnet,omitempty"`
ApplicationGatewayBackendAddressPools *[]SubResource `json:"applicationGatewayBackendAddressPools,omitempty"`
LoadBalancerBackendAddressPools *[]SubResource `json:"loadBalancerBackendAddressPools,omitempty"`
LoadBalancerInboundNatPools *[]SubResource `json:"loadBalancerInboundNatPools,omitempty"`
}
// VirtualMachineScaleSetListResult is the List Virtual Machine operation
@ -1032,6 +1015,7 @@ type VirtualMachineScaleSetProperties struct {
UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"`
VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
OverProvision *bool `json:"overProvision,omitempty"`
}
// VirtualMachineScaleSetSku is describes an available virtual machine scale
@ -1147,6 +1131,7 @@ type VirtualMachineScaleSetVMProperties struct {
DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"`
AvailabilitySet *SubResource `json:"availabilitySet,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
LicenseType *string `json:"licenseType,omitempty"`
}
// VirtualMachineSize is describes the properties of a VM size.
@ -1163,19 +1148,6 @@ type VirtualMachineSize struct {
type VirtualMachineSizeListResult struct {
autorest.Response `json:"-"`
Value *[]VirtualMachineSize `json:"value,omitempty"`
NextLink *string `json:",omitempty"`
}
// VirtualMachineSizeListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client VirtualMachineSizeListResult) VirtualMachineSizeListResultPreparer() (*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)))
}
// VirtualMachineStatusCodeCount is the status code and count of the virtual

View File

@ -14,7 +14,7 @@ package compute
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// UsageOperationsClient is the the Compute Management Client.
@ -33,13 +32,7 @@ type UsageOperationsClient struct {
// 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)}
return UsageOperationsClient{New(subscriptionID)}
}
// List lists compute usages for a subscription.
@ -68,21 +61,20 @@ func (client UsageOperationsClient) List(location string) (result ListUsagesResu
// ListPreparer prepares the List request.
func (client UsageOperationsClient) ListPreparer(location string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": url.QueryEscape(location),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"location": autorest.Encode("path", location),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/usages", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the

View File

@ -14,7 +14,7 @@ package compute
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -23,9 +23,9 @@ import (
)
const (
major = "2"
minor = "1"
patch = "1"
major = "3"
minor = "0"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"
semVerFormat = "%s.%s.%s%s"
@ -34,7 +34,7 @@ const (
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
return fmt.Sprintf(userAgentFormat, Version(), "compute", "2015-06-15")
return fmt.Sprintf(userAgentFormat, Version(), "compute", "2016-03-30")
}
// Version returns the semantic version (see http://semver.org) of the client.

View File

@ -14,7 +14,7 @@ package compute
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// VirtualMachineExtensionImagesClient is the the Compute Management Client.
@ -33,13 +32,7 @@ type VirtualMachineExtensionImagesClient struct {
// NewVirtualMachineExtensionImagesClient creates an instance of the
// VirtualMachineExtensionImagesClient client.
func NewVirtualMachineExtensionImagesClient(subscriptionID string) VirtualMachineExtensionImagesClient {
return NewVirtualMachineExtensionImagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualMachineExtensionImagesClientWithBaseURI creates an instance of
// the VirtualMachineExtensionImagesClient client.
func NewVirtualMachineExtensionImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionImagesClient {
return VirtualMachineExtensionImagesClient{NewWithBaseURI(baseURI, subscriptionID)}
return VirtualMachineExtensionImagesClient{New(subscriptionID)}
}
// Get gets a virtual machine extension image.
@ -67,24 +60,23 @@ func (client VirtualMachineExtensionImagesClient) Get(location string, publisher
// GetPreparer prepares the Get request.
func (client VirtualMachineExtensionImagesClient) GetPreparer(location string, publisherName string, typeParameter string, version string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": url.QueryEscape(location),
"publisherName": url.QueryEscape(publisherName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"type": url.QueryEscape(typeParameter),
"version": url.QueryEscape(version),
"location": autorest.Encode("path", location),
"publisherName": autorest.Encode("path", publisherName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"type": autorest.Encode("path", typeParameter),
"version": autorest.Encode("path", version),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions/{version}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -108,7 +100,7 @@ func (client VirtualMachineExtensionImagesClient) GetResponder(resp *http.Respon
// ListTypes gets a list of virtual machine extension image types.
//
func (client VirtualMachineExtensionImagesClient) ListTypes(location string, publisherName string) (result ListVirtualMachineImageResource, err error) {
func (client VirtualMachineExtensionImagesClient) ListTypes(location string, publisherName string) (result ListVirtualMachineExtensionImage, err error) {
req, err := client.ListTypesPreparer(location, publisherName)
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListTypes", nil, "Failure preparing request")
@ -131,22 +123,21 @@ func (client VirtualMachineExtensionImagesClient) ListTypes(location string, pub
// ListTypesPreparer prepares the ListTypes request.
func (client VirtualMachineExtensionImagesClient) ListTypesPreparer(location string, publisherName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": url.QueryEscape(location),
"publisherName": url.QueryEscape(publisherName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"location": autorest.Encode("path", location),
"publisherName": autorest.Encode("path", publisherName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListTypesSender sends the ListTypes request. The method will close the
@ -157,7 +148,7 @@ func (client VirtualMachineExtensionImagesClient) ListTypesSender(req *http.Requ
// ListTypesResponder handles the response to the ListTypes request. The method always
// closes the http.Response Body.
func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) {
func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
@ -171,8 +162,8 @@ func (client VirtualMachineExtensionImagesClient) ListTypesResponder(resp *http.
// ListVersions gets a list of virtual machine extension image versions.
//
// filter is the filter to apply on the operation.
func (client VirtualMachineExtensionImagesClient) ListVersions(location string, publisherName string, typeParameter string, filter string, top *int32, orderBy string) (result ListVirtualMachineImageResource, err error) {
req, err := client.ListVersionsPreparer(location, publisherName, typeParameter, filter, top, orderBy)
func (client VirtualMachineExtensionImagesClient) ListVersions(location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (result ListVirtualMachineExtensionImage, err error) {
req, err := client.ListVersionsPreparer(location, publisherName, typeParameter, filter, top, orderby)
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.VirtualMachineExtensionImagesClient", "ListVersions", nil, "Failure preparing request")
}
@ -192,34 +183,33 @@ func (client VirtualMachineExtensionImagesClient) ListVersions(location string,
}
// ListVersionsPreparer prepares the ListVersions request.
func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(location string, publisherName string, typeParameter string, filter string, top *int32, orderBy string) (*http.Request, error) {
func (client VirtualMachineExtensionImagesClient) ListVersionsPreparer(location string, publisherName string, typeParameter string, filter string, top *int32, orderby string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": url.QueryEscape(location),
"publisherName": url.QueryEscape(publisherName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"type": url.QueryEscape(typeParameter),
"location": autorest.Encode("path", location),
"publisherName": autorest.Encode("path", publisherName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"type": autorest.Encode("path", typeParameter),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = filter
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
queryParameters["$top"] = top
queryParameters["$top"] = autorest.Encode("query", *top)
}
if len(orderBy) > 0 {
queryParameters["$orderBy"] = orderBy
if len(orderby) > 0 {
queryParameters["$orderby"] = autorest.Encode("query", orderby)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmextension/types/{type}/versions", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListVersionsSender sends the ListVersions request. The method will close the
@ -230,7 +220,7 @@ func (client VirtualMachineExtensionImagesClient) ListVersionsSender(req *http.R
// ListVersionsResponder handles the response to the ListVersions request. The method always
// closes the http.Response Body.
func (client VirtualMachineExtensionImagesClient) ListVersionsResponder(resp *http.Response) (result ListVirtualMachineImageResource, err error) {
func (client VirtualMachineExtensionImagesClient) ListVersionsResponder(resp *http.Response) (result ListVirtualMachineExtensionImage, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),

View File

@ -14,7 +14,7 @@ package compute
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// VirtualMachineExtensionsClient is the the Compute Management Client.
@ -33,13 +32,7 @@ type VirtualMachineExtensionsClient struct {
// NewVirtualMachineExtensionsClient creates an instance of the
// VirtualMachineExtensionsClient client.
func NewVirtualMachineExtensionsClient(subscriptionID string) VirtualMachineExtensionsClient {
return NewVirtualMachineExtensionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualMachineExtensionsClientWithBaseURI creates an instance of the
// VirtualMachineExtensionsClient client.
func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineExtensionsClient {
return VirtualMachineExtensionsClient{NewWithBaseURI(baseURI, subscriptionID)}
return VirtualMachineExtensionsClient{New(subscriptionID)}
}
// CreateOrUpdate the operation to create or update the extension. This method
@ -75,24 +68,24 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdate(resourceGroupName st
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client VirtualMachineExtensionsClient) CreateOrUpdatePreparer(resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmExtensionName": url.QueryEscape(vmExtensionName),
"vmName": url.QueryEscape(vmName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmExtensionName": autorest.Encode("path", vmExtensionName),
"vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
autorest.WithJSON(extensionParameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -109,7 +102,7 @@ func (client VirtualMachineExtensionsClient) CreateOrUpdateResponder(resp *http.
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByClosing())
result.Response = resp
return
@ -146,23 +139,22 @@ func (client VirtualMachineExtensionsClient) Delete(resourceGroupName string, vm
// DeletePreparer prepares the Delete request.
func (client VirtualMachineExtensionsClient) DeletePreparer(resourceGroupName string, vmName string, vmExtensionName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmExtensionName": url.QueryEscape(vmExtensionName),
"vmName": url.QueryEscape(vmName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmExtensionName": autorest.Encode("path", vmExtensionName),
"vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -179,7 +171,7 @@ func (client VirtualMachineExtensionsClient) DeleteResponder(resp *http.Response
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusNoContent, http.StatusOK),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
@ -214,26 +206,25 @@ func (client VirtualMachineExtensionsClient) Get(resourceGroupName string, vmNam
// GetPreparer prepares the Get request.
func (client VirtualMachineExtensionsClient) GetPreparer(resourceGroupName string, vmName string, vmExtensionName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmExtensionName": url.QueryEscape(vmExtensionName),
"vmName": url.QueryEscape(vmName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmExtensionName": autorest.Encode("path", vmExtensionName),
"vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if len(expand) > 0 {
queryParameters["$expand"] = expand
queryParameters["$expand"] = autorest.Encode("query", expand)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/extensions/{vmExtensionName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the

View File

@ -14,7 +14,7 @@ package compute
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// VirtualMachineImagesClient is the the Compute Management Client.
@ -33,13 +32,7 @@ type VirtualMachineImagesClient struct {
// NewVirtualMachineImagesClient creates an instance of the
// VirtualMachineImagesClient client.
func NewVirtualMachineImagesClient(subscriptionID string) VirtualMachineImagesClient {
return NewVirtualMachineImagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualMachineImagesClientWithBaseURI creates an instance of the
// VirtualMachineImagesClient client.
func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineImagesClient {
return VirtualMachineImagesClient{NewWithBaseURI(baseURI, subscriptionID)}
return VirtualMachineImagesClient{New(subscriptionID)}
}
// Get gets a virtual machine image.
@ -67,25 +60,24 @@ func (client VirtualMachineImagesClient) Get(location string, publisherName stri
// GetPreparer prepares the Get request.
func (client VirtualMachineImagesClient) GetPreparer(location string, publisherName string, offer string, skus string, version string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": url.QueryEscape(location),
"offer": url.QueryEscape(offer),
"publisherName": url.QueryEscape(publisherName),
"skus": url.QueryEscape(skus),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"version": url.QueryEscape(version),
"location": autorest.Encode("path", location),
"offer": autorest.Encode("path", offer),
"publisherName": autorest.Encode("path", publisherName),
"skus": autorest.Encode("path", skus),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"version": autorest.Encode("path", version),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions/{version}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -133,33 +125,32 @@ func (client VirtualMachineImagesClient) List(location string, publisherName str
// ListPreparer prepares the List request.
func (client VirtualMachineImagesClient) ListPreparer(location string, publisherName string, offer string, skus string, filter string, top *int32, orderby string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": url.QueryEscape(location),
"offer": url.QueryEscape(offer),
"publisherName": url.QueryEscape(publisherName),
"skus": url.QueryEscape(skus),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"location": autorest.Encode("path", location),
"offer": autorest.Encode("path", offer),
"publisherName": autorest.Encode("path", publisherName),
"skus": autorest.Encode("path", skus),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = filter
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
queryParameters["$top"] = top
queryParameters["$top"] = autorest.Encode("query", *top)
}
if len(orderby) > 0 {
queryParameters["$orderby"] = orderby
queryParameters["$orderby"] = autorest.Encode("query", orderby)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus/{skus}/versions", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -206,22 +197,21 @@ func (client VirtualMachineImagesClient) ListOffers(location string, publisherNa
// ListOffersPreparer prepares the ListOffers request.
func (client VirtualMachineImagesClient) ListOffersPreparer(location string, publisherName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": url.QueryEscape(location),
"publisherName": url.QueryEscape(publisherName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"location": autorest.Encode("path", location),
"publisherName": autorest.Encode("path", publisherName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListOffersSender sends the ListOffers request. The method will close the
@ -268,21 +258,20 @@ func (client VirtualMachineImagesClient) ListPublishers(location string) (result
// ListPublishersPreparer prepares the ListPublishers request.
func (client VirtualMachineImagesClient) ListPublishersPreparer(location string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": url.QueryEscape(location),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"location": autorest.Encode("path", location),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListPublishersSender sends the ListPublishers request. The method will close the
@ -329,23 +318,22 @@ func (client VirtualMachineImagesClient) ListSkus(location string, publisherName
// ListSkusPreparer prepares the ListSkus request.
func (client VirtualMachineImagesClient) ListSkusPreparer(location string, publisherName string, offer string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": url.QueryEscape(location),
"offer": url.QueryEscape(offer),
"publisherName": url.QueryEscape(publisherName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"location": autorest.Encode("path", location),
"offer": autorest.Encode("path", offer),
"publisherName": autorest.Encode("path", publisherName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/publishers/{publisherName}/artifacttypes/vmimage/offers/{offer}/skus", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSkusSender sends the ListSkus request. The method will close the

View File

@ -14,7 +14,7 @@ package compute
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// VirtualMachinesClient is the the Compute Management Client.
@ -33,18 +32,12 @@ type VirtualMachinesClient struct {
// NewVirtualMachinesClient creates an instance of the VirtualMachinesClient
// client.
func NewVirtualMachinesClient(subscriptionID string) VirtualMachinesClient {
return NewVirtualMachinesClientWithBaseURI(DefaultBaseURI, subscriptionID)
return VirtualMachinesClient{New(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 VirtualHardDisks of the VM and outputs a
// template that can be used to create similar VMs. This method may poll for
// completion. Polling can be canceled by passing the cancel channel
// Capture captures the VM by copying virtual hard disks of the VM and outputs
// a template that can be used to create similar VMs. 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.
//
@ -74,23 +67,23 @@ func (client VirtualMachinesClient) Capture(resourceGroupName string, vmName str
// CapturePreparer prepares the Capture request.
func (client VirtualMachinesClient) CapturePreparer(resourceGroupName string, vmName string, parameters VirtualMachineCaptureParameters, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmName": url.QueryEscape(vmName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/capture", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CaptureSender sends the Capture request. The method will close the
@ -144,23 +137,23 @@ func (client VirtualMachinesClient) CreateOrUpdate(resourceGroupName string, vmN
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client VirtualMachinesClient) CreateOrUpdatePreparer(resourceGroupName string, vmName string, parameters VirtualMachine, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmName": url.QueryEscape(vmName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -177,7 +170,7 @@ func (client VirtualMachinesClient) CreateOrUpdateResponder(resp *http.Response)
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByClosing())
result.Response = resp
return
@ -214,22 +207,21 @@ func (client VirtualMachinesClient) Deallocate(resourceGroupName string, vmName
// DeallocatePreparer prepares the Deallocate request.
func (client VirtualMachinesClient) DeallocatePreparer(resourceGroupName string, vmName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmName": url.QueryEscape(vmName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/deallocate", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeallocateSender sends the Deallocate request. The method will close the
@ -282,22 +274,21 @@ func (client VirtualMachinesClient) Delete(resourceGroupName string, vmName stri
// DeletePreparer prepares the Delete request.
func (client VirtualMachinesClient) DeletePreparer(resourceGroupName string, vmName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmName": url.QueryEscape(vmName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -347,22 +338,21 @@ func (client VirtualMachinesClient) Generalize(resourceGroupName string, vmName
// GeneralizePreparer prepares the Generalize request.
func (client VirtualMachinesClient) GeneralizePreparer(resourceGroupName string, vmName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmName": url.QueryEscape(vmName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/generalize", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GeneralizeSender sends the Generalize request. The method will close the
@ -387,8 +377,8 @@ func (client VirtualMachinesClient) GeneralizeResponder(resp *http.Response) (re
//
// resourceGroupName is the name of the resource group. vmName is the name of
// the virtual machine. expand is the expand expression to apply on the
// operation.
func (client VirtualMachinesClient) Get(resourceGroupName string, vmName string, expand string) (result VirtualMachine, err error) {
// operation. Possible values include: 'instanceView'
func (client VirtualMachinesClient) Get(resourceGroupName string, vmName string, expand InstanceViewTypes) (result VirtualMachine, err error) {
req, err := client.GetPreparer(resourceGroupName, vmName, expand)
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Get", nil, "Failure preparing request")
@ -409,27 +399,26 @@ func (client VirtualMachinesClient) Get(resourceGroupName string, vmName string,
}
// GetPreparer prepares the Get request.
func (client VirtualMachinesClient) GetPreparer(resourceGroupName string, vmName string, expand string) (*http.Request, error) {
func (client VirtualMachinesClient) GetPreparer(resourceGroupName string, vmName string, expand InstanceViewTypes) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmName": url.QueryEscape(vmName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if len(expand) > 0 {
queryParameters["$expand"] = expand
if len(string(expand)) > 0 {
queryParameters["$expand"] = autorest.Encode("query", expand)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -477,21 +466,20 @@ func (client VirtualMachinesClient) List(resourceGroupName string) (result Virtu
// ListPreparer prepares the List request.
func (client VirtualMachinesClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -513,30 +501,6 @@ 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.
@ -563,20 +527,19 @@ func (client VirtualMachinesClient) ListAll() (result VirtualMachineListResult,
// ListAllPreparer prepares the ListAll request.
func (client VirtualMachinesClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachines", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the
@ -622,8 +585,8 @@ func (client VirtualMachinesClient) ListAllNextResults(lastResults VirtualMachin
return
}
// ListAvailableSizes lists virtual-machine-sizes available to be used for a
// virtual machine.
// ListAvailableSizes lists all available virtual machine sizes it can be
// resized to for a virtual machine.
//
// resourceGroupName is the name of the resource group. vmName is the name of
// the virtual machine.
@ -650,22 +613,21 @@ func (client VirtualMachinesClient) ListAvailableSizes(resourceGroupName string,
// ListAvailableSizesPreparer prepares the ListAvailableSizes request.
func (client VirtualMachinesClient) ListAvailableSizesPreparer(resourceGroupName string, vmName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmName": url.QueryEscape(vmName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/vmSizes", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListAvailableSizesSender sends the ListAvailableSizes request. The method will close the
@ -687,30 +649,6 @@ func (client VirtualMachinesClient) ListAvailableSizesResponder(resp *http.Respo
return
}
// ListAvailableSizesNextResults retrieves the next set of results, if any.
func (client VirtualMachinesClient) ListAvailableSizesNextResults(lastResults VirtualMachineSizeListResult) (result VirtualMachineSizeListResult, err error) {
req, err := lastResults.VirtualMachineSizeListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", nil, "Failure preparing next results request request")
}
if req == nil {
return
}
resp, err := client.ListAvailableSizesSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", resp, "Failure sending next results request request")
}
result, err = client.ListAvailableSizesResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "ListAvailableSizes", resp, "Failure responding to next results request request")
}
return
}
// PowerOff the operation to power off (stop) a virtual machine. 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
@ -741,22 +679,21 @@ func (client VirtualMachinesClient) PowerOff(resourceGroupName string, vmName st
// PowerOffPreparer prepares the PowerOff request.
func (client VirtualMachinesClient) PowerOffPreparer(resourceGroupName string, vmName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmName": url.QueryEscape(vmName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/powerOff", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// PowerOffSender sends the PowerOff request. The method will close the
@ -779,6 +716,73 @@ func (client VirtualMachinesClient) PowerOffResponder(resp *http.Response) (resu
return
}
// Redeploy the operation to redeploy a virtual machine. 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. vmName is the name of
// the virtual machine.
func (client VirtualMachinesClient) Redeploy(resourceGroupName string, vmName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.RedeployPreparer(resourceGroupName, vmName, cancel)
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", nil, "Failure preparing request")
}
resp, err := client.RedeploySender(req)
if err != nil {
result.Response = resp
return result, autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", resp, "Failure sending request")
}
result, err = client.RedeployResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachinesClient", "Redeploy", resp, "Failure responding to request")
}
return
}
// RedeployPreparer prepares the Redeploy request.
func (client VirtualMachinesClient) RedeployPreparer(resourceGroupName string, vmName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmName": autorest.Encode("path", vmName),
}
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.Compute/virtualMachines/{vmName}/redeploy", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// RedeploySender sends the Redeploy request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachinesClient) RedeploySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// RedeployResponder handles the response to the Redeploy request. The method always
// closes the http.Response Body.
func (client VirtualMachinesClient) RedeployResponder(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
}
// Restart the operation to restart a virtual machine. 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
@ -809,22 +813,21 @@ func (client VirtualMachinesClient) Restart(resourceGroupName string, vmName str
// RestartPreparer prepares the Restart request.
func (client VirtualMachinesClient) RestartPreparer(resourceGroupName string, vmName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmName": url.QueryEscape(vmName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/restart", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// RestartSender sends the Restart request. The method will close the
@ -877,22 +880,21 @@ func (client VirtualMachinesClient) Start(resourceGroupName string, vmName strin
// StartPreparer prepares the Start request.
func (client VirtualMachinesClient) StartPreparer(resourceGroupName string, vmName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmName": url.QueryEscape(vmName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmName": autorest.Encode("path", vmName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// StartSender sends the Start request. The method will close the

View File

@ -14,7 +14,7 @@ package compute
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// VirtualMachineScaleSetsClient is the the Compute Management Client.
@ -33,19 +32,14 @@ type VirtualMachineScaleSetsClient struct {
// NewVirtualMachineScaleSetsClient creates an instance of the
// VirtualMachineScaleSetsClient client.
func NewVirtualMachineScaleSetsClient(subscriptionID string) VirtualMachineScaleSetsClient {
return NewVirtualMachineScaleSetsClientWithBaseURI(DefaultBaseURI, subscriptionID)
return VirtualMachineScaleSetsClient{New(subscriptionID)}
}
// NewVirtualMachineScaleSetsClientWithBaseURI creates an instance of the
// VirtualMachineScaleSetsClient client.
func NewVirtualMachineScaleSetsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetsClient {
return VirtualMachineScaleSetsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate the operation to create or update a virtual machine scale
// set. 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.
// CreateOrUpdate allows you to create or update a virtual machine scale set
// by providing parameters or a path to pre-configured parameter file. 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. name is parameters
// supplied to the Create Virtual Machine Scale Set operation. parameters is
@ -73,23 +67,23 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdate(resourceGroupName str
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client VirtualMachineScaleSetsClient) CreateOrUpdatePreparer(resourceGroupName string, name string, parameters VirtualMachineScaleSet, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"name": url.QueryEscape(name),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"name": autorest.Encode("path", name),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{name}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{name}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -106,16 +100,18 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdateResponder(resp *http.R
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusCreated, http.StatusOK),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByClosing())
result.Response = resp
return
}
// Deallocate the operation to deallocate virtual machines in a virtual
// machine scale set. 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.
// Deallocate allows you to deallocate virtual machines in a virtual machine
// scale set. Shuts down the virtual machines and releases the compute
// resources. You are not billed for the compute resources that this virtual
// machine scale set 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. vmInstanceIDs is the list of
@ -143,21 +139,20 @@ func (client VirtualMachineScaleSetsClient) Deallocate(resourceGroupName string,
// DeallocatePreparer prepares the Deallocate request.
func (client VirtualMachineScaleSetsClient) DeallocatePreparer(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmScaleSetName": url.QueryEscape(vmScaleSetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/deallocate", pathParameters),
autorest.WithQueryParameters(queryParameters))
if vmInstanceIDs != nil {
preparer = autorest.DecoratePreparer(preparer,
@ -186,7 +181,7 @@ func (client VirtualMachineScaleSetsClient) DeallocateResponder(resp *http.Respo
return
}
// Delete the operation to delete a virtual machine scale set. This method may
// Delete allows you to delete a virtual machine scale set. 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.
@ -216,22 +211,21 @@ func (client VirtualMachineScaleSetsClient) Delete(resourceGroupName string, vmS
// DeletePreparer prepares the Delete request.
func (client VirtualMachineScaleSetsClient) DeletePreparer(resourceGroupName string, vmScaleSetName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmScaleSetName": url.QueryEscape(vmScaleSetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -248,16 +242,16 @@ func (client VirtualMachineScaleSetsClient) DeleteResponder(resp *http.Response)
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK, http.StatusNoContent),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// DeleteInstances the operation to delete virtual machines in a virtual
// machine scale set. 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.
// DeleteInstances allows you to delete virtual machines in a virtual machine
// scale set. 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. vmInstanceIDs is the list of
@ -285,23 +279,23 @@ func (client VirtualMachineScaleSetsClient) DeleteInstances(resourceGroupName st
// DeleteInstancesPreparer prepares the DeleteInstances request.
func (client VirtualMachineScaleSetsClient) DeleteInstancesPreparer(resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmScaleSetName": url.QueryEscape(vmScaleSetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/delete", pathParameters),
autorest.WithJSON(vmInstanceIDs),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteInstancesSender sends the DeleteInstances request. The method will close the
@ -324,7 +318,7 @@ func (client VirtualMachineScaleSetsClient) DeleteInstancesResponder(resp *http.
return
}
// Get the operation to get a virtual machine scale set.
// Get display information about a virtual machine scale set.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set.
@ -351,22 +345,21 @@ func (client VirtualMachineScaleSetsClient) Get(resourceGroupName string, vmScal
// GetPreparer prepares the Get request.
func (client VirtualMachineScaleSetsClient) GetPreparer(resourceGroupName string, vmScaleSetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmScaleSetName": url.QueryEscape(vmScaleSetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -388,8 +381,7 @@ func (client VirtualMachineScaleSetsClient) GetResponder(resp *http.Response) (r
return
}
// GetInstanceView the operation to get a virtual machine scale set instance
// view.
// GetInstanceView displays status of a virtual machine scale set instance.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set.
@ -416,22 +408,21 @@ func (client VirtualMachineScaleSetsClient) GetInstanceView(resourceGroupName st
// GetInstanceViewPreparer prepares the GetInstanceView request.
func (client VirtualMachineScaleSetsClient) GetInstanceViewPreparer(resourceGroupName string, vmScaleSetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmScaleSetName": url.QueryEscape(vmScaleSetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/instanceView", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetInstanceViewSender sends the GetInstanceView request. The method will close the
@ -453,8 +444,7 @@ func (client VirtualMachineScaleSetsClient) GetInstanceViewResponder(resp *http.
return
}
// List the operation to list virtual machine scale sets under a resource
// group.
// List lists all virtual machine scale sets under a resource group.
//
// resourceGroupName is the name of the resource group.
func (client VirtualMachineScaleSetsClient) List(resourceGroupName string) (result VirtualMachineScaleSetListResult, err error) {
@ -480,21 +470,20 @@ func (client VirtualMachineScaleSetsClient) List(resourceGroupName string) (resu
// ListPreparer prepares the List request.
func (client VirtualMachineScaleSetsClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -540,10 +529,10 @@ func (client VirtualMachineScaleSetsClient) ListNextResults(lastResults VirtualM
return
}
// ListAll gets the list of Virtual Machine Scale Sets in the subscription.
// Use nextLink property in the response to get the next page of Virtual
// Machine Scale Sets. Do this till nextLink is not null to fetch all the
// Virtual Machine Scale Sets.
// ListAll lists all Virtual Machine Scale Sets in the subscription. Use
// nextLink property in the response to get the next page of Virtual Machine
// Scale Sets. Do this till nextLink is not null to fetch all the Virtual
// Machine Scale Sets.
func (client VirtualMachineScaleSetsClient) ListAll() (result VirtualMachineScaleSetListWithLinkResult, err error) {
req, err := client.ListAllPreparer()
if err != nil {
@ -567,20 +556,19 @@ func (client VirtualMachineScaleSetsClient) ListAll() (result VirtualMachineScal
// ListAllPreparer prepares the ListAll request.
func (client VirtualMachineScaleSetsClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/virtualMachineScaleSets", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the
@ -626,8 +614,9 @@ func (client VirtualMachineScaleSetsClient) ListAllNextResults(lastResults Virtu
return
}
// ListSkus the operation to list available skus for a virtual machine scale
// set.
// ListSkus displays available skus for your virtual machine scale set
// including the minimum and maximum vm instances allowed for a particular
// sku.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set.
@ -654,22 +643,21 @@ func (client VirtualMachineScaleSetsClient) ListSkus(resourceGroupName string, v
// ListSkusPreparer prepares the ListSkus request.
func (client VirtualMachineScaleSetsClient) ListSkusPreparer(resourceGroupName string, vmScaleSetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmScaleSetName": url.QueryEscape(vmScaleSetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/skus", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSkusSender sends the ListSkus request. The method will close the
@ -715,10 +703,12 @@ func (client VirtualMachineScaleSetsClient) ListSkusNextResults(lastResults Virt
return
}
// PowerOff the operation to power off (stop) virtual machines in a virtual
// machine scale set. 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.
// PowerOff allows you to power off (stop) virtual machines in a virtual
// machine scale set. Note that resources are still attached and you are
// getting charged for the resources. Use deallocate to release resources.
// 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. vmInstanceIDs is the list of
@ -746,21 +736,20 @@ func (client VirtualMachineScaleSetsClient) PowerOff(resourceGroupName string, v
// PowerOffPreparer prepares the PowerOff request.
func (client VirtualMachineScaleSetsClient) PowerOffPreparer(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmScaleSetName": url.QueryEscape(vmScaleSetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/poweroff", pathParameters),
autorest.WithQueryParameters(queryParameters))
if vmInstanceIDs != nil {
preparer = autorest.DecoratePreparer(preparer,
@ -789,8 +778,76 @@ func (client VirtualMachineScaleSetsClient) PowerOffResponder(resp *http.Respons
return
}
// Restart the operation to restart virtual machines in a virtual machine
// scale set. This method may poll for completion. Polling can be canceled by
// Reimage allows you to re-image(update the version of the installed
// operating system) virtual machines in a virtual machine scale set. 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.
func (client VirtualMachineScaleSetsClient) Reimage(resourceGroupName string, vmScaleSetName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.ReimagePreparer(resourceGroupName, vmScaleSetName, cancel)
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", nil, "Failure preparing request")
}
resp, err := client.ReimageSender(req)
if err != nil {
result.Response = resp
return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", resp, "Failure sending request")
}
result, err = client.ReimageResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetsClient", "Reimage", resp, "Failure responding to request")
}
return
}
// ReimagePreparer prepares the Reimage request.
func (client VirtualMachineScaleSetsClient) ReimagePreparer(resourceGroupName string, vmScaleSetName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
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.Compute/virtualMachineScaleSets/{vmScaleSetName}/reimage", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// ReimageSender sends the Reimage request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetsClient) ReimageSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// ReimageResponder handles the response to the Reimage request. The method always
// closes the http.Response Body.
func (client VirtualMachineScaleSetsClient) ReimageResponder(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
}
// Restart allows you to restart virtual machines in a virtual machine scale
// set. 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.
//
@ -820,21 +877,20 @@ func (client VirtualMachineScaleSetsClient) Restart(resourceGroupName string, vm
// RestartPreparer prepares the Restart request.
func (client VirtualMachineScaleSetsClient) RestartPreparer(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmScaleSetName": url.QueryEscape(vmScaleSetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/restart", pathParameters),
autorest.WithQueryParameters(queryParameters))
if vmInstanceIDs != nil {
preparer = autorest.DecoratePreparer(preparer,
@ -863,10 +919,10 @@ func (client VirtualMachineScaleSetsClient) RestartResponder(resp *http.Response
return
}
// Start the operation to start virtual machines in a virtual machine scale
// set. 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.
// Start allows you to start virtual machines in a virtual machine scale set.
// 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. vmInstanceIDs is the list of
@ -894,21 +950,20 @@ func (client VirtualMachineScaleSetsClient) Start(resourceGroupName string, vmSc
// StartPreparer prepares the Start request.
func (client VirtualMachineScaleSetsClient) StartPreparer(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmScaleSetName": url.QueryEscape(vmScaleSetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/start", pathParameters),
autorest.WithQueryParameters(queryParameters))
if vmInstanceIDs != nil {
preparer = autorest.DecoratePreparer(preparer,
@ -937,7 +992,7 @@ func (client VirtualMachineScaleSetsClient) StartResponder(resp *http.Response)
return
}
// UpdateInstances the operation to manually upgrade virtual machines in a
// UpdateInstances allows you to manually upgrade virtual machines in a
// virtual machine scale set. 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.
@ -968,23 +1023,23 @@ func (client VirtualMachineScaleSetsClient) UpdateInstances(resourceGroupName st
// UpdateInstancesPreparer prepares the UpdateInstances request.
func (client VirtualMachineScaleSetsClient) UpdateInstancesPreparer(resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmScaleSetName": url.QueryEscape(vmScaleSetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/manualupgrade", pathParameters),
autorest.WithJSON(vmInstanceIDs),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// UpdateInstancesSender sends the UpdateInstances request. The method will close the

View File

@ -14,7 +14,7 @@ package compute
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// VirtualMachineScaleSetVMsClient is the the Compute Management Client.
@ -33,19 +32,15 @@ type VirtualMachineScaleSetVMsClient struct {
// NewVirtualMachineScaleSetVMsClient creates an instance of the
// VirtualMachineScaleSetVMsClient client.
func NewVirtualMachineScaleSetVMsClient(subscriptionID string) VirtualMachineScaleSetVMsClient {
return NewVirtualMachineScaleSetVMsClientWithBaseURI(DefaultBaseURI, subscriptionID)
return VirtualMachineScaleSetVMsClient{New(subscriptionID)}
}
// NewVirtualMachineScaleSetVMsClientWithBaseURI creates an instance of the
// VirtualMachineScaleSetVMsClient client.
func NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineScaleSetVMsClient {
return VirtualMachineScaleSetVMsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Deallocate the operation to deallocate a virtual machine scale set. 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.
// 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.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. instanceID is the instance id of
@ -73,23 +68,22 @@ func (client VirtualMachineScaleSetVMsClient) Deallocate(resourceGroupName strin
// DeallocatePreparer prepares the Deallocate request.
func (client VirtualMachineScaleSetVMsClient) DeallocatePreparer(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"instanceId": url.QueryEscape(instanceID),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmScaleSetName": url.QueryEscape(vmScaleSetName),
"instanceId": autorest.Encode("path", instanceID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/deallocate", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeallocateSender sends the Deallocate request. The method will close the
@ -112,7 +106,7 @@ func (client VirtualMachineScaleSetVMsClient) DeallocateResponder(resp *http.Res
return
}
// Delete the operation to delete a virtual machine scale set. This method may
// Delete allows you to delete a virtual machine scale set. 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.
@ -143,23 +137,22 @@ func (client VirtualMachineScaleSetVMsClient) Delete(resourceGroupName string, v
// DeletePreparer prepares the Delete request.
func (client VirtualMachineScaleSetVMsClient) DeletePreparer(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"instanceId": url.QueryEscape(instanceID),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmScaleSetName": url.QueryEscape(vmScaleSetName),
"instanceId": autorest.Encode("path", instanceID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -176,13 +169,13 @@ func (client VirtualMachineScaleSetVMsClient) DeleteResponder(resp *http.Respons
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent, http.StatusAccepted),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// Get the operation to get a virtual machine scale set virtual machine.
// Get displays information about a virtual machine scale set virtual machine.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. instanceID is the instance id of
@ -210,23 +203,22 @@ func (client VirtualMachineScaleSetVMsClient) Get(resourceGroupName string, vmSc
// GetPreparer prepares the Get request.
func (client VirtualMachineScaleSetVMsClient) GetPreparer(resourceGroupName string, vmScaleSetName string, instanceID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"instanceId": url.QueryEscape(instanceID),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmScaleSetName": url.QueryEscape(vmScaleSetName),
"instanceId": autorest.Encode("path", instanceID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -248,7 +240,7 @@ func (client VirtualMachineScaleSetVMsClient) GetResponder(resp *http.Response)
return
}
// GetInstanceView the operation to get a virtual machine scale set virtual
// GetInstanceView displays the status of a virtual machine scale set virtual
// machine.
//
// resourceGroupName is the name of the resource group. vmScaleSetName is the
@ -277,23 +269,22 @@ func (client VirtualMachineScaleSetVMsClient) GetInstanceView(resourceGroupName
// GetInstanceViewPreparer prepares the GetInstanceView request.
func (client VirtualMachineScaleSetVMsClient) GetInstanceViewPreparer(resourceGroupName string, vmScaleSetName string, instanceID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"instanceId": url.QueryEscape(instanceID),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmScaleSetName": url.QueryEscape(vmScaleSetName),
"instanceId": autorest.Encode("path", instanceID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/instanceView", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetInstanceViewSender sends the GetInstanceView request. The method will close the
@ -315,7 +306,7 @@ func (client VirtualMachineScaleSetVMsClient) GetInstanceViewResponder(resp *htt
return
}
// List the operation to list virtual machine scale sets VMs.
// List lists all virtual machines in a VM scale sets.
//
// resourceGroupName is the name of the resource group.
// virtualMachineScaleSetName is the name of the virtual machine scale set.
@ -345,31 +336,30 @@ func (client VirtualMachineScaleSetVMsClient) List(resourceGroupName string, vir
// ListPreparer prepares the List request.
func (client VirtualMachineScaleSetVMsClient) ListPreparer(resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualMachineScaleSetName": url.QueryEscape(virtualMachineScaleSetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = filter
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if len(selectParameter) > 0 {
queryParameters["$select"] = selectParameter
queryParameters["$select"] = autorest.Encode("query", selectParameter)
}
if len(expand) > 0 {
queryParameters["$expand"] = expand
queryParameters["$expand"] = autorest.Encode("query", expand)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -415,10 +405,10 @@ func (client VirtualMachineScaleSetVMsClient) ListNextResults(lastResults Virtua
return
}
// PowerOff the operation to power off (stop) a virtual machine scale set.
// 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.
// PowerOff allows you to power off (stop) a virtual machine in a VM scale
// set. 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
@ -446,23 +436,22 @@ func (client VirtualMachineScaleSetVMsClient) PowerOff(resourceGroupName string,
// PowerOffPreparer prepares the PowerOff request.
func (client VirtualMachineScaleSetVMsClient) PowerOffPreparer(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"instanceId": url.QueryEscape(instanceID),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmScaleSetName": url.QueryEscape(vmScaleSetName),
"instanceId": autorest.Encode("path", instanceID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/poweroff", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// PowerOffSender sends the PowerOff request. The method will close the
@ -485,10 +474,80 @@ func (client VirtualMachineScaleSetVMsClient) PowerOffResponder(resp *http.Respo
return
}
// Restart the operation to restart a virtual machine scale set. 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.
// Reimage allows you to re-image(update the version of the installed
// operating system) a virtual machine scale set instance. 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
// the virtual machine.
func (client VirtualMachineScaleSetVMsClient) Reimage(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.ReimagePreparer(resourceGroupName, vmScaleSetName, instanceID, cancel)
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", nil, "Failure preparing request")
}
resp, err := client.ReimageSender(req)
if err != nil {
result.Response = resp
return result, autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", resp, "Failure sending request")
}
result, err = client.ReimageResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineScaleSetVMsClient", "Reimage", resp, "Failure responding to request")
}
return
}
// ReimagePreparer prepares the Reimage request.
func (client VirtualMachineScaleSetVMsClient) ReimagePreparer(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"instanceId": autorest.Encode("path", instanceID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
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.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/reimage", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// ReimageSender sends the Reimage request. The method will close the
// http.Response Body if it receives an error.
func (client VirtualMachineScaleSetVMsClient) ReimageSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// ReimageResponder handles the response to the Reimage request. The method always
// closes the http.Response Body.
func (client VirtualMachineScaleSetVMsClient) ReimageResponder(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
}
// Restart allows you to restart a virtual machine in a VM scale set. 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
@ -516,23 +575,22 @@ func (client VirtualMachineScaleSetVMsClient) Restart(resourceGroupName string,
// RestartPreparer prepares the Restart request.
func (client VirtualMachineScaleSetVMsClient) RestartPreparer(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"instanceId": url.QueryEscape(instanceID),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmScaleSetName": url.QueryEscape(vmScaleSetName),
"instanceId": autorest.Encode("path", instanceID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/restart", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// RestartSender sends the Restart request. The method will close the
@ -555,10 +613,10 @@ func (client VirtualMachineScaleSetVMsClient) RestartResponder(resp *http.Respon
return
}
// Start the operation to start a virtual machine scale set. 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.
// Start allows you to start a virtual machine in a VM scale set. 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
@ -586,23 +644,22 @@ func (client VirtualMachineScaleSetVMsClient) Start(resourceGroupName string, vm
// StartPreparer prepares the Start request.
func (client VirtualMachineScaleSetVMsClient) StartPreparer(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"instanceId": url.QueryEscape(instanceID),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"vmScaleSetName": url.QueryEscape(vmScaleSetName),
"instanceId": autorest.Encode("path", instanceID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"vmScaleSetName": autorest.Encode("path", vmScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmScaleSetName}/virtualmachines/{instanceId}/start", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// StartSender sends the Start request. The method will close the

View File

@ -14,7 +14,7 @@ package compute
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// VirtualMachineSizesClient is the the Compute Management Client.
@ -33,16 +32,11 @@ type VirtualMachineSizesClient struct {
// NewVirtualMachineSizesClient creates an instance of the
// VirtualMachineSizesClient client.
func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient {
return NewVirtualMachineSizesClientWithBaseURI(DefaultBaseURI, subscriptionID)
return VirtualMachineSizesClient{New(subscriptionID)}
}
// NewVirtualMachineSizesClientWithBaseURI creates an instance of the
// VirtualMachineSizesClient client.
func NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineSizesClient {
return VirtualMachineSizesClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// List lists virtual-machine-sizes available in a location for a subscription.
// List lists all available virtual machine sizes for a subscription in a
// location.
//
// location is the location upon which virtual-machine-sizes is queried.
func (client VirtualMachineSizesClient) List(location string) (result VirtualMachineSizeListResult, err error) {
@ -68,21 +62,20 @@ func (client VirtualMachineSizesClient) List(location string) (result VirtualMac
// ListPreparer prepares the List request.
func (client VirtualMachineSizesClient) ListPreparer(location string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": url.QueryEscape(location),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"location": autorest.Encode("path", location),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/vmSizes", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -103,27 +96,3 @@ func (client VirtualMachineSizesClient) ListResponder(resp *http.Response) (resu
result.Response = autorest.Response{Response: resp}
return
}
// ListNextResults retrieves the next set of results, if any.
func (client VirtualMachineSizesClient) ListNextResults(lastResults VirtualMachineSizeListResult) (result VirtualMachineSizeListResult, err error) {
req, err := lastResults.VirtualMachineSizeListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "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.VirtualMachineSizesClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "compute.VirtualMachineSizesClient", "List", resp, "Failure responding to next results request request")
}
return
}

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// ApplicationGatewaysClient is the the Microsoft Azure Network management API
@ -37,13 +36,7 @@ type ApplicationGatewaysClient struct {
// NewApplicationGatewaysClient creates an instance of the
// ApplicationGatewaysClient client.
func NewApplicationGatewaysClient(subscriptionID string) ApplicationGatewaysClient {
return NewApplicationGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewApplicationGatewaysClientWithBaseURI creates an instance of the
// ApplicationGatewaysClient client.
func NewApplicationGatewaysClientWithBaseURI(baseURI string, subscriptionID string) ApplicationGatewaysClient {
return ApplicationGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)}
return ApplicationGatewaysClient{New(subscriptionID)}
}
// CreateOrUpdate the Put ApplicationGateway operation creates/updates a
@ -77,23 +70,23 @@ func (client ApplicationGatewaysClient) CreateOrUpdate(resourceGroupName string,
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client ApplicationGatewaysClient) CreateOrUpdatePreparer(resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"applicationGatewayName": url.QueryEscape(applicationGatewayName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"applicationGatewayName": autorest.Encode("path", applicationGatewayName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -146,22 +139,21 @@ func (client ApplicationGatewaysClient) Delete(resourceGroupName string, applica
// DeletePreparer prepares the Delete request.
func (client ApplicationGatewaysClient) DeletePreparer(resourceGroupName string, applicationGatewayName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"applicationGatewayName": url.QueryEscape(applicationGatewayName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"applicationGatewayName": autorest.Encode("path", applicationGatewayName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -212,22 +204,21 @@ func (client ApplicationGatewaysClient) Get(resourceGroupName string, applicatio
// GetPreparer prepares the Get request.
func (client ApplicationGatewaysClient) GetPreparer(resourceGroupName string, applicationGatewayName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"applicationGatewayName": url.QueryEscape(applicationGatewayName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"applicationGatewayName": autorest.Encode("path", applicationGatewayName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -276,21 +267,20 @@ func (client ApplicationGatewaysClient) List(resourceGroupName string) (result A
// ListPreparer prepares the List request.
func (client ApplicationGatewaysClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -361,20 +351,19 @@ func (client ApplicationGatewaysClient) ListAll() (result ApplicationGatewayList
// ListAllPreparer prepares the ListAll request.
func (client ApplicationGatewaysClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the
@ -451,22 +440,21 @@ func (client ApplicationGatewaysClient) Start(resourceGroupName string, applicat
// StartPreparer prepares the Start request.
func (client ApplicationGatewaysClient) StartPreparer(resourceGroupName string, applicationGatewayName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"applicationGatewayName": url.QueryEscape(applicationGatewayName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"applicationGatewayName": autorest.Encode("path", applicationGatewayName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// StartSender sends the Start request. The method will close the
@ -520,22 +508,21 @@ func (client ApplicationGatewaysClient) Stop(resourceGroupName string, applicati
// StopPreparer prepares the Stop request.
func (client ApplicationGatewaysClient) StopPreparer(resourceGroupName string, applicationGatewayName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"applicationGatewayName": url.QueryEscape(applicationGatewayName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"applicationGatewayName": autorest.Encode("path", applicationGatewayName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// StopSender sends the Stop request. The method will close the

View File

@ -1,5 +1,5 @@
// Package network implements the Azure ARM Network service API version
// 2015-06-15.
// 2016-03-30.
//
// The Microsoft Azure Network management API provides a RESTful set of web
// services that interact with Microsoft Azure Networks service to manage
@ -21,7 +21,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -29,12 +29,11 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
const (
// APIVersion is the version of the Network
APIVersion = "2015-06-15"
APIVersion = "2016-03-30"
// DefaultBaseURI is the default URI used for the service Network
DefaultBaseURI = "https://management.azure.com"
@ -44,19 +43,16 @@ const (
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,
BaseURI: DefaultBaseURI,
APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}
}
@ -90,24 +86,23 @@ func (client ManagementClient) CheckDNSNameAvailability(location string, domainN
// CheckDNSNameAvailabilityPreparer prepares the CheckDNSNameAvailability request.
func (client ManagementClient) CheckDNSNameAvailabilityPreparer(location string, domainNameLabel string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": url.QueryEscape(location),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"location": autorest.Encode("path", location),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if len(domainNameLabel) > 0 {
queryParameters["domainNameLabel"] = domainNameLabel
queryParameters["domainNameLabel"] = autorest.Encode("query", domainNameLabel)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/CheckDnsNameAvailability", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CheckDNSNameAvailabilitySender sends the CheckDNSNameAvailability request. The method will close the

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// ExpressRouteCircuitAuthorizationsClient is the the Microsoft Azure Network
@ -37,13 +36,7 @@ type ExpressRouteCircuitAuthorizationsClient struct {
// NewExpressRouteCircuitAuthorizationsClient creates an instance of the
// ExpressRouteCircuitAuthorizationsClient client.
func NewExpressRouteCircuitAuthorizationsClient(subscriptionID string) ExpressRouteCircuitAuthorizationsClient {
return NewExpressRouteCircuitAuthorizationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewExpressRouteCircuitAuthorizationsClientWithBaseURI creates an instance
// of the ExpressRouteCircuitAuthorizationsClient client.
func NewExpressRouteCircuitAuthorizationsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitAuthorizationsClient {
return ExpressRouteCircuitAuthorizationsClient{NewWithBaseURI(baseURI, subscriptionID)}
return ExpressRouteCircuitAuthorizationsClient{New(subscriptionID)}
}
// CreateOrUpdate the Put Authorization operation creates/updates an
@ -79,24 +72,24 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(resourceGro
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdatePreparer(resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"authorizationName": url.QueryEscape(authorizationName),
"circuitName": url.QueryEscape(circuitName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"authorizationName": autorest.Encode("path", authorizationName),
"circuitName": autorest.Encode("path", circuitName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", pathParameters),
autorest.WithJSON(authorizationParameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -151,23 +144,22 @@ func (client ExpressRouteCircuitAuthorizationsClient) Delete(resourceGroupName s
// DeletePreparer prepares the Delete request.
func (client ExpressRouteCircuitAuthorizationsClient) DeletePreparer(resourceGroupName string, circuitName string, authorizationName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"authorizationName": url.QueryEscape(authorizationName),
"circuitName": url.QueryEscape(circuitName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"authorizationName": autorest.Encode("path", authorizationName),
"circuitName": autorest.Encode("path", circuitName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -219,23 +211,22 @@ func (client ExpressRouteCircuitAuthorizationsClient) Get(resourceGroupName stri
// GetPreparer prepares the Get request.
func (client ExpressRouteCircuitAuthorizationsClient) GetPreparer(resourceGroupName string, circuitName string, authorizationName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"authorizationName": url.QueryEscape(authorizationName),
"circuitName": url.QueryEscape(circuitName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"authorizationName": autorest.Encode("path", authorizationName),
"circuitName": autorest.Encode("path", circuitName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations/{authorizationName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -285,22 +276,21 @@ func (client ExpressRouteCircuitAuthorizationsClient) List(resourceGroupName str
// ListPreparer prepares the List request.
func (client ExpressRouteCircuitAuthorizationsClient) ListPreparer(resourceGroupName string, circuitName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"circuitName": url.QueryEscape(circuitName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"circuitName": autorest.Encode("path", circuitName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/authorizations", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// ExpressRouteCircuitPeeringsClient is the the Microsoft Azure Network
@ -37,13 +36,7 @@ type ExpressRouteCircuitPeeringsClient struct {
// NewExpressRouteCircuitPeeringsClient creates an instance of the
// ExpressRouteCircuitPeeringsClient client.
func NewExpressRouteCircuitPeeringsClient(subscriptionID string) ExpressRouteCircuitPeeringsClient {
return NewExpressRouteCircuitPeeringsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewExpressRouteCircuitPeeringsClientWithBaseURI creates an instance of the
// ExpressRouteCircuitPeeringsClient client.
func NewExpressRouteCircuitPeeringsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitPeeringsClient {
return ExpressRouteCircuitPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)}
return ExpressRouteCircuitPeeringsClient{New(subscriptionID)}
}
// CreateOrUpdate the Put Pering operation creates/updates an peering in the
@ -78,24 +71,24 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(resourceGroupName
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdatePreparer(resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"circuitName": url.QueryEscape(circuitName),
"peeringName": url.QueryEscape(peeringName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"circuitName": autorest.Encode("path", circuitName),
"peeringName": autorest.Encode("path", peeringName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", pathParameters),
autorest.WithJSON(peeringParameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -148,23 +141,22 @@ func (client ExpressRouteCircuitPeeringsClient) Delete(resourceGroupName string,
// DeletePreparer prepares the Delete request.
func (client ExpressRouteCircuitPeeringsClient) DeletePreparer(resourceGroupName string, circuitName string, peeringName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"circuitName": url.QueryEscape(circuitName),
"peeringName": url.QueryEscape(peeringName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"circuitName": autorest.Encode("path", circuitName),
"peeringName": autorest.Encode("path", peeringName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -215,23 +207,22 @@ func (client ExpressRouteCircuitPeeringsClient) Get(resourceGroupName string, ci
// GetPreparer prepares the Get request.
func (client ExpressRouteCircuitPeeringsClient) GetPreparer(resourceGroupName string, circuitName string, peeringName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"circuitName": url.QueryEscape(circuitName),
"peeringName": url.QueryEscape(peeringName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"circuitName": autorest.Encode("path", circuitName),
"peeringName": autorest.Encode("path", peeringName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -281,22 +272,21 @@ func (client ExpressRouteCircuitPeeringsClient) List(resourceGroupName string, c
// ListPreparer prepares the List request.
func (client ExpressRouteCircuitPeeringsClient) ListPreparer(resourceGroupName string, circuitName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"circuitName": url.QueryEscape(circuitName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"circuitName": autorest.Encode("path", circuitName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// ExpressRouteCircuitsClient is the the Microsoft Azure Network management
@ -37,13 +36,7 @@ type ExpressRouteCircuitsClient struct {
// NewExpressRouteCircuitsClient creates an instance of the
// ExpressRouteCircuitsClient client.
func NewExpressRouteCircuitsClient(subscriptionID string) ExpressRouteCircuitsClient {
return NewExpressRouteCircuitsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewExpressRouteCircuitsClientWithBaseURI creates an instance of the
// ExpressRouteCircuitsClient client.
func NewExpressRouteCircuitsClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteCircuitsClient {
return ExpressRouteCircuitsClient{NewWithBaseURI(baseURI, subscriptionID)}
return ExpressRouteCircuitsClient{New(subscriptionID)}
}
// CreateOrUpdate the Put ExpressRouteCircuit operation creates/updates a
@ -77,23 +70,23 @@ func (client ExpressRouteCircuitsClient) CreateOrUpdate(resourceGroupName string
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client ExpressRouteCircuitsClient) CreateOrUpdatePreparer(resourceGroupName string, circuitName string, parameters ExpressRouteCircuit, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"circuitName": url.QueryEscape(circuitName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"circuitName": autorest.Encode("path", circuitName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -146,22 +139,21 @@ func (client ExpressRouteCircuitsClient) Delete(resourceGroupName string, circui
// DeletePreparer prepares the Delete request.
func (client ExpressRouteCircuitsClient) DeletePreparer(resourceGroupName string, circuitName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"circuitName": url.QueryEscape(circuitName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"circuitName": autorest.Encode("path", circuitName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -212,22 +204,21 @@ func (client ExpressRouteCircuitsClient) Get(resourceGroupName string, circuitNa
// GetPreparer prepares the Get request.
func (client ExpressRouteCircuitsClient) GetPreparer(resourceGroupName string, circuitName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"circuitName": url.QueryEscape(circuitName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"circuitName": autorest.Encode("path", circuitName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -249,6 +240,135 @@ func (client ExpressRouteCircuitsClient) GetResponder(resp *http.Response) (resu
return
}
// GetPeeringStats the Liststats ExpressRouteCircuit opertion 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. peeringName is the name of the peering.
func (client ExpressRouteCircuitsClient) GetPeeringStats(resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitStats, err error) {
req, err := client.GetPeeringStatsPreparer(resourceGroupName, circuitName, peeringName)
if err != nil {
return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetPeeringStats", nil, "Failure preparing request")
}
resp, err := client.GetPeeringStatsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetPeeringStats", resp, "Failure sending request")
}
result, err = client.GetPeeringStatsResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetPeeringStats", resp, "Failure responding to request")
}
return
}
// GetPeeringStatsPreparer prepares the GetPeeringStats request.
func (client ExpressRouteCircuitsClient) GetPeeringStatsPreparer(resourceGroupName string, circuitName string, peeringName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"circuitName": autorest.Encode("path", circuitName),
"peeringName": autorest.Encode("path", peeringName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/stats", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetPeeringStatsSender sends the GetPeeringStats request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitsClient) GetPeeringStatsSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetPeeringStatsResponder handles the response to the GetPeeringStats request. The method always
// closes the http.Response Body.
func (client ExpressRouteCircuitsClient) GetPeeringStatsResponder(resp *http.Response) (result ExpressRouteCircuitStats, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetStats the Liststats ExpressRouteCircuit opertion 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.
func (client ExpressRouteCircuitsClient) GetStats(resourceGroupName string, circuitName string) (result ExpressRouteCircuitStats, err error) {
req, err := client.GetStatsPreparer(resourceGroupName, circuitName)
if err != nil {
return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetStats", nil, "Failure preparing request")
}
resp, err := client.GetStatsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetStats", resp, "Failure sending request")
}
result, err = client.GetStatsResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "GetStats", resp, "Failure responding to request")
}
return
}
// GetStatsPreparer prepares the GetStats request.
func (client ExpressRouteCircuitsClient) GetStatsPreparer(resourceGroupName string, circuitName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"circuitName": autorest.Encode("path", circuitName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"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}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetStatsSender sends the GetStats request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitsClient) GetStatsSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetStatsResponder handles the response to the GetStats request. The method always
// closes the http.Response Body.
func (client ExpressRouteCircuitsClient) GetStatsResponder(resp *http.Response) (result ExpressRouteCircuitStats, 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 ExpressRouteCircuit opertion retrieves all the
// ExpressRouteCircuits in a resource group.
//
@ -276,21 +396,20 @@ func (client ExpressRouteCircuitsClient) List(resourceGroupName string) (result
// ListPreparer prepares the List request.
func (client ExpressRouteCircuitsClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -361,20 +480,19 @@ func (client ExpressRouteCircuitsClient) ListAll() (result ExpressRouteCircuitLi
// ListAllPreparer prepares the ListAll request.
func (client ExpressRouteCircuitsClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteCircuits", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the
@ -422,19 +540,23 @@ func (client ExpressRouteCircuitsClient) ListAllNextResults(lastResults ExpressR
// ListArpTable the ListArpTable from ExpressRouteCircuit opertion retrieves
// the currently advertised arp table associated with the
// ExpressRouteCircuits in a resource group.
// 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
// HTTP requests.
//
// resourceGroupName is the name of the resource group. circuitName is the
// name of the circuit.
func (client ExpressRouteCircuitsClient) ListArpTable(resourceGroupName string, circuitName string) (result ExpressRouteCircuitsArpTableListResult, err error) {
req, err := client.ListArpTablePreparer(resourceGroupName, circuitName)
// name of the circuit. peeringName is the name of the peering. devicePath is
// the path of the device.
func (client ExpressRouteCircuitsClient) ListArpTable(resourceGroupName string, circuitName string, peeringName string, devicePath string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.ListArpTablePreparer(resourceGroupName, circuitName, peeringName, devicePath, cancel)
if err != nil {
return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListArpTable", nil, "Failure preparing request")
}
resp, err := client.ListArpTableSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
result.Response = resp
return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListArpTable", resp, "Failure sending request")
}
@ -447,84 +569,66 @@ func (client ExpressRouteCircuitsClient) ListArpTable(resourceGroupName string,
}
// ListArpTablePreparer prepares the ListArpTable request.
func (client ExpressRouteCircuitsClient) ListArpTablePreparer(resourceGroupName string, circuitName string) (*http.Request, error) {
func (client ExpressRouteCircuitsClient) ListArpTablePreparer(resourceGroupName string, circuitName string, peeringName string, devicePath string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"circuitName": url.QueryEscape(circuitName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"circuitName": autorest.Encode("path", circuitName),
"devicePath": autorest.Encode("path", devicePath),
"peeringName": autorest.Encode("path", peeringName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/arpTable"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/arpTables/{devicePath}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// ListArpTableSender sends the ListArpTable request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitsClient) ListArpTableSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// ListArpTableResponder handles the response to the ListArpTable request. The method always
// closes the http.Response Body.
func (client ExpressRouteCircuitsClient) ListArpTableResponder(resp *http.Response) (result ExpressRouteCircuitsArpTableListResult, err error) {
func (client ExpressRouteCircuitsClient) ListArpTableResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListArpTableNextResults retrieves the next set of results, if any.
func (client ExpressRouteCircuitsClient) ListArpTableNextResults(lastResults ExpressRouteCircuitsArpTableListResult) (result ExpressRouteCircuitsArpTableListResult, err error) {
req, err := lastResults.ExpressRouteCircuitsArpTableListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListArpTable", nil, "Failure preparing next results request request")
}
if req == nil {
return
}
resp, err := client.ListArpTableSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListArpTable", resp, "Failure sending next results request request")
}
result, err = client.ListArpTableResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListArpTable", resp, "Failure responding to next results request request")
}
result.Response = resp
return
}
// ListRoutesTable the ListRoutesTable from ExpressRouteCircuit opertion
// retrieves the currently advertised routes table associated with the
// ExpressRouteCircuits in a resource group.
// 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
// HTTP requests.
//
// resourceGroupName is the name of the resource group. circuitName is the
// name of the circuit.
func (client ExpressRouteCircuitsClient) ListRoutesTable(resourceGroupName string, circuitName string) (result ExpressRouteCircuitsRoutesTableListResult, err error) {
req, err := client.ListRoutesTablePreparer(resourceGroupName, circuitName)
// name of the circuit. peeringName is the name of the peering. devicePath is
// the path of the device.
func (client ExpressRouteCircuitsClient) ListRoutesTable(resourceGroupName string, circuitName string, peeringName string, devicePath string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.ListRoutesTablePreparer(resourceGroupName, circuitName, peeringName, devicePath, cancel)
if err != nil {
return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTable", nil, "Failure preparing request")
}
resp, err := client.ListRoutesTableSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
result.Response = resp
return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTable", resp, "Failure sending request")
}
@ -537,154 +641,115 @@ func (client ExpressRouteCircuitsClient) ListRoutesTable(resourceGroupName strin
}
// ListRoutesTablePreparer prepares the ListRoutesTable request.
func (client ExpressRouteCircuitsClient) ListRoutesTablePreparer(resourceGroupName string, circuitName string) (*http.Request, error) {
func (client ExpressRouteCircuitsClient) ListRoutesTablePreparer(resourceGroupName string, circuitName string, peeringName string, devicePath string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"circuitName": url.QueryEscape(circuitName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"circuitName": autorest.Encode("path", circuitName),
"devicePath": autorest.Encode("path", devicePath),
"peeringName": autorest.Encode("path", peeringName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/routesTable"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTables/{devicePath}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// ListRoutesTableSender sends the ListRoutesTable request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitsClient) ListRoutesTableSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// ListRoutesTableResponder handles the response to the ListRoutesTable request. The method always
// closes the http.Response Body.
func (client ExpressRouteCircuitsClient) ListRoutesTableResponder(resp *http.Response) (result ExpressRouteCircuitsRoutesTableListResult, err error) {
func (client ExpressRouteCircuitsClient) ListRoutesTableResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
result.Response = resp
return
}
// ListRoutesTableNextResults retrieves the next set of results, if any.
func (client ExpressRouteCircuitsClient) ListRoutesTableNextResults(lastResults ExpressRouteCircuitsRoutesTableListResult) (result ExpressRouteCircuitsRoutesTableListResult, err error) {
req, err := lastResults.ExpressRouteCircuitsRoutesTableListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTable", nil, "Failure preparing next results request request")
}
if req == nil {
return
}
resp, err := client.ListRoutesTableSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTable", resp, "Failure sending next results request request")
}
result, err = client.ListRoutesTableResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTable", resp, "Failure responding to next results request request")
}
return
}
// ListStats the Liststats ExpressRouteCircuit opertion retrieves all the
// stats from a ExpressRouteCircuits in a resource group.
// ListRoutesTableSummary the ListRoutesTable from ExpressRouteCircuit
// opertion 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
// HTTP requests.
//
// resourceGroupName is the name of the resource group. circuitName is the
// name of the loadBalancer.
func (client ExpressRouteCircuitsClient) ListStats(resourceGroupName string, circuitName string) (result ExpressRouteCircuitsStatsListResult, err error) {
req, err := client.ListStatsPreparer(resourceGroupName, circuitName)
// name of the circuit. peeringName is the name of the peering. devicePath is
// the path of the device.
func (client ExpressRouteCircuitsClient) ListRoutesTableSummary(resourceGroupName string, circuitName string, peeringName string, devicePath string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.ListRoutesTableSummaryPreparer(resourceGroupName, circuitName, peeringName, devicePath, cancel)
if err != nil {
return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListStats", nil, "Failure preparing request")
return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTableSummary", nil, "Failure preparing request")
}
resp, err := client.ListStatsSender(req)
resp, err := client.ListRoutesTableSummarySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListStats", resp, "Failure sending request")
result.Response = resp
return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTableSummary", resp, "Failure sending request")
}
result, err = client.ListStatsResponder(resp)
result, err = client.ListRoutesTableSummaryResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListStats", resp, "Failure responding to request")
err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListRoutesTableSummary", resp, "Failure responding to request")
}
return
}
// ListStatsPreparer prepares the ListStats request.
func (client ExpressRouteCircuitsClient) ListStatsPreparer(resourceGroupName string, circuitName string) (*http.Request, error) {
// ListRoutesTableSummaryPreparer prepares the ListRoutesTableSummary request.
func (client ExpressRouteCircuitsClient) ListRoutesTableSummaryPreparer(resourceGroupName string, circuitName string, peeringName string, devicePath string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"circuitName": url.QueryEscape(circuitName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"circuitName": autorest.Encode("path", circuitName),
"devicePath": autorest.Encode("path", devicePath),
"peeringName": autorest.Encode("path", peeringName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/stats"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/expressRouteCircuits/{circuitName}/peerings/{peeringName}/routeTablesSummary/{devicePath}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// ListStatsSender sends the ListStats request. The method will close the
// ListRoutesTableSummarySender sends the ListRoutesTableSummary request. The method will close the
// http.Response Body if it receives an error.
func (client ExpressRouteCircuitsClient) ListStatsSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
func (client ExpressRouteCircuitsClient) ListRoutesTableSummarySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// ListStatsResponder handles the response to the ListStats request. The method always
// ListRoutesTableSummaryResponder handles the response to the ListRoutesTableSummary request. The method always
// closes the http.Response Body.
func (client ExpressRouteCircuitsClient) ListStatsResponder(resp *http.Response) (result ExpressRouteCircuitsStatsListResult, err error) {
func (client ExpressRouteCircuitsClient) ListRoutesTableSummaryResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListStatsNextResults retrieves the next set of results, if any.
func (client ExpressRouteCircuitsClient) ListStatsNextResults(lastResults ExpressRouteCircuitsStatsListResult) (result ExpressRouteCircuitsStatsListResult, err error) {
req, err := lastResults.ExpressRouteCircuitsStatsListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListStats", nil, "Failure preparing next results request request")
}
if req == nil {
return
}
resp, err := client.ListStatsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListStats", resp, "Failure sending next results request request")
}
result, err = client.ListStatsResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "network.ExpressRouteCircuitsClient", "ListStats", resp, "Failure responding to next results request request")
}
result.Response = resp
return
}

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// ExpressRouteServiceProvidersClient is the the Microsoft Azure Network
@ -37,13 +36,7 @@ type ExpressRouteServiceProvidersClient struct {
// NewExpressRouteServiceProvidersClient creates an instance of the
// ExpressRouteServiceProvidersClient client.
func NewExpressRouteServiceProvidersClient(subscriptionID string) ExpressRouteServiceProvidersClient {
return NewExpressRouteServiceProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewExpressRouteServiceProvidersClientWithBaseURI creates an instance of the
// ExpressRouteServiceProvidersClient client.
func NewExpressRouteServiceProvidersClientWithBaseURI(baseURI string, subscriptionID string) ExpressRouteServiceProvidersClient {
return ExpressRouteServiceProvidersClient{NewWithBaseURI(baseURI, subscriptionID)}
return ExpressRouteServiceProvidersClient{New(subscriptionID)}
}
// List the List ExpressRouteServiceProvider opertion retrieves all the
@ -71,20 +64,19 @@ func (client ExpressRouteServiceProvidersClient) List() (result ExpressRouteServ
// ListPreparer prepares the List request.
func (client ExpressRouteServiceProvidersClient) ListPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/expressRouteServiceProviders", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// InterfacesClient is the the Microsoft Azure Network management API provides
@ -36,13 +35,7 @@ type InterfacesClient struct {
// NewInterfacesClient creates an instance of the InterfacesClient client.
func NewInterfacesClient(subscriptionID string) InterfacesClient {
return NewInterfacesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewInterfacesClientWithBaseURI creates an instance of the InterfacesClient
// client.
func NewInterfacesClientWithBaseURI(baseURI string, subscriptionID string) InterfacesClient {
return InterfacesClient{NewWithBaseURI(baseURI, subscriptionID)}
return InterfacesClient{New(subscriptionID)}
}
// CreateOrUpdate the Put NetworkInterface operation creates/updates a
@ -76,23 +69,23 @@ func (client InterfacesClient) CreateOrUpdate(resourceGroupName string, networkI
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client InterfacesClient) CreateOrUpdatePreparer(resourceGroupName string, networkInterfaceName string, parameters Interface, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"networkInterfaceName": url.QueryEscape(networkInterfaceName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"networkInterfaceName": autorest.Encode("path", networkInterfaceName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -145,22 +138,21 @@ func (client InterfacesClient) Delete(resourceGroupName string, networkInterface
// DeletePreparer prepares the Delete request.
func (client InterfacesClient) DeletePreparer(resourceGroupName string, networkInterfaceName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"networkInterfaceName": url.QueryEscape(networkInterfaceName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"networkInterfaceName": autorest.Encode("path", networkInterfaceName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -212,25 +204,24 @@ func (client InterfacesClient) Get(resourceGroupName string, networkInterfaceNam
// GetPreparer prepares the Get request.
func (client InterfacesClient) GetPreparer(resourceGroupName string, networkInterfaceName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"networkInterfaceName": url.QueryEscape(networkInterfaceName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"networkInterfaceName": autorest.Encode("path", networkInterfaceName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if len(expand) > 0 {
queryParameters["$expand"] = expand
queryParameters["$expand"] = autorest.Encode("query", expand)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces/{networkInterfaceName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -283,27 +274,26 @@ func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterface(resourc
// GetVirtualMachineScaleSetNetworkInterfacePreparer prepares the GetVirtualMachineScaleSetNetworkInterface request.
func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfacePreparer(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"networkInterfaceName": url.QueryEscape(networkInterfaceName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualmachineIndex": url.QueryEscape(virtualmachineIndex),
"virtualMachineScaleSetName": url.QueryEscape(virtualMachineScaleSetName),
"networkInterfaceName": autorest.Encode("path", networkInterfaceName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualmachineIndex": autorest.Encode("path", virtualmachineIndex),
"virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if len(expand) > 0 {
queryParameters["$expand"] = expand
queryParameters["$expand"] = autorest.Encode("query", expand)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces/{networkInterfaceName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetVirtualMachineScaleSetNetworkInterfaceSender sends the GetVirtualMachineScaleSetNetworkInterface request. The method will close the
@ -352,21 +342,20 @@ func (client InterfacesClient) List(resourceGroupName string) (result InterfaceL
// ListPreparer prepares the List request.
func (client InterfacesClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkInterfaces", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -437,20 +426,19 @@ func (client InterfacesClient) ListAll() (result InterfaceListResult, err error)
// ListAllPreparer prepares the ListAll request.
func (client InterfacesClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkInterfaces", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the
@ -525,22 +513,21 @@ func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfaces(resou
// ListVirtualMachineScaleSetNetworkInterfacesPreparer prepares the ListVirtualMachineScaleSetNetworkInterfaces request.
func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesPreparer(resourceGroupName string, virtualMachineScaleSetName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualMachineScaleSetName": url.QueryEscape(virtualMachineScaleSetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/networkInterfaces", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListVirtualMachineScaleSetNetworkInterfacesSender sends the ListVirtualMachineScaleSetNetworkInterfaces request. The method will close the
@ -616,23 +603,22 @@ func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfaces(res
// ListVirtualMachineScaleSetVMNetworkInterfacesPreparer prepares the ListVirtualMachineScaleSetVMNetworkInterfaces request.
func (client InterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesPreparer(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualmachineIndex": url.QueryEscape(virtualmachineIndex),
"virtualMachineScaleSetName": url.QueryEscape(virtualMachineScaleSetName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualmachineIndex": autorest.Encode("path", virtualmachineIndex),
"virtualMachineScaleSetName": autorest.Encode("path", virtualMachineScaleSetName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.Compute/virtualMachineScaleSets/{virtualMachineScaleSetName}/virtualMachines/{virtualmachineIndex}/networkInterfaces", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListVirtualMachineScaleSetVMNetworkInterfacesSender sends the ListVirtualMachineScaleSetVMNetworkInterfaces request. The method will close the

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// LoadBalancersClient is the the Microsoft Azure Network management API
@ -37,13 +36,7 @@ type LoadBalancersClient struct {
// NewLoadBalancersClient creates an instance of the LoadBalancersClient
// client.
func NewLoadBalancersClient(subscriptionID string) LoadBalancersClient {
return NewLoadBalancersClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewLoadBalancersClientWithBaseURI creates an instance of the
// LoadBalancersClient client.
func NewLoadBalancersClientWithBaseURI(baseURI string, subscriptionID string) LoadBalancersClient {
return LoadBalancersClient{NewWithBaseURI(baseURI, subscriptionID)}
return LoadBalancersClient{New(subscriptionID)}
}
// CreateOrUpdate the Put LoadBalancer operation creates/updates a
@ -77,23 +70,23 @@ func (client LoadBalancersClient) CreateOrUpdate(resourceGroupName string, loadB
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client LoadBalancersClient) CreateOrUpdatePreparer(resourceGroupName string, loadBalancerName string, parameters LoadBalancer, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"loadBalancerName": url.QueryEscape(loadBalancerName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"loadBalancerName": autorest.Encode("path", loadBalancerName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -146,22 +139,21 @@ func (client LoadBalancersClient) Delete(resourceGroupName string, loadBalancerN
// DeletePreparer prepares the Delete request.
func (client LoadBalancersClient) DeletePreparer(resourceGroupName string, loadBalancerName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"loadBalancerName": url.QueryEscape(loadBalancerName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"loadBalancerName": autorest.Encode("path", loadBalancerName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -212,25 +204,24 @@ func (client LoadBalancersClient) Get(resourceGroupName string, loadBalancerName
// GetPreparer prepares the Get request.
func (client LoadBalancersClient) GetPreparer(resourceGroupName string, loadBalancerName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"loadBalancerName": url.QueryEscape(loadBalancerName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"loadBalancerName": autorest.Encode("path", loadBalancerName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if len(expand) > 0 {
queryParameters["$expand"] = expand
queryParameters["$expand"] = autorest.Encode("query", expand)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -279,21 +270,20 @@ func (client LoadBalancersClient) List(resourceGroupName string) (result LoadBal
// ListPreparer prepares the List request.
func (client LoadBalancersClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -364,20 +354,19 @@ func (client LoadBalancersClient) ListAll() (result LoadBalancerListResult, err
// ListAllPreparer prepares the ListAll request.
func (client LoadBalancersClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/loadBalancers", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// LocalNetworkGatewaysClient is the the Microsoft Azure Network management
@ -37,13 +36,7 @@ type LocalNetworkGatewaysClient struct {
// NewLocalNetworkGatewaysClient creates an instance of the
// LocalNetworkGatewaysClient client.
func NewLocalNetworkGatewaysClient(subscriptionID string) LocalNetworkGatewaysClient {
return NewLocalNetworkGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewLocalNetworkGatewaysClientWithBaseURI creates an instance of the
// LocalNetworkGatewaysClient client.
func NewLocalNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID string) LocalNetworkGatewaysClient {
return LocalNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)}
return LocalNetworkGatewaysClient{New(subscriptionID)}
}
// CreateOrUpdate the Put LocalNetworkGateway operation creates/updates a
@ -79,23 +72,23 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdate(resourceGroupName string
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client LocalNetworkGatewaysClient) CreateOrUpdatePreparer(resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"localNetworkGatewayName": url.QueryEscape(localNetworkGatewayName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"localNetworkGatewayName": autorest.Encode("path", localNetworkGatewayName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -149,22 +142,21 @@ func (client LocalNetworkGatewaysClient) Delete(resourceGroupName string, localN
// DeletePreparer prepares the Delete request.
func (client LocalNetworkGatewaysClient) DeletePreparer(resourceGroupName string, localNetworkGatewayName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"localNetworkGatewayName": url.QueryEscape(localNetworkGatewayName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"localNetworkGatewayName": autorest.Encode("path", localNetworkGatewayName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -215,22 +207,21 @@ func (client LocalNetworkGatewaysClient) Get(resourceGroupName string, localNetw
// GetPreparer prepares the Get request.
func (client LocalNetworkGatewaysClient) GetPreparer(resourceGroupName string, localNetworkGatewayName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"localNetworkGatewayName": url.QueryEscape(localNetworkGatewayName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"localNetworkGatewayName": autorest.Encode("path", localNetworkGatewayName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways/{localNetworkGatewayName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -279,21 +270,20 @@ func (client LocalNetworkGatewaysClient) List(resourceGroupName string) (result
// ListPreparer prepares the List request.
func (client LocalNetworkGatewaysClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/localNetworkGateways", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -200,6 +200,16 @@ const (
Static IPAllocationMethod = "Static"
)
// IPVersion enumerates the values for ip version.
type IPVersion string
const (
// IPv4 specifies the i pv 4 state for ip version.
IPv4 IPVersion = "IPv4"
// IPv6 specifies the i pv 6 state for ip version.
IPv6 IPVersion = "IPv6"
)
// LoadDistribution enumerates the values for load distribution.
type LoadDistribution string
@ -331,14 +341,6 @@ const (
TransportProtocolUDP TransportProtocol = "Udp"
)
// UsageUnit enumerates the values for usage unit.
type UsageUnit string
const (
// Count specifies the count state for usage unit.
Count UsageUnit = "Count"
)
// VirtualNetworkGatewayConnectionStatus enumerates the values for virtual
// network gateway connection status.
type VirtualNetworkGatewayConnectionStatus string
@ -470,7 +472,7 @@ type ApplicationGatewayBackendAddressPool struct {
// ApplicationGatewayBackendAddressPoolPropertiesFormat is properties of
// Backend Address Pool of application gateway
type ApplicationGatewayBackendAddressPoolPropertiesFormat struct {
BackendIPConfigurations *[]SubResource `json:"backendIPConfigurations,omitempty"`
BackendIPConfigurations *[]InterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"`
BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@ -545,7 +547,7 @@ type ApplicationGatewayHTTPListenerPropertiesFormat struct {
Protocol ApplicationGatewayProtocol `json:"protocol,omitempty"`
HostName *string `json:"hostName,omitempty"`
SslCertificate *SubResource `json:"sslCertificate,omitempty"`
RequireServerNameIndication *string `json:"requireServerNameIndication,omitempty"`
RequireServerNameIndication *bool `json:"requireServerNameIndication,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@ -757,6 +759,13 @@ type BackendAddressPoolPropertiesFormat struct {
ProvisioningState *string `json:"provisioningState,omitempty"`
}
// BgpSettings is
type BgpSettings struct {
Asn *int64 `json:"asn,omitempty"`
BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"`
PeerWeight *int32 `json:"peerWeight,omitempty"`
}
// ConnectionResetSharedKey is
type ConnectionResetSharedKey struct {
autorest.Response `json:"-"`
@ -822,6 +831,8 @@ type ExpressRouteCircuit struct {
// ExpressRouteCircuitArpTable is the arp table associated with the
// ExpressRouteCircuit
type ExpressRouteCircuitArpTable struct {
Age *int32 `json:"age,omitempty"`
Interface *string `json:"interface,omitempty"`
IPAddress *string `json:"ipAddress,omitempty"`
MacAddress *string `json:"macAddress,omitempty"`
}
@ -912,6 +923,7 @@ type ExpressRouteCircuitPeeringPropertiesFormat struct {
// ExpressRouteCircuitPropertiesFormat is properties of ExpressRouteCircuit
type ExpressRouteCircuitPropertiesFormat struct {
AllowClassicOperations *bool `json:"allowClassicOperations,omitempty"`
CircuitProvisioningState *string `json:"circuitProvisioningState,omitempty"`
ServiceProviderProvisioningState ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"`
Authorizations *[]ExpressRouteCircuitAuthorization `json:"authorizations,omitempty"`
@ -925,10 +937,21 @@ type ExpressRouteCircuitPropertiesFormat struct {
// ExpressRouteCircuitRoutesTable is the routes table associated with the
// ExpressRouteCircuit
type ExpressRouteCircuitRoutesTable struct {
AddressPrefix *string `json:"addressPrefix,omitempty"`
NextHopType RouteNextHopType `json:"nextHopType,omitempty"`
NextHopIP *string `json:"nextHopIP,omitempty"`
AsPath *string `json:"asPath,omitempty"`
Network *string `json:"network,omitempty"`
NextHop *string `json:"nextHop,omitempty"`
LocPrf *string `json:"locPrf,omitempty"`
Weight *int32 `json:"weight,omitempty"`
Path *string `json:"path,omitempty"`
}
// ExpressRouteCircuitRoutesTableSummary is the routes table associated with
// the ExpressRouteCircuit
type ExpressRouteCircuitRoutesTableSummary struct {
Neighbor *string `json:"neighbor,omitempty"`
V *int32 `json:"v,omitempty"`
As *int32 `json:"as,omitempty"`
UpDown *string `json:"upDown,omitempty"`
StatePfxRcd *string `json:"statePfxRcd,omitempty"`
}
// ExpressRouteCircuitsArpTableListResult is response for ListArpTable
@ -939,18 +962,6 @@ type ExpressRouteCircuitsArpTableListResult struct {
NextLink *string `json:"nextLink,omitempty"`
}
// ExpressRouteCircuitsArpTableListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client ExpressRouteCircuitsArpTableListResult) ExpressRouteCircuitsArpTableListResultPreparer() (*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)))
}
// ExpressRouteCircuitServiceProviderProperties is contains
// ServiceProviderProperties in an ExpressRouteCircuit
type ExpressRouteCircuitServiceProviderProperties struct {
@ -974,42 +985,21 @@ type ExpressRouteCircuitsRoutesTableListResult struct {
NextLink *string `json:"nextLink,omitempty"`
}
// ExpressRouteCircuitsRoutesTableListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client ExpressRouteCircuitsRoutesTableListResult) ExpressRouteCircuitsRoutesTableListResultPreparer() (*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)))
}
// ExpressRouteCircuitsStatsListResult is response for ListStats from Express
// Route Circuits Api service call
type ExpressRouteCircuitsStatsListResult struct {
// ExpressRouteCircuitsRoutesTableSummaryListResult is response for
// ListRoutesTable associated with the Express Route Circuits Api
type ExpressRouteCircuitsRoutesTableSummaryListResult struct {
autorest.Response `json:"-"`
Value *[]ExpressRouteCircuitStats `json:"value,omitempty"`
NextLink *string `json:"nextLink,omitempty"`
}
// ExpressRouteCircuitsStatsListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client ExpressRouteCircuitsStatsListResult) ExpressRouteCircuitsStatsListResultPreparer() (*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)))
Value *[]ExpressRouteCircuitRoutesTableSummary `json:"value,omitempty"`
NextLink *string `json:"nextLink,omitempty"`
}
// ExpressRouteCircuitStats is contains Stats associated with the peering
type ExpressRouteCircuitStats struct {
BytesIn *int32 `json:"bytesIn,omitempty"`
BytesOut *int32 `json:"bytesOut,omitempty"`
autorest.Response `json:"-"`
PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"`
PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"`
SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"`
SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"`
}
// ExpressRouteServiceProvider is expressRouteResourceProvider object
@ -1131,10 +1121,11 @@ type Interface struct {
// InterfaceDNSSettings is dns Settings of a network interface
type InterfaceDNSSettings struct {
DNSServers *[]string `json:"dnsServers,omitempty"`
AppliedDNSServers *[]string `json:"appliedDnsServers,omitempty"`
InternalDNSNameLabel *string `json:"internalDnsNameLabel,omitempty"`
InternalFqdn *string `json:"internalFqdn,omitempty"`
DNSServers *[]string `json:"dnsServers,omitempty"`
AppliedDNSServers *[]string `json:"appliedDnsServers,omitempty"`
InternalDNSNameLabel *string `json:"internalDnsNameLabel,omitempty"`
InternalFqdn *string `json:"internalFqdn,omitempty"`
InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"`
}
// InterfaceIPConfiguration is iPConfiguration in a NetworkInterface
@ -1147,13 +1138,16 @@ type InterfaceIPConfiguration struct {
// InterfaceIPConfigurationPropertiesFormat is properties of IPConfiguration
type InterfaceIPConfigurationPropertiesFormat struct {
LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"`
LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"`
PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
Subnet *Subnet `json:"subnet,omitempty"`
PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"`
LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"`
LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"`
PrivateIPAddress *string `json:"privateIPAddress,omitempty"`
PrivateIPAllocationMethod IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"`
PrivateIPAddressVersion IPVersion `json:"privateIPAddressVersion,omitempty"`
Subnet *Subnet `json:"subnet,omitempty"`
Primary *bool `json:"primary,omitempty"`
PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
// InterfaceListResult is response for ListNetworkInterface Api service call
@ -1307,6 +1301,7 @@ func (client LocalNetworkGatewayListResult) LocalNetworkGatewayListResultPrepare
type LocalNetworkGatewayPropertiesFormat struct {
LocalNetworkAddressSpace *AddressSpace `json:"localNetworkAddressSpace,omitempty"`
GatewayIPAddress *string `json:"gatewayIpAddress,omitempty"`
BgpSettings *BgpSettings `json:"bgpSettings,omitempty"`
ResourceGUID *string `json:"resourceGuid,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@ -1389,6 +1384,7 @@ func (client PublicIPAddressListResult) PublicIPAddressListResultPreparer() (*ht
// PublicIPAddressPropertiesFormat is publicIpAddress properties
type PublicIPAddressPropertiesFormat struct {
PublicIPAllocationMethod IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"`
PublicIPAddressVersion IPVersion `json:"publicIPAddressVersion,omitempty"`
IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"`
DNSSettings *PublicIPAddressDNSSettings `json:"dnsSettings,omitempty"`
IPAddress *string `json:"ipAddress,omitempty"`
@ -1616,7 +1612,7 @@ type SubResource struct {
// Usage is describes Network Resource Usage.
type Usage struct {
Unit UsageUnit `json:"unit,omitempty"`
Unit *string `json:"unit,omitempty"`
CurrentValue *int64 `json:"currentValue,omitempty"`
Limit *int64 `json:"limit,omitempty"`
Name *UsageName `json:"name,omitempty"`
@ -1718,6 +1714,7 @@ type VirtualNetworkGatewayConnectionPropertiesFormat struct {
EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"`
IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"`
Peer *SubResource `json:"peer,omitempty"`
EnableBgp *bool `json:"enableBgp,omitempty"`
ResourceGUID *string `json:"resourceGuid,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}
@ -1770,6 +1767,7 @@ type VirtualNetworkGatewayPropertiesFormat struct {
GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"`
Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"`
VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"`
BgpSettings *BgpSettings `json:"bgpSettings,omitempty"`
ResourceGUID *string `json:"resourceGuid,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
}

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// PublicIPAddressesClient is the the Microsoft Azure Network management API
@ -37,13 +36,7 @@ type PublicIPAddressesClient struct {
// NewPublicIPAddressesClient creates an instance of the
// PublicIPAddressesClient client.
func NewPublicIPAddressesClient(subscriptionID string) PublicIPAddressesClient {
return NewPublicIPAddressesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewPublicIPAddressesClientWithBaseURI creates an instance of the
// PublicIPAddressesClient client.
func NewPublicIPAddressesClientWithBaseURI(baseURI string, subscriptionID string) PublicIPAddressesClient {
return PublicIPAddressesClient{NewWithBaseURI(baseURI, subscriptionID)}
return PublicIPAddressesClient{New(subscriptionID)}
}
// CreateOrUpdate the Put PublicIPAddress operation creates/updates a
@ -77,23 +70,23 @@ func (client PublicIPAddressesClient) CreateOrUpdate(resourceGroupName string, p
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client PublicIPAddressesClient) CreateOrUpdatePreparer(resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"publicIpAddressName": url.QueryEscape(publicIPAddressName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"publicIpAddressName": autorest.Encode("path", publicIPAddressName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -146,22 +139,21 @@ func (client PublicIPAddressesClient) Delete(resourceGroupName string, publicIPA
// DeletePreparer prepares the Delete request.
func (client PublicIPAddressesClient) DeletePreparer(resourceGroupName string, publicIPAddressName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"publicIpAddressName": url.QueryEscape(publicIPAddressName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"publicIpAddressName": autorest.Encode("path", publicIPAddressName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -212,25 +204,24 @@ func (client PublicIPAddressesClient) Get(resourceGroupName string, publicIPAddr
// GetPreparer prepares the Get request.
func (client PublicIPAddressesClient) GetPreparer(resourceGroupName string, publicIPAddressName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"publicIpAddressName": url.QueryEscape(publicIPAddressName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"publicIpAddressName": autorest.Encode("path", publicIPAddressName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if len(expand) > 0 {
queryParameters["$expand"] = expand
queryParameters["$expand"] = autorest.Encode("query", expand)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses/{publicIpAddressName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -279,21 +270,20 @@ func (client PublicIPAddressesClient) List(resourceGroupName string) (result Pub
// ListPreparer prepares the List request.
func (client PublicIPAddressesClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/publicIPAddresses", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -364,20 +354,19 @@ func (client PublicIPAddressesClient) ListAll() (result PublicIPAddressListResul
// ListAllPreparer prepares the ListAll request.
func (client PublicIPAddressesClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/publicIPAddresses", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// RoutesClient is the the Microsoft Azure Network management API provides a
@ -36,12 +35,7 @@ type RoutesClient struct {
// NewRoutesClient creates an instance of the RoutesClient client.
func NewRoutesClient(subscriptionID string) RoutesClient {
return NewRoutesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewRoutesClientWithBaseURI creates an instance of the RoutesClient client.
func NewRoutesClientWithBaseURI(baseURI string, subscriptionID string) RoutesClient {
return RoutesClient{NewWithBaseURI(baseURI, subscriptionID)}
return RoutesClient{New(subscriptionID)}
}
// CreateOrUpdate the Put route operation creates/updates a route in the
@ -75,24 +69,24 @@ func (client RoutesClient) CreateOrUpdate(resourceGroupName string, routeTableNa
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client RoutesClient) CreateOrUpdatePreparer(resourceGroupName string, routeTableName string, routeName string, routeParameters Route, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"routeName": url.QueryEscape(routeName),
"routeTableName": url.QueryEscape(routeTableName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"routeName": autorest.Encode("path", routeName),
"routeTableName": autorest.Encode("path", routeTableName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", pathParameters),
autorest.WithJSON(routeParameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -145,23 +139,22 @@ func (client RoutesClient) Delete(resourceGroupName string, routeTableName strin
// DeletePreparer prepares the Delete request.
func (client RoutesClient) DeletePreparer(resourceGroupName string, routeTableName string, routeName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"routeName": url.QueryEscape(routeName),
"routeTableName": url.QueryEscape(routeTableName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"routeName": autorest.Encode("path", routeName),
"routeTableName": autorest.Encode("path", routeTableName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -212,23 +205,22 @@ func (client RoutesClient) Get(resourceGroupName string, routeTableName string,
// GetPreparer prepares the Get request.
func (client RoutesClient) GetPreparer(resourceGroupName string, routeTableName string, routeName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"routeName": url.QueryEscape(routeName),
"routeTableName": url.QueryEscape(routeTableName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"routeName": autorest.Encode("path", routeName),
"routeTableName": autorest.Encode("path", routeTableName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes/{routeName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -278,22 +270,21 @@ func (client RoutesClient) List(resourceGroupName string, routeTableName string)
// ListPreparer prepares the List request.
func (client RoutesClient) ListPreparer(resourceGroupName string, routeTableName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"routeTableName": url.QueryEscape(routeTableName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"routeTableName": autorest.Encode("path", routeTableName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}/routes", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// RouteTablesClient is the the Microsoft Azure Network management API
@ -36,13 +35,7 @@ type RouteTablesClient struct {
// NewRouteTablesClient creates an instance of the RouteTablesClient client.
func NewRouteTablesClient(subscriptionID string) RouteTablesClient {
return NewRouteTablesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewRouteTablesClientWithBaseURI creates an instance of the
// RouteTablesClient client.
func NewRouteTablesClientWithBaseURI(baseURI string, subscriptionID string) RouteTablesClient {
return RouteTablesClient{NewWithBaseURI(baseURI, subscriptionID)}
return RouteTablesClient{New(subscriptionID)}
}
// CreateOrUpdate the Put RouteTable operation creates/updates a route tablein
@ -76,23 +69,23 @@ func (client RouteTablesClient) CreateOrUpdate(resourceGroupName string, routeTa
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client RouteTablesClient) CreateOrUpdatePreparer(resourceGroupName string, routeTableName string, parameters RouteTable, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"routeTableName": url.QueryEscape(routeTableName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"routeTableName": autorest.Encode("path", routeTableName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -145,22 +138,21 @@ func (client RouteTablesClient) Delete(resourceGroupName string, routeTableName
// DeletePreparer prepares the Delete request.
func (client RouteTablesClient) DeletePreparer(resourceGroupName string, routeTableName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"routeTableName": url.QueryEscape(routeTableName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"routeTableName": autorest.Encode("path", routeTableName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -211,25 +203,24 @@ func (client RouteTablesClient) Get(resourceGroupName string, routeTableName str
// GetPreparer prepares the Get request.
func (client RouteTablesClient) GetPreparer(resourceGroupName string, routeTableName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"routeTableName": url.QueryEscape(routeTableName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"routeTableName": autorest.Encode("path", routeTableName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if len(expand) > 0 {
queryParameters["$expand"] = expand
queryParameters["$expand"] = autorest.Encode("query", expand)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables/{routeTableName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -277,21 +268,20 @@ func (client RouteTablesClient) List(resourceGroupName string) (result RouteTabl
// ListPreparer prepares the List request.
func (client RouteTablesClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/routeTables", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -361,20 +351,19 @@ func (client RouteTablesClient) ListAll() (result RouteTableListResult, err erro
// ListAllPreparer prepares the ListAll request.
func (client RouteTablesClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/routeTables", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// SecurityGroupsClient is the the Microsoft Azure Network management API
@ -37,13 +36,7 @@ type SecurityGroupsClient struct {
// NewSecurityGroupsClient creates an instance of the SecurityGroupsClient
// client.
func NewSecurityGroupsClient(subscriptionID string) SecurityGroupsClient {
return NewSecurityGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewSecurityGroupsClientWithBaseURI creates an instance of the
// SecurityGroupsClient client.
func NewSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string) SecurityGroupsClient {
return SecurityGroupsClient{NewWithBaseURI(baseURI, subscriptionID)}
return SecurityGroupsClient{New(subscriptionID)}
}
// CreateOrUpdate the Put NetworkSecurityGroup operation creates/updates a
@ -79,23 +72,23 @@ func (client SecurityGroupsClient) CreateOrUpdate(resourceGroupName string, netw
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client SecurityGroupsClient) CreateOrUpdatePreparer(resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"networkSecurityGroupName": url.QueryEscape(networkSecurityGroupName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -148,22 +141,21 @@ func (client SecurityGroupsClient) Delete(resourceGroupName string, networkSecur
// DeletePreparer prepares the Delete request.
func (client SecurityGroupsClient) DeletePreparer(resourceGroupName string, networkSecurityGroupName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"networkSecurityGroupName": url.QueryEscape(networkSecurityGroupName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -215,25 +207,24 @@ func (client SecurityGroupsClient) Get(resourceGroupName string, networkSecurity
// GetPreparer prepares the Get request.
func (client SecurityGroupsClient) GetPreparer(resourceGroupName string, networkSecurityGroupName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"networkSecurityGroupName": url.QueryEscape(networkSecurityGroupName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if len(expand) > 0 {
queryParameters["$expand"] = expand
queryParameters["$expand"] = autorest.Encode("query", expand)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -282,21 +273,20 @@ func (client SecurityGroupsClient) List(resourceGroupName string) (result Securi
// ListPreparer prepares the List request.
func (client SecurityGroupsClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -367,20 +357,19 @@ func (client SecurityGroupsClient) ListAll() (result SecurityGroupListResult, er
// ListAllPreparer prepares the ListAll request.
func (client SecurityGroupsClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/networkSecurityGroups", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// SecurityRulesClient is the the Microsoft Azure Network management API
@ -37,13 +36,7 @@ type SecurityRulesClient struct {
// NewSecurityRulesClient creates an instance of the SecurityRulesClient
// client.
func NewSecurityRulesClient(subscriptionID string) SecurityRulesClient {
return NewSecurityRulesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewSecurityRulesClientWithBaseURI creates an instance of the
// SecurityRulesClient client.
func NewSecurityRulesClientWithBaseURI(baseURI string, subscriptionID string) SecurityRulesClient {
return SecurityRulesClient{NewWithBaseURI(baseURI, subscriptionID)}
return SecurityRulesClient{New(subscriptionID)}
}
// CreateOrUpdate the Put network security rule operation creates/updates a
@ -80,24 +73,24 @@ func (client SecurityRulesClient) CreateOrUpdate(resourceGroupName string, netwo
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client SecurityRulesClient) CreateOrUpdatePreparer(resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"networkSecurityGroupName": url.QueryEscape(networkSecurityGroupName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"securityRuleName": url.QueryEscape(securityRuleName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"securityRuleName": autorest.Encode("path", securityRuleName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", pathParameters),
autorest.WithJSON(securityRuleParameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -151,23 +144,22 @@ func (client SecurityRulesClient) Delete(resourceGroupName string, networkSecuri
// DeletePreparer prepares the Delete request.
func (client SecurityRulesClient) DeletePreparer(resourceGroupName string, networkSecurityGroupName string, securityRuleName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"networkSecurityGroupName": url.QueryEscape(networkSecurityGroupName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"securityRuleName": url.QueryEscape(securityRuleName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"securityRuleName": autorest.Encode("path", securityRuleName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -219,23 +211,22 @@ func (client SecurityRulesClient) Get(resourceGroupName string, networkSecurityG
// GetPreparer prepares the Get request.
func (client SecurityRulesClient) GetPreparer(resourceGroupName string, networkSecurityGroupName string, securityRuleName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"networkSecurityGroupName": url.QueryEscape(networkSecurityGroupName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"securityRuleName": url.QueryEscape(securityRuleName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"securityRuleName": autorest.Encode("path", securityRuleName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules/{securityRuleName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -285,22 +276,21 @@ func (client SecurityRulesClient) List(resourceGroupName string, networkSecurity
// ListPreparer prepares the List request.
func (client SecurityRulesClient) ListPreparer(resourceGroupName string, networkSecurityGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"networkSecurityGroupName": url.QueryEscape(networkSecurityGroupName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"networkSecurityGroupName": autorest.Encode("path", networkSecurityGroupName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkSecurityGroups/{networkSecurityGroupName}/securityRules", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// SubnetsClient is the the Microsoft Azure Network management API provides a
@ -36,12 +35,7 @@ type SubnetsClient struct {
// NewSubnetsClient creates an instance of the SubnetsClient client.
func NewSubnetsClient(subscriptionID string) SubnetsClient {
return NewSubnetsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewSubnetsClientWithBaseURI creates an instance of the SubnetsClient client.
func NewSubnetsClientWithBaseURI(baseURI string, subscriptionID string) SubnetsClient {
return SubnetsClient{NewWithBaseURI(baseURI, subscriptionID)}
return SubnetsClient{New(subscriptionID)}
}
// CreateOrUpdate the Put Subnet operation creates/updates a subnet in
@ -76,24 +70,24 @@ func (client SubnetsClient) CreateOrUpdate(resourceGroupName string, virtualNetw
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client SubnetsClient) CreateOrUpdatePreparer(resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subnetName": url.QueryEscape(subnetName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualNetworkName": url.QueryEscape(virtualNetworkName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subnetName": autorest.Encode("path", subnetName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkName": autorest.Encode("path", virtualNetworkName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", pathParameters),
autorest.WithJSON(subnetParameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -146,23 +140,22 @@ func (client SubnetsClient) Delete(resourceGroupName string, virtualNetworkName
// DeletePreparer prepares the Delete request.
func (client SubnetsClient) DeletePreparer(resourceGroupName string, virtualNetworkName string, subnetName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subnetName": url.QueryEscape(subnetName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualNetworkName": url.QueryEscape(virtualNetworkName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subnetName": autorest.Encode("path", subnetName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkName": autorest.Encode("path", virtualNetworkName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -214,26 +207,25 @@ func (client SubnetsClient) Get(resourceGroupName string, virtualNetworkName str
// GetPreparer prepares the Get request.
func (client SubnetsClient) GetPreparer(resourceGroupName string, virtualNetworkName string, subnetName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subnetName": url.QueryEscape(subnetName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualNetworkName": url.QueryEscape(virtualNetworkName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subnetName": autorest.Encode("path", subnetName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkName": autorest.Encode("path", virtualNetworkName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if len(expand) > 0 {
queryParameters["$expand"] = expand
queryParameters["$expand"] = autorest.Encode("query", expand)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets/{subnetName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -283,22 +275,21 @@ func (client SubnetsClient) List(resourceGroupName string, virtualNetworkName st
// ListPreparer prepares the List request.
func (client SubnetsClient) ListPreparer(resourceGroupName string, virtualNetworkName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualNetworkName": url.QueryEscape(virtualNetworkName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkName": autorest.Encode("path", virtualNetworkName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}/subnets"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// UsagesClient is the the Microsoft Azure Network management API provides a
@ -36,12 +35,7 @@ type UsagesClient struct {
// NewUsagesClient creates an instance of the UsagesClient client.
func NewUsagesClient(subscriptionID string) UsagesClient {
return NewUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewUsagesClientWithBaseURI creates an instance of the UsagesClient client.
func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesClient {
return UsagesClient{NewWithBaseURI(baseURI, subscriptionID)}
return UsagesClient{New(subscriptionID)}
}
// List lists compute usages for a subscription.
@ -70,21 +64,20 @@ func (client UsagesClient) List(location string) (result UsagesListResult, err e
// ListPreparer prepares the List request.
func (client UsagesClient) ListPreparer(location string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"location": url.QueryEscape(location),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"location": autorest.Encode("path", location),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/locations/{location}/usages", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -23,9 +23,9 @@ import (
)
const (
major = "2"
minor = "1"
patch = "1"
major = "3"
minor = "0"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"
semVerFormat = "%s.%s.%s%s"
@ -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", "2015-06-15")
return fmt.Sprintf(userAgentFormat, Version(), "network", "2016-03-30")
}
// Version returns the semantic version (see http://semver.org) of the client.

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// VirtualNetworkGatewayConnectionsClient is the the Microsoft Azure Network
@ -37,13 +36,7 @@ type VirtualNetworkGatewayConnectionsClient struct {
// NewVirtualNetworkGatewayConnectionsClient creates an instance of the
// VirtualNetworkGatewayConnectionsClient client.
func NewVirtualNetworkGatewayConnectionsClient(subscriptionID string) VirtualNetworkGatewayConnectionsClient {
return NewVirtualNetworkGatewayConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualNetworkGatewayConnectionsClientWithBaseURI creates an instance of
// the VirtualNetworkGatewayConnectionsClient client.
func NewVirtualNetworkGatewayConnectionsClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkGatewayConnectionsClient {
return VirtualNetworkGatewayConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)}
return VirtualNetworkGatewayConnectionsClient{New(subscriptionID)}
}
// CreateOrUpdate the Put VirtualNetworkGatewayConnection operation
@ -81,23 +74,23 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdate(resourceGrou
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdatePreparer(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualNetworkGatewayConnectionName": url.QueryEscape(virtualNetworkGatewayConnectionName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -152,22 +145,21 @@ func (client VirtualNetworkGatewayConnectionsClient) Delete(resourceGroupName st
// DeletePreparer prepares the Delete request.
func (client VirtualNetworkGatewayConnectionsClient) DeletePreparer(resourceGroupName string, virtualNetworkGatewayConnectionName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualNetworkGatewayConnectionName": url.QueryEscape(virtualNetworkGatewayConnectionName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -220,22 +212,21 @@ func (client VirtualNetworkGatewayConnectionsClient) Get(resourceGroupName strin
// GetPreparer prepares the Get request.
func (client VirtualNetworkGatewayConnectionsClient) GetPreparer(resourceGroupName string, virtualNetworkGatewayConnectionName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualNetworkGatewayConnectionName": url.QueryEscape(virtualNetworkGatewayConnectionName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -287,22 +278,21 @@ func (client VirtualNetworkGatewayConnectionsClient) GetSharedKey(resourceGroupN
// GetSharedKeyPreparer prepares the GetSharedKey request.
func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyPreparer(resourceGroupName string, connectionSharedKeyName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"connectionSharedKeyName": url.QueryEscape(connectionSharedKeyName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"connectionSharedKeyName": autorest.Encode("path", connectionSharedKeyName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{connectionSharedKeyName}/sharedkey"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{connectionSharedKeyName}/sharedkey", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSharedKeySender sends the GetSharedKey request. The method will close the
@ -351,21 +341,20 @@ func (client VirtualNetworkGatewayConnectionsClient) List(resourceGroupName stri
// ListPreparer prepares the List request.
func (client VirtualNetworkGatewayConnectionsClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -446,23 +435,23 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(resourceGrou
// ResetSharedKeyPreparer prepares the ResetSharedKey request.
func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyPreparer(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualNetworkGatewayConnectionName": url.QueryEscape(virtualNetworkGatewayConnectionName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey/reset", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// ResetSharedKeySender sends the ResetSharedKey request. The method will close the
@ -520,23 +509,23 @@ func (client VirtualNetworkGatewayConnectionsClient) SetSharedKey(resourceGroupN
// SetSharedKeyPreparer prepares the SetSharedKey request.
func (client VirtualNetworkGatewayConnectionsClient) SetSharedKeyPreparer(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualNetworkGatewayConnectionName": url.QueryEscape(virtualNetworkGatewayConnectionName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// SetSharedKeySender sends the SetSharedKey request. The method will close the

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// VirtualNetworkGatewaysClient is the the Microsoft Azure Network management
@ -37,13 +36,7 @@ type VirtualNetworkGatewaysClient struct {
// NewVirtualNetworkGatewaysClient creates an instance of the
// VirtualNetworkGatewaysClient client.
func NewVirtualNetworkGatewaysClient(subscriptionID string) VirtualNetworkGatewaysClient {
return NewVirtualNetworkGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualNetworkGatewaysClientWithBaseURI creates an instance of the
// VirtualNetworkGatewaysClient client.
func NewVirtualNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworkGatewaysClient {
return VirtualNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)}
return VirtualNetworkGatewaysClient{New(subscriptionID)}
}
// CreateOrUpdate the Put VirtualNetworkGateway operation creates/updates a
@ -79,23 +72,23 @@ func (client VirtualNetworkGatewaysClient) CreateOrUpdate(resourceGroupName stri
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client VirtualNetworkGatewaysClient) CreateOrUpdatePreparer(resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualNetworkGatewayName": url.QueryEscape(virtualNetworkGatewayName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworkgateways/{virtualNetworkGatewayName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -149,22 +142,21 @@ func (client VirtualNetworkGatewaysClient) Delete(resourceGroupName string, virt
// DeletePreparer prepares the Delete request.
func (client VirtualNetworkGatewaysClient) DeletePreparer(resourceGroupName string, virtualNetworkGatewayName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualNetworkGatewayName": url.QueryEscape(virtualNetworkGatewayName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworkgateways/{virtualNetworkGatewayName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -218,23 +210,23 @@ func (client VirtualNetworkGatewaysClient) Generatevpnclientpackage(resourceGrou
// GeneratevpnclientpackagePreparer prepares the Generatevpnclientpackage request.
func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackagePreparer(resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualNetworkGatewayName": url.QueryEscape(virtualNetworkGatewayName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworkgateways/{virtualNetworkGatewayName}/generatevpnclientpackage"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/generatevpnclientpackage", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GeneratevpnclientpackageSender sends the Generatevpnclientpackage request. The method will close the
@ -284,22 +276,21 @@ func (client VirtualNetworkGatewaysClient) Get(resourceGroupName string, virtual
// GetPreparer prepares the Get request.
func (client VirtualNetworkGatewaysClient) GetPreparer(resourceGroupName string, virtualNetworkGatewayName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualNetworkGatewayName": url.QueryEscape(virtualNetworkGatewayName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworkgateways/{virtualNetworkGatewayName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -348,21 +339,20 @@ func (client VirtualNetworkGatewaysClient) List(resourceGroupName string) (resul
// ListPreparer prepares the List request.
func (client VirtualNetworkGatewaysClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -441,23 +431,23 @@ func (client VirtualNetworkGatewaysClient) Reset(resourceGroupName string, virtu
// ResetPreparer prepares the Reset request.
func (client VirtualNetworkGatewaysClient) ResetPreparer(resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualNetworkGatewayName": url.QueryEscape(virtualNetworkGatewayName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkGatewayName": autorest.Encode("path", virtualNetworkGatewayName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworkgateways/{virtualNetworkGatewayName}/reset"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// ResetSender sends the Reset request. The method will close the

View File

@ -14,7 +14,7 @@ package network
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// VirtualNetworksClient is the the Microsoft Azure Network management API
@ -37,13 +36,7 @@ type VirtualNetworksClient struct {
// NewVirtualNetworksClient creates an instance of the VirtualNetworksClient
// client.
func NewVirtualNetworksClient(subscriptionID string) VirtualNetworksClient {
return NewVirtualNetworksClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewVirtualNetworksClientWithBaseURI creates an instance of the
// VirtualNetworksClient client.
func NewVirtualNetworksClientWithBaseURI(baseURI string, subscriptionID string) VirtualNetworksClient {
return VirtualNetworksClient{NewWithBaseURI(baseURI, subscriptionID)}
return VirtualNetworksClient{New(subscriptionID)}
}
// CreateOrUpdate the Put VirtualNetwork operation creates/updates a virtual
@ -78,23 +71,23 @@ func (client VirtualNetworksClient) CreateOrUpdate(resourceGroupName string, vir
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client VirtualNetworksClient) CreateOrUpdatePreparer(resourceGroupName string, virtualNetworkName string, parameters VirtualNetwork, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualNetworkName": url.QueryEscape(virtualNetworkName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkName": autorest.Encode("path", virtualNetworkName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -147,22 +140,21 @@ func (client VirtualNetworksClient) Delete(resourceGroupName string, virtualNetw
// DeletePreparer prepares the Delete request.
func (client VirtualNetworksClient) DeletePreparer(resourceGroupName string, virtualNetworkName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualNetworkName": url.QueryEscape(virtualNetworkName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkName": autorest.Encode("path", virtualNetworkName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -213,25 +205,24 @@ func (client VirtualNetworksClient) Get(resourceGroupName string, virtualNetwork
// GetPreparer prepares the Get request.
func (client VirtualNetworksClient) GetPreparer(resourceGroupName string, virtualNetworkName string, expand string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"virtualNetworkName": url.QueryEscape(virtualNetworkName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkName": autorest.Encode("path", virtualNetworkName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if len(expand) > 0 {
queryParameters["$expand"] = expand
queryParameters["$expand"] = autorest.Encode("query", expand)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks/{virtualNetworkName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -280,21 +271,20 @@ func (client VirtualNetworksClient) List(resourceGroupName string) (result Virtu
// ListPreparer prepares the List request.
func (client VirtualNetworksClient) ListPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualnetworks"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -365,20 +355,19 @@ func (client VirtualNetworksClient) ListAll() (result VirtualNetworkListResult,
// ListAllPreparer prepares the ListAll request.
func (client VirtualNetworksClient) ListAllPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualnetworks"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/virtualNetworks", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListAllSender sends the ListAll request. The method will close the

View File

@ -1,5 +1,5 @@
// Package resources implements the Azure ARM Resources service API version
// 2015-11-01.
// 2016-02-01.
//
package resources
@ -17,7 +17,7 @@ package resources
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -25,12 +25,11 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
const (
// APIVersion is the version of the Resources
APIVersion = "2015-11-01"
APIVersion = "2016-02-01"
// DefaultBaseURI is the default URI used for the service Resources
DefaultBaseURI = "https://management.azure.com"
@ -40,19 +39,16 @@ const (
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,
BaseURI: DefaultBaseURI,
APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}
}
@ -63,8 +59,8 @@ func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
// insensitive. resourceProviderNamespace is resource identity.
// parentResourcePath is resource identity. resourceType is resource
// identity. resourceName is resource identity.
func (client ManagementClient) CheckExistence(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (result autorest.Response, err error) {
req, err := client.CheckExistencePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion)
func (client ManagementClient) CheckExistence(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) {
req, err := client.CheckExistencePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.ManagementClient", "CheckExistence", nil, "Failure preparing request")
}
@ -84,27 +80,26 @@ func (client ManagementClient) CheckExistence(resourceGroupName string, resource
}
// CheckExistencePreparer prepares the CheckExistence request.
func (client ManagementClient) CheckExistencePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (*http.Request, error) {
func (client ManagementClient) CheckExistencePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"parentResourcePath": parentResourcePath,
"resourceGroupName": url.QueryEscape(resourceGroupName),
"resourceName": url.QueryEscape(resourceName),
"resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"resourceName": autorest.Encode("path", resourceName),
"resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
"resourceType": resourceType,
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsHead(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CheckExistenceSender sends the CheckExistence request. The method will close the
@ -132,8 +127,8 @@ func (client ManagementClient) CheckExistenceResponder(resp *http.Response) (res
// parentResourcePath is resource identity. resourceType is resource
// identity. resourceName is resource identity. parameters is create or
// update resource parameters.
func (client ManagementClient) CreateOrUpdate(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, parameters GenericResource) (result GenericResource, err error) {
req, err := client.CreateOrUpdatePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters)
func (client ManagementClient) CreateOrUpdate(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result GenericResource, err error) {
req, err := client.CreateOrUpdatePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.ManagementClient", "CreateOrUpdate", nil, "Failure preparing request")
}
@ -153,28 +148,28 @@ func (client ManagementClient) CreateOrUpdate(resourceGroupName string, resource
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client ManagementClient) CreateOrUpdatePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, parameters GenericResource) (*http.Request, error) {
func (client ManagementClient) CreateOrUpdatePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) {
pathParameters := map[string]interface{}{
"parentResourcePath": parentResourcePath,
"resourceGroupName": url.QueryEscape(resourceGroupName),
"resourceName": url.QueryEscape(resourceName),
"resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"resourceName": autorest.Encode("path", resourceName),
"resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
"resourceType": resourceType,
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -202,8 +197,8 @@ func (client ManagementClient) CreateOrUpdateResponder(resp *http.Response) (res
// insensitive. resourceProviderNamespace is resource identity.
// parentResourcePath is resource identity. resourceType is resource
// identity. resourceName is resource identity.
func (client ManagementClient) Delete(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion)
func (client ManagementClient) Delete(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.ManagementClient", "Delete", nil, "Failure preparing request")
}
@ -223,27 +218,26 @@ func (client ManagementClient) Delete(resourceGroupName string, resourceProvider
}
// DeletePreparer prepares the Delete request.
func (client ManagementClient) DeletePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (*http.Request, error) {
func (client ManagementClient) DeletePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"parentResourcePath": parentResourcePath,
"resourceGroupName": url.QueryEscape(resourceGroupName),
"resourceName": url.QueryEscape(resourceName),
"resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"resourceName": autorest.Encode("path", resourceName),
"resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
"resourceType": resourceType,
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// DeleteSender sends the Delete request. The method will close the
@ -270,8 +264,8 @@ func (client ManagementClient) DeleteResponder(resp *http.Response) (result auto
// insensitive. resourceProviderNamespace is resource identity.
// parentResourcePath is resource identity. resourceType is resource
// identity. resourceName is resource identity.
func (client ManagementClient) Get(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (result GenericResource, err error) {
req, err := client.GetPreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion)
func (client ManagementClient) Get(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result GenericResource, err error) {
req, err := client.GetPreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.ManagementClient", "Get", nil, "Failure preparing request")
}
@ -291,27 +285,26 @@ func (client ManagementClient) Get(resourceGroupName string, resourceProviderNam
}
// GetPreparer prepares the Get request.
func (client ManagementClient) GetPreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (*http.Request, error) {
func (client ManagementClient) GetPreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"parentResourcePath": parentResourcePath,
"resourceGroupName": url.QueryEscape(resourceGroupName),
"resourceName": url.QueryEscape(resourceName),
"resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"resourceName": autorest.Encode("path", resourceName),
"resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
"resourceType": resourceType,
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -326,7 +319,7 @@ func (client ManagementClient) GetResponder(resp *http.Response) (result Generic
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@ -360,26 +353,25 @@ 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) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = filter
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
queryParameters["$top"] = top
queryParameters["$top"] = autorest.Encode("query", *top)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resources"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resources", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -425,8 +417,8 @@ func (client ManagementClient) ListNextResults(lastResults ResourceListResult) (
return
}
// MoveResources begin moving resources.To determine whether the operation has
// finished processing the request, call GetLongRunningOperationStatus. This
// MoveResources move resources from one resource group to another. The
// resources being moved should all be in the same 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 HTTP requests.
@ -456,22 +448,22 @@ func (client ManagementClient) MoveResources(sourceResourceGroupName string, par
// MoveResourcesPreparer prepares the MoveResources request.
func (client ManagementClient) MoveResourcesPreparer(sourceResourceGroupName string, parameters MoveInfo, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"sourceResourceGroupName": url.QueryEscape(sourceResourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"sourceResourceGroupName": autorest.Encode("path", sourceResourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// MoveResourcesSender sends the MoveResources request. The method will close the

View File

@ -14,7 +14,7 @@ package resources
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// DeploymentOperationsClient is the client for the DeploymentOperations
@ -34,13 +33,7 @@ type DeploymentOperationsClient struct {
// NewDeploymentOperationsClient creates an instance of the
// DeploymentOperationsClient client.
func NewDeploymentOperationsClient(subscriptionID string) DeploymentOperationsClient {
return NewDeploymentOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewDeploymentOperationsClientWithBaseURI creates an instance of the
// DeploymentOperationsClient client.
func NewDeploymentOperationsClientWithBaseURI(baseURI string, subscriptionID string) DeploymentOperationsClient {
return DeploymentOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
return DeploymentOperationsClient{New(subscriptionID)}
}
// Get get a list of deployments operations.
@ -71,23 +64,22 @@ func (client DeploymentOperationsClient) Get(resourceGroupName string, deploymen
// GetPreparer prepares the Get request.
func (client DeploymentOperationsClient) GetPreparer(resourceGroupName string, deploymentName string, operationID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"deploymentName": url.QueryEscape(deploymentName),
"operationId": url.QueryEscape(operationID),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"deploymentName": autorest.Encode("path", deploymentName),
"operationId": autorest.Encode("path", operationID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations/{operationId}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -137,25 +129,24 @@ func (client DeploymentOperationsClient) List(resourceGroupName string, deployme
// ListPreparer prepares the List request.
func (client DeploymentOperationsClient) ListPreparer(resourceGroupName string, deploymentName string, top *int32) (*http.Request, error) {
pathParameters := map[string]interface{}{
"deploymentName": url.QueryEscape(deploymentName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"deploymentName": autorest.Encode("path", deploymentName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if top != nil {
queryParameters["$top"] = top
queryParameters["$top"] = autorest.Encode("query", *top)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/deployments/{deploymentName}/operations", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the

View File

@ -14,7 +14,7 @@ package resources
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// DeploymentsClient is the client for the Deployments methods of the
@ -33,13 +32,7 @@ type DeploymentsClient struct {
// NewDeploymentsClient creates an instance of the DeploymentsClient client.
func NewDeploymentsClient(subscriptionID string) DeploymentsClient {
return NewDeploymentsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewDeploymentsClientWithBaseURI creates an instance of the
// DeploymentsClient client.
func NewDeploymentsClientWithBaseURI(baseURI string, subscriptionID string) DeploymentsClient {
return DeploymentsClient{NewWithBaseURI(baseURI, subscriptionID)}
return DeploymentsClient{New(subscriptionID)}
}
// Cancel cancel a currently running template deployment.
@ -69,22 +62,21 @@ func (client DeploymentsClient) Cancel(resourceGroupName string, deploymentName
// CancelPreparer prepares the Cancel request.
func (client DeploymentsClient) CancelPreparer(resourceGroupName string, deploymentName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"deploymentName": url.QueryEscape(deploymentName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"deploymentName": autorest.Encode("path", deploymentName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/cancel", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CancelSender sends the Cancel request. The method will close the
@ -132,22 +124,21 @@ func (client DeploymentsClient) CheckExistence(resourceGroupName string, deploym
// CheckExistencePreparer prepares the CheckExistence request.
func (client DeploymentsClient) CheckExistencePreparer(resourceGroupName string, deploymentName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"deploymentName": url.QueryEscape(deploymentName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"deploymentName": autorest.Encode("path", deploymentName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsHead(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CheckExistenceSender sends the CheckExistence request. The method will close the
@ -199,23 +190,23 @@ func (client DeploymentsClient) CreateOrUpdate(resourceGroupName string, deploym
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client DeploymentsClient) CreateOrUpdatePreparer(resourceGroupName string, deploymentName string, parameters Deployment, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"deploymentName": url.QueryEscape(deploymentName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"deploymentName": autorest.Encode("path", deploymentName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -238,11 +229,9 @@ func (client DeploymentsClient) CreateOrUpdateResponder(resp *http.Response) (re
return
}
// Delete begin deleting deployment.To determine whether the operation has
// finished processing the request, call GetLongRunningOperationStatus. 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.
// Delete delete deployment. 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. The name is case
// insensitive. deploymentName is the name of the deployment to be deleted.
@ -269,22 +258,21 @@ func (client DeploymentsClient) Delete(resourceGroupName string, deploymentName
// DeletePreparer prepares the Delete request.
func (client DeploymentsClient) DeletePreparer(resourceGroupName string, deploymentName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"deploymentName": url.QueryEscape(deploymentName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"deploymentName": autorest.Encode("path", deploymentName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -307,6 +295,69 @@ func (client DeploymentsClient) DeleteResponder(resp *http.Response) (result aut
return
}
// ExportTemplate exports a deployment template.
//
// resourceGroupName is the name of the resource group. The name is case
// insensitive. deploymentName is the name of the deployment.
func (client DeploymentsClient) ExportTemplate(resourceGroupName string, deploymentName string) (result DeploymentExportResult, err error) {
req, err := client.ExportTemplatePreparer(resourceGroupName, deploymentName)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ExportTemplate", nil, "Failure preparing request")
}
resp, err := client.ExportTemplateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ExportTemplate", resp, "Failure sending request")
}
result, err = client.ExportTemplateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.DeploymentsClient", "ExportTemplate", resp, "Failure responding to request")
}
return
}
// ExportTemplatePreparer prepares the ExportTemplate request.
func (client DeploymentsClient) ExportTemplatePreparer(resourceGroupName string, deploymentName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"deploymentName": autorest.Encode("path", deploymentName),
"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.Resources/deployments/{deploymentName}/exportTemplate", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ExportTemplateSender sends the ExportTemplate request. The method will close the
// http.Response Body if it receives an error.
func (client DeploymentsClient) ExportTemplateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// ExportTemplateResponder handles the response to the ExportTemplate request. The method always
// closes the http.Response Body.
func (client DeploymentsClient) ExportTemplateResponder(resp *http.Response) (result DeploymentExportResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Get get a deployment.
//
// resourceGroupName is the name of the resource group to get. The name is
@ -334,22 +385,21 @@ func (client DeploymentsClient) Get(resourceGroupName string, deploymentName str
// GetPreparer prepares the Get request.
func (client DeploymentsClient) GetPreparer(resourceGroupName string, deploymentName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"deploymentName": url.QueryEscape(deploymentName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"deploymentName": autorest.Encode("path", deploymentName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -399,27 +449,26 @@ func (client DeploymentsClient) List(resourceGroupName string, filter string, to
// ListPreparer prepares the List request.
func (client DeploymentsClient) ListPreparer(resourceGroupName string, filter string, top *int32) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = filter
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
queryParameters["$top"] = top
queryParameters["$top"] = autorest.Encode("query", *top)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -493,23 +542,23 @@ func (client DeploymentsClient) Validate(resourceGroupName string, deploymentNam
// ValidatePreparer prepares the Validate request.
func (client DeploymentsClient) ValidatePreparer(resourceGroupName string, deploymentName string, parameters Deployment) (*http.Request, error) {
pathParameters := map[string]interface{}{
"deploymentName": url.QueryEscape(deploymentName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"deploymentName": autorest.Encode("path", deploymentName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Resources/deployments/{deploymentName}/validate", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ValidateSender sends the Validate request. The method will close the

View File

@ -14,7 +14,7 @@ package resources
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// GroupsClient is the client for the Groups methods of the Resources service.
@ -32,12 +31,7 @@ type GroupsClient struct {
// NewGroupsClient creates an instance of the GroupsClient client.
func NewGroupsClient(subscriptionID string) GroupsClient {
return NewGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewGroupsClientWithBaseURI creates an instance of the GroupsClient client.
func NewGroupsClientWithBaseURI(baseURI string, subscriptionID string) GroupsClient {
return GroupsClient{NewWithBaseURI(baseURI, subscriptionID)}
return GroupsClient{New(subscriptionID)}
}
// CheckExistence checks whether resource group exists.
@ -67,21 +61,20 @@ func (client GroupsClient) CheckExistence(resourceGroupName string) (result auto
// CheckExistencePreparer prepares the CheckExistence request.
func (client GroupsClient) CheckExistencePreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsHead(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CheckExistenceSender sends the CheckExistence request. The method will close the
@ -130,22 +123,22 @@ func (client GroupsClient) CreateOrUpdate(resourceGroupName string, parameters R
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client GroupsClient) CreateOrUpdatePreparer(resourceGroupName string, parameters ResourceGroup) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -167,11 +160,9 @@ func (client GroupsClient) CreateOrUpdateResponder(resp *http.Response) (result
return
}
// Delete begin deleting resource group.To determine whether the operation has
// finished processing the request, call GetLongRunningOperationStatus. 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.
// Delete delete 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 HTTP requests.
//
// resourceGroupName is the name of the resource group to be deleted. The name
// is case insensitive.
@ -198,21 +189,20 @@ func (client GroupsClient) Delete(resourceGroupName string, cancel <-chan struct
// DeletePreparer prepares the Delete request.
func (client GroupsClient) DeletePreparer(resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DeleteSender sends the Delete request. The method will close the
@ -235,6 +225,71 @@ func (client GroupsClient) DeleteResponder(resp *http.Response) (result autorest
return
}
// ExportTemplate captures the specified resource group as a template.
//
// resourceGroupName is the name of the resource group to be created or
// updated. parameters is parameters supplied to the export template resource
// group operation.
func (client GroupsClient) ExportTemplate(resourceGroupName string, parameters ExportTemplateRequest) (result ResourceGroupExportResult, err error) {
req, err := client.ExportTemplatePreparer(resourceGroupName, parameters)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "ExportTemplate", nil, "Failure preparing request")
}
resp, err := client.ExportTemplateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "resources.GroupsClient", "ExportTemplate", resp, "Failure sending request")
}
result, err = client.ExportTemplateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.GroupsClient", "ExportTemplate", resp, "Failure responding to request")
}
return
}
// ExportTemplatePreparer prepares the ExportTemplate request.
func (client GroupsClient) ExportTemplatePreparer(resourceGroupName string, parameters ExportTemplateRequest) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/exportTemplate", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ExportTemplateSender sends the ExportTemplate request. The method will close the
// http.Response Body if it receives an error.
func (client GroupsClient) ExportTemplateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// ExportTemplateResponder handles the response to the ExportTemplate request. The method always
// closes the http.Response Body.
func (client GroupsClient) ExportTemplateResponder(resp *http.Response) (result ResourceGroupExportResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Get get a resource group.
//
// resourceGroupName is the name of the resource group to get. The name is
@ -262,21 +317,20 @@ func (client GroupsClient) Get(resourceGroupName string) (result ResourceGroup,
// GetPreparer prepares the Get request.
func (client GroupsClient) GetPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -325,26 +379,25 @@ func (client GroupsClient) List(filter string, top *int32) (result ResourceGroup
// ListPreparer prepares the List request.
func (client GroupsClient) ListPreparer(filter string, top *int32) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = filter
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
queryParameters["$top"] = top
queryParameters["$top"] = autorest.Encode("query", *top)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -418,27 +471,26 @@ 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) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = filter
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
queryParameters["$top"] = top
queryParameters["$top"] = autorest.Encode("query", *top)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/resources", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListResourcesSender sends the ListResources request. The method will close the
@ -515,22 +567,22 @@ func (client GroupsClient) Patch(resourceGroupName string, parameters ResourceGr
// PatchPreparer prepares the Patch request.
func (client GroupsClient) PatchPreparer(resourceGroupName string, parameters ResourceGroup) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// PatchSender sends the Patch request. The method will close the

View File

@ -14,7 +14,7 @@ package resources
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -35,6 +35,15 @@ const (
Incremental DeploymentMode = "Incremental"
)
// ResourceIdentityType enumerates the values for resource identity type.
type ResourceIdentityType string
const (
// SystemAssigned specifies the system assigned state for resource
// identity type.
SystemAssigned ResourceIdentityType = "SystemAssigned"
)
// BasicDependency is deployment dependency information.
type BasicDependency struct {
ID *string `json:"id,omitempty"`
@ -42,6 +51,11 @@ type BasicDependency struct {
ResourceName *string `json:"resourceName,omitempty"`
}
// DebugSetting is
type DebugSetting struct {
DetailLevel *string `json:"detailLevel,omitempty"`
}
// Dependency is deployment dependency information.
type Dependency struct {
DependsOn *[]BasicDependency `json:"dependsOn,omitempty"`
@ -55,6 +69,12 @@ type Deployment struct {
Properties *DeploymentProperties `json:"properties,omitempty"`
}
// DeploymentExportResult is
type DeploymentExportResult struct {
autorest.Response `json:"-"`
Template *map[string]interface{} `json:"template,omitempty"`
}
// DeploymentExtended is deployment information.
type DeploymentExtended struct {
autorest.Response `json:"-"`
@ -99,9 +119,12 @@ type DeploymentOperation struct {
type DeploymentOperationProperties struct {
ProvisioningState *string `json:"provisioningState,omitempty"`
Timestamp *date.Time `json:"timestamp,omitempty"`
ServiceRequestID *string `json:"serviceRequestId,omitempty"`
StatusCode *string `json:"statusCode,omitempty"`
StatusMessage *map[string]interface{} `json:"statusMessage,omitempty"`
TargetResource *TargetResource `json:"targetResource,omitempty"`
Request *HTTPMessage `json:"request,omitempty"`
Response *HTTPMessage `json:"response,omitempty"`
}
// DeploymentOperationsListResult is list of deployment operations.
@ -130,6 +153,7 @@ type DeploymentProperties struct {
Parameters *map[string]interface{} `json:"parameters,omitempty"`
ParametersLink *ParametersLink `json:"parametersLink,omitempty"`
Mode DeploymentMode `json:"mode,omitempty"`
DebugSetting *DebugSetting `json:"debugSetting,omitempty"`
}
// DeploymentPropertiesExtended is deployment properties with additional
@ -146,6 +170,7 @@ type DeploymentPropertiesExtended struct {
Parameters *map[string]interface{} `json:"parameters,omitempty"`
ParametersLink *ParametersLink `json:"parametersLink,omitempty"`
Mode DeploymentMode `json:"mode,omitempty"`
DebugSetting *DebugSetting `json:"debugSetting,omitempty"`
}
// DeploymentValidateResult is information from validate template deployment
@ -156,6 +181,12 @@ type DeploymentValidateResult struct {
Properties *DeploymentPropertiesExtended `json:"properties,omitempty"`
}
// ExportTemplateRequest is export resource group template request parameters.
type ExportTemplateRequest struct {
Resources *[]string `json:"resources,omitempty"`
Options *string `json:"options,omitempty"`
}
// GenericResource is resource information.
type GenericResource struct {
autorest.Response `json:"-"`
@ -166,6 +197,10 @@ type GenericResource struct {
Tags *map[string]*string `json:"tags,omitempty"`
Plan *Plan `json:"plan,omitempty"`
Properties *map[string]interface{} `json:"properties,omitempty"`
Kind *string `json:"kind,omitempty"`
ManagedBy *string `json:"managedBy,omitempty"`
Sku *Sku `json:"sku,omitempty"`
Identity *Identity `json:"identity,omitempty"`
}
// GenericResourceFilter is resource filter.
@ -173,6 +208,19 @@ 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
type HTTPMessage struct {
Content *map[string]interface{} `json:"content,omitempty"`
}
// Identity is identity for the resource.
type Identity struct {
PrincipalID *string `json:"principalId,omitempty"`
TenantID *string `json:"tenantId,omitempty"`
Type ResourceIdentityType `json:"type,omitempty"`
}
// MoveInfo is parameters of move resources.
@ -196,53 +244,6 @@ type Plan struct {
PromotionCode *string `json:"promotionCode,omitempty"`
}
// PolicyAssignment is policy assignment.
type PolicyAssignment struct {
autorest.Response `json:"-"`
Properties *PolicyAssignmentProperties `json:"properties,omitempty"`
Name *string `json:"name,omitempty"`
}
// PolicyAssignmentListResult is policy assignment list operation result.
type PolicyAssignmentListResult struct {
autorest.Response `json:"-"`
Value *[]PolicyAssignment `json:"value,omitempty"`
NextLink *string `json:"nextLink,omitempty"`
}
// PolicyAssignmentListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client PolicyAssignmentListResult) PolicyAssignmentListResultPreparer() (*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)))
}
// PolicyAssignmentProperties is policy Assignment properties.
type PolicyAssignmentProperties struct {
Scope *string `json:"scope,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
PolicyDefinitionID *string `json:"policyDefinitionId,omitempty"`
}
// PolicyDefinition is policy definition.
type PolicyDefinition struct {
autorest.Response `json:"-"`
Properties *PolicyDefinitionProperties `json:"properties,omitempty"`
Name *string `json:"name,omitempty"`
}
// PolicyDefinitionProperties is policy definition properties.
type PolicyDefinitionProperties struct {
Description *string `json:"description,omitempty"`
DisplayName *string `json:"displayName,omitempty"`
PolicyRule *map[string]interface{} `json:"policyRule,omitempty"`
}
// Provider is resource provider information.
type Provider struct {
autorest.Response `json:"-"`
@ -298,6 +299,13 @@ type ResourceGroup struct {
Tags *map[string]*string `json:"tags,omitempty"`
}
// ResourceGroupExportResult is
type ResourceGroupExportResult struct {
autorest.Response `json:"-"`
Template *map[string]interface{} `json:"template,omitempty"`
Error *ResourceManagementErrorWithDetails `json:"error,omitempty"`
}
// ResourceGroupFilter is resource group filter.
type ResourceGroupFilter struct {
TagName *string `json:"tagName,omitempty"`
@ -347,46 +355,12 @@ func (client ResourceListResult) ResourceListResultPreparer() (*http.Request, er
autorest.WithBaseURL(to.String(client.NextLink)))
}
// ResourceManagementError is
type ResourceManagementError struct {
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
Target *string `json:"target,omitempty"`
}
// ResourceManagementErrorWithDetails is
type ResourceManagementErrorWithDetails struct {
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
Target *string `json:"target,omitempty"`
Details *[]ResourceManagementError `json:"details,omitempty"`
}
// ResourceProviderOperationDefinition is resource provider operation
// information.
type ResourceProviderOperationDefinition struct {
Name *string `json:"name,omitempty"`
Display *ResourceProviderOperationDisplayProperties `json:"display,omitempty"`
}
// ResourceProviderOperationDetailListResult is list of resource provider
// operations.
type ResourceProviderOperationDetailListResult struct {
autorest.Response `json:"-"`
Value *[]ResourceProviderOperationDefinition `json:"value,omitempty"`
NextLink *string `json:",omitempty"`
}
// ResourceProviderOperationDetailListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client ResourceProviderOperationDetailListResult) ResourceProviderOperationDetailListResultPreparer() (*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)))
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
Target *string `json:"target,omitempty"`
Details *[]ResourceManagementErrorWithDetails `json:"details,omitempty"`
}
// ResourceProviderOperationDisplayProperties is resource provider operation's
@ -399,6 +373,16 @@ type ResourceProviderOperationDisplayProperties struct {
Description *string `json:"description,omitempty"`
}
// Sku is sku for the resource.
type Sku struct {
Name *string `json:"name,omitempty"`
Tier *string `json:"tier,omitempty"`
Size *string `json:"size,omitempty"`
Family *string `json:"family,omitempty"`
Model *string `json:"model,omitempty"`
Capacity *int32 `json:"capacity,omitempty"`
}
// SubResource is
type SubResource struct {
ID *string `json:"id,omitempty"`

View File

@ -1,786 +0,0 @@
package resources
// 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.14.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"
"net/url"
)
// PolicyAssignmentsClient is the client for the PolicyAssignments methods of
// the Resources service.
type PolicyAssignmentsClient struct {
ManagementClient
}
// NewPolicyAssignmentsClient creates an instance of the
// PolicyAssignmentsClient client.
func NewPolicyAssignmentsClient(subscriptionID string) PolicyAssignmentsClient {
return NewPolicyAssignmentsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewPolicyAssignmentsClientWithBaseURI creates an instance of the
// PolicyAssignmentsClient client.
func NewPolicyAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) PolicyAssignmentsClient {
return PolicyAssignmentsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// Create create policy assignment.
//
// scope is scope. policyAssignmentName is policy assignment name. parameters
// is policy assignment.
func (client PolicyAssignmentsClient) Create(scope string, policyAssignmentName string, parameters PolicyAssignment) (result PolicyAssignment, err error) {
req, err := client.CreatePreparer(scope, policyAssignmentName, parameters)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "Create", nil, "Failure preparing request")
}
resp, err := client.CreateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "Create", resp, "Failure sending request")
}
result, err = client.CreateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "Create", resp, "Failure responding to request")
}
return
}
// CreatePreparer prepares the Create request.
func (client PolicyAssignmentsClient) CreatePreparer(scope string, policyAssignmentName string, parameters PolicyAssignment) (*http.Request, error) {
pathParameters := map[string]interface{}{
"policyAssignmentName": url.QueryEscape(policyAssignmentName),
"scope": scope,
"subscriptionId": url.QueryEscape(client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}"),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
// CreateSender sends the Create request. The method will close the
// http.Response Body if it receives an error.
func (client PolicyAssignmentsClient) CreateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// CreateResponder handles the response to the Create request. The method always
// closes the http.Response Body.
func (client PolicyAssignmentsClient) CreateResponder(resp *http.Response) (result PolicyAssignment, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// CreateByID create policy assignment by Id.
//
// policyAssignmentID is policy assignment Id parameters is policy assignment.
func (client PolicyAssignmentsClient) CreateByID(policyAssignmentID string, parameters PolicyAssignment) (result PolicyAssignment, err error) {
req, err := client.CreateByIDPreparer(policyAssignmentID, parameters)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "CreateByID", nil, "Failure preparing request")
}
resp, err := client.CreateByIDSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "CreateByID", resp, "Failure sending request")
}
result, err = client.CreateByIDResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "CreateByID", resp, "Failure responding to request")
}
return
}
// CreateByIDPreparer prepares the CreateByID request.
func (client PolicyAssignmentsClient) CreateByIDPreparer(policyAssignmentID string, parameters PolicyAssignment) (*http.Request, error) {
pathParameters := map[string]interface{}{
"policyAssignmentId": policyAssignmentID,
"subscriptionId": url.QueryEscape(client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/{policyAssignmentId}"),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
// CreateByIDSender sends the CreateByID request. The method will close the
// http.Response Body if it receives an error.
func (client PolicyAssignmentsClient) CreateByIDSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// CreateByIDResponder handles the response to the CreateByID request. The method always
// closes the http.Response Body.
func (client PolicyAssignmentsClient) CreateByIDResponder(resp *http.Response) (result PolicyAssignment, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Delete delete policy assignment.
//
// scope is scope. policyAssignmentName is policy assignment name.
func (client PolicyAssignmentsClient) Delete(scope string, policyAssignmentName string) (result PolicyAssignment, err error) {
req, err := client.DeletePreparer(scope, policyAssignmentName)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
func (client PolicyAssignmentsClient) DeletePreparer(scope string, policyAssignmentName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"policyAssignmentName": url.QueryEscape(policyAssignmentName),
"scope": scope,
"subscriptionId": url.QueryEscape(client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client PolicyAssignmentsClient) DeleteSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client PolicyAssignmentsClient) DeleteResponder(resp *http.Response) (result PolicyAssignment, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// DeleteByID delete policy assignment.
//
// policyAssignmentID is policy assignment Id
func (client PolicyAssignmentsClient) DeleteByID(policyAssignmentID string) (result PolicyAssignment, err error) {
req, err := client.DeleteByIDPreparer(policyAssignmentID)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "DeleteByID", nil, "Failure preparing request")
}
resp, err := client.DeleteByIDSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "DeleteByID", resp, "Failure sending request")
}
result, err = client.DeleteByIDResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "DeleteByID", resp, "Failure responding to request")
}
return
}
// DeleteByIDPreparer prepares the DeleteByID request.
func (client PolicyAssignmentsClient) DeleteByIDPreparer(policyAssignmentID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"policyAssignmentId": policyAssignmentID,
"subscriptionId": url.QueryEscape(client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/{policyAssignmentId}"),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
// DeleteByIDSender sends the DeleteByID request. The method will close the
// http.Response Body if it receives an error.
func (client PolicyAssignmentsClient) DeleteByIDSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// DeleteByIDResponder handles the response to the DeleteByID request. The method always
// closes the http.Response Body.
func (client PolicyAssignmentsClient) DeleteByIDResponder(resp *http.Response) (result PolicyAssignment, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Get get single policy assignment.
//
// scope is scope. policyAssignmentName is policy assignment name.
func (client PolicyAssignmentsClient) Get(scope string, policyAssignmentName string) (result PolicyAssignment, err error) {
req, err := client.GetPreparer(scope, policyAssignmentName)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client PolicyAssignmentsClient) GetPreparer(scope string, policyAssignmentName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"policyAssignmentName": url.QueryEscape(policyAssignmentName),
"scope": scope,
"subscriptionId": url.QueryEscape(client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/{scope}/providers/Microsoft.Authorization/policyAssignments/{policyAssignmentName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client PolicyAssignmentsClient) 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 PolicyAssignmentsClient) GetResponder(resp *http.Response) (result PolicyAssignment, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// GetByID get single policy assignment.
//
// policyAssignmentID is policy assignment Id
func (client PolicyAssignmentsClient) GetByID(policyAssignmentID string) (result PolicyAssignment, err error) {
req, err := client.GetByIDPreparer(policyAssignmentID)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "GetByID", nil, "Failure preparing request")
}
resp, err := client.GetByIDSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "GetByID", resp, "Failure sending request")
}
result, err = client.GetByIDResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "GetByID", resp, "Failure responding to request")
}
return
}
// GetByIDPreparer prepares the GetByID request.
func (client PolicyAssignmentsClient) GetByIDPreparer(policyAssignmentID string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"policyAssignmentId": policyAssignmentID,
"subscriptionId": url.QueryEscape(client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/{policyAssignmentId}"),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
// GetByIDSender sends the GetByID request. The method will close the
// http.Response Body if it receives an error.
func (client PolicyAssignmentsClient) GetByIDSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// GetByIDResponder handles the response to the GetByID request. The method always
// closes the http.Response Body.
func (client PolicyAssignmentsClient) GetByIDResponder(resp *http.Response) (result PolicyAssignment, 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 gets policy assignments of the subscription.
//
// filter is the filter to apply on the operation.
func (client PolicyAssignmentsClient) List(filter string) (result PolicyAssignmentListResult, err error) {
req, err := client.ListPreparer(filter)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client PolicyAssignmentsClient) ListPreparer(filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = filter
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policyAssignments"),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client PolicyAssignmentsClient) 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 PolicyAssignmentsClient) ListResponder(resp *http.Response) (result PolicyAssignmentListResult, 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 PolicyAssignmentsClient) ListNextResults(lastResults PolicyAssignmentListResult) (result PolicyAssignmentListResult, err error) {
req, err := lastResults.PolicyAssignmentListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "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, "resources.PolicyAssignmentsClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "List", resp, "Failure responding to next results request request")
}
return
}
// ListForResource gets policy assignments of the resource.
//
// resourceGroupName is the name of the resource group.
// resourceProviderNamespace is the name of the resource provider.
// parentResourcePath is the parent resource path. resourceType is the
// resource type. resourceName is the resource name. filter is the filter to
// apply on the operation.
func (client PolicyAssignmentsClient) ListForResource(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (result PolicyAssignmentListResult, err error) {
req, err := client.ListForResourcePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, filter)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForResource", nil, "Failure preparing request")
}
resp, err := client.ListForResourceSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForResource", resp, "Failure sending request")
}
result, err = client.ListForResourceResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForResource", resp, "Failure responding to request")
}
return
}
// ListForResourcePreparer prepares the ListForResource request.
func (client PolicyAssignmentsClient) ListForResourcePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"parentResourcePath": url.QueryEscape(parentResourcePath),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"resourceName": url.QueryEscape(resourceName),
"resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
"resourceType": url.QueryEscape(resourceType),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = filter
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}providers/Microsoft.Authorization/policyAssignments"),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
// ListForResourceSender sends the ListForResource request. The method will close the
// http.Response Body if it receives an error.
func (client PolicyAssignmentsClient) ListForResourceSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// ListForResourceResponder handles the response to the ListForResource request. The method always
// closes the http.Response Body.
func (client PolicyAssignmentsClient) ListForResourceResponder(resp *http.Response) (result PolicyAssignmentListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListForResourceNextResults retrieves the next set of results, if any.
func (client PolicyAssignmentsClient) ListForResourceNextResults(lastResults PolicyAssignmentListResult) (result PolicyAssignmentListResult, err error) {
req, err := lastResults.PolicyAssignmentListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForResource", nil, "Failure preparing next results request request")
}
if req == nil {
return
}
resp, err := client.ListForResourceSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForResource", resp, "Failure sending next results request request")
}
result, err = client.ListForResourceResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForResource", resp, "Failure responding to next results request request")
}
return
}
// ListForResourceGroup gets policy assignments of the resource group.
//
// resourceGroupName is resource group name. filter is the filter to apply on
// the operation.
func (client PolicyAssignmentsClient) ListForResourceGroup(resourceGroupName string, filter string) (result PolicyAssignmentListResult, err error) {
req, err := client.ListForResourceGroupPreparer(resourceGroupName, filter)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForResourceGroup", nil, "Failure preparing request")
}
resp, err := client.ListForResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForResourceGroup", resp, "Failure sending request")
}
result, err = client.ListForResourceGroupResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForResourceGroup", resp, "Failure responding to request")
}
return
}
// ListForResourceGroupPreparer prepares the ListForResourceGroup request.
func (client PolicyAssignmentsClient) ListForResourceGroupPreparer(resourceGroupName string, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = filter
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Authorization/policyAssignments"),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
// ListForResourceGroupSender sends the ListForResourceGroup request. The method will close the
// http.Response Body if it receives an error.
func (client PolicyAssignmentsClient) ListForResourceGroupSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// ListForResourceGroupResponder handles the response to the ListForResourceGroup request. The method always
// closes the http.Response Body.
func (client PolicyAssignmentsClient) ListForResourceGroupResponder(resp *http.Response) (result PolicyAssignmentListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListForResourceGroupNextResults retrieves the next set of results, if any.
func (client PolicyAssignmentsClient) ListForResourceGroupNextResults(lastResults PolicyAssignmentListResult) (result PolicyAssignmentListResult, err error) {
req, err := lastResults.PolicyAssignmentListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForResourceGroup", nil, "Failure preparing next results request request")
}
if req == nil {
return
}
resp, err := client.ListForResourceGroupSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForResourceGroup", resp, "Failure sending next results request request")
}
result, err = client.ListForResourceGroupResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForResourceGroup", resp, "Failure responding to next results request request")
}
return
}
// ListForScope gets policy assignments of the scope.
//
// scope is scope. filter is the filter to apply on the operation.
func (client PolicyAssignmentsClient) ListForScope(scope string, filter string) (result PolicyAssignmentListResult, err error) {
req, err := client.ListForScopePreparer(scope, filter)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForScope", nil, "Failure preparing request")
}
resp, err := client.ListForScopeSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForScope", resp, "Failure sending request")
}
result, err = client.ListForScopeResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForScope", resp, "Failure responding to request")
}
return
}
// ListForScopePreparer prepares the ListForScope request.
func (client PolicyAssignmentsClient) ListForScopePreparer(scope string, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"scope": scope,
"subscriptionId": url.QueryEscape(client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = filter
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/{scope}/providers/Microsoft.Authorization/policyAssignments"),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
// ListForScopeSender sends the ListForScope request. The method will close the
// http.Response Body if it receives an error.
func (client PolicyAssignmentsClient) ListForScopeSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// ListForScopeResponder handles the response to the ListForScope request. The method always
// closes the http.Response Body.
func (client PolicyAssignmentsClient) ListForScopeResponder(resp *http.Response) (result PolicyAssignmentListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListForScopeNextResults retrieves the next set of results, if any.
func (client PolicyAssignmentsClient) ListForScopeNextResults(lastResults PolicyAssignmentListResult) (result PolicyAssignmentListResult, err error) {
req, err := lastResults.PolicyAssignmentListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForScope", nil, "Failure preparing next results request request")
}
if req == nil {
return
}
resp, err := client.ListForScopeSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForScope", resp, "Failure sending next results request request")
}
result, err = client.ListForScopeResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.PolicyAssignmentsClient", "ListForScope", resp, "Failure responding to next results request request")
}
return
}

View File

@ -1,231 +0,0 @@
package resources
// 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.14.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"
"net/url"
)
// PolicyDefinitionsClient is the client for the PolicyDefinitions methods of
// the Resources service.
type PolicyDefinitionsClient struct {
ManagementClient
}
// NewPolicyDefinitionsClient creates an instance of the
// PolicyDefinitionsClient client.
func NewPolicyDefinitionsClient(subscriptionID string) PolicyDefinitionsClient {
return NewPolicyDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewPolicyDefinitionsClientWithBaseURI creates an instance of the
// PolicyDefinitionsClient client.
func NewPolicyDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) PolicyDefinitionsClient {
return PolicyDefinitionsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// CreateOrUpdate create or update policy definition.
//
// policyDefinitionName is the policy definition name. parameters is the
// policy definition properties
func (client PolicyDefinitionsClient) CreateOrUpdate(policyDefinitionName string, parameters PolicyDefinition) (result PolicyDefinition, err error) {
req, err := client.CreateOrUpdatePreparer(policyDefinitionName, parameters)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.PolicyDefinitionsClient", "CreateOrUpdate", nil, "Failure preparing request")
}
resp, err := client.CreateOrUpdateSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "resources.PolicyDefinitionsClient", "CreateOrUpdate", resp, "Failure sending request")
}
result, err = client.CreateOrUpdateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.PolicyDefinitionsClient", "CreateOrUpdate", resp, "Failure responding to request")
}
return
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client PolicyDefinitionsClient) CreateOrUpdatePreparer(policyDefinitionName string, parameters PolicyDefinition) (*http.Request, error) {
pathParameters := map[string]interface{}{
"policyDefinitionName": url.QueryEscape(policyDefinitionName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policydefinitions/{policyDefinitionName}"),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
// http.Response Body if it receives an error.
func (client PolicyDefinitionsClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always
// closes the http.Response Body.
func (client PolicyDefinitionsClient) CreateOrUpdateResponder(resp *http.Response) (result PolicyDefinition, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// Delete deletes policy definition.
//
// policyDefinitionName is the policy definition name.
func (client PolicyDefinitionsClient) Delete(policyDefinitionName string) (result autorest.Response, err error) {
req, err := client.DeletePreparer(policyDefinitionName)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.PolicyDefinitionsClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil {
result.Response = resp
return result, autorest.NewErrorWithError(err, "resources.PolicyDefinitionsClient", "Delete", resp, "Failure sending request")
}
result, err = client.DeleteResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.PolicyDefinitionsClient", "Delete", resp, "Failure responding to request")
}
return
}
// DeletePreparer prepares the Delete request.
func (client PolicyDefinitionsClient) DeletePreparer(policyDefinitionName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"policyDefinitionName": url.QueryEscape(policyDefinitionName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policydefinitions/{policyDefinitionName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
// DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error.
func (client PolicyDefinitionsClient) DeleteSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body.
func (client PolicyDefinitionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByClosing())
result.Response = resp
return
}
// Get gets policy definition.
//
// policyDefinitionName is the policy definition name.
func (client PolicyDefinitionsClient) Get(policyDefinitionName string) (result PolicyDefinition, err error) {
req, err := client.GetPreparer(policyDefinitionName)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.PolicyDefinitionsClient", "Get", nil, "Failure preparing request")
}
resp, err := client.GetSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "resources.PolicyDefinitionsClient", "Get", resp, "Failure sending request")
}
result, err = client.GetResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.PolicyDefinitionsClient", "Get", resp, "Failure responding to request")
}
return
}
// GetPreparer prepares the Get request.
func (client PolicyDefinitionsClient) GetPreparer(policyDefinitionName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"policyDefinitionName": url.QueryEscape(policyDefinitionName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Authorization/policydefinitions/{policyDefinitionName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
// GetSender sends the Get request. The method will close the
// http.Response Body if it receives an error.
func (client PolicyDefinitionsClient) 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 PolicyDefinitionsClient) GetResponder(resp *http.Response) (result PolicyDefinition, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}

View File

@ -1,130 +0,0 @@
package resources
// 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.14.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"
"net/url"
)
// ProviderOperationDetailsClient is the client for the
// ProviderOperationDetails methods of the Resources service.
type ProviderOperationDetailsClient struct {
ManagementClient
}
// NewProviderOperationDetailsClient creates an instance of the
// ProviderOperationDetailsClient client.
func NewProviderOperationDetailsClient(subscriptionID string) ProviderOperationDetailsClient {
return NewProviderOperationDetailsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewProviderOperationDetailsClientWithBaseURI creates an instance of the
// ProviderOperationDetailsClient client.
func NewProviderOperationDetailsClientWithBaseURI(baseURI string, subscriptionID string) ProviderOperationDetailsClient {
return ProviderOperationDetailsClient{NewWithBaseURI(baseURI, subscriptionID)}
}
// List gets a list of resource providers.
//
// resourceProviderNamespace is resource identity.
func (client ProviderOperationDetailsClient) List(resourceProviderNamespace string, apiVersion string) (result ResourceProviderOperationDetailListResult, err error) {
req, err := client.ListPreparer(resourceProviderNamespace, apiVersion)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.ProviderOperationDetailsClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "resources.ProviderOperationDetailsClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.ProviderOperationDetailsClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client ProviderOperationDetailsClient) ListPreparer(resourceProviderNamespace string, apiVersion string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/providers/{resourceProviderNamespace}/operations"),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client ProviderOperationDetailsClient) 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 ProviderOperationDetailsClient) ListResponder(resp *http.Response) (result ResourceProviderOperationDetailListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListNextResults retrieves the next set of results, if any.
func (client ProviderOperationDetailsClient) ListNextResults(lastResults ResourceProviderOperationDetailListResult) (result ResourceProviderOperationDetailListResult, err error) {
req, err := lastResults.ResourceProviderOperationDetailListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.ProviderOperationDetailsClient", "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, "resources.ProviderOperationDetailsClient", "List", resp, "Failure sending next results request request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "resources.ProviderOperationDetailsClient", "List", resp, "Failure responding to next results request request")
}
return
}

View File

@ -14,7 +14,7 @@ package resources
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// ProvidersClient is the client for the Providers methods of the Resources
@ -33,13 +32,7 @@ type ProvidersClient struct {
// NewProvidersClient creates an instance of the ProvidersClient client.
func NewProvidersClient(subscriptionID string) ProvidersClient {
return NewProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewProvidersClientWithBaseURI creates an instance of the ProvidersClient
// client.
func NewProvidersClientWithBaseURI(baseURI string, subscriptionID string) ProvidersClient {
return ProvidersClient{NewWithBaseURI(baseURI, subscriptionID)}
return ProvidersClient{New(subscriptionID)}
}
// Get gets a resource provider.
@ -68,21 +61,20 @@ func (client ProvidersClient) Get(resourceProviderNamespace string) (result Prov
// GetPreparer prepares the Get request.
func (client ProvidersClient) GetPreparer(resourceProviderNamespace string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -130,23 +122,22 @@ func (client ProvidersClient) List(top *int32) (result ProviderListResult, err e
// ListPreparer prepares the List request.
func (client ProvidersClient) ListPreparer(top *int32) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if top != nil {
queryParameters["$top"] = top
queryParameters["$top"] = autorest.Encode("query", *top)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -218,21 +209,20 @@ func (client ProvidersClient) Register(resourceProviderNamespace string) (result
// RegisterPreparer prepares the Register request.
func (client ProvidersClient) RegisterPreparer(resourceProviderNamespace string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// RegisterSender sends the Register request. The method will close the
@ -280,21 +270,20 @@ func (client ProvidersClient) Unregister(resourceProviderNamespace string) (resu
// UnregisterPreparer prepares the Unregister request.
func (client ProvidersClient) UnregisterPreparer(resourceProviderNamespace string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/unregister", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// UnregisterSender sends the Unregister request. The method will close the

View File

@ -14,7 +14,7 @@ package resources
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// Client is the client for the Resources methods of the Resources service.
@ -32,12 +31,7 @@ type Client struct {
// NewClient creates an instance of the Client client.
func NewClient(subscriptionID string) Client {
return NewClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewClientWithBaseURI creates an instance of the Client client.
func NewClientWithBaseURI(baseURI string, subscriptionID string) Client {
return Client{NewWithBaseURI(baseURI, subscriptionID)}
return Client{New(subscriptionID)}
}
// CheckExistence checks whether resource exists.
@ -46,8 +40,8 @@ func NewClientWithBaseURI(baseURI string, subscriptionID string) Client {
// insensitive. resourceProviderNamespace is resource identity.
// parentResourcePath is resource identity. resourceType is resource
// identity. resourceName is resource identity.
func (client Client) CheckExistence(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (result autorest.Response, err error) {
req, err := client.CheckExistencePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion)
func (client Client) CheckExistence(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) {
req, err := client.CheckExistencePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.Client", "CheckExistence", nil, "Failure preparing request")
}
@ -67,27 +61,26 @@ func (client Client) CheckExistence(resourceGroupName string, resourceProviderNa
}
// CheckExistencePreparer prepares the CheckExistence request.
func (client Client) CheckExistencePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (*http.Request, error) {
func (client Client) CheckExistencePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"parentResourcePath": parentResourcePath,
"resourceGroupName": url.QueryEscape(resourceGroupName),
"resourceName": url.QueryEscape(resourceName),
"resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"resourceName": autorest.Encode("path", resourceName),
"resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
"resourceType": resourceType,
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsHead(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CheckExistenceSender sends the CheckExistence request. The method will close the
@ -115,8 +108,8 @@ func (client Client) CheckExistenceResponder(resp *http.Response) (result autore
// parentResourcePath is resource identity. resourceType is resource
// identity. resourceName is resource identity. parameters is create or
// update resource parameters.
func (client Client) CreateOrUpdate(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, parameters GenericResource) (result GenericResource, err error) {
req, err := client.CreateOrUpdatePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters)
func (client Client) CreateOrUpdate(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (result GenericResource, err error) {
req, err := client.CreateOrUpdatePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, parameters)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.Client", "CreateOrUpdate", nil, "Failure preparing request")
}
@ -136,28 +129,28 @@ func (client Client) CreateOrUpdate(resourceGroupName string, resourceProviderNa
}
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client Client) CreateOrUpdatePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string, parameters GenericResource) (*http.Request, error) {
func (client Client) CreateOrUpdatePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, parameters GenericResource) (*http.Request, error) {
pathParameters := map[string]interface{}{
"parentResourcePath": parentResourcePath,
"resourceGroupName": url.QueryEscape(resourceGroupName),
"resourceName": url.QueryEscape(resourceName),
"resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"resourceName": autorest.Encode("path", resourceName),
"resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
"resourceType": resourceType,
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -185,8 +178,8 @@ func (client Client) CreateOrUpdateResponder(resp *http.Response) (result Generi
// insensitive. resourceProviderNamespace is resource identity.
// parentResourcePath is resource identity. resourceType is resource
// identity. resourceName is resource identity.
func (client Client) Delete(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion)
func (client Client) Delete(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.Client", "Delete", nil, "Failure preparing request")
}
@ -206,27 +199,26 @@ func (client Client) Delete(resourceGroupName string, resourceProviderNamespace
}
// DeletePreparer prepares the Delete request.
func (client Client) DeletePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (*http.Request, error) {
func (client Client) DeletePreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"parentResourcePath": parentResourcePath,
"resourceGroupName": url.QueryEscape(resourceGroupName),
"resourceName": url.QueryEscape(resourceName),
"resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"resourceName": autorest.Encode("path", resourceName),
"resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
"resourceType": resourceType,
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// DeleteSender sends the Delete request. The method will close the
@ -253,8 +245,8 @@ func (client Client) DeleteResponder(resp *http.Response) (result autorest.Respo
// insensitive. resourceProviderNamespace is resource identity.
// parentResourcePath is resource identity. resourceType is resource
// identity. resourceName is resource identity.
func (client Client) Get(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (result GenericResource, err error) {
req, err := client.GetPreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion)
func (client Client) Get(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (result GenericResource, err error) {
req, err := client.GetPreparer(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName)
if err != nil {
return result, autorest.NewErrorWithError(err, "resources.Client", "Get", nil, "Failure preparing request")
}
@ -274,27 +266,26 @@ func (client Client) Get(resourceGroupName string, resourceProviderNamespace str
}
// GetPreparer prepares the Get request.
func (client Client) GetPreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string, apiVersion string) (*http.Request, error) {
func (client Client) GetPreparer(resourceGroupName string, resourceProviderNamespace string, parentResourcePath string, resourceType string, resourceName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"parentResourcePath": parentResourcePath,
"resourceGroupName": url.QueryEscape(resourceGroupName),
"resourceName": url.QueryEscape(resourceName),
"resourceProviderNamespace": url.QueryEscape(resourceProviderNamespace),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"resourceName": autorest.Encode("path", resourceName),
"resourceProviderNamespace": autorest.Encode("path", resourceProviderNamespace),
"resourceType": resourceType,
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -309,7 +300,7 @@ func (client Client) GetResponder(resp *http.Response) (result GenericResource,
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
@ -343,26 +334,25 @@ 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) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if len(filter) > 0 {
queryParameters["$filter"] = filter
queryParameters["$filter"] = autorest.Encode("query", filter)
}
if top != nil {
queryParameters["$top"] = top
queryParameters["$top"] = autorest.Encode("query", *top)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resources"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resources", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -408,8 +398,8 @@ func (client Client) ListNextResults(lastResults ResourceListResult) (result Res
return
}
// MoveResources begin moving resources.To determine whether the operation has
// finished processing the request, call GetLongRunningOperationStatus. This
// MoveResources move resources from one resource group to another. The
// resources being moved should all be in the same 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 HTTP requests.
@ -439,22 +429,22 @@ func (client Client) MoveResources(sourceResourceGroupName string, parameters Mo
// MoveResourcesPreparer prepares the MoveResources request.
func (client Client) MoveResourcesPreparer(sourceResourceGroupName string, parameters MoveInfo, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"sourceResourceGroupName": url.QueryEscape(sourceResourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"sourceResourceGroupName": autorest.Encode("path", sourceResourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// MoveResourcesSender sends the MoveResources request. The method will close the

View File

@ -14,7 +14,7 @@ package resources
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// TagsClient is the client for the Tags methods of the Resources service.
@ -32,12 +31,7 @@ type TagsClient struct {
// NewTagsClient creates an instance of the TagsClient client.
func NewTagsClient(subscriptionID string) TagsClient {
return NewTagsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewTagsClientWithBaseURI creates an instance of the TagsClient client.
func NewTagsClientWithBaseURI(baseURI string, subscriptionID string) TagsClient {
return TagsClient{NewWithBaseURI(baseURI, subscriptionID)}
return TagsClient{New(subscriptionID)}
}
// CreateOrUpdate create a subscription resource tag.
@ -66,21 +60,20 @@ func (client TagsClient) CreateOrUpdate(tagName string) (result TagDetails, err
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client TagsClient) CreateOrUpdatePreparer(tagName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"tagName": url.QueryEscape(tagName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"tagName": autorest.Encode("path", tagName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/tagNames/{tagName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/tagNames/{tagName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -128,22 +121,21 @@ func (client TagsClient) CreateOrUpdateValue(tagName string, tagValue string) (r
// CreateOrUpdateValuePreparer prepares the CreateOrUpdateValue request.
func (client TagsClient) CreateOrUpdateValuePreparer(tagName string, tagValue string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"tagName": url.QueryEscape(tagName),
"tagValue": url.QueryEscape(tagValue),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"tagName": autorest.Encode("path", tagName),
"tagValue": autorest.Encode("path", tagValue),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateValueSender sends the CreateOrUpdateValue request. The method will close the
@ -191,21 +183,20 @@ func (client TagsClient) Delete(tagName string) (result autorest.Response, err e
// DeletePreparer prepares the Delete request.
func (client TagsClient) DeletePreparer(tagName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"tagName": url.QueryEscape(tagName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"tagName": autorest.Encode("path", tagName),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/tagNames/{tagName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/tagNames/{tagName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// DeleteSender sends the Delete request. The method will close the
@ -252,22 +243,21 @@ func (client TagsClient) DeleteValue(tagName string, tagValue string) (result au
// DeleteValuePreparer prepares the DeleteValue request.
func (client TagsClient) DeleteValuePreparer(tagName string, tagValue string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"tagName": url.QueryEscape(tagName),
"tagValue": url.QueryEscape(tagValue),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
"tagName": autorest.Encode("path", tagName),
"tagValue": autorest.Encode("path", tagValue),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/tagNames/{tagName}/tagValues/{tagValue}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// DeleteValueSender sends the DeleteValue request. The method will close the
@ -312,20 +302,19 @@ func (client TagsClient) List() (result TagsListResult, err error) {
// ListPreparer prepares the List request.
func (client TagsClient) ListPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/tagNames"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/tagNames", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the

View File

@ -14,7 +14,7 @@ package resources
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -23,9 +23,9 @@ import (
)
const (
major = "2"
minor = "1"
patch = "1"
major = "3"
minor = "0"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"
semVerFormat = "%s.%s.%s%s"
@ -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", "2015-11-01")
return fmt.Sprintf(userAgentFormat, Version(), "resources", "2016-02-01")
}
// Version returns the semantic version (see http://semver.org) of the client.

View File

@ -1,5 +1,5 @@
// Package scheduler implements the Azure ARM Scheduler service API version
// 2016-01-01.
// 2016-03-01.
//
package scheduler
@ -17,7 +17,7 @@ package scheduler
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -27,7 +27,7 @@ import (
const (
// APIVersion is the version of the Scheduler
APIVersion = "2016-01-01"
APIVersion = "2016-03-01"
// DefaultBaseURI is the default URI used for the service Scheduler
DefaultBaseURI = "https://management.azure.com"
@ -37,19 +37,16 @@ const (
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,
BaseURI: DefaultBaseURI,
APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}
}

View File

@ -14,7 +14,7 @@ package scheduler
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// JobCollectionsClient is the client for the JobCollections methods of the
@ -34,13 +33,7 @@ type JobCollectionsClient struct {
// NewJobCollectionsClient creates an instance of the JobCollectionsClient
// client.
func NewJobCollectionsClient(subscriptionID string) JobCollectionsClient {
return NewJobCollectionsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewJobCollectionsClientWithBaseURI creates an instance of the
// JobCollectionsClient client.
func NewJobCollectionsClientWithBaseURI(baseURI string, subscriptionID string) JobCollectionsClient {
return JobCollectionsClient{NewWithBaseURI(baseURI, subscriptionID)}
return JobCollectionsClient{New(subscriptionID)}
}
// CreateOrUpdate provisions a new job collection or updates an existing job
@ -71,23 +64,23 @@ func (client JobCollectionsClient) CreateOrUpdate(resourceGroupName string, jobC
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client JobCollectionsClient) CreateOrUpdatePreparer(resourceGroupName string, jobCollectionName string, jobCollection JobCollectionDefinition) (*http.Request, error) {
pathParameters := map[string]interface{}{
"jobCollectionName": url.QueryEscape(jobCollectionName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"jobCollectionName": autorest.Encode("path", jobCollectionName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}", pathParameters),
autorest.WithJSON(jobCollection),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -109,12 +102,14 @@ func (client JobCollectionsClient) CreateOrUpdateResponder(resp *http.Response)
return
}
// Delete deletes a job collection.
// Delete deletes a job collection. 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 resource group name. jobCollectionName is the job
// collection name.
func (client JobCollectionsClient) Delete(resourceGroupName string, jobCollectionName string) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, jobCollectionName)
func (client JobCollectionsClient) Delete(resourceGroupName string, jobCollectionName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, jobCollectionName, cancel)
if err != nil {
return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "Delete", nil, "Failure preparing request")
}
@ -134,30 +129,31 @@ func (client JobCollectionsClient) Delete(resourceGroupName string, jobCollectio
}
// DeletePreparer prepares the Delete request.
func (client JobCollectionsClient) DeletePreparer(resourceGroupName string, jobCollectionName string) (*http.Request, error) {
func (client JobCollectionsClient) DeletePreparer(resourceGroupName string, jobCollectionName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"jobCollectionName": url.QueryEscape(jobCollectionName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"jobCollectionName": autorest.Encode("path", jobCollectionName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}", 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 JobCollectionsClient) DeleteSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteResponder handles the response to the Delete request. The method always
@ -166,18 +162,21 @@ func (client JobCollectionsClient) DeleteResponder(resp *http.Response) (result
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
// Disable disables all of the jobs in the job collection.
// Disable disables all of the jobs in the job collection. 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 resource group name. jobCollectionName is the job
// collection name.
func (client JobCollectionsClient) Disable(resourceGroupName string, jobCollectionName string) (result autorest.Response, err error) {
req, err := client.DisablePreparer(resourceGroupName, jobCollectionName)
func (client JobCollectionsClient) Disable(resourceGroupName string, jobCollectionName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.DisablePreparer(resourceGroupName, jobCollectionName, cancel)
if err != nil {
return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "Disable", nil, "Failure preparing request")
}
@ -197,30 +196,31 @@ func (client JobCollectionsClient) Disable(resourceGroupName string, jobCollecti
}
// DisablePreparer prepares the Disable request.
func (client JobCollectionsClient) DisablePreparer(resourceGroupName string, jobCollectionName string) (*http.Request, error) {
func (client JobCollectionsClient) DisablePreparer(resourceGroupName string, jobCollectionName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"jobCollectionName": url.QueryEscape(jobCollectionName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"jobCollectionName": autorest.Encode("path", jobCollectionName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/disable"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/disable", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// DisableSender sends the Disable request. The method will close the
// http.Response Body if it receives an error.
func (client JobCollectionsClient) DisableSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// DisableResponder handles the response to the Disable request. The method always
@ -229,18 +229,21 @@ func (client JobCollectionsClient) DisableResponder(resp *http.Response) (result
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
// Enable enables all of the jobs in the job collection.
// Enable enables all of the jobs in the job collection. 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 resource group name. jobCollectionName is the job
// collection name.
func (client JobCollectionsClient) Enable(resourceGroupName string, jobCollectionName string) (result autorest.Response, err error) {
req, err := client.EnablePreparer(resourceGroupName, jobCollectionName)
func (client JobCollectionsClient) Enable(resourceGroupName string, jobCollectionName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.EnablePreparer(resourceGroupName, jobCollectionName, cancel)
if err != nil {
return result, autorest.NewErrorWithError(err, "scheduler.JobCollectionsClient", "Enable", nil, "Failure preparing request")
}
@ -260,30 +263,31 @@ func (client JobCollectionsClient) Enable(resourceGroupName string, jobCollectio
}
// EnablePreparer prepares the Enable request.
func (client JobCollectionsClient) EnablePreparer(resourceGroupName string, jobCollectionName string) (*http.Request, error) {
func (client JobCollectionsClient) EnablePreparer(resourceGroupName string, jobCollectionName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"jobCollectionName": url.QueryEscape(jobCollectionName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"jobCollectionName": autorest.Encode("path", jobCollectionName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/enable"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/enable", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// EnableSender sends the Enable request. The method will close the
// http.Response Body if it receives an error.
func (client JobCollectionsClient) EnableSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// EnableResponder handles the response to the Enable request. The method always
@ -292,7 +296,7 @@ func (client JobCollectionsClient) EnableResponder(resp *http.Response) (result
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
@ -325,22 +329,21 @@ func (client JobCollectionsClient) Get(resourceGroupName string, jobCollectionNa
// GetPreparer prepares the Get request.
func (client JobCollectionsClient) GetPreparer(resourceGroupName string, jobCollectionName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"jobCollectionName": url.QueryEscape(jobCollectionName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"jobCollectionName": autorest.Encode("path", jobCollectionName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -388,21 +391,20 @@ func (client JobCollectionsClient) ListByResourceGroup(resourceGroupName string)
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
func (client JobCollectionsClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
@ -472,20 +474,19 @@ func (client JobCollectionsClient) ListBySubscription() (result JobCollectionLis
// ListBySubscriptionPreparer prepares the ListBySubscription request.
func (client JobCollectionsClient) ListBySubscriptionPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Scheduler/jobCollections"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Scheduler/jobCollections", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListBySubscriptionSender sends the ListBySubscription request. The method will close the
@ -558,23 +559,23 @@ func (client JobCollectionsClient) Patch(resourceGroupName string, jobCollection
// PatchPreparer prepares the Patch request.
func (client JobCollectionsClient) PatchPreparer(resourceGroupName string, jobCollectionName string, jobCollection JobCollectionDefinition) (*http.Request, error) {
pathParameters := map[string]interface{}{
"jobCollectionName": url.QueryEscape(jobCollectionName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"jobCollectionName": autorest.Encode("path", jobCollectionName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}", pathParameters),
autorest.WithJSON(jobCollection),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// PatchSender sends the Patch request. The method will close the

View File

@ -14,7 +14,7 @@ package scheduler
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// JobsClient is the client for the Jobs methods of the Scheduler service.
@ -32,12 +31,7 @@ type JobsClient struct {
// NewJobsClient creates an instance of the JobsClient client.
func NewJobsClient(subscriptionID string) JobsClient {
return NewJobsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewJobsClientWithBaseURI creates an instance of the JobsClient client.
func NewJobsClientWithBaseURI(baseURI string, subscriptionID string) JobsClient {
return JobsClient{NewWithBaseURI(baseURI, subscriptionID)}
return JobsClient{New(subscriptionID)}
}
// CreateOrUpdate provisions a new job or updates an existing job.
@ -67,24 +61,24 @@ func (client JobsClient) CreateOrUpdate(resourceGroupName string, jobCollectionN
// CreateOrUpdatePreparer prepares the CreateOrUpdate request.
func (client JobsClient) CreateOrUpdatePreparer(resourceGroupName string, jobCollectionName string, jobName string, job JobDefinition) (*http.Request, error) {
pathParameters := map[string]interface{}{
"jobCollectionName": url.QueryEscape(jobCollectionName),
"jobName": url.QueryEscape(jobName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"jobCollectionName": autorest.Encode("path", jobCollectionName),
"jobName": autorest.Encode("path", jobName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}", pathParameters),
autorest.WithJSON(job),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the
@ -133,23 +127,22 @@ func (client JobsClient) Delete(resourceGroupName string, jobCollectionName stri
// DeletePreparer prepares the Delete request.
func (client JobsClient) DeletePreparer(resourceGroupName string, jobCollectionName string, jobName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"jobCollectionName": url.QueryEscape(jobCollectionName),
"jobName": url.QueryEscape(jobName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"jobCollectionName": autorest.Encode("path", jobCollectionName),
"jobName": autorest.Encode("path", jobName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// DeleteSender sends the Delete request. The method will close the
@ -197,23 +190,22 @@ func (client JobsClient) Get(resourceGroupName string, jobCollectionName string,
// GetPreparer prepares the Get request.
func (client JobsClient) GetPreparer(resourceGroupName string, jobCollectionName string, jobName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"jobCollectionName": url.QueryEscape(jobCollectionName),
"jobName": url.QueryEscape(jobName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"jobCollectionName": autorest.Encode("path", jobCollectionName),
"jobName": autorest.Encode("path", jobName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetSender sends the Get request. The method will close the
@ -265,31 +257,30 @@ func (client JobsClient) List(resourceGroupName string, jobCollectionName string
// ListPreparer prepares the List request.
func (client JobsClient) ListPreparer(resourceGroupName string, jobCollectionName string, top *int32, skip *int32, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"jobCollectionName": url.QueryEscape(jobCollectionName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"jobCollectionName": autorest.Encode("path", jobCollectionName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if top != nil {
queryParameters["$top"] = top
queryParameters["$top"] = autorest.Encode("query", *top)
}
if skip != nil {
queryParameters["$skip"] = skip
queryParameters["$skip"] = autorest.Encode("query", *skip)
}
if len(filter) > 0 {
queryParameters["$filter"] = filter
queryParameters["$filter"] = autorest.Encode("query", filter)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -365,32 +356,31 @@ func (client JobsClient) ListJobHistory(resourceGroupName string, jobCollectionN
// ListJobHistoryPreparer prepares the ListJobHistory request.
func (client JobsClient) ListJobHistoryPreparer(resourceGroupName string, jobCollectionName string, jobName string, top *int32, skip *int32, filter string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"jobCollectionName": url.QueryEscape(jobCollectionName),
"jobName": url.QueryEscape(jobName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"jobCollectionName": autorest.Encode("path", jobCollectionName),
"jobName": autorest.Encode("path", jobName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
if top != nil {
queryParameters["$top"] = top
queryParameters["$top"] = autorest.Encode("query", *top)
}
if skip != nil {
queryParameters["$skip"] = skip
queryParameters["$skip"] = autorest.Encode("query", *skip)
}
if len(filter) > 0 {
queryParameters["$filter"] = filter
queryParameters["$filter"] = autorest.Encode("query", filter)
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}/history"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}/history", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListJobHistorySender sends the ListJobHistory request. The method will close the
@ -463,24 +453,24 @@ func (client JobsClient) Patch(resourceGroupName string, jobCollectionName strin
// PatchPreparer prepares the Patch request.
func (client JobsClient) PatchPreparer(resourceGroupName string, jobCollectionName string, jobName string, job JobDefinition) (*http.Request, error) {
pathParameters := map[string]interface{}{
"jobCollectionName": url.QueryEscape(jobCollectionName),
"jobName": url.QueryEscape(jobName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"jobCollectionName": autorest.Encode("path", jobCollectionName),
"jobName": autorest.Encode("path", jobName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}", pathParameters),
autorest.WithJSON(job),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// PatchSender sends the Patch request. The method will close the
@ -529,23 +519,22 @@ func (client JobsClient) Run(resourceGroupName string, jobCollectionName string,
// RunPreparer prepares the Run request.
func (client JobsClient) RunPreparer(resourceGroupName string, jobCollectionName string, jobName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"jobCollectionName": url.QueryEscape(jobCollectionName),
"jobName": url.QueryEscape(jobName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"jobCollectionName": autorest.Encode("path", jobCollectionName),
"jobName": autorest.Encode("path", jobName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}/run"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Scheduler/jobCollections/{jobCollectionName}/jobs/{jobName}/run", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// RunSender sends the Run request. The method will close the

View File

@ -14,7 +14,7 @@ package scheduler
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -221,8 +221,10 @@ type SkuDefinition string
const (
// Free specifies the free state for sku definition.
Free SkuDefinition = "Free"
// Premium specifies the premium state for sku definition.
Premium SkuDefinition = "Premium"
// P10Premium specifies the p10 premium state for sku definition.
P10Premium SkuDefinition = "P10Premium"
// P20Premium specifies the p20 premium state for sku definition.
P20Premium SkuDefinition = "P20Premium"
// Standard specifies the standard state for sku definition.
Standard SkuDefinition = "Standard"
)

View File

@ -14,7 +14,7 @@ package scheduler
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -23,9 +23,9 @@ import (
)
const (
major = "2"
minor = "1"
patch = "1"
major = "3"
minor = "0"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"
semVerFormat = "%s.%s.%s%s"
@ -34,7 +34,7 @@ const (
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
return fmt.Sprintf(userAgentFormat, Version(), "scheduler", "2016-01-01")
return fmt.Sprintf(userAgentFormat, Version(), "scheduler", "2016-03-01")
}
// Version returns the semantic version (see http://semver.org) of the client.

View File

@ -14,15 +14,15 @@ package storage
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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 (
"net/http"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// AccountsClient is the the Storage Management Client.
@ -32,13 +32,7 @@ type AccountsClient struct {
// NewAccountsClient creates an instance of the AccountsClient client.
func NewAccountsClient(subscriptionID string) AccountsClient {
return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID)
}
// NewAccountsClientWithBaseURI creates an instance of the AccountsClient
// client.
func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient {
return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)}
return AccountsClient{New(subscriptionID)}
}
// CheckNameAvailability checks that account name is valid and is not in use.
@ -69,21 +63,21 @@ func (client AccountsClient) CheckNameAvailability(accountName AccountCheckNameA
// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request.
func (client AccountsClient) CheckNameAvailabilityPreparer(accountName AccountCheckNameAvailabilityParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability", pathParameters),
autorest.WithJSON(accountName),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the
@ -106,13 +100,13 @@ func (client AccountsClient) CheckNameAvailabilityResponder(resp *http.Response)
}
// Create asynchronously creates a new storage account with the specified
// parameters. Existing accounts cannot be updated with this API and should
// instead use the Update Storage Account API. If an account is already
// created and subsequent PUT request is issued with exact same set of
// properties, then HTTP 200 would be returned. 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.
// parameters. If an account is already created and subsequent create request
// is issued with different properties, the account properties will be
// updated. If an account is already created and subsequent create or update
// request is issued with exact same set of properties, the request will
// succeed. 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 within the user's
// subscription. accountName is the name of the storage account within the
@ -142,23 +136,23 @@ func (client AccountsClient) Create(resourceGroupName string, accountName string
// CreatePreparer prepares the Create request.
func (client AccountsClient) CreatePreparer(resourceGroupName string, accountName string, parameters AccountCreateParameters, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{
"accountName": url.QueryEscape(accountName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"accountName": autorest.Encode("path", accountName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{Cancel: cancel},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateSender sends the Create request. The method will close the
@ -175,7 +169,7 @@ func (client AccountsClient) CreateResponder(resp *http.Response) (result autore
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted),
azure.WithErrorUnlessStatusCode(http.StatusAccepted, http.StatusOK),
autorest.ByClosing())
result.Response = resp
return
@ -210,22 +204,21 @@ func (client AccountsClient) Delete(resourceGroupName string, accountName string
// DeletePreparer prepares the Delete request.
func (client AccountsClient) DeletePreparer(resourceGroupName string, accountName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"accountName": url.QueryEscape(accountName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"accountName": autorest.Encode("path", accountName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// DeleteSender sends the Delete request. The method will close the
@ -277,22 +270,21 @@ func (client AccountsClient) GetProperties(resourceGroupName string, accountName
// GetPropertiesPreparer prepares the GetProperties request.
func (client AccountsClient) GetPropertiesPreparer(resourceGroupName string, accountName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"accountName": url.QueryEscape(accountName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"accountName": autorest.Encode("path", accountName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// GetPropertiesSender sends the GetProperties request. The method will close the
@ -339,20 +331,19 @@ func (client AccountsClient) List() (result AccountListResult, err error) {
// ListPreparer prepares the List request.
func (client AccountsClient) ListPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
@ -403,21 +394,20 @@ func (client AccountsClient) ListByResourceGroup(resourceGroupName string) (resu
// ListByResourceGroupPreparer prepares the ListByResourceGroup request.
func (client AccountsClient) ListByResourceGroupPreparer(resourceGroupName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the
@ -443,7 +433,7 @@ func (client AccountsClient) ListByResourceGroupResponder(resp *http.Response) (
//
// resourceGroupName is the name of the resource group. accountName is the
// name of the storage account.
func (client AccountsClient) ListKeys(resourceGroupName string, accountName string) (result AccountKeys, err error) {
func (client AccountsClient) ListKeys(resourceGroupName string, accountName string) (result AccountListKeysResult, err error) {
req, err := client.ListKeysPreparer(resourceGroupName, accountName)
if err != nil {
return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "ListKeys", nil, "Failure preparing request")
@ -466,22 +456,21 @@ func (client AccountsClient) ListKeys(resourceGroupName string, accountName stri
// ListKeysPreparer prepares the ListKeys request.
func (client AccountsClient) ListKeysPreparer(resourceGroupName string, accountName string) (*http.Request, error) {
pathParameters := map[string]interface{}{
"accountName": url.QueryEscape(accountName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"accountName": autorest.Encode("path", accountName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys"),
autorest.WithPathParameters(pathParameters),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListKeysSender sends the ListKeys request. The method will close the
@ -492,7 +481,7 @@ func (client AccountsClient) ListKeysSender(req *http.Request) (*http.Response,
// ListKeysResponder handles the response to the ListKeys request. The method always
// closes the http.Response Body.
func (client AccountsClient) ListKeysResponder(resp *http.Response) (result AccountKeys, err error) {
func (client AccountsClient) ListKeysResponder(resp *http.Response) (result AccountListKeysResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
@ -511,7 +500,7 @@ func (client AccountsClient) ListKeysResponder(resp *http.Response) (result Acco
// characters in length and use numbers and lower-case letters only.
// regenerateKey is specifies name of the key which should be regenerated.
// key1 or key2 for the default keys
func (client AccountsClient) RegenerateKey(resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters) (result AccountKeys, err error) {
func (client AccountsClient) RegenerateKey(resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters) (result AccountListKeysResult, err error) {
req, err := client.RegenerateKeyPreparer(resourceGroupName, accountName, regenerateKey)
if err != nil {
return result, autorest.NewErrorWithError(err, "storage.AccountsClient", "RegenerateKey", nil, "Failure preparing request")
@ -534,23 +523,23 @@ func (client AccountsClient) RegenerateKey(resourceGroupName string, accountName
// RegenerateKeyPreparer prepares the RegenerateKey request.
func (client AccountsClient) RegenerateKeyPreparer(resourceGroupName string, accountName string, regenerateKey AccountRegenerateKeyParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
"accountName": url.QueryEscape(accountName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"accountName": autorest.Encode("path", accountName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey", pathParameters),
autorest.WithJSON(regenerateKey),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// RegenerateKeySender sends the RegenerateKey request. The method will close the
@ -561,7 +550,7 @@ func (client AccountsClient) RegenerateKeySender(req *http.Request) (*http.Respo
// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always
// closes the http.Response Body.
func (client AccountsClient) RegenerateKeyResponder(resp *http.Response) (result AccountKeys, err error) {
func (client AccountsClient) RegenerateKeyResponder(resp *http.Response) (result AccountListKeysResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
@ -572,25 +561,22 @@ func (client AccountsClient) RegenerateKeyResponder(resp *http.Response) (result
return
}
// Update updates the account type or tags for a storage account. It can also
// be used to add a custom domain (note that custom domains cannot be added
// via the Create operation). Only one custom domain is supported per storage
// account. In order to replace a custom domain, the old value must be
// cleared before a new value may be set. To clear a custom domain, simply
// update the custom domain with empty string. Then call update again with
// the new cutsom domain name. The update API can only be used to update one
// of tags, accountType, or customDomain per call. To update multiple of
// these properties, call the API multiple times with one change per call.
// This call does not change the storage keys for the account. If you want to
// change storage account keys, use the RegenerateKey operation. The location
// and name of the storage account cannot be changed after creation.
// Update the update operation can be used to update the account type,
// encryption, or tags for a storage account. It can also be used to map the
// account to a custom domain. Only one custom domain is supported per
// storage account and. replacement/change of custom domain is not supported.
// In order to replace an old custom domain, the old value must be
// cleared/unregistered before a new value may be set. Update of multiple
// properties is supported. This call does not change the storage keys for
// the account. If you want to change storage account keys, use the
// regenerate keys operation. The location and name of the storage account
// cannot be changed after creation.
//
// resourceGroupName is the name of the resource group within the user's
// subscription. accountName is the name of the storage account within the
// specified resource group. Storage account names must be between 3 and 24
// characters in length and use numbers and lower-case letters only.
// parameters is the parameters to update on the account. Note that only one
// property can be changed at a time using this API.
// parameters is the parameters to provide for the updated account.
func (client AccountsClient) Update(resourceGroupName string, accountName string, parameters AccountUpdateParameters) (result Account, err error) {
req, err := client.UpdatePreparer(resourceGroupName, accountName, parameters)
if err != nil {
@ -614,23 +600,23 @@ func (client AccountsClient) Update(resourceGroupName string, accountName string
// UpdatePreparer prepares the Update request.
func (client AccountsClient) UpdatePreparer(resourceGroupName string, accountName string, parameters AccountUpdateParameters) (*http.Request, error) {
pathParameters := map[string]interface{}{
"accountName": url.QueryEscape(accountName),
"resourceGroupName": url.QueryEscape(resourceGroupName),
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"accountName": autorest.Encode("path", accountName),
"resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}"),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}", pathParameters),
autorest.WithJSON(parameters),
autorest.WithPathParameters(pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// UpdateSender sends the Update request. The method will close the

View File

@ -1,5 +1,5 @@
// Package storage implements the Azure ARM Storage service API version
// 2015-06-15.
// 2016-01-01.
//
// The Storage Management Client.
package storage
@ -18,7 +18,7 @@ package storage
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -28,7 +28,7 @@ import (
const (
// APIVersion is the version of the Storage
APIVersion = "2015-06-15"
APIVersion = "2016-01-01"
// DefaultBaseURI is the default URI used for the service Storage
DefaultBaseURI = "https://management.azure.com"
@ -38,19 +38,16 @@ const (
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,
BaseURI: DefaultBaseURI,
APIVersion: APIVersion,
SubscriptionID: subscriptionID,
}
}

View File

@ -14,7 +14,7 @@ package storage
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -23,6 +23,16 @@ import (
"github.com/Azure/go-autorest/autorest/date"
)
// AccessTier enumerates the values for access tier.
type AccessTier string
const (
// Cool specifies the cool state for access tier.
Cool AccessTier = "Cool"
// Hot specifies the hot state for access tier.
Hot AccessTier = "Hot"
)
// AccountStatus enumerates the values for account status.
type AccountStatus string
@ -33,20 +43,24 @@ const (
Unavailable AccountStatus = "Unavailable"
)
// AccountType enumerates the values for account type.
type AccountType string
// KeyPermission enumerates the values for key permission.
type KeyPermission string
const (
// PremiumLRS specifies the premium lrs state for account type.
PremiumLRS AccountType = "Premium_LRS"
// StandardGRS specifies the standard grs state for account type.
StandardGRS AccountType = "Standard_GRS"
// StandardLRS specifies the standard lrs state for account type.
StandardLRS AccountType = "Standard_LRS"
// StandardRAGRS specifies the standard ragrs state for account type.
StandardRAGRS AccountType = "Standard_RAGRS"
// StandardZRS specifies the standard zrs state for account type.
StandardZRS AccountType = "Standard_ZRS"
// FULL specifies the full state for key permission.
FULL KeyPermission = "FULL"
// READ specifies the read state for key permission.
READ KeyPermission = "READ"
)
// Kind enumerates the values for kind.
type Kind string
const (
// BlobStorage specifies the blob storage state for kind.
BlobStorage Kind = "BlobStorage"
// Storage specifies the storage state for kind.
Storage Kind = "Storage"
)
// ProvisioningState enumerates the values for provisioning state.
@ -71,6 +85,32 @@ const (
AlreadyExists Reason = "AlreadyExists"
)
// SkuName enumerates the values for sku name.
type SkuName string
const (
// PremiumLRS specifies the premium lrs state for sku name.
PremiumLRS SkuName = "Premium_LRS"
// StandardGRS specifies the standard grs state for sku name.
StandardGRS SkuName = "Standard_GRS"
// StandardLRS specifies the standard lrs state for sku name.
StandardLRS SkuName = "Standard_LRS"
// StandardRAGRS specifies the standard ragrs state for sku name.
StandardRAGRS SkuName = "Standard_RAGRS"
// StandardZRS specifies the standard zrs state for sku name.
StandardZRS SkuName = "Standard_ZRS"
)
// SkuTier enumerates the values for sku tier.
type SkuTier string
const (
// Premium specifies the premium state for sku tier.
Premium SkuTier = "Premium"
// Standard specifies the standard state for sku tier.
Standard SkuTier = "Standard"
)
// UsageUnit enumerates the values for usage unit.
type UsageUnit string
@ -97,6 +137,8 @@ type Account struct {
Type *string `json:"type,omitempty"`
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Sku *Sku `json:"sku,omitempty"`
Kind Kind `json:"kind,omitempty"`
Properties *AccountProperties `json:"properties,omitempty"`
}
@ -108,16 +150,24 @@ type AccountCheckNameAvailabilityParameters struct {
// AccountCreateParameters is the parameters to provide for the account.
type AccountCreateParameters struct {
Sku *Sku `json:"sku,omitempty"`
Kind Kind `json:"kind,omitempty"`
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Properties *AccountPropertiesCreateParameters `json:"properties,omitempty"`
}
// AccountKeys is the access keys for the storage account.
type AccountKeys struct {
// AccountKey is an access key for the storage account.
type AccountKey struct {
KeyName *string `json:"keyName,omitempty"`
Value *string `json:"value,omitempty"`
Permissions KeyPermission `json:"permissions,omitempty"`
}
// AccountListKeysResult is the ListKeys operation response.
type AccountListKeysResult struct {
autorest.Response `json:"-"`
Key1 *string `json:"key1,omitempty"`
Key2 *string `json:"key2,omitempty"`
Keys *[]AccountKey `json:"keys,omitempty"`
}
// AccountListResult is the list storage accounts operation response.
@ -129,7 +179,6 @@ type AccountListResult struct {
// AccountProperties is
type AccountProperties struct {
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
AccountType AccountType `json:"accountType,omitempty"`
PrimaryEndpoints *Endpoints `json:"primaryEndpoints,omitempty"`
PrimaryLocation *string `json:"primaryLocation,omitempty"`
StatusOfPrimary AccountStatus `json:"statusOfPrimary,omitempty"`
@ -139,17 +188,22 @@ type AccountProperties struct {
CreationTime *date.Time `json:"creationTime,omitempty"`
CustomDomain *CustomDomain `json:"customDomain,omitempty"`
SecondaryEndpoints *Endpoints `json:"secondaryEndpoints,omitempty"`
Encryption *Encryption `json:"encryption,omitempty"`
AccessTier AccessTier `json:"accessTier,omitempty"`
}
// AccountPropertiesCreateParameters is
type AccountPropertiesCreateParameters struct {
AccountType AccountType `json:"accountType,omitempty"`
CustomDomain *CustomDomain `json:"customDomain,omitempty"`
Encryption *Encryption `json:"encryption,omitempty"`
AccessTier AccessTier `json:"accessTier,omitempty"`
}
// AccountPropertiesUpdateParameters is
type AccountPropertiesUpdateParameters struct {
AccountType AccountType `json:"accountType,omitempty"`
CustomDomain *CustomDomain `json:"customDomain,omitempty"`
Encryption *Encryption `json:"encryption,omitempty"`
AccessTier AccessTier `json:"accessTier,omitempty"`
}
// AccountRegenerateKeyParameters is
@ -157,8 +211,9 @@ type AccountRegenerateKeyParameters struct {
KeyName *string `json:"keyName,omitempty"`
}
// AccountUpdateParameters is the parameters to update on the account.
// AccountUpdateParameters is the parameters to provide for the account.
type AccountUpdateParameters struct {
Sku *Sku `json:"sku,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Properties *AccountPropertiesUpdateParameters `json:"properties,omitempty"`
}
@ -178,6 +233,23 @@ type CustomDomain struct {
UseSubDomain *bool `json:"useSubDomain,omitempty"`
}
// Encryption is the encryption settings on the account.
type Encryption struct {
Services *EncryptionServices `json:"services,omitempty"`
KeySource *string `json:"keySource,omitempty"`
}
// EncryptionService is an encrypted service.
type EncryptionService struct {
Enabled *bool `json:"enabled,omitempty"`
LastEnabledTime *date.Time `json:"lastEnabledTime,omitempty"`
}
// EncryptionServices is the encrypted services.
type EncryptionServices struct {
Blob *EncryptionService `json:"blob,omitempty"`
}
// Endpoints is the URIs that are used to perform a retrieval of a public
// blob, queue or table object.
type Endpoints struct {
@ -196,6 +268,12 @@ type Resource struct {
Tags *map[string]*string `json:"tags,omitempty"`
}
// Sku is the SKU of the storage account.
type Sku struct {
Name SkuName `json:"name,omitempty"`
Tier SkuTier `json:"tier,omitempty"`
}
// Usage is describes Storage Resource Usage.
type Usage struct {
Unit UsageUnit `json:"unit,omitempty"`

View File

@ -14,7 +14,7 @@ package storage
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -22,7 +22,6 @@ import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
"net/url"
)
// UsageOperationsClient is the the Storage Management Client.
@ -33,13 +32,7 @@ type UsageOperationsClient struct {
// 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)}
return UsageOperationsClient{New(subscriptionID)}
}
// List gets the current usage count and the limit for the resources under the
@ -67,20 +60,19 @@ func (client UsageOperationsClient) List() (result UsageListResult, err error) {
// ListPreparer prepares the List request.
func (client UsageOperationsClient) ListPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": url.QueryEscape(client.SubscriptionID),
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": APIVersion,
"api-version": client.APIVersion,
}
return autorest.Prepare(&http.Request{},
autorest.AsJSON(),
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/subscriptions/{subscriptionId}/providers/Microsoft.Storage/usages"),
autorest.WithPathParameters(pathParameters),
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

View File

@ -14,7 +14,7 @@ package storage
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.14.0.0
// 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.
@ -23,9 +23,9 @@ import (
)
const (
major = "2"
minor = "1"
patch = "1"
major = "3"
minor = "0"
patch = "0"
// Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta"
semVerFormat = "%s.%s.%s%s"
@ -34,7 +34,7 @@ const (
// UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string {
return fmt.Sprintf(userAgentFormat, Version(), "storage", "2015-06-15")
return fmt.Sprintf(userAgentFormat, Version(), "storage", "2016-01-01")
}
// Version returns the semantic version (see http://semver.org) of the client.

View File

@ -132,7 +132,7 @@ func NewClient(accountName, accountKey, blobServiceBaseURL, apiVersion string, u
key, err := base64.StdEncoding.DecodeString(accountKey)
if err != nil {
return c, err
return c, fmt.Errorf("azure: malformed storage account key: %v", err)
}
return Client{

View File

@ -62,8 +62,9 @@ func DoPollForAsynchronous(delay time.Duration) autorest.SendDecorator {
return resp, err
}
delay = autorest.GetRetryAfter(resp, delay)
resp, err = autorest.SendWithSender(s, r,
autorest.AfterDelay(autorest.GetRetryAfter(resp, delay)))
autorest.AfterDelay(delay))
}
return resp, err

View File

@ -6,6 +6,7 @@ See the included examples for more detail.
package azure
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
@ -29,12 +30,20 @@ const (
// ServiceError encapsulates the error response from an Azure service.
type ServiceError struct {
Code string `json:"code"`
Message string `json:"message"`
Code string `json:"code"`
Message string `json:"message"`
Details *[]interface{} `json:"details"`
}
func (se ServiceError) Error() string {
return fmt.Sprintf("Azure Error: Code=%q Message=%q", se.Code, se.Message)
if se.Details != nil {
d, err := json.Marshal(*(se.Details))
if err != nil {
return fmt.Sprintf("Code=%q Message=%q Details=%v", se.Code, se.Message, *se.Details)
}
return fmt.Sprintf("Code=%q Message=%q Details=%v", se.Code, se.Message, string(d))
}
return fmt.Sprintf("Code=%q Message=%q", se.Code, se.Message)
}
// RequestError describes an error response returned by Azure service.
@ -50,8 +59,8 @@ type RequestError struct {
// Error returns a human-friendly error message from service error.
func (e RequestError) Error() string {
return fmt.Sprintf("azure: Service returned an error. Code=%q Message=%q Status=%d",
e.ServiceError.Code, e.ServiceError.Message, e.StatusCode)
return fmt.Sprintf("autorest/azure: Service returned an error. Status=%v %v",
e.StatusCode, e.ServiceError)
}
// IsAzureError returns true if the passed error is an Azure Service error; false otherwise.
@ -149,14 +158,20 @@ func WithErrorUnlessStatusCode(codes ...int) autorest.RespondDecorator {
var e RequestError
defer resp.Body.Close()
// Copy and replace the Body in case it does not contain an error object.
// This will leave the Body available to the caller.
b, decodeErr := autorest.CopyAndDecode(autorest.EncodedAsJSON, resp.Body, &e)
resp.Body = ioutil.NopCloser(&b) // replace body with in-memory reader
if decodeErr != nil || e.ServiceError == nil {
return fmt.Errorf("autorest/azure: error response cannot be parsed: %q error: %v", b.String(), err)
resp.Body = ioutil.NopCloser(&b)
if decodeErr != nil {
return fmt.Errorf("autorest/azure: error response cannot be parsed: %q error: %v", b.String(), decodeErr)
} else if e.ServiceError == nil {
e.ServiceError = &ServiceError{Code: "Unknown", Message: "Unknown service error"}
}
e.RequestID = ExtractRequestID(resp)
e.StatusCode = resp.StatusCode
if e.StatusCode == nil {
e.StatusCode = resp.StatusCode
}
err = &e
}
return err

View File

@ -11,20 +11,20 @@ const (
// Environment represents a set of endpoints for each of Azure's Clouds.
type Environment struct {
Name string
ManagementPortalURL string
PublishSettingsURL string
ServiceManagementEndpoint string
ResourceManagerEndpoint string
ActiveDirectoryEndpoint string
GalleryEndpoint string
KeyVaultEndpoint string
GraphEndpoint string
StorageEndpointSuffix string
SQLDatabaseDNSSuffix string
TrafficManagerDNSSuffix string
KeyVaultDNSSuffix string
ServiceBusEndpointSuffix string
Name string `json:"name"`
ManagementPortalURL string `json:"managementPortalURL"`
PublishSettingsURL string `json:"publishSettingsURL"`
ServiceManagementEndpoint string `json:"serviceManagementEndpoint"`
ResourceManagerEndpoint string `json:"resourceManagerEndpoint"`
ActiveDirectoryEndpoint string `json:"activeDirectoryEndpoint"`
GalleryEndpoint string `json:"galleryEndpoint"`
KeyVaultEndpoint string `json:"keyVaultEndpoint"`
GraphEndpoint string `json:"graphEndpoint"`
StorageEndpointSuffix string `json:"storageEndpointSuffix"`
SQLDatabaseDNSSuffix string `json:"sqlDatabaseDNSSuffix"`
TrafficManagerDNSSuffix string `json:"trafficManagerDNSSuffix"`
KeyVaultDNSSuffix string `json:"keyVaultDNSSuffix"`
ServiceBusEndpointSuffix string `json:"serviceBusEndpointSuffix"`
}
var (
@ -55,12 +55,12 @@ var (
ResourceManagerEndpoint: "https://management.usgovcloudapi.net",
ActiveDirectoryEndpoint: "https://login.microsoftonline.com/",
GalleryEndpoint: "https://gallery.usgovcloudapi.net/",
KeyVaultEndpoint: "https://vault.azure.net/",
KeyVaultEndpoint: "https://vault.usgovcloudapi.net/",
GraphEndpoint: "https://graph.usgovcloudapi.net/",
StorageEndpointSuffix: "core.usgovcloudapi.net",
SQLDatabaseDNSSuffix: "database.usgovcloudapi.net",
TrafficManagerDNSSuffix: "trafficmanager.net",
KeyVaultDNSSuffix: "vault.azure.net",
TrafficManagerDNSSuffix: "usgovtrafficmanager.net",
KeyVaultDNSSuffix: "vault.usgovcloudapi.net",
ServiceBusEndpointSuffix: "servicebus.usgovcloudapi.net",
}
@ -73,14 +73,32 @@ var (
ResourceManagerEndpoint: "https://management.chinacloudapi.cn/",
ActiveDirectoryEndpoint: "https://login.chinacloudapi.cn/?api-version=1.0",
GalleryEndpoint: "https://gallery.chinacloudapi.cn/",
KeyVaultEndpoint: "https://vault.azure.net/",
KeyVaultEndpoint: "https://vault.azure.cn/",
GraphEndpoint: "https://graph.chinacloudapi.cn/",
StorageEndpointSuffix: "core.chinacloudapi.cn",
SQLDatabaseDNSSuffix: "database.chinacloudapi.cn",
TrafficManagerDNSSuffix: "trafficmanager.cn",
KeyVaultDNSSuffix: "vault.azure.net",
KeyVaultDNSSuffix: "vault.azure.cn",
ServiceBusEndpointSuffix: "servicebus.chinacloudapi.net",
}
// GermanCloud is the cloud environment operated in Germany
GermanCloud = Environment{
Name: "AzureGermanCloud",
ManagementPortalURL: "http://portal.microsoftazure.de/",
PublishSettingsURL: "https://manage.microsoftazure.de/publishsettings/index",
ServiceManagementEndpoint: "https://management.core.cloudapi.de",
ResourceManagerEndpoint: "https://management.microsoftazure.de",
ActiveDirectoryEndpoint: "https://login.microsoftonline.de/",
GalleryEndpoint: "https://gallery.cloudapi.de/",
KeyVaultEndpoint: "https://vault.microsoftazure.de/",
GraphEndpoint: "https://graph.cloudapi.de/",
StorageEndpointSuffix: "core.cloudapi.de",
SQLDatabaseDNSSuffix: "database.cloudapi.de",
TrafficManagerDNSSuffix: "azuretrafficmanager.de",
KeyVaultDNSSuffix: "vault.microsoftazure.de",
ServiceBusEndpointSuffix: "servicebus.cloudapi.de",
}
)
// OAuthConfigForTenant returns an OAuthConfig with tenant specific urls

View File

@ -14,6 +14,7 @@ func LoadToken(path string) (*Token, error) {
if err != nil {
return nil, fmt.Errorf("failed to open file (%s) while loading token: %v", path, err)
}
defer file.Close()
var token Token

View File

@ -137,7 +137,7 @@ func (secret *ServicePrincipalCertificateSecret) SignJwt(spt *ServicePrincipalTo
token := jwt.New(jwt.SigningMethodRS256)
token.Header["x5t"] = thumbprint
token.Claims = map[string]interface{}{
token.Claims = jwt.MapClaims{
"aud": spt.oauthConfig.TokenEndpoint,
"iss": spt.clientID,
"sub": spt.clientID,
@ -147,7 +147,7 @@ func (secret *ServicePrincipalCertificateSecret) SignJwt(spt *ServicePrincipalTo
}
signedString, err := token.SignedString(secret.PrivateKey)
return signedString, nil
return signedString, err
}
// SetAuthenticationValues is a method of the interface ServicePrincipalSecret.

View File

@ -7,6 +7,7 @@ import (
"io/ioutil"
"log"
"net/http"
"net/http/cookiejar"
"time"
)
@ -16,8 +17,22 @@ const (
// DefaultPollingDuration is a reasonable total polling duration.
DefaultPollingDuration = 15 * time.Minute
// DefaultRetryAttempts is number of attempts for retry status codes (5xx).
DefaultRetryAttempts = 3
// DefaultRetryDuration is a resonable delay for retry.
defaultRetryInterval = 30 * time.Second
)
var statusCodesForRetry = []int{
http.StatusRequestTimeout, // 408
http.StatusInternalServerError, // 500
http.StatusBadGateway, // 502
http.StatusServiceUnavailable, // 503
http.StatusGatewayTimeout, // 504
}
const (
requestFormat = `HTTP Request Begin ===================================================
%s
@ -75,9 +90,7 @@ func (li LoggingInspector) ByInspecting() RespondDecorator {
return func(r Responder) Responder {
return ResponderFunc(func(resp *http.Response) error {
var body, b bytes.Buffer
defer resp.Body.Close()
resp.Body = ioutil.NopCloser(io.TeeReader(resp.Body, &body))
if err := resp.Write(&b); err != nil {
return fmt.Errorf("Failed to write response: %v", err)
@ -114,17 +127,25 @@ type Client struct {
// PollingDuration sets the maximum polling time after which an error is returned.
PollingDuration time.Duration
// RetryAttempts sets the default number of retry attempts for client.
RetryAttempts int
// UserAgent, if not empty, will be set as the HTTP User-Agent header on all requests sent
// through the Do method.
UserAgent string
Jar http.CookieJar
}
// NewClientWithUserAgent returns an instance of a Client with the UserAgent set to the passed
// string.
func NewClientWithUserAgent(ua string) Client {
c := Client{PollingDelay: DefaultPollingDelay, PollingDuration: DefaultPollingDuration}
c.UserAgent = ua
return c
return Client{
PollingDelay: DefaultPollingDelay,
PollingDuration: DefaultPollingDuration,
RetryAttempts: DefaultRetryAttempts,
UserAgent: ua,
}
}
// Do implements the Sender interface by invoking the active Sender after applying authorization.
@ -141,18 +162,18 @@ func (c Client) Do(r *http.Request) (*http.Response, error) {
if err != nil {
return nil, NewErrorWithError(err, "autorest/Client", "Do", nil, "Preparing request failed")
}
resp, err := c.sender().Do(r)
resp, err := SendWithSender(c.sender(), r,
DoRetryForStatusCodes(c.RetryAttempts, defaultRetryInterval, statusCodesForRetry...))
Respond(resp,
c.ByInspecting())
return resp, err
}
// sender returns the Sender to which to send requests.
func (c Client) sender() Sender {
if c.Sender == nil {
return http.DefaultClient
j, _ := cookiejar.New(nil)
return &http.Client{Jar: j}
}
return c.Sender
}

View File

@ -24,7 +24,7 @@ type DetailedError struct {
Method string
// StatusCode is the HTTP Response StatusCode (if non-zero) that led to the error.
StatusCode int
StatusCode interface{}
// Message is the error message.
Message string

View File

@ -166,7 +166,9 @@ func WithBaseURL(baseURL string) PrepareDecorator {
r, err := p.Prepare(r)
if err == nil {
var u *url.URL
u, err = url.Parse(baseURL)
if u, err = url.Parse(baseURL); err != nil {
return r, err
}
if u.Scheme == "" {
err = fmt.Errorf("autorest: No scheme detected in URL %s", baseURL)
}
@ -268,12 +270,8 @@ func WithPath(path string) PrepareDecorator {
if r.URL == nil {
return r, NewError("autorest", "WithPath", "Invoked with a nil URL")
}
u := r.URL
u.Path = strings.TrimRight(u.Path, "/")
if strings.HasPrefix(path, "/") {
u.Path = path
} else {
u.Path += "/" + path
if r.URL, err = parseURL(r.URL, path); err != nil {
return r, err
}
}
return r, err
@ -284,7 +282,7 @@ func WithPath(path string) PrepareDecorator {
// WithEscapedPathParameters returns a PrepareDecorator that replaces brace-enclosed keys within the
// request path (i.e., http.Request.URL.Path) with the corresponding values from the passed map. The
// values will be escaped (aka URL encoded) before insertion into the path.
func WithEscapedPathParameters(pathParameters map[string]interface{}) PrepareDecorator {
func WithEscapedPathParameters(path string, pathParameters map[string]interface{}) PrepareDecorator {
parameters := escapeValueStrings(ensureValueStrings(pathParameters))
return func(p Preparer) Preparer {
return PreparerFunc(func(r *http.Request) (*http.Request, error) {
@ -294,7 +292,10 @@ func WithEscapedPathParameters(pathParameters map[string]interface{}) PrepareDec
return r, NewError("autorest", "WithEscapedPathParameters", "Invoked with a nil URL")
}
for key, value := range parameters {
r.URL.Path = strings.Replace(r.URL.Path, "{"+key+"}", value, -1)
path = strings.Replace(path, "{"+key+"}", value, -1)
}
if r.URL, err = parseURL(r.URL, path); err != nil {
return r, err
}
}
return r, err
@ -304,7 +305,7 @@ func WithEscapedPathParameters(pathParameters map[string]interface{}) PrepareDec
// WithPathParameters returns a PrepareDecorator that replaces brace-enclosed keys within the
// request path (i.e., http.Request.URL.Path) with the corresponding values from the passed map.
func WithPathParameters(pathParameters map[string]interface{}) PrepareDecorator {
func WithPathParameters(path string, pathParameters map[string]interface{}) PrepareDecorator {
parameters := ensureValueStrings(pathParameters)
return func(p Preparer) Preparer {
return PreparerFunc(func(r *http.Request) (*http.Request, error) {
@ -314,7 +315,11 @@ func WithPathParameters(pathParameters map[string]interface{}) PrepareDecorator
return r, NewError("autorest", "WithPathParameters", "Invoked with a nil URL")
}
for key, value := range parameters {
r.URL.Path = strings.Replace(r.URL.Path, "{"+key+"}", value, -1)
path = strings.Replace(path, "{"+key+"}", value, -1)
}
if r.URL, err = parseURL(r.URL, path); err != nil {
return r, err
}
}
return r, err
@ -322,6 +327,14 @@ func WithPathParameters(pathParameters map[string]interface{}) PrepareDecorator
}
}
func parseURL(u *url.URL, path string) (*url.URL, error) {
p := strings.TrimRight(u.String(), "/")
if !strings.HasPrefix(path, "/") {
path = "/" + path
}
return url.Parse(p + path)
}
// WithQueryParameters returns a PrepareDecorators that encodes and applies the query parameters
// given in the supplied map (i.e., key=value).
func WithQueryParameters(queryParameters map[string]interface{}) PrepareDecorator {
@ -337,7 +350,7 @@ func WithQueryParameters(queryParameters map[string]interface{}) PrepareDecorato
for key, value := range parameters {
v.Add(key, value)
}
r.URL.RawQuery = v.Encode()
r.URL.RawQuery = createQuery(v)
}
return r, err
})

View File

@ -1,7 +1,9 @@
package autorest
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"math"
"net/http"
@ -184,6 +186,36 @@ func DoRetryForAttempts(attempts int, backoff time.Duration) SendDecorator {
}
}
// DoRetryForStatusCodes returns a SendDecorator that retries for specified statusCodes for up to the specified
// number of attempts, exponentially backing off between requests using the supplied backoff
// time.Duration (which may be zero). Retrying may be canceled by closing the optional channel on
// the http.Request.
func DoRetryForStatusCodes(attempts int, backoff time.Duration, codes ...int) SendDecorator {
return func(s Sender) Sender {
return SenderFunc(func(r *http.Request) (resp *http.Response, err error) {
b := []byte{}
if r.Body != nil {
b, err = ioutil.ReadAll(r.Body)
if err != nil {
return resp, err
}
}
// Increment to add the first call (attempts denotes number of retries)
attempts++
for attempt := 0; attempt < attempts; attempt++ {
r.Body = ioutil.NopCloser(bytes.NewBuffer(b))
resp, err = s.Do(r)
if err != nil || !ResponseHasStatusCode(resp, codes...) {
return resp, err
}
DelayForBackoff(backoff, attempt, r.Cancel)
}
return resp, err
})
}
}
// DoRetryForDuration returns a SendDecorator that retries the request until the total time is equal
// to or greater than the specified duration, exponentially backing off between requests using the
// supplied backoff time.Duration (which may be zero). Retrying may be canceled by closing the
@ -222,11 +254,12 @@ func WithLogging(logger *log.Logger) SendDecorator {
}
// DelayForBackoff invokes time.After for the supplied backoff duration raised to the power of
// passed attempt (i.e., an exponential backoff delay). Backoff may be zero. The delay may be
// canceled by closing the passed channel. If terminated early, returns false.
// passed attempt (i.e., an exponential backoff delay). Backoff duration is in seconds and can set
// to zero for no delay. The delay may be canceled by closing the passed channel. If terminated early,
// returns false.
func DelayForBackoff(backoff time.Duration, attempt int, cancel <-chan struct{}) bool {
select {
case <-time.After(time.Duration(math.Pow(float64(backoff), float64(attempt)))):
case <-time.After(time.Duration(backoff.Seconds()*math.Pow(2, float64(attempt))) * time.Second):
return true
case <-cancel:
return false

View File

@ -7,6 +7,8 @@ import (
"fmt"
"io"
"net/url"
"sort"
"strings"
)
// EncodedAs is a series of constants specifying various data encodings
@ -97,7 +99,63 @@ func ensureValueString(value interface{}) string {
switch v := value.(type) {
case string:
return v
case []byte:
return string(v)
default:
return fmt.Sprintf("%v", v)
}
}
// String method converts interface v to string. If interface is a list, it
// joins list elements using separator.
func String(v interface{}, sep ...string) string {
if len(sep) > 0 {
return ensureValueString(strings.Join(v.([]string), sep[0]))
}
return ensureValueString(v)
}
// Encode method encodes url path and query parameters.
func Encode(location string, v interface{}, sep ...string) string {
s := String(v, sep...)
switch strings.ToLower(location) {
case "path":
return pathEscape(s)
case "query":
return queryEscape(s)
default:
return s
}
}
func pathEscape(s string) string {
return strings.Replace(url.QueryEscape(s), "+", "%20", -1)
}
func queryEscape(s string) string {
return url.QueryEscape(s)
}
// This method is same as Encode() method of "net/url" go package,
// except it does not encode the query parameters because they
// already come encoded. It formats values map in query format (bar=foo&a=b).
func createQuery(v url.Values) string {
var buf bytes.Buffer
keys := make([]string, 0, len(v))
for k := range v {
keys = append(keys, k)
}
sort.Strings(keys)
for _, k := range keys {
vs := v[k]
prefix := url.QueryEscape(k) + "="
for _, v := range vs {
if buf.Len() > 0 {
buf.WriteByte('&')
}
buf.WriteString(prefix)
buf.WriteString(v)
}
}
return buf.String()
}

View File

@ -1,4 +0,0 @@
.DS_Store
bin

View File

@ -1,7 +0,0 @@
language: go
go:
- 1.3.3
- 1.4.2
- 1.5
- tip

96
vendor/github.com/dgrijalva/jwt-go/MIGRATION_GUIDE.md generated vendored Normal file
View File

@ -0,0 +1,96 @@
## Migration Guide from v2 -> v3
Version 3 adds several new, frequently requested features. To do so, it introduces a few breaking changes. We've worked to keep these as minimal as possible. This guide explains the breaking changes and how you can quickly update your code.
### `Token.Claims` is now an interface type
The most requested feature from the 2.0 verison of this library was the ability to provide a custom type to the JSON parser for claims. This was implemented by introducing a new interface, `Claims`, to replace `map[string]interface{}`. We also included two concrete implementations of `Claims`: `MapClaims` and `StandardClaims`.
`MapClaims` is an alias for `map[string]interface{}` with built in validation behavior. It is the default claims type when using `Parse`. The usage is unchanged except you must type cast the claims property.
The old example for parsing a token looked like this..
```go
if token, err := jwt.Parse(tokenString, keyLookupFunc); err == nil {
fmt.Printf("Token for user %v expires %v", token.Claims["user"], token.Claims["exp"])
}
```
is now directly mapped to...
```go
if token, err := jwt.Parse(tokenString, keyLookupFunc); err == nil {
claims := token.Claims.(jwt.MapClaims)
fmt.Printf("Token for user %v expires %v", claims["user"], claims["exp"])
}
```
`StandardClaims` is designed to be embedded in your custom type. You can supply a custom claims type with the new `ParseWithClaims` function. Here's an example of using a custom claims type.
```go
type MyCustomClaims struct {
User string
*StandardClaims
}
if token, err := jwt.ParseWithClaims(tokenString, &MyCustomClaims{}, keyLookupFunc); err == nil {
claims := token.Claims.(*MyCustomClaims)
fmt.Printf("Token for user %v expires %v", claims.User, claims.StandardClaims.ExpiresAt)
}
```
### `ParseFromRequest` has been moved
To keep this library focused on the tokens without becoming overburdened with complex request processing logic, `ParseFromRequest` and its new companion `ParseFromRequestWithClaims` have been moved to a subpackage, `request`. The method signatues have also been augmented to receive a new argument: `Extractor`.
`Extractors` do the work of picking the token string out of a request. The interface is simple and composable.
This simple parsing example:
```go
if token, err := jwt.ParseFromRequest(tokenString, req, keyLookupFunc); err == nil {
fmt.Printf("Token for user %v expires %v", token.Claims["user"], token.Claims["exp"])
}
```
is directly mapped to:
```go
if token, err := request.ParseFromRequest(tokenString, request.OAuth2Extractor, req, keyLookupFunc); err == nil {
fmt.Printf("Token for user %v expires %v", token.Claims["user"], token.Claims["exp"])
}
```
There are several concrete `Extractor` types provided for your convenience:
* `HeaderExtractor` will search a list of headers until one contains content.
* `ArgumentExtractor` will search a list of keys in request query and form arguments until one contains content.
* `MultiExtractor` will try a list of `Extractors` in order until one returns content.
* `AuthorizationHeaderExtractor` will look in the `Authorization` header for a `Bearer` token.
* `OAuth2Extractor` searches the places an OAuth2 token would be specified (per the spec): `Authorization` header and `access_token` argument
* `PostExtractionFilter` wraps an `Extractor`, allowing you to process the content before it's parsed. A simple example is stripping the `Bearer ` text from a header
### RSA signing methods no longer accept `[]byte` keys
Due to a [critical vulnerability](https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/), we've decided the convenience of accepting `[]byte` instead of `rsa.PublicKey` or `rsa.PrivateKey` isn't worth the risk of misuse.
To replace this behavior, we've added two helper methods: `ParseRSAPrivateKeyFromPEM(key []byte) (*rsa.PrivateKey, error)` and `ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error)`. These are just simple helpers for unpacking PEM encoded PKCS1 and PKCS8 keys. If your keys are encoded any other way, all you need to do is convert them to the `crypto/rsa` package's types.
```go
func keyLookupFunc(*Token) (interface{}, error) {
// Don't forget to validate the alg is what you expect:
if _, ok := token.Method.(*jwt.SigningMethodRSA); !ok {
return nil, fmt.Errorf("Unexpected signing method: %v", token.Header["alg"])
}
// Look up key
key, err := lookupPublicKey(token.Header["kid"])
if err != nil {
return nil, err
}
// Unpack key from PEM encoded PKCS8
return jwt.ParseRSAPublicKeyFromPEM(key)
}
```

View File

@ -1,11 +1,16 @@
A [go](http://www.golang.org) (or 'golang' for search engine friendliness) implementation of [JSON Web Tokens](http://self-issued.info/docs/draft-jones-json-web-token.html)
A [go](http://www.golang.org) (or 'golang' for search engine friendliness) implementation of [JSON Web Tokens](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html)
[![Build Status](https://travis-ci.org/dgrijalva/jwt-go.svg?branch=master)](https://travis-ci.org/dgrijalva/jwt-go)
**BREAKING CHANGES:*** Version 3.0.0 is here. It includes _a lot_ of changes including a few that break the API. We've tried to break as few things as possible, so there should just be a few type signature changes. A full list of breaking changes is available in `VERSION_HISTORY.md`. See `MIGRATION_GUIDE.md` for more information on updating your code.
**NOTICE:** A vulnerability in JWT was [recently published](https://auth0.com/blog/2015/03/31/critical-vulnerabilities-in-json-web-token-libraries/). As this library doesn't force users to validate the `alg` is what they expected, it's possible your usage is effected. There will be an update soon to remedy this, and it will likey require backwards-incompatible changes to the API. In the short term, please make sure your implementation verifies the `alg` is what you expect.
## What the heck is a JWT?
JWT.io has [a great introduction](https://jwt.io/introduction) to JSON Web Tokens.
In short, it's a signed JSON object that does something useful (for example, authentication). It's commonly used for `Bearer` tokens in Oauth 2. A token is made of three parts, separated by `.`'s. The first two parts are JSON objects, that have been [base64url](http://tools.ietf.org/html/rfc4648) encoded. The last part is the signature, encoded the same way.
The first part is called the header. It contains the necessary information for verifying the last part, the signature. For example, which encryption method was used for signing and what key was used.
@ -16,37 +21,13 @@ The part in the middle is the interesting bit. It's called the Claims and conta
This library supports the parsing and verification as well as the generation and signing of JWTs. Current supported signing algorithms are HMAC SHA, RSA, RSA-PSS, and ECDSA, though hooks are present for adding your own.
## Parse and Verify
## Examples
Parsing and verifying tokens is pretty straight forward. You pass in the token and a function for looking up the key. This is done as a callback since you may need to parse the token to find out what signing method and key was used.
See [the project documentation](https://godoc.org/github.com/dgrijalva/jwt-go) for examples of usage:
```go
token, err := jwt.Parse(myToken, func(token *jwt.Token) (interface{}, error) {
// Don't forget to validate the alg is what you expect:
if _, ok := token.Method.(*jwt.SigningMethodRSA); !ok {
return nil, fmt.Errorf("Unexpected signing method: %v", token.Header["alg"])
}
return myLookupKey(token.Header["kid"]), nil
})
if err == nil && token.Valid {
deliverGoodness("!")
} else {
deliverUtterRejection(":(")
}
```
## Create a token
```go
// Create the token
token := jwt.New(jwt.SigningMethodHS256)
// Set some claims
token.Claims["foo"] = "bar"
token.Claims["exp"] = time.Now().Add(time.Hour * 72).Unix()
// Sign and get the complete encoded token as a string
tokenString, err := token.SignedString(mySigningKey)
```
* [Simple example of parsing and validating a token](https://godoc.org/github.com/dgrijalva/jwt-go#example-Parse--Hmac)
* [Simple example of building and signing a token](https://godoc.org/github.com/dgrijalva/jwt-go#example-New--Hmac)
* [Directory of Examples](https://godoc.org/github.com/dgrijalva/jwt-go#pkg-examples)
## Extensions
@ -54,6 +35,12 @@ This library publishes all the necessary components for adding your own signing
Here's an example of an extension that integrates with the Google App Engine signing tools: https://github.com/someone1/gcp-jwt-go
## Compliance
This library was last reviewed to comply with [RTF 7519](http://www.rfc-editor.org/info/rfc7519) dated May 2015 with a few notable differences:
* In order to protect against accidental use of [Unsecured JWTs](http://self-issued.info/docs/draft-ietf-oauth-json-web-token.html#UnsecuredJWT), tokens using `alg=none` will only be accepted if the constant `jwt.UnsafeAllowNoneSignatureType` is provided as the key.
## Project Status & Versioning
This library is considered production ready. Feedback and feature requests are appreciated. The API should be considered stable. There should be very few backwards-incompatible changes outside of major version updates (and only with good reason).
@ -95,4 +82,4 @@ Without going too far down the rabbit hole, here's a description of the interact
Documentation can be found [on godoc.org](http://godoc.org/github.com/dgrijalva/jwt-go).
The command line utility included in this project (cmd/jwt) provides a straightforward example of token creation and parsing as well as a useful tool for debugging your own integration. For a more http centric example, see [this gist](https://gist.github.com/cryptix/45c33ecf0ae54828e63b).
The command line utility included in this project (cmd/jwt) provides a straightforward example of token creation and parsing as well as a useful tool for debugging your own integration. You'll also find several implementation examples in to documentation.

View File

@ -1,5 +1,43 @@
## `jwt-go` Version History
#### 3.0.0
* **Compatibility Breaking Changes**: See MIGRATION_GUIDE.md for tips on updating your code
* Dropped support for `[]byte` keys when using RSA signing methods. This convenience feature could contribute to security vulnerabilities involving mismatched key types with signing methods.
* `ParseFromRequest` has been moved to `request` subpackage and usage has changed
* The `Claims` property on `Token` is now type `Claims` instead of `map[string]interface{}`. The default value is type `MapClaims`, which is an alias to `map[string]interface{}`. This makes it possible to use a custom type when decoding claims.
* Other Additions and Changes
* Added `Claims` interface type to allow users to decode the claims into a custom type
* Added `ParseWithClaims`, which takes a third argument of type `Claims`. Use this function instead of `Parse` if you have a custom type you'd like to decode into.
* Dramatically improved the functionality and flexibility of `ParseFromRequest`, which is now in the `request` subpackage
* Added `ParseFromRequestWithClaims` which is the `FromRequest` equivalent of `ParseWithClaims`
* Added new interface type `Extractor`, which is used for extracting JWT strings from http requests. Used with `ParseFromRequest` and `ParseFromRequestWithClaims`.
* Added several new, more specific, validation errors to error type bitmask
* Moved examples from README to executable example files
* Signing method registry is now thread safe
* Added new property to `ValidationError`, which contains the raw error returned by calls made by parse/verify (such as those returned by keyfunc or json parser)
#### 2.7.0
This will likely be the last backwards compatible release before 3.0.0, excluding essential bug fixes.
* Added new option `-show` to the `jwt` command that will just output the decoded token without verifying
* Error text for expired tokens includes how long it's been expired
* Fixed incorrect error returned from `ParseRSAPublicKeyFromPEM`
* Documentation updates
#### 2.6.0
* Exposed inner error within ValidationError
* Fixed validation errors when using UseJSONNumber flag
* Added several unit tests
#### 2.5.0
* Added support for signing method none. You shouldn't use this. The API tries to make this clear.
* Updated/fixed some documentation
* Added more helpful error message when trying to parse tokens that begin with `BEARER `
#### 2.4.0
* Added new type, Parser, to allow for configuration of various parsing parameters

134
vendor/github.com/dgrijalva/jwt-go/claims.go generated vendored Normal file
View File

@ -0,0 +1,134 @@
package jwt
import (
"crypto/subtle"
"fmt"
"time"
)
// For a type to be a Claims object, it must just have a Valid method that determines
// if the token is invalid for any supported reason
type Claims interface {
Valid() error
}
// Structured version of Claims Section, as referenced at
// https://tools.ietf.org/html/rfc7519#section-4.1
// See examples for how to use this with your own claim types
type StandardClaims struct {
Audience string `json:"aud,omitempty"`
ExpiresAt int64 `json:"exp,omitempty"`
Id string `json:"jti,omitempty"`
IssuedAt int64 `json:"iat,omitempty"`
Issuer string `json:"iss,omitempty"`
NotBefore int64 `json:"nbf,omitempty"`
Subject string `json:"sub,omitempty"`
}
// Validates time based claims "exp, iat, nbf".
// There is no accounting for clock skew.
// As well, if any of the above claims are not in the token, it will still
// be considered a valid claim.
func (c StandardClaims) Valid() error {
vErr := new(ValidationError)
now := TimeFunc().Unix()
// The claims below are optional, by default, so if they are set to the
// default value in Go, let's not fail the verification for them.
if c.VerifyExpiresAt(now, false) == false {
delta := time.Unix(now, 0).Sub(time.Unix(c.ExpiresAt, 0))
vErr.Inner = fmt.Errorf("token is expired by %v", delta)
vErr.Errors |= ValidationErrorExpired
}
if c.VerifyIssuedAt(now, false) == false {
vErr.Inner = fmt.Errorf("Token used before issued")
vErr.Errors |= ValidationErrorIssuedAt
}
if c.VerifyNotBefore(now, false) == false {
vErr.Inner = fmt.Errorf("token is not valid yet")
vErr.Errors |= ValidationErrorNotValidYet
}
if vErr.valid() {
return nil
}
return vErr
}
// Compares the aud claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (c *StandardClaims) VerifyAudience(cmp string, req bool) bool {
return verifyAud(c.Audience, cmp, req)
}
// Compares the exp claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (c *StandardClaims) VerifyExpiresAt(cmp int64, req bool) bool {
return verifyExp(c.ExpiresAt, cmp, req)
}
// Compares the iat claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (c *StandardClaims) VerifyIssuedAt(cmp int64, req bool) bool {
return verifyIat(c.IssuedAt, cmp, req)
}
// Compares the iss claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (c *StandardClaims) VerifyIssuer(cmp string, req bool) bool {
return verifyIss(c.Issuer, cmp, req)
}
// Compares the nbf claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (c *StandardClaims) VerifyNotBefore(cmp int64, req bool) bool {
return verifyNbf(c.NotBefore, cmp, req)
}
// ----- helpers
func verifyAud(aud string, cmp string, required bool) bool {
if aud == "" {
return !required
}
if subtle.ConstantTimeCompare([]byte(aud), []byte(cmp)) != 0 {
return true
} else {
return false
}
}
func verifyExp(exp int64, now int64, required bool) bool {
if exp == 0 {
return !required
}
return now <= exp
}
func verifyIat(iat int64, now int64, required bool) bool {
if iat == 0 {
return !required
}
return now >= iat
}
func verifyIss(iss string, cmp string, required bool) bool {
if iss == "" {
return !required
}
if subtle.ConstantTimeCompare([]byte(iss), []byte(cmp)) != 0 {
return true
} else {
return false
}
}
func verifyNbf(nbf int64, now int64, required bool) bool {
if nbf == 0 {
return !required
}
return now >= nbf
}

View File

@ -69,7 +69,7 @@ func (m *SigningMethodECDSA) Verify(signingString, signature string, key interfa
case *ecdsa.PublicKey:
ecdsaKey = k
default:
return ErrInvalidKey
return ErrInvalidKeyType
}
if len(sig) != 2*m.KeySize {
@ -103,7 +103,7 @@ func (m *SigningMethodECDSA) Sign(signingString string, key interface{}) (string
case *ecdsa.PrivateKey:
ecdsaKey = k
default:
return "", ErrInvalidKey
return "", ErrInvalidKeyType
}
// Create the hasher

View File

@ -6,9 +6,9 @@ import (
// Error constants
var (
ErrInvalidKey = errors.New("key is invalid or of invalid type")
ErrHashUnavailable = errors.New("the requested hash function is unavailable")
ErrNoTokenInRequest = errors.New("no token present in request")
ErrInvalidKey = errors.New("key is invalid")
ErrInvalidKeyType = errors.New("key is of invalid type")
ErrHashUnavailable = errors.New("the requested hash function is unavailable")
)
// The errors that might occur when parsing and validating a token
@ -16,22 +16,42 @@ const (
ValidationErrorMalformed uint32 = 1 << iota // Token is malformed
ValidationErrorUnverifiable // Token could not be verified because of signing problems
ValidationErrorSignatureInvalid // Signature validation failed
ValidationErrorExpired // Exp validation failed
ValidationErrorNotValidYet // NBF validation failed
// Standard Claim validation errors
ValidationErrorAudience // AUD validation failed
ValidationErrorExpired // EXP validation failed
ValidationErrorIssuedAt // IAT validation failed
ValidationErrorIssuer // ISS validation failed
ValidationErrorNotValidYet // NBF validation failed
ValidationErrorId // JTI validation failed
ValidationErrorClaimsInvalid // Generic claims validation error
)
// Helper for constructing a ValidationError with a string error message
func NewValidationError(errorText string, errorFlags uint32) *ValidationError {
return &ValidationError{
text: errorText,
Errors: errorFlags,
}
}
// The error from Parse if token is not valid
type ValidationError struct {
err string
Inner error // stores the error returned by external dependencies, i.e.: KeyFunc
Errors uint32 // bitfield. see ValidationError... constants
text string // errors that do not have a valid error just have text
}
// Validation error is an error type
func (e ValidationError) Error() string {
if e.err == "" {
if e.Inner != nil {
return e.Inner.Error()
} else if e.text != "" {
return e.text
} else {
return "token is invalid"
}
return e.err
return e.Inner.Error()
}
// No errors

View File

@ -49,7 +49,7 @@ func (m *SigningMethodHMAC) Verify(signingString, signature string, key interfac
// Verify the key is the right type
keyBytes, ok := key.([]byte)
if !ok {
return ErrInvalidKey
return ErrInvalidKeyType
}
// Decode signature, for comparison

94
vendor/github.com/dgrijalva/jwt-go/map_claims.go generated vendored Normal file
View File

@ -0,0 +1,94 @@
package jwt
import (
"encoding/json"
"errors"
// "fmt"
)
// Claims type that uses the map[string]interface{} for JSON decoding
// This is the default claims type if you don't supply one
type MapClaims map[string]interface{}
// Compares the aud claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (m MapClaims) VerifyAudience(cmp string, req bool) bool {
aud, _ := m["aud"].(string)
return verifyAud(aud, cmp, req)
}
// Compares the exp claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (m MapClaims) VerifyExpiresAt(cmp int64, req bool) bool {
switch exp := m["exp"].(type) {
case float64:
return verifyExp(int64(exp), cmp, req)
case json.Number:
v, _ := exp.Int64()
return verifyExp(v, cmp, req)
}
return req == false
}
// Compares the iat claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (m MapClaims) VerifyIssuedAt(cmp int64, req bool) bool {
switch iat := m["iat"].(type) {
case float64:
return verifyIat(int64(iat), cmp, req)
case json.Number:
v, _ := iat.Int64()
return verifyIat(v, cmp, req)
}
return req == false
}
// Compares the iss claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (m MapClaims) VerifyIssuer(cmp string, req bool) bool {
iss, _ := m["iss"].(string)
return verifyIss(iss, cmp, req)
}
// Compares the nbf claim against cmp.
// If required is false, this method will return true if the value matches or is unset
func (m MapClaims) VerifyNotBefore(cmp int64, req bool) bool {
switch nbf := m["nbf"].(type) {
case float64:
return verifyNbf(int64(nbf), cmp, req)
case json.Number:
v, _ := nbf.Int64()
return verifyNbf(v, cmp, req)
}
return req == false
}
// Validates time based claims "exp, iat, nbf".
// There is no accounting for clock skew.
// As well, if any of the above claims are not in the token, it will still
// be considered a valid claim.
func (m MapClaims) Valid() error {
vErr := new(ValidationError)
now := TimeFunc().Unix()
if m.VerifyExpiresAt(now, false) == false {
vErr.Inner = errors.New("Token is expired")
vErr.Errors |= ValidationErrorExpired
}
if m.VerifyIssuedAt(now, false) == false {
vErr.Inner = errors.New("Token used before issued")
vErr.Errors |= ValidationErrorIssuedAt
}
if m.VerifyNotBefore(now, false) == false {
vErr.Inner = errors.New("Token is not valid yet")
vErr.Errors |= ValidationErrorNotValidYet
}
if vErr.valid() {
return nil
}
return vErr
}

52
vendor/github.com/dgrijalva/jwt-go/none.go generated vendored Normal file
View File

@ -0,0 +1,52 @@
package jwt
// Implements the none signing method. This is required by the spec
// but you probably should never use it.
var SigningMethodNone *signingMethodNone
const UnsafeAllowNoneSignatureType unsafeNoneMagicConstant = "none signing method allowed"
var NoneSignatureTypeDisallowedError error
type signingMethodNone struct{}
type unsafeNoneMagicConstant string
func init() {
SigningMethodNone = &signingMethodNone{}
NoneSignatureTypeDisallowedError = NewValidationError("'none' signature type is not allowed", ValidationErrorSignatureInvalid)
RegisterSigningMethod(SigningMethodNone.Alg(), func() SigningMethod {
return SigningMethodNone
})
}
func (m *signingMethodNone) Alg() string {
return "none"
}
// Only allow 'none' alg type if UnsafeAllowNoneSignatureType is specified as the key
func (m *signingMethodNone) Verify(signingString, signature string, key interface{}) (err error) {
// Key must be UnsafeAllowNoneSignatureType to prevent accidentally
// accepting 'none' signing method
if _, ok := key.(unsafeNoneMagicConstant); !ok {
return NoneSignatureTypeDisallowedError
}
// If signing method is none, signature must be an empty string
if signature != "" {
return NewValidationError(
"'none' signing method with non-empty signature",
ValidationErrorSignatureInvalid,
)
}
// Accept 'none' signing method.
return nil
}
// Only allow 'none' signing if UnsafeAllowNoneSignatureType is specified as the key
func (m *signingMethodNone) Sign(signingString string, key interface{}) (string, error) {
if _, ok := key.(unsafeNoneMagicConstant); ok {
return "", nil
}
return "", NoneSignatureTypeDisallowedError
}

View File

@ -16,45 +16,59 @@ type Parser struct {
// keyFunc will receive the parsed token and should return the key for validating.
// If everything is kosher, err will be nil
func (p *Parser) Parse(tokenString string, keyFunc Keyfunc) (*Token, error) {
return p.ParseWithClaims(tokenString, MapClaims{}, keyFunc)
}
func (p *Parser) ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token, error) {
parts := strings.Split(tokenString, ".")
if len(parts) != 3 {
return nil, &ValidationError{err: "token contains an invalid number of segments", Errors: ValidationErrorMalformed}
return nil, NewValidationError("token contains an invalid number of segments", ValidationErrorMalformed)
}
var err error
token := &Token{Raw: tokenString}
// parse Header
var headerBytes []byte
if headerBytes, err = DecodeSegment(parts[0]); err != nil {
if strings.HasPrefix(strings.ToLower(tokenString), "bearer ") {
return token, &ValidationError{err: "tokenstring should not contain 'bearer '", Errors: ValidationErrorMalformed}
return token, NewValidationError("tokenstring should not contain 'bearer '", ValidationErrorMalformed)
}
return token, &ValidationError{err: err.Error(), Errors: ValidationErrorMalformed}
return token, &ValidationError{Inner: err, Errors: ValidationErrorMalformed}
}
if err = json.Unmarshal(headerBytes, &token.Header); err != nil {
return token, &ValidationError{err: err.Error(), Errors: ValidationErrorMalformed}
return token, &ValidationError{Inner: err, Errors: ValidationErrorMalformed}
}
// parse Claims
var claimBytes []byte
token.Claims = claims
if claimBytes, err = DecodeSegment(parts[1]); err != nil {
return token, &ValidationError{err: err.Error(), Errors: ValidationErrorMalformed}
return token, &ValidationError{Inner: err, Errors: ValidationErrorMalformed}
}
dec := json.NewDecoder(bytes.NewBuffer(claimBytes))
if p.UseJSONNumber {
dec.UseNumber()
}
if err = dec.Decode(&token.Claims); err != nil {
return token, &ValidationError{err: err.Error(), Errors: ValidationErrorMalformed}
// JSON Decode. Special case for map type to avoid weird pointer behavior
if c, ok := token.Claims.(MapClaims); ok {
err = dec.Decode(&c)
} else {
err = dec.Decode(&claims)
}
// Handle decode error
if err != nil {
return token, &ValidationError{Inner: err, Errors: ValidationErrorMalformed}
}
// Lookup signature method
if method, ok := token.Header["alg"].(string); ok {
if token.Method = GetSigningMethod(method); token.Method == nil {
return token, &ValidationError{err: "signing method (alg) is unavailable.", Errors: ValidationErrorUnverifiable}
return token, NewValidationError("signing method (alg) is unavailable.", ValidationErrorUnverifiable)
}
} else {
return token, &ValidationError{err: "signing method (alg) is unspecified.", Errors: ValidationErrorUnverifiable}
return token, NewValidationError("signing method (alg) is unspecified.", ValidationErrorUnverifiable)
}
// Verify signing method is in the required set
@ -69,7 +83,7 @@ func (p *Parser) Parse(tokenString string, keyFunc Keyfunc) (*Token, error) {
}
if !signingMethodValid {
// signing method is not in the listed set
return token, &ValidationError{err: fmt.Sprintf("signing method %v is invalid", alg), Errors: ValidationErrorSignatureInvalid}
return token, NewValidationError(fmt.Sprintf("signing method %v is invalid", alg), ValidationErrorSignatureInvalid)
}
}
@ -77,33 +91,31 @@ func (p *Parser) Parse(tokenString string, keyFunc Keyfunc) (*Token, error) {
var key interface{}
if keyFunc == nil {
// keyFunc was not provided. short circuiting validation
return token, &ValidationError{err: "no Keyfunc was provided.", Errors: ValidationErrorUnverifiable}
return token, NewValidationError("no Keyfunc was provided.", ValidationErrorUnverifiable)
}
if key, err = keyFunc(token); err != nil {
// keyFunc returned an error
return token, &ValidationError{err: err.Error(), Errors: ValidationErrorUnverifiable}
return token, &ValidationError{Inner: err, Errors: ValidationErrorUnverifiable}
}
// Check expiration times
vErr := &ValidationError{}
now := TimeFunc().Unix()
if exp, ok := token.Claims["exp"].(float64); ok {
if now > int64(exp) {
vErr.err = "token is expired"
vErr.Errors |= ValidationErrorExpired
}
}
if nbf, ok := token.Claims["nbf"].(float64); ok {
if now < int64(nbf) {
vErr.err = "token is not valid yet"
vErr.Errors |= ValidationErrorNotValidYet
// Validate Claims
if err := token.Claims.Valid(); err != nil {
// If the Claims Valid returned an error, check if it is a validation error,
// If it was another error type, create a ValidationError with a generic ClaimsInvalid flag set
if e, ok := err.(*ValidationError); !ok {
vErr = &ValidationError{Inner: err, Errors: ValidationErrorClaimsInvalid}
} else {
vErr = e
}
}
// Perform validation
token.Signature = parts[2]
if err = token.Method.Verify(strings.Join(parts[0:2], "."), token.Signature, key); err != nil {
vErr.err = err.Error()
vErr.Inner = err
vErr.Errors |= ValidationErrorSignatureInvalid
}

View File

@ -44,8 +44,7 @@ func (m *SigningMethodRSA) Alg() string {
}
// Implements the Verify method from SigningMethod
// For this signing method, must be either a PEM encoded PKCS1 or PKCS8 RSA public key as
// []byte, or an rsa.PublicKey structure.
// For this signing method, must be an rsa.PublicKey structure.
func (m *SigningMethodRSA) Verify(signingString, signature string, key interface{}) error {
var err error
@ -56,16 +55,10 @@ func (m *SigningMethodRSA) Verify(signingString, signature string, key interface
}
var rsaKey *rsa.PublicKey
var ok bool
switch k := key.(type) {
case []byte:
if rsaKey, err = ParseRSAPublicKeyFromPEM(k); err != nil {
return err
}
case *rsa.PublicKey:
rsaKey = k
default:
return ErrInvalidKey
if rsaKey, ok = key.(*rsa.PublicKey); !ok {
return ErrInvalidKeyType
}
// Create hasher
@ -80,20 +73,13 @@ func (m *SigningMethodRSA) Verify(signingString, signature string, key interface
}
// Implements the Sign method from SigningMethod
// For this signing method, must be either a PEM encoded PKCS1 or PKCS8 RSA private key as
// []byte, or an rsa.PrivateKey structure.
// For this signing method, must be an rsa.PrivateKey structure.
func (m *SigningMethodRSA) Sign(signingString string, key interface{}) (string, error) {
var err error
var rsaKey *rsa.PrivateKey
var ok bool
switch k := key.(type) {
case []byte:
if rsaKey, err = ParseRSAPrivateKeyFromPEM(k); err != nil {
return "", err
}
case *rsa.PrivateKey:
rsaKey = k
default:
// Validate type of key
if rsaKey, ok = key.(*rsa.PrivateKey); !ok {
return "", ErrInvalidKey
}

View File

@ -106,7 +106,7 @@ func (m *SigningMethodRSAPSS) Sign(signingString string, key interface{}) (strin
case *rsa.PrivateKey:
rsaKey = k
default:
return "", ErrInvalidKey
return "", ErrInvalidKeyType
}
// Create the hasher

View File

@ -10,6 +10,7 @@ import (
var (
ErrKeyMustBePEMEncoded = errors.New("Invalid Key: Key must be PEM encoded PKCS1 or PKCS8 private key")
ErrNotRSAPrivateKey = errors.New("Key is not a valid RSA private key")
ErrNotRSAPublicKey = errors.New("Key is not a valid RSA public key")
)
// Parse PEM encoded PKCS1 or PKCS8 private key
@ -61,7 +62,7 @@ func ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error) {
var pkey *rsa.PublicKey
var ok bool
if pkey, ok = parsedKey.(*rsa.PublicKey); !ok {
return nil, ErrNotRSAPrivateKey
return nil, ErrNotRSAPublicKey
}
return pkey, nil

View File

@ -1,6 +1,11 @@
package jwt
import (
"sync"
)
var signingMethods = map[string]func() SigningMethod{}
var signingMethodLock = new(sync.RWMutex)
// Implement SigningMethod to add new methods for signing or verifying tokens.
type SigningMethod interface {
@ -12,11 +17,17 @@ type SigningMethod interface {
// Register the "alg" name and a factory function for signing method.
// This is typically done during init() in the method's implementation
func RegisterSigningMethod(alg string, f func() SigningMethod) {
signingMethodLock.Lock()
defer signingMethodLock.Unlock()
signingMethods[alg] = f
}
// Get a signing method from an "alg" string
func GetSigningMethod(alg string) (method SigningMethod) {
signingMethodLock.RLock()
defer signingMethodLock.RUnlock()
if methodF, ok := signingMethods[alg]; ok {
method = methodF()
}

View File

@ -3,7 +3,6 @@ package jwt
import (
"encoding/base64"
"encoding/json"
"net/http"
"strings"
"time"
)
@ -15,7 +14,7 @@ var TimeFunc = time.Now
// Parse methods use this callback function to supply
// the key for verification. The function receives the parsed,
// but unverified Token. This allows you to use propries in the
// but unverified Token. This allows you to use properties in the
// Header of the token (such as `kid`) to identify which key to use.
type Keyfunc func(*Token) (interface{}, error)
@ -25,19 +24,23 @@ type Token struct {
Raw string // The raw token. Populated when you Parse a token
Method SigningMethod // The signing method used or to be used
Header map[string]interface{} // The first segment of the token
Claims map[string]interface{} // The second segment of the token
Claims Claims // The second segment of the token
Signature string // The third segment of the token. Populated when you Parse a token
Valid bool // Is the token valid? Populated when you Parse/Verify a token
}
// Create a new Token. Takes a signing method
func New(method SigningMethod) *Token {
return NewWithClaims(method, MapClaims{})
}
func NewWithClaims(method SigningMethod, claims Claims) *Token {
return &Token{
Header: map[string]interface{}{
"typ": "JWT",
"alg": method.Alg(),
},
Claims: make(map[string]interface{}),
Claims: claims,
Method: method,
}
}
@ -63,16 +66,15 @@ func (t *Token) SigningString() (string, error) {
var err error
parts := make([]string, 2)
for i, _ := range parts {
var source map[string]interface{}
if i == 0 {
source = t.Header
} else {
source = t.Claims
}
var jsonValue []byte
if jsonValue, err = json.Marshal(source); err != nil {
return "", err
if i == 0 {
if jsonValue, err = json.Marshal(t.Header); err != nil {
return "", err
}
} else {
if jsonValue, err = json.Marshal(t.Claims); err != nil {
return "", err
}
}
parts[i] = EncodeSegment(jsonValue)
@ -87,28 +89,8 @@ func Parse(tokenString string, keyFunc Keyfunc) (*Token, error) {
return new(Parser).Parse(tokenString, keyFunc)
}
// Try to find the token in an http.Request.
// This method will call ParseMultipartForm if there's no token in the header.
// Currently, it looks in the Authorization header as well as
// looking for an 'access_token' request parameter in req.Form.
func ParseFromRequest(req *http.Request, keyFunc Keyfunc) (token *Token, err error) {
// Look for an Authorization header
if ah := req.Header.Get("Authorization"); ah != "" {
// Should be a bearer token
if len(ah) > 6 && strings.ToUpper(ah[0:7]) == "BEARER " {
return Parse(ah[7:], keyFunc)
}
}
// Look for "access_token" parameter
req.ParseMultipartForm(10e6)
if tokStr := req.Form.Get("access_token"); tokStr != "" {
return Parse(tokStr, keyFunc)
}
return nil, ErrNoTokenInRequest
func ParseWithClaims(tokenString string, claims Claims, keyFunc Keyfunc) (*Token, error) {
return new(Parser).ParseWithClaims(tokenString, claims, keyFunc)
}
// Encode JWT specific base64url encoding with padding stripped

108
vendor/vendor.json vendored
View File

@ -3,134 +3,186 @@
"ignore": "appengine test",
"package": [
{
"checksumSHA1": "rJgU6MbpmtRBZH6JNByWvzNNKlM=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/arm/cdn",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "akhrj2PzJv19enRg4Ar6rE6FWLk=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/arm/compute",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "opJ3PtP7GCxGbMGTdqDIvAL30X0=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/arm/network",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "hBg0HREYbzIAzab2qpevBiYQ8V4=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/arm/resources/resources",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "HTn8BviQEiF6Tp98QWlov90du90=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/arm/scheduler",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "XtI6atfC23rgxiObn0Da6fvXL94=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/arm/storage",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "Q+0Zz0iylSKMck4JhYc8XR83i8M=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/core/http",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "F2fqk+OPM3drSkK0G6So5ASayyA=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/core/tls",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "SGOuRzxuQpJChBvq6SsNojKvcKw=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "TcQ6KXoBkvUhCYeggJ/bwcz+QaQ=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/affinitygroup",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "HfjyhRfmKBsVgWLTOfWVcxe8Z88=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/hostedservice",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "4otMhU6xZ41HfmiGZFYtV93GdcI=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/location",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "hxivwm3D13cqFGOlOS3q8HD7DN0=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/networksecuritygroup",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "2USoeYg8k1tA1QNLRByEnP/asqs=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/osimage",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "hzwziaU5QlMlFcFPdbEmW18oV3Y=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/sql",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "YoAhDE0X6hSFuPpXbpfqcTC0Zvw=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/storageservice",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "6xEiZL4a9rr5YbnY0RdzuzhEF1Q=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/virtualmachine",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "xcBM3zQtfcE3VHNBACJJGEesCBI=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/virtualmachinedisk",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "0bfdkDZ2JFV7bol6GQFfC0g+lP4=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/virtualmachineimage",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "IhjDqm84VDVSIoHyiGvUzuljG3s=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/virtualnetwork",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "KkKaKnxZ+I5qG0V0eg8vjNctI+E=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/management/vmutils",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "O6OHu5bxX1FAHpKt0TDSwPLvmzA=",
"comment": "v2.1.1-beta-8-gca4d906",
"path": "github.com/Azure/azure-sdk-for-go/storage",
"revision": "ca4d906d1c0973ae3022588df7dfa13d53b5b476"
"revision": "2cdbb8553a20830507e4178b4d0803794136dde7",
"revisionTime": "2016-06-29T16:19:23Z"
},
{
"checksumSHA1": "pi00alAztMy9MGxJmvg9qC+tsGk=",
"comment": "v7.0.5",
"path": "github.com/Azure/go-autorest/autorest",
"revision": "4bdf29b663ebad9598d2c391b73a4b46bdedbf42"
"revision": "9c64b6583716b13caa7f85398c3331229c38f168",
"revisionTime": "2016-06-28T23:39:30Z"
},
{
"checksumSHA1": "wP+cCq8z17Raoq9PndkX4J17W2w=",
"comment": "v7.0.5",
"path": "github.com/Azure/go-autorest/autorest/azure",
"revision": "4bdf29b663ebad9598d2c391b73a4b46bdedbf42"
"revision": "9c64b6583716b13caa7f85398c3331229c38f168",
"revisionTime": "2016-06-28T23:39:30Z"
},
{
"checksumSHA1": "q4bSpJ5t571H3ny1PwIgTn6g75E=",
"comment": "v7.0.5",
"path": "github.com/Azure/go-autorest/autorest/date",
"revision": "4bdf29b663ebad9598d2c391b73a4b46bdedbf42"
"revision": "9c64b6583716b13caa7f85398c3331229c38f168",
"revisionTime": "2016-06-28T23:39:30Z"
},
{
"checksumSHA1": "Ev8qCsbFjDlMlX0N2tYAhYQFpUc=",
"comment": "v7.0.5",
"path": "github.com/Azure/go-autorest/autorest/to",
"revision": "4bdf29b663ebad9598d2c391b73a4b46bdedbf42"
"revision": "9c64b6583716b13caa7f85398c3331229c38f168",
"revisionTime": "2016-06-28T23:39:30Z"
},
{
"comment": "0.0.2-27-gedd0930",
@ -566,9 +618,11 @@
"revision": "5215b55f46b2b919f50a1df0eaa5886afe4e3b3d"
},
{
"checksumSHA1": "yDQQpeUxwqB3C+4opweg6znWJQk=",
"comment": "v2.4.0-11-gf219341",
"path": "github.com/dgrijalva/jwt-go",
"revision": "f2193411bd642f7db03249fd79d5292c9b34916a"
"revision": "f0777076321ab64f6efc15a82d9d23b98539b943",
"revisionTime": "2016-06-17T17:01:58Z"
},
{
"comment": "v0.9.0-20-gf75d769",

Some files were not shown because too many files have changed in this diff Show More