[WIP] provider/azurerm: Bump sdk version to 7.0.1 (#10458)

* provider/azurerm: Bump sdk version to 7.0.1

* Fixing the build (#10489)

* Fixing the broken tests (#10499)

* Updating the method signatures to match (#10533)
This commit is contained in:
Paul Stack 2016-12-06 08:39:47 +00:00 committed by GitHub
parent dccdaceee0
commit 54459900c5
131 changed files with 4037 additions and 3034 deletions

View File

@ -41,11 +41,11 @@ func retrieveLoadBalancerById(loadBalancerId string, meta interface{}) (*network
} }
func findLoadBalancerBackEndAddressPoolByName(lb *network.LoadBalancer, name string) (*network.BackendAddressPool, int, bool) { func findLoadBalancerBackEndAddressPoolByName(lb *network.LoadBalancer, name string) (*network.BackendAddressPool, int, bool) {
if lb == nil || lb.Properties == nil || lb.Properties.BackendAddressPools == nil { if lb == nil || lb.LoadBalancerPropertiesFormat == nil || lb.LoadBalancerPropertiesFormat.BackendAddressPools == nil {
return nil, -1, false return nil, -1, false
} }
for i, apc := range *lb.Properties.BackendAddressPools { for i, apc := range *lb.LoadBalancerPropertiesFormat.BackendAddressPools {
if apc.Name != nil && *apc.Name == name { if apc.Name != nil && *apc.Name == name {
return &apc, i, true return &apc, i, true
} }
@ -55,11 +55,11 @@ func findLoadBalancerBackEndAddressPoolByName(lb *network.LoadBalancer, name str
} }
func findLoadBalancerFrontEndIpConfigurationByName(lb *network.LoadBalancer, name string) (*network.FrontendIPConfiguration, int, bool) { func findLoadBalancerFrontEndIpConfigurationByName(lb *network.LoadBalancer, name string) (*network.FrontendIPConfiguration, int, bool) {
if lb == nil || lb.Properties == nil || lb.Properties.FrontendIPConfigurations == nil { if lb == nil || lb.LoadBalancerPropertiesFormat == nil || lb.LoadBalancerPropertiesFormat.FrontendIPConfigurations == nil {
return nil, -1, false return nil, -1, false
} }
for i, feip := range *lb.Properties.FrontendIPConfigurations { for i, feip := range *lb.LoadBalancerPropertiesFormat.FrontendIPConfigurations {
if feip.Name != nil && *feip.Name == name { if feip.Name != nil && *feip.Name == name {
return &feip, i, true return &feip, i, true
} }
@ -69,11 +69,11 @@ func findLoadBalancerFrontEndIpConfigurationByName(lb *network.LoadBalancer, nam
} }
func findLoadBalancerRuleByName(lb *network.LoadBalancer, name string) (*network.LoadBalancingRule, int, bool) { func findLoadBalancerRuleByName(lb *network.LoadBalancer, name string) (*network.LoadBalancingRule, int, bool) {
if lb == nil || lb.Properties == nil || lb.Properties.LoadBalancingRules == nil { if lb == nil || lb.LoadBalancerPropertiesFormat == nil || lb.LoadBalancerPropertiesFormat.LoadBalancingRules == nil {
return nil, -1, false return nil, -1, false
} }
for i, lbr := range *lb.Properties.LoadBalancingRules { for i, lbr := range *lb.LoadBalancerPropertiesFormat.LoadBalancingRules {
if lbr.Name != nil && *lbr.Name == name { if lbr.Name != nil && *lbr.Name == name {
return &lbr, i, true return &lbr, i, true
} }
@ -83,11 +83,11 @@ func findLoadBalancerRuleByName(lb *network.LoadBalancer, name string) (*network
} }
func findLoadBalancerNatRuleByName(lb *network.LoadBalancer, name string) (*network.InboundNatRule, int, bool) { func findLoadBalancerNatRuleByName(lb *network.LoadBalancer, name string) (*network.InboundNatRule, int, bool) {
if lb == nil || lb.Properties == nil || lb.Properties.InboundNatRules == nil { if lb == nil || lb.LoadBalancerPropertiesFormat == nil || lb.LoadBalancerPropertiesFormat.InboundNatRules == nil {
return nil, -1, false return nil, -1, false
} }
for i, nr := range *lb.Properties.InboundNatRules { for i, nr := range *lb.LoadBalancerPropertiesFormat.InboundNatRules {
if nr.Name != nil && *nr.Name == name { if nr.Name != nil && *nr.Name == name {
return &nr, i, true return &nr, i, true
} }
@ -97,11 +97,11 @@ func findLoadBalancerNatRuleByName(lb *network.LoadBalancer, name string) (*netw
} }
func findLoadBalancerNatPoolByName(lb *network.LoadBalancer, name string) (*network.InboundNatPool, int, bool) { func findLoadBalancerNatPoolByName(lb *network.LoadBalancer, name string) (*network.InboundNatPool, int, bool) {
if lb == nil || lb.Properties == nil || lb.Properties.InboundNatPools == nil { if lb == nil || lb.LoadBalancerPropertiesFormat == nil || lb.LoadBalancerPropertiesFormat.InboundNatPools == nil {
return nil, -1, false return nil, -1, false
} }
for i, np := range *lb.Properties.InboundNatPools { for i, np := range *lb.LoadBalancerPropertiesFormat.InboundNatPools {
if np.Name != nil && *np.Name == name { if np.Name != nil && *np.Name == name {
return &np, i, true return &np, i, true
} }
@ -111,11 +111,11 @@ func findLoadBalancerNatPoolByName(lb *network.LoadBalancer, name string) (*netw
} }
func findLoadBalancerProbeByName(lb *network.LoadBalancer, name string) (*network.Probe, int, bool) { func findLoadBalancerProbeByName(lb *network.LoadBalancer, name string) (*network.Probe, int, bool) {
if lb == nil || lb.Properties == nil || lb.Properties.Probes == nil { if lb == nil || lb.LoadBalancerPropertiesFormat == nil || lb.LoadBalancerPropertiesFormat.Probes == nil {
return nil, -1, false return nil, -1, false
} }
for i, p := range *lb.Properties.Probes { for i, p := range *lb.LoadBalancerPropertiesFormat.Probes {
if p.Name != nil && *p.Name == name { if p.Name != nil && *p.Name == name {
return &p, i, true return &p, i, true
} }
@ -131,7 +131,7 @@ func loadbalancerStateRefreshFunc(client *ArmClient, resourceGroupName string, l
return nil, "", fmt.Errorf("Error issuing read request in loadbalancerStateRefreshFunc to Azure ARM for LoadBalancer '%s' (RG: '%s'): %s", loadbalancer, resourceGroupName, err) return nil, "", fmt.Errorf("Error issuing read request in loadbalancerStateRefreshFunc to Azure ARM for LoadBalancer '%s' (RG: '%s'): %s", loadbalancer, resourceGroupName, err)
} }
return res, *res.Properties.ProvisioningState, nil return res, *res.LoadBalancerPropertiesFormat.ProvisioningState, nil
} }
} }

View File

@ -86,7 +86,7 @@ func resourceArmAvailabilitySetCreate(d *schema.ResourceData, meta interface{})
availSet := compute.AvailabilitySet{ availSet := compute.AvailabilitySet{
Name: &name, Name: &name,
Location: &location, Location: &location,
Properties: &compute.AvailabilitySetProperties{ AvailabilitySetProperties: &compute.AvailabilitySetProperties{
PlatformFaultDomainCount: azure.Int32(int32(faultDomainCount)), PlatformFaultDomainCount: azure.Int32(int32(faultDomainCount)),
PlatformUpdateDomainCount: azure.Int32(int32(updateDomainCount)), PlatformUpdateDomainCount: azure.Int32(int32(updateDomainCount)),
}, },
@ -122,7 +122,7 @@ func resourceArmAvailabilitySetRead(d *schema.ResourceData, meta interface{}) er
return fmt.Errorf("Error making Read request on Azure Availability Set %s: %s", name, err) return fmt.Errorf("Error making Read request on Azure Availability Set %s: %s", name, err)
} }
availSet := *resp.Properties availSet := *resp.AvailabilitySetProperties
d.Set("resource_group_name", resGroup) d.Set("resource_group_name", resGroup)
d.Set("platform_update_domain_count", availSet.PlatformUpdateDomainCount) d.Set("platform_update_domain_count", availSet.PlatformUpdateDomainCount)
d.Set("platform_fault_domain_count", availSet.PlatformFaultDomainCount) d.Set("platform_fault_domain_count", availSet.PlatformFaultDomainCount)

View File

@ -194,7 +194,7 @@ func testCheckAzureRMAvailabilitySetDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("Availability Set still exists:\n%#v", resp.Properties) return fmt.Errorf("Availability Set still exists:\n%#v", resp.AvailabilitySetProperties)
} }
} }

View File

@ -148,7 +148,7 @@ func resourceArmCdnEndpointCreate(d *schema.ResourceData, meta interface{}) erro
caching_behaviour := d.Get("querystring_caching_behaviour").(string) caching_behaviour := d.Get("querystring_caching_behaviour").(string)
tags := d.Get("tags").(map[string]interface{}) tags := d.Get("tags").(map[string]interface{})
properties := cdn.EndpointPropertiesCreateParameters{ properties := cdn.EndpointProperties{
IsHTTPAllowed: &http_allowed, IsHTTPAllowed: &http_allowed,
IsHTTPSAllowed: &https_allowed, IsHTTPSAllowed: &https_allowed,
IsCompressionEnabled: &compression_enabled, IsCompressionEnabled: &compression_enabled,
@ -184,18 +184,18 @@ func resourceArmCdnEndpointCreate(d *schema.ResourceData, meta interface{}) erro
properties.ContentTypesToCompress = &content_types properties.ContentTypesToCompress = &content_types
} }
cdnEndpoint := cdn.EndpointCreateParameters{ cdnEndpoint := cdn.Endpoint{
Location: &location, Location: &location,
Properties: &properties, EndpointProperties: &properties,
Tags: expandTags(tags), Tags: expandTags(tags),
} }
_, err := cdnEndpointsClient.Create(name, cdnEndpoint, profileName, resGroup, make(chan struct{})) _, err := cdnEndpointsClient.Create(resGroup, profileName, name, cdnEndpoint, make(chan struct{}))
if err != nil { if err != nil {
return err return err
} }
read, err := cdnEndpointsClient.Get(name, profileName, resGroup) read, err := cdnEndpointsClient.Get(resGroup, profileName, name)
if err != nil { if err != nil {
return err return err
} }
@ -222,7 +222,7 @@ func resourceArmCdnEndpointRead(d *schema.ResourceData, meta interface{}) error
profileName = id.Path["Profiles"] profileName = id.Path["Profiles"]
} }
log.Printf("[INFO] Trying to find the AzureRM CDN Endpoint %s (Profile: %s, RG: %s)", name, profileName, resGroup) log.Printf("[INFO] Trying to find the AzureRM CDN Endpoint %s (Profile: %s, RG: %s)", name, profileName, resGroup)
resp, err := cdnEndpointsClient.Get(name, profileName, resGroup) resp, err := cdnEndpointsClient.Get(resGroup, profileName, name)
if err != nil { if err != nil {
if resp.StatusCode == http.StatusNotFound { if resp.StatusCode == http.StatusNotFound {
d.SetId("") d.SetId("")
@ -235,21 +235,21 @@ func resourceArmCdnEndpointRead(d *schema.ResourceData, meta interface{}) error
d.Set("resource_group_name", resGroup) d.Set("resource_group_name", resGroup)
d.Set("location", azureRMNormalizeLocation(*resp.Location)) d.Set("location", azureRMNormalizeLocation(*resp.Location))
d.Set("profile_name", profileName) d.Set("profile_name", profileName)
d.Set("host_name", resp.Properties.HostName) d.Set("host_name", resp.EndpointProperties.HostName)
d.Set("is_compression_enabled", resp.Properties.IsCompressionEnabled) d.Set("is_compression_enabled", resp.EndpointProperties.IsCompressionEnabled)
d.Set("is_http_allowed", resp.Properties.IsHTTPAllowed) d.Set("is_http_allowed", resp.EndpointProperties.IsHTTPAllowed)
d.Set("is_https_allowed", resp.Properties.IsHTTPSAllowed) d.Set("is_https_allowed", resp.EndpointProperties.IsHTTPSAllowed)
d.Set("querystring_caching_behaviour", resp.Properties.QueryStringCachingBehavior) d.Set("querystring_caching_behaviour", resp.EndpointProperties.QueryStringCachingBehavior)
if resp.Properties.OriginHostHeader != nil && *resp.Properties.OriginHostHeader != "" { if resp.EndpointProperties.OriginHostHeader != nil && *resp.EndpointProperties.OriginHostHeader != "" {
d.Set("origin_host_header", resp.Properties.OriginHostHeader) d.Set("origin_host_header", resp.EndpointProperties.OriginHostHeader)
} }
if resp.Properties.OriginPath != nil && *resp.Properties.OriginPath != "" { if resp.EndpointProperties.OriginPath != nil && *resp.EndpointProperties.OriginPath != "" {
d.Set("origin_path", resp.Properties.OriginPath) d.Set("origin_path", resp.EndpointProperties.OriginPath)
} }
if resp.Properties.ContentTypesToCompress != nil { if resp.EndpointProperties.ContentTypesToCompress != nil {
d.Set("content_types_to_compress", flattenAzureRMCdnEndpointContentTypes(resp.Properties.ContentTypesToCompress)) d.Set("content_types_to_compress", flattenAzureRMCdnEndpointContentTypes(resp.EndpointProperties.ContentTypesToCompress))
} }
d.Set("origin", flattenAzureRMCdnEndpointOrigin(resp.Properties.Origins)) d.Set("origin", flattenAzureRMCdnEndpointOrigin(resp.EndpointProperties.Origins))
flattenAndSetTags(d, resp.Tags) flattenAndSetTags(d, resp.Tags)
@ -302,10 +302,10 @@ func resourceArmCdnEndpointUpdate(d *schema.ResourceData, meta interface{}) erro
updateProps := cdn.EndpointUpdateParameters{ updateProps := cdn.EndpointUpdateParameters{
Tags: expandTags(newTags), Tags: expandTags(newTags),
Properties: &properties, EndpointPropertiesUpdateParameters: &properties,
} }
_, err := cdnEndpointsClient.Update(name, updateProps, profileName, resGroup, make(chan struct{})) _, err := cdnEndpointsClient.Update(resGroup, profileName, name, updateProps, make(chan struct{}))
if err != nil { if err != nil {
return fmt.Errorf("Error issuing Azure ARM update request to update CDN Endpoint %q: %s", name, err) return fmt.Errorf("Error issuing Azure ARM update request to update CDN Endpoint %q: %s", name, err)
} }
@ -327,7 +327,7 @@ func resourceArmCdnEndpointDelete(d *schema.ResourceData, meta interface{}) erro
} }
name := id.Path["endpoints"] name := id.Path["endpoints"]
accResp, err := client.DeleteIfExists(name, profileName, resGroup, make(chan struct{})) accResp, err := client.Delete(resGroup, profileName, name, make(chan struct{}))
if err != nil { if err != nil {
if accResp.StatusCode == http.StatusNotFound { if accResp.StatusCode == http.StatusNotFound {
return nil return nil
@ -389,7 +389,7 @@ func expandAzureRmCdnEndpointOrigins(d *schema.ResourceData) ([]cdn.DeepCreatedO
origin := cdn.DeepCreatedOrigin{ origin := cdn.DeepCreatedOrigin{
Name: &name, Name: &name,
Properties: &properties, DeepCreatedOriginProperties: &properties,
} }
origins = append(origins, origin) origins = append(origins, origin)
@ -403,14 +403,14 @@ func flattenAzureRMCdnEndpointOrigin(list *[]cdn.DeepCreatedOrigin) []map[string
for _, i := range *list { for _, i := range *list {
l := map[string]interface{}{ l := map[string]interface{}{
"name": *i.Name, "name": *i.Name,
"host_name": *i.Properties.HostName, "host_name": *i.DeepCreatedOriginProperties.HostName,
} }
if i.Properties.HTTPPort != nil { if i.DeepCreatedOriginProperties.HTTPPort != nil {
l["http_port"] = *i.Properties.HTTPPort l["http_port"] = *i.DeepCreatedOriginProperties.HTTPPort
} }
if i.Properties.HTTPSPort != nil { if i.DeepCreatedOriginProperties.HTTPSPort != nil {
l["https_port"] = *i.Properties.HTTPSPort l["https_port"] = *i.DeepCreatedOriginProperties.HTTPSPort
} }
result = append(result, l) result = append(result, l)
} }

View File

@ -104,7 +104,7 @@ func testCheckAzureRMCdnEndpointExists(name string) resource.TestCheckFunc {
conn := testAccProvider.Meta().(*ArmClient).cdnEndpointsClient conn := testAccProvider.Meta().(*ArmClient).cdnEndpointsClient
resp, err := conn.Get(name, profileName, resourceGroup) resp, err := conn.Get(resourceGroup, profileName, name)
if err != nil { if err != nil {
return fmt.Errorf("Bad: Get on cdnEndpointsClient: %s", err) return fmt.Errorf("Bad: Get on cdnEndpointsClient: %s", err)
} }
@ -134,7 +134,7 @@ func testCheckAzureRMCdnEndpointDisappears(name string) resource.TestCheckFunc {
conn := testAccProvider.Meta().(*ArmClient).cdnEndpointsClient conn := testAccProvider.Meta().(*ArmClient).cdnEndpointsClient
_, err := conn.DeleteIfExists(name, profileName, resourceGroup, make(chan struct{})) _, err := conn.Delete(resourceGroup, profileName, name, make(chan struct{}))
if err != nil { if err != nil {
return fmt.Errorf("Bad: Delete on cdnEndpointsClient: %s", err) return fmt.Errorf("Bad: Delete on cdnEndpointsClient: %s", err)
} }
@ -155,14 +155,14 @@ func testCheckAzureRMCdnEndpointDestroy(s *terraform.State) error {
resourceGroup := rs.Primary.Attributes["resource_group_name"] resourceGroup := rs.Primary.Attributes["resource_group_name"]
profileName := rs.Primary.Attributes["profile_name"] profileName := rs.Primary.Attributes["profile_name"]
resp, err := conn.Get(name, profileName, resourceGroup) resp, err := conn.Get(resourceGroup, profileName, name)
if err != nil { if err != nil {
return nil return nil
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("CDN Endpoint still exists:\n%#v", resp.Properties) return fmt.Errorf("CDN Endpoint still exists:\n%#v", resp.EndpointProperties)
} }
} }

View File

@ -60,7 +60,7 @@ func resourceArmCdnProfileCreate(d *schema.ResourceData, meta interface{}) error
sku := d.Get("sku").(string) sku := d.Get("sku").(string)
tags := d.Get("tags").(map[string]interface{}) tags := d.Get("tags").(map[string]interface{})
cdnProfile := cdn.ProfileCreateParameters{ cdnProfile := cdn.Profile{
Location: &location, Location: &location,
Tags: expandTags(tags), Tags: expandTags(tags),
Sku: &cdn.Sku{ Sku: &cdn.Sku{
@ -68,12 +68,12 @@ func resourceArmCdnProfileCreate(d *schema.ResourceData, meta interface{}) error
}, },
} }
_, err := cdnProfilesClient.Create(name, cdnProfile, resGroup, make(chan struct{})) _, err := cdnProfilesClient.Create(resGroup, name, cdnProfile, make(chan struct{}))
if err != nil { if err != nil {
return err return err
} }
read, err := cdnProfilesClient.Get(name, resGroup) read, err := cdnProfilesClient.Get(resGroup, name)
if err != nil { if err != nil {
return err return err
} }
@ -96,7 +96,7 @@ func resourceArmCdnProfileRead(d *schema.ResourceData, meta interface{}) error {
resGroup := id.ResourceGroup resGroup := id.ResourceGroup
name := id.Path["profiles"] name := id.Path["profiles"]
resp, err := cdnProfilesClient.Get(name, resGroup) resp, err := cdnProfilesClient.Get(resGroup, name)
if err != nil { if err != nil {
if resp.StatusCode == http.StatusNotFound { if resp.StatusCode == http.StatusNotFound {
d.SetId("") d.SetId("")
@ -133,7 +133,7 @@ func resourceArmCdnProfileUpdate(d *schema.ResourceData, meta interface{}) error
Tags: expandTags(newTags), Tags: expandTags(newTags),
} }
_, err := cdnProfilesClient.Update(name, props, resGroup, make(chan struct{})) _, err := cdnProfilesClient.Update(resGroup, name, props, make(chan struct{}))
if err != nil { if err != nil {
return fmt.Errorf("Error issuing Azure ARM update request to update CDN Profile %q: %s", name, err) return fmt.Errorf("Error issuing Azure ARM update request to update CDN Profile %q: %s", name, err)
} }
@ -151,7 +151,8 @@ func resourceArmCdnProfileDelete(d *schema.ResourceData, meta interface{}) error
resGroup := id.ResourceGroup resGroup := id.ResourceGroup
name := id.Path["profiles"] name := id.Path["profiles"]
_, err = cdnProfilesClient.DeleteIfExists(name, resGroup, make(chan struct{})) _, err = cdnProfilesClient.Delete(resGroup, name, make(chan struct{}))
// TODO: check the status code
return err return err
} }

View File

@ -124,7 +124,7 @@ func testCheckAzureRMCdnProfileExists(name string) resource.TestCheckFunc {
conn := testAccProvider.Meta().(*ArmClient).cdnProfilesClient conn := testAccProvider.Meta().(*ArmClient).cdnProfilesClient
resp, err := conn.Get(name, resourceGroup) resp, err := conn.Get(resourceGroup, name)
if err != nil { if err != nil {
return fmt.Errorf("Bad: Get on cdnProfilesClient: %s", err) return fmt.Errorf("Bad: Get on cdnProfilesClient: %s", err)
} }
@ -148,14 +148,14 @@ func testCheckAzureRMCdnProfileDestroy(s *terraform.State) error {
name := rs.Primary.Attributes["name"] name := rs.Primary.Attributes["name"]
resourceGroup := rs.Primary.Attributes["resource_group_name"] resourceGroup := rs.Primary.Attributes["resource_group_name"]
resp, err := conn.Get(name, resourceGroup) resp, err := conn.Get(resourceGroup, name)
if err != nil { if err != nil {
return nil return nil
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("CDN Profile still exists:\n%#v", resp.Properties) return fmt.Errorf("CDN Profile still exists:\n%#v", resp.ProfileProperties)
} }
} }

View File

@ -164,7 +164,7 @@ func testCheckAzureRMEventHubNamespaceDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("EventHub Namespace still exists:\n%#v", resp.Properties) return fmt.Errorf("EventHub Namespace still exists:\n%#v", resp.NamespaceProperties)
} }
} }

View File

@ -114,7 +114,7 @@ func resourceArmLoadBalancerCreate(d *schema.ResourceData, meta interface{}) err
Name: azure.String(name), Name: azure.String(name),
Location: azure.String(location), Location: azure.String(location),
Tags: expandedTags, Tags: expandedTags,
Properties: &properties, LoadBalancerPropertiesFormat: &properties,
} }
_, err := loadBalancerClient.CreateOrUpdate(resGroup, name, loadbalancer, make(chan struct{})) _, err := loadBalancerClient.CreateOrUpdate(resGroup, name, loadbalancer, make(chan struct{}))
@ -157,8 +157,8 @@ func resourecArmLoadBalancerRead(d *schema.ResourceData, meta interface{}) error
return nil return nil
} }
if loadBalancer.Properties != nil && loadBalancer.Properties.FrontendIPConfigurations != nil { if loadBalancer.LoadBalancerPropertiesFormat != nil && loadBalancer.LoadBalancerPropertiesFormat.FrontendIPConfigurations != nil {
d.Set("frontend_ip_configuration", flattenLoadBalancerFrontendIpConfiguration(loadBalancer.Properties.FrontendIPConfigurations)) d.Set("frontend_ip_configuration", flattenLoadBalancerFrontendIpConfiguration(loadBalancer.LoadBalancerPropertiesFormat.FrontendIPConfigurations))
} }
flattenAndSetTags(d, loadBalancer.Tags) flattenAndSetTags(d, loadBalancer.Tags)
@ -216,7 +216,7 @@ func expandAzureRmLoadBalancerFrontendIpConfigurations(d *schema.ResourceData) *
name := data["name"].(string) name := data["name"].(string)
frontEndConfig := network.FrontendIPConfiguration{ frontEndConfig := network.FrontendIPConfiguration{
Name: &name, Name: &name,
Properties: &properties, FrontendIPConfigurationPropertiesFormat: &properties,
} }
frontEndConfigs = append(frontEndConfigs, frontEndConfig) frontEndConfigs = append(frontEndConfigs, frontEndConfig)
@ -230,23 +230,23 @@ func flattenLoadBalancerFrontendIpConfiguration(ipConfigs *[]network.FrontendIPC
for _, config := range *ipConfigs { for _, config := range *ipConfigs {
ipConfig := make(map[string]interface{}) ipConfig := make(map[string]interface{})
ipConfig["name"] = *config.Name ipConfig["name"] = *config.Name
ipConfig["private_ip_address_allocation"] = config.Properties.PrivateIPAllocationMethod ipConfig["private_ip_address_allocation"] = config.FrontendIPConfigurationPropertiesFormat.PrivateIPAllocationMethod
if config.Properties.Subnet != nil { if config.FrontendIPConfigurationPropertiesFormat.Subnet != nil {
ipConfig["subnet_id"] = *config.Properties.Subnet.ID ipConfig["subnet_id"] = *config.FrontendIPConfigurationPropertiesFormat.Subnet.ID
} }
if config.Properties.PrivateIPAddress != nil { if config.FrontendIPConfigurationPropertiesFormat.PrivateIPAddress != nil {
ipConfig["private_ip_address"] = *config.Properties.PrivateIPAddress ipConfig["private_ip_address"] = *config.FrontendIPConfigurationPropertiesFormat.PrivateIPAddress
} }
if config.Properties.PublicIPAddress != nil { if config.FrontendIPConfigurationPropertiesFormat.PublicIPAddress != nil {
ipConfig["public_ip_address_id"] = *config.Properties.PublicIPAddress.ID ipConfig["public_ip_address_id"] = *config.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.ID
} }
if config.Properties.LoadBalancingRules != nil { if config.FrontendIPConfigurationPropertiesFormat.LoadBalancingRules != nil {
load_balancing_rules := make([]string, 0, len(*config.Properties.LoadBalancingRules)) load_balancing_rules := make([]string, 0, len(*config.FrontendIPConfigurationPropertiesFormat.LoadBalancingRules))
for _, rule := range *config.Properties.LoadBalancingRules { for _, rule := range *config.FrontendIPConfigurationPropertiesFormat.LoadBalancingRules {
load_balancing_rules = append(load_balancing_rules, *rule.ID) load_balancing_rules = append(load_balancing_rules, *rule.ID)
} }
@ -254,9 +254,9 @@ func flattenLoadBalancerFrontendIpConfiguration(ipConfigs *[]network.FrontendIPC
} }
if config.Properties.InboundNatRules != nil { if config.FrontendIPConfigurationPropertiesFormat.InboundNatRules != nil {
inbound_nat_rules := make([]string, 0, len(*config.Properties.InboundNatRules)) inbound_nat_rules := make([]string, 0, len(*config.FrontendIPConfigurationPropertiesFormat.InboundNatRules))
for _, rule := range *config.Properties.InboundNatRules { for _, rule := range *config.FrontendIPConfigurationPropertiesFormat.InboundNatRules {
inbound_nat_rules = append(inbound_nat_rules, *rule.ID) inbound_nat_rules = append(inbound_nat_rules, *rule.ID)
} }

View File

@ -79,8 +79,8 @@ func resourceArmLoadBalancerBackendAddressPoolCreate(d *schema.ResourceData, met
return fmt.Errorf("A BackEnd Address Pool with name %q already exists.", d.Get("name").(string)) return fmt.Errorf("A BackEnd Address Pool with name %q already exists.", d.Get("name").(string))
} }
backendAddressPools := append(*loadBalancer.Properties.BackendAddressPools, expandAzureRmLoadBalancerBackendAddressPools(d)) backendAddressPools := append(*loadBalancer.LoadBalancerPropertiesFormat.BackendAddressPools, expandAzureRmLoadBalancerBackendAddressPools(d))
loadBalancer.Properties.BackendAddressPools = &backendAddressPools loadBalancer.LoadBalancerPropertiesFormat.BackendAddressPools = &backendAddressPools
resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string)) resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string))
if err != nil { if err != nil {
return errwrap.Wrapf("Error Getting LoadBalancer Name and Group: {{err}}", err) return errwrap.Wrapf("Error Getting LoadBalancer Name and Group: {{err}}", err)
@ -100,7 +100,7 @@ func resourceArmLoadBalancerBackendAddressPoolCreate(d *schema.ResourceData, met
} }
var pool_id string var pool_id string
for _, BackendAddressPool := range *(*read.Properties).BackendAddressPools { for _, BackendAddressPool := range *(*read.LoadBalancerPropertiesFormat).BackendAddressPools {
if *BackendAddressPool.Name == d.Get("name").(string) { if *BackendAddressPool.Name == d.Get("name").(string) {
pool_id = *BackendAddressPool.ID pool_id = *BackendAddressPool.ID
} }
@ -137,23 +137,23 @@ func resourceArmLoadBalancerBackendAddressPoolRead(d *schema.ResourceData, meta
return nil return nil
} }
configs := *loadBalancer.Properties.BackendAddressPools configs := *loadBalancer.LoadBalancerPropertiesFormat.BackendAddressPools
for _, config := range configs { for _, config := range configs {
if *config.Name == d.Get("name").(string) { if *config.Name == d.Get("name").(string) {
d.Set("name", config.Name) d.Set("name", config.Name)
if config.Properties.BackendIPConfigurations != nil { if config.BackendAddressPoolPropertiesFormat.BackendIPConfigurations != nil {
backend_ip_configurations := make([]string, 0, len(*config.Properties.BackendIPConfigurations)) backend_ip_configurations := make([]string, 0, len(*config.BackendAddressPoolPropertiesFormat.BackendIPConfigurations))
for _, backendConfig := range *config.Properties.BackendIPConfigurations { for _, backendConfig := range *config.BackendAddressPoolPropertiesFormat.BackendIPConfigurations {
backend_ip_configurations = append(backend_ip_configurations, *backendConfig.ID) backend_ip_configurations = append(backend_ip_configurations, *backendConfig.ID)
} }
d.Set("backend_ip_configurations", backend_ip_configurations) d.Set("backend_ip_configurations", backend_ip_configurations)
} }
if config.Properties.LoadBalancingRules != nil { if config.BackendAddressPoolPropertiesFormat.LoadBalancingRules != nil {
load_balancing_rules := make([]string, 0, len(*config.Properties.LoadBalancingRules)) load_balancing_rules := make([]string, 0, len(*config.BackendAddressPoolPropertiesFormat.LoadBalancingRules))
for _, rule := range *config.Properties.LoadBalancingRules { for _, rule := range *config.BackendAddressPoolPropertiesFormat.LoadBalancingRules {
load_balancing_rules = append(load_balancing_rules, *rule.ID) load_balancing_rules = append(load_balancing_rules, *rule.ID)
} }
@ -189,9 +189,9 @@ func resourceArmLoadBalancerBackendAddressPoolDelete(d *schema.ResourceData, met
return nil return nil
} }
oldBackEndPools := *loadBalancer.Properties.BackendAddressPools oldBackEndPools := *loadBalancer.LoadBalancerPropertiesFormat.BackendAddressPools
newBackEndPools := append(oldBackEndPools[:index], oldBackEndPools[index+1:]...) newBackEndPools := append(oldBackEndPools[:index], oldBackEndPools[index+1:]...)
loadBalancer.Properties.BackendAddressPools = &newBackEndPools loadBalancer.LoadBalancerPropertiesFormat.BackendAddressPools = &newBackEndPools
resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string)) resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string))
if err != nil { if err != nil {

View File

@ -96,7 +96,7 @@ func resourceArmLoadBalancerNatPoolCreate(d *schema.ResourceData, meta interface
return errwrap.Wrapf("Error Expanding NAT Pool {{err}}", err) return errwrap.Wrapf("Error Expanding NAT Pool {{err}}", err)
} }
natPools := append(*loadBalancer.Properties.InboundNatPools, *newNatPool) natPools := append(*loadBalancer.LoadBalancerPropertiesFormat.InboundNatPools, *newNatPool)
existingNatPool, existingNatPoolIndex, exists := findLoadBalancerNatPoolByName(loadBalancer, d.Get("name").(string)) existingNatPool, existingNatPoolIndex, exists := findLoadBalancerNatPoolByName(loadBalancer, d.Get("name").(string))
if exists { if exists {
@ -108,7 +108,7 @@ func resourceArmLoadBalancerNatPoolCreate(d *schema.ResourceData, meta interface
} }
} }
loadBalancer.Properties.InboundNatPools = &natPools loadBalancer.LoadBalancerPropertiesFormat.InboundNatPools = &natPools
resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string)) resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string))
if err != nil { if err != nil {
return errwrap.Wrapf("Error Getting LoadBalancer Name and Group: {{err}}", err) return errwrap.Wrapf("Error Getting LoadBalancer Name and Group: {{err}}", err)
@ -128,7 +128,7 @@ func resourceArmLoadBalancerNatPoolCreate(d *schema.ResourceData, meta interface
} }
var natPool_id string var natPool_id string
for _, InboundNatPool := range *(*read.Properties).InboundNatPools { for _, InboundNatPool := range *(*read.LoadBalancerPropertiesFormat).InboundNatPools {
if *InboundNatPool.Name == d.Get("name").(string) { if *InboundNatPool.Name == d.Get("name").(string) {
natPool_id = *InboundNatPool.ID natPool_id = *InboundNatPool.ID
} }
@ -165,18 +165,18 @@ func resourceArmLoadBalancerNatPoolRead(d *schema.ResourceData, meta interface{}
return nil return nil
} }
configs := *loadBalancer.Properties.InboundNatPools configs := *loadBalancer.LoadBalancerPropertiesFormat.InboundNatPools
for _, config := range configs { for _, config := range configs {
if *config.Name == d.Get("name").(string) { if *config.Name == d.Get("name").(string) {
d.Set("name", config.Name) d.Set("name", config.Name)
d.Set("protocol", config.Properties.Protocol) d.Set("protocol", config.InboundNatPoolPropertiesFormat.Protocol)
d.Set("frontend_port_start", config.Properties.FrontendPortRangeStart) d.Set("frontend_port_start", config.InboundNatPoolPropertiesFormat.FrontendPortRangeStart)
d.Set("frontend_port_end", config.Properties.FrontendPortRangeEnd) d.Set("frontend_port_end", config.InboundNatPoolPropertiesFormat.FrontendPortRangeEnd)
d.Set("backend_port", config.Properties.BackendPort) d.Set("backend_port", config.InboundNatPoolPropertiesFormat.BackendPort)
if config.Properties.FrontendIPConfiguration != nil { if config.InboundNatPoolPropertiesFormat.FrontendIPConfiguration != nil {
d.Set("frontend_ip_configuration_id", config.Properties.FrontendIPConfiguration.ID) d.Set("frontend_ip_configuration_id", config.InboundNatPoolPropertiesFormat.FrontendIPConfiguration.ID)
} }
break break
@ -208,9 +208,9 @@ func resourceArmLoadBalancerNatPoolDelete(d *schema.ResourceData, meta interface
return nil return nil
} }
oldNatPools := *loadBalancer.Properties.InboundNatPools oldNatPools := *loadBalancer.LoadBalancerPropertiesFormat.InboundNatPools
newNatPools := append(oldNatPools[:index], oldNatPools[index+1:]...) newNatPools := append(oldNatPools[:index], oldNatPools[index+1:]...)
loadBalancer.Properties.InboundNatPools = &newNatPools loadBalancer.LoadBalancerPropertiesFormat.InboundNatPools = &newNatPools
resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string)) resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string))
if err != nil { if err != nil {
@ -257,7 +257,7 @@ func expandAzureRmLoadBalancerNatPool(d *schema.ResourceData, lb *network.LoadBa
natPool := network.InboundNatPool{ natPool := network.InboundNatPool{
Name: azure.String(d.Get("name").(string)), Name: azure.String(d.Get("name").(string)),
Properties: &properties, InboundNatPoolPropertiesFormat: &properties,
} }
return &natPool, nil return &natPool, nil

View File

@ -96,7 +96,7 @@ func resourceArmLoadBalancerNatRuleCreate(d *schema.ResourceData, meta interface
return errwrap.Wrapf("Error Expanding NAT Rule {{err}}", err) return errwrap.Wrapf("Error Expanding NAT Rule {{err}}", err)
} }
natRules := append(*loadBalancer.Properties.InboundNatRules, *newNatRule) natRules := append(*loadBalancer.LoadBalancerPropertiesFormat.InboundNatRules, *newNatRule)
existingNatRule, existingNatRuleIndex, exists := findLoadBalancerNatRuleByName(loadBalancer, d.Get("name").(string)) existingNatRule, existingNatRuleIndex, exists := findLoadBalancerNatRuleByName(loadBalancer, d.Get("name").(string))
if exists { if exists {
@ -108,7 +108,7 @@ func resourceArmLoadBalancerNatRuleCreate(d *schema.ResourceData, meta interface
} }
} }
loadBalancer.Properties.InboundNatRules = &natRules loadBalancer.LoadBalancerPropertiesFormat.InboundNatRules = &natRules
resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string)) resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string))
if err != nil { if err != nil {
return errwrap.Wrapf("Error Getting LoadBalancer Name and Group: {{err}}", err) return errwrap.Wrapf("Error Getting LoadBalancer Name and Group: {{err}}", err)
@ -128,7 +128,7 @@ func resourceArmLoadBalancerNatRuleCreate(d *schema.ResourceData, meta interface
} }
var natRule_id string var natRule_id string
for _, InboundNatRule := range *(*read.Properties).InboundNatRules { for _, InboundNatRule := range *(*read.LoadBalancerPropertiesFormat).InboundNatRules {
if *InboundNatRule.Name == d.Get("name").(string) { if *InboundNatRule.Name == d.Get("name").(string) {
natRule_id = *InboundNatRule.ID natRule_id = *InboundNatRule.ID
} }
@ -165,21 +165,21 @@ func resourceArmLoadBalancerNatRuleRead(d *schema.ResourceData, meta interface{}
return nil return nil
} }
configs := *loadBalancer.Properties.InboundNatRules configs := *loadBalancer.LoadBalancerPropertiesFormat.InboundNatRules
for _, config := range configs { for _, config := range configs {
if *config.Name == d.Get("name").(string) { if *config.Name == d.Get("name").(string) {
d.Set("name", config.Name) d.Set("name", config.Name)
d.Set("protocol", config.Properties.Protocol) d.Set("protocol", config.InboundNatRulePropertiesFormat.Protocol)
d.Set("frontend_port", config.Properties.FrontendPort) d.Set("frontend_port", config.InboundNatRulePropertiesFormat.FrontendPort)
d.Set("backend_port", config.Properties.BackendPort) d.Set("backend_port", config.InboundNatRulePropertiesFormat.BackendPort)
if config.Properties.FrontendIPConfiguration != nil { if config.InboundNatRulePropertiesFormat.FrontendIPConfiguration != nil {
d.Set("frontend_ip_configuration_id", config.Properties.FrontendIPConfiguration.ID) d.Set("frontend_ip_configuration_id", config.InboundNatRulePropertiesFormat.FrontendIPConfiguration.ID)
} }
if config.Properties.BackendIPConfiguration != nil { if config.InboundNatRulePropertiesFormat.BackendIPConfiguration != nil {
d.Set("backend_ip_configuration_id", config.Properties.BackendIPConfiguration.ID) d.Set("backend_ip_configuration_id", config.InboundNatRulePropertiesFormat.BackendIPConfiguration.ID)
} }
break break
@ -211,9 +211,9 @@ func resourceArmLoadBalancerNatRuleDelete(d *schema.ResourceData, meta interface
return nil return nil
} }
oldNatRules := *loadBalancer.Properties.InboundNatRules oldNatRules := *loadBalancer.LoadBalancerPropertiesFormat.InboundNatRules
newNatRules := append(oldNatRules[:index], oldNatRules[index+1:]...) newNatRules := append(oldNatRules[:index], oldNatRules[index+1:]...)
loadBalancer.Properties.InboundNatRules = &newNatRules loadBalancer.LoadBalancerPropertiesFormat.InboundNatRules = &newNatRules
resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string)) resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string))
if err != nil { if err != nil {
@ -259,7 +259,7 @@ func expandAzureRmLoadBalancerNatRule(d *schema.ResourceData, lb *network.LoadBa
natRule := network.InboundNatRule{ natRule := network.InboundNatRule{
Name: azure.String(d.Get("name").(string)), Name: azure.String(d.Get("name").(string)),
Properties: &properties, InboundNatRulePropertiesFormat: &properties,
} }
return &natRule, nil return &natRule, nil

View File

@ -102,7 +102,7 @@ func resourceArmLoadBalancerProbeCreate(d *schema.ResourceData, meta interface{}
return errwrap.Wrapf("Error Expanding Probe {{err}}", err) return errwrap.Wrapf("Error Expanding Probe {{err}}", err)
} }
probes := append(*loadBalancer.Properties.Probes, *newProbe) probes := append(*loadBalancer.LoadBalancerPropertiesFormat.Probes, *newProbe)
existingProbe, existingProbeIndex, exists := findLoadBalancerProbeByName(loadBalancer, d.Get("name").(string)) existingProbe, existingProbeIndex, exists := findLoadBalancerProbeByName(loadBalancer, d.Get("name").(string))
if exists { if exists {
@ -114,7 +114,7 @@ func resourceArmLoadBalancerProbeCreate(d *schema.ResourceData, meta interface{}
} }
} }
loadBalancer.Properties.Probes = &probes loadBalancer.LoadBalancerPropertiesFormat.Probes = &probes
resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string)) resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string))
if err != nil { if err != nil {
return errwrap.Wrapf("Error Getting LoadBalancer Name and Group: {{err}}", err) return errwrap.Wrapf("Error Getting LoadBalancer Name and Group: {{err}}", err)
@ -134,7 +134,7 @@ func resourceArmLoadBalancerProbeCreate(d *schema.ResourceData, meta interface{}
} }
var createdProbe_id string var createdProbe_id string
for _, Probe := range *(*read.Properties).Probes { for _, Probe := range *(*read.LoadBalancerPropertiesFormat).Probes {
if *Probe.Name == d.Get("name").(string) { if *Probe.Name == d.Get("name").(string) {
createdProbe_id = *Probe.ID createdProbe_id = *Probe.ID
} }
@ -171,16 +171,16 @@ func resourceArmLoadBalancerProbeRead(d *schema.ResourceData, meta interface{})
return nil return nil
} }
configs := *loadBalancer.Properties.Probes configs := *loadBalancer.LoadBalancerPropertiesFormat.Probes
for _, config := range configs { for _, config := range configs {
if *config.Name == d.Get("name").(string) { if *config.Name == d.Get("name").(string) {
d.Set("name", config.Name) d.Set("name", config.Name)
d.Set("protocol", config.Properties.Protocol) d.Set("protocol", config.ProbePropertiesFormat.Protocol)
d.Set("interval_in_seconds", config.Properties.IntervalInSeconds) d.Set("interval_in_seconds", config.ProbePropertiesFormat.IntervalInSeconds)
d.Set("number_of_probes", config.Properties.NumberOfProbes) d.Set("number_of_probes", config.ProbePropertiesFormat.NumberOfProbes)
d.Set("port", config.Properties.Port) d.Set("port", config.ProbePropertiesFormat.Port)
d.Set("request_path", config.Properties.RequestPath) d.Set("request_path", config.ProbePropertiesFormat.RequestPath)
break break
} }
@ -211,9 +211,9 @@ func resourceArmLoadBalancerProbeDelete(d *schema.ResourceData, meta interface{}
return nil return nil
} }
oldProbes := *loadBalancer.Properties.Probes oldProbes := *loadBalancer.LoadBalancerPropertiesFormat.Probes
newProbes := append(oldProbes[:index], oldProbes[index+1:]...) newProbes := append(oldProbes[:index], oldProbes[index+1:]...)
loadBalancer.Properties.Probes = &newProbes loadBalancer.LoadBalancerPropertiesFormat.Probes = &newProbes
resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string)) resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string))
if err != nil { if err != nil {
@ -254,7 +254,7 @@ func expandAzureRmLoadBalancerProbe(d *schema.ResourceData, lb *network.LoadBala
probe := network.Probe{ probe := network.Probe{
Name: azure.String(d.Get("name").(string)), Name: azure.String(d.Get("name").(string)),
Properties: &properties, ProbePropertiesFormat: &properties,
} }
return &probe, nil return &probe, nil

View File

@ -123,7 +123,7 @@ func resourceArmLoadBalancerRuleCreate(d *schema.ResourceData, meta interface{})
return errwrap.Wrapf("Error Exanding LoadBalancer Rule {{err}}", err) return errwrap.Wrapf("Error Exanding LoadBalancer Rule {{err}}", err)
} }
lbRules := append(*loadBalancer.Properties.LoadBalancingRules, *newLbRule) lbRules := append(*loadBalancer.LoadBalancerPropertiesFormat.LoadBalancingRules, *newLbRule)
existingRule, existingRuleIndex, exists := findLoadBalancerRuleByName(loadBalancer, d.Get("name").(string)) existingRule, existingRuleIndex, exists := findLoadBalancerRuleByName(loadBalancer, d.Get("name").(string))
if exists { if exists {
@ -135,7 +135,7 @@ func resourceArmLoadBalancerRuleCreate(d *schema.ResourceData, meta interface{})
} }
} }
loadBalancer.Properties.LoadBalancingRules = &lbRules loadBalancer.LoadBalancerPropertiesFormat.LoadBalancingRules = &lbRules
resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string)) resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string))
if err != nil { if err != nil {
return errwrap.Wrapf("Error Getting LoadBalancer Name and Group: {{err}}", err) return errwrap.Wrapf("Error Getting LoadBalancer Name and Group: {{err}}", err)
@ -155,7 +155,7 @@ func resourceArmLoadBalancerRuleCreate(d *schema.ResourceData, meta interface{})
} }
var rule_id string var rule_id string
for _, LoadBalancingRule := range *(*read.Properties).LoadBalancingRules { for _, LoadBalancingRule := range *(*read.LoadBalancerPropertiesFormat).LoadBalancingRules {
if *LoadBalancingRule.Name == d.Get("name").(string) { if *LoadBalancingRule.Name == d.Get("name").(string) {
rule_id = *LoadBalancingRule.ID rule_id = *LoadBalancingRule.ID
} }
@ -192,37 +192,37 @@ func resourceArmLoadBalancerRuleRead(d *schema.ResourceData, meta interface{}) e
return nil return nil
} }
configs := *loadBalancer.Properties.LoadBalancingRules configs := *loadBalancer.LoadBalancerPropertiesFormat.LoadBalancingRules
for _, config := range configs { for _, config := range configs {
if *config.Name == d.Get("name").(string) { if *config.Name == d.Get("name").(string) {
d.Set("name", config.Name) d.Set("name", config.Name)
d.Set("protocol", config.Properties.Protocol) d.Set("protocol", config.LoadBalancingRulePropertiesFormat.Protocol)
d.Set("frontend_port", config.Properties.FrontendPort) d.Set("frontend_port", config.LoadBalancingRulePropertiesFormat.FrontendPort)
d.Set("backend_port", config.Properties.BackendPort) d.Set("backend_port", config.LoadBalancingRulePropertiesFormat.BackendPort)
if config.Properties.EnableFloatingIP != nil { if config.LoadBalancingRulePropertiesFormat.EnableFloatingIP != nil {
d.Set("enable_floating_ip", config.Properties.EnableFloatingIP) d.Set("enable_floating_ip", config.LoadBalancingRulePropertiesFormat.EnableFloatingIP)
} }
if config.Properties.IdleTimeoutInMinutes != nil { if config.LoadBalancingRulePropertiesFormat.IdleTimeoutInMinutes != nil {
d.Set("idle_timeout_in_minutes", config.Properties.IdleTimeoutInMinutes) d.Set("idle_timeout_in_minutes", config.LoadBalancingRulePropertiesFormat.IdleTimeoutInMinutes)
} }
if config.Properties.FrontendIPConfiguration != nil { if config.LoadBalancingRulePropertiesFormat.FrontendIPConfiguration != nil {
d.Set("frontend_ip_configuration_id", config.Properties.FrontendIPConfiguration.ID) d.Set("frontend_ip_configuration_id", config.LoadBalancingRulePropertiesFormat.FrontendIPConfiguration.ID)
} }
if config.Properties.BackendAddressPool != nil { if config.LoadBalancingRulePropertiesFormat.BackendAddressPool != nil {
d.Set("backend_address_pool_id", config.Properties.BackendAddressPool.ID) d.Set("backend_address_pool_id", config.LoadBalancingRulePropertiesFormat.BackendAddressPool.ID)
} }
if config.Properties.Probe != nil { if config.LoadBalancingRulePropertiesFormat.Probe != nil {
d.Set("probe_id", config.Properties.Probe.ID) d.Set("probe_id", config.LoadBalancingRulePropertiesFormat.Probe.ID)
} }
if config.Properties.LoadDistribution != "" { if config.LoadBalancingRulePropertiesFormat.LoadDistribution != "" {
d.Set("load_distribution", config.Properties.LoadDistribution) d.Set("load_distribution", config.LoadBalancingRulePropertiesFormat.LoadDistribution)
} }
} }
} }
@ -252,9 +252,9 @@ func resourceArmLoadBalancerRuleDelete(d *schema.ResourceData, meta interface{})
return nil return nil
} }
oldLbRules := *loadBalancer.Properties.LoadBalancingRules oldLbRules := *loadBalancer.LoadBalancerPropertiesFormat.LoadBalancingRules
newLbRules := append(oldLbRules[:index], oldLbRules[index+1:]...) newLbRules := append(oldLbRules[:index], oldLbRules[index+1:]...)
loadBalancer.Properties.LoadBalancingRules = &newLbRules loadBalancer.LoadBalancerPropertiesFormat.LoadBalancingRules = &newLbRules
resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string)) resGroup, loadBalancerName, err := resourceGroupAndLBNameFromId(d.Get("loadbalancer_id").(string))
if err != nil { if err != nil {
@ -325,7 +325,7 @@ func expandAzureRmLoadBalancerRule(d *schema.ResourceData, lb *network.LoadBalan
lbRule := network.LoadBalancingRule{ lbRule := network.LoadBalancingRule{
Name: azure.String(d.Get("name").(string)), Name: azure.String(d.Get("name").(string)),
Properties: &properties, LoadBalancingRulePropertiesFormat: &properties,
} }
return &lbRule, nil return &lbRule, nil

View File

@ -178,7 +178,7 @@ func testCheckAzureRMLoadBalancerDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("LoadBalancer still exists:\n%#v", resp.Properties) return fmt.Errorf("LoadBalancer still exists:\n%#v", resp.LoadBalancerPropertiesFormat)
} }
} }

View File

@ -66,7 +66,7 @@ func resourceArmLocalNetworkGatewayCreate(d *schema.ResourceData, meta interface
gateway := network.LocalNetworkGateway{ gateway := network.LocalNetworkGateway{
Name: &name, Name: &name,
Location: &location, Location: &location,
Properties: &network.LocalNetworkGatewayPropertiesFormat{ LocalNetworkGatewayPropertiesFormat: &network.LocalNetworkGatewayPropertiesFormat{
LocalNetworkAddressSpace: &network.AddressSpace{ LocalNetworkAddressSpace: &network.AddressSpace{
AddressPrefixes: &prefixes, AddressPrefixes: &prefixes,
}, },
@ -115,10 +115,10 @@ func resourceArmLocalNetworkGatewayRead(d *schema.ResourceData, meta interface{}
d.Set("resource_group_name", resGroup) d.Set("resource_group_name", resGroup)
d.Set("name", resp.Name) d.Set("name", resp.Name)
d.Set("location", resp.Location) d.Set("location", resp.Location)
d.Set("gateway_address", resp.Properties.GatewayIPAddress) d.Set("gateway_address", resp.LocalNetworkGatewayPropertiesFormat.GatewayIPAddress)
prefs := []string{} prefs := []string{}
if ps := *resp.Properties.LocalNetworkAddressSpace.AddressPrefixes; ps != nil { if ps := *resp.LocalNetworkGatewayPropertiesFormat.LocalNetworkAddressSpace.AddressPrefixes; ps != nil {
prefs = ps prefs = ps
} }
d.Set("address_space", prefs) d.Set("address_space", prefs)

View File

@ -137,7 +137,7 @@ func testCheckAzureRMLocalNetworkGatewayDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("Local network gateway still exists:\n%#v", resp.Properties) return fmt.Errorf("Local network gateway still exists:\n%#v", resp.LocalNetworkGatewayPropertiesFormat)
} }
} }

View File

@ -207,7 +207,7 @@ func resourceArmNetworkInterfaceCreate(d *schema.ResourceData, meta interface{})
iface := network.Interface{ iface := network.Interface{
Name: &name, Name: &name,
Location: &location, Location: &location,
Properties: &properties, InterfacePropertiesFormat: &properties,
Tags: expandTags(tags), Tags: expandTags(tags),
} }
@ -248,7 +248,7 @@ func resourceArmNetworkInterfaceRead(d *schema.ResourceData, meta interface{}) e
return fmt.Errorf("Error making Read request on Azure Network Interface %s: %s", name, err) return fmt.Errorf("Error making Read request on Azure Network Interface %s: %s", name, err)
} }
iface := *resp.Properties iface := *resp.InterfacePropertiesFormat
if iface.MacAddress != nil { if iface.MacAddress != nil {
if *iface.MacAddress != "" { if *iface.MacAddress != "" {
@ -259,8 +259,8 @@ func resourceArmNetworkInterfaceRead(d *schema.ResourceData, meta interface{}) e
if iface.IPConfigurations != nil && len(*iface.IPConfigurations) > 0 { if iface.IPConfigurations != nil && len(*iface.IPConfigurations) > 0 {
var privateIPAddress *string var privateIPAddress *string
///TODO: Change this to a loop when https://github.com/Azure/azure-sdk-for-go/issues/259 is fixed ///TODO: Change this to a loop when https://github.com/Azure/azure-sdk-for-go/issues/259 is fixed
if (*iface.IPConfigurations)[0].Properties != nil { if (*iface.IPConfigurations)[0].InterfaceIPConfigurationPropertiesFormat != nil {
privateIPAddress = (*iface.IPConfigurations)[0].Properties.PrivateIPAddress privateIPAddress = (*iface.IPConfigurations)[0].InterfaceIPConfigurationPropertiesFormat.PrivateIPAddress
} }
if *privateIPAddress != "" { if *privateIPAddress != "" {
@ -418,7 +418,7 @@ func expandAzureRmNetworkInterfaceIpConfigurations(d *schema.ResourceData) ([]ne
name := data["name"].(string) name := data["name"].(string)
ipConfig := network.InterfaceIPConfiguration{ ipConfig := network.InterfaceIPConfiguration{
Name: &name, Name: &name,
Properties: &properties, InterfaceIPConfigurationPropertiesFormat: &properties,
} }
ipConfigs = append(ipConfigs, ipConfig) ipConfigs = append(ipConfigs, ipConfig)

View File

@ -170,7 +170,7 @@ func testCheckAzureRMNetworkInterfaceDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("Network Interface still exists:\n%#v", resp.Properties) return fmt.Errorf("Network Interface still exists:\n%#v", resp.InterfacePropertiesFormat)
} }
} }

View File

@ -139,7 +139,7 @@ func resourceArmNetworkSecurityGroupCreate(d *schema.ResourceData, meta interfac
sg := network.SecurityGroup{ sg := network.SecurityGroup{
Name: &name, Name: &name,
Location: &location, Location: &location,
Properties: &network.SecurityGroupPropertiesFormat{ SecurityGroupPropertiesFormat: &network.SecurityGroupPropertiesFormat{
SecurityRules: &sgRules, SecurityRules: &sgRules,
}, },
Tags: expandTags(tags), Tags: expandTags(tags),
@ -194,8 +194,8 @@ func resourceArmNetworkSecurityGroupRead(d *schema.ResourceData, meta interface{
return fmt.Errorf("Error making Read request on Azure Network Security Group %s: %s", name, err) return fmt.Errorf("Error making Read request on Azure Network Security Group %s: %s", name, err)
} }
if resp.Properties.SecurityRules != nil { if resp.SecurityGroupPropertiesFormat.SecurityRules != nil {
d.Set("security_rule", flattenNetworkSecurityRules(resp.Properties.SecurityRules)) d.Set("security_rule", flattenNetworkSecurityRules(resp.SecurityGroupPropertiesFormat.SecurityRules))
} }
d.Set("resource_group_name", resGroup) d.Set("resource_group_name", resGroup)
@ -241,17 +241,17 @@ func flattenNetworkSecurityRules(rules *[]network.SecurityRule) []map[string]int
for _, rule := range *rules { for _, rule := range *rules {
sgRule := make(map[string]interface{}) sgRule := make(map[string]interface{})
sgRule["name"] = *rule.Name sgRule["name"] = *rule.Name
sgRule["destination_address_prefix"] = *rule.Properties.DestinationAddressPrefix sgRule["destination_address_prefix"] = *rule.SecurityRulePropertiesFormat.DestinationAddressPrefix
sgRule["destination_port_range"] = *rule.Properties.DestinationPortRange sgRule["destination_port_range"] = *rule.SecurityRulePropertiesFormat.DestinationPortRange
sgRule["source_address_prefix"] = *rule.Properties.SourceAddressPrefix sgRule["source_address_prefix"] = *rule.SecurityRulePropertiesFormat.SourceAddressPrefix
sgRule["source_port_range"] = *rule.Properties.SourcePortRange sgRule["source_port_range"] = *rule.SecurityRulePropertiesFormat.SourcePortRange
sgRule["priority"] = int(*rule.Properties.Priority) sgRule["priority"] = int(*rule.SecurityRulePropertiesFormat.Priority)
sgRule["access"] = rule.Properties.Access sgRule["access"] = rule.SecurityRulePropertiesFormat.Access
sgRule["direction"] = rule.Properties.Direction sgRule["direction"] = rule.SecurityRulePropertiesFormat.Direction
sgRule["protocol"] = rule.Properties.Protocol sgRule["protocol"] = rule.SecurityRulePropertiesFormat.Protocol
if rule.Properties.Description != nil { if rule.SecurityRulePropertiesFormat.Description != nil {
sgRule["description"] = *rule.Properties.Description sgRule["description"] = *rule.SecurityRulePropertiesFormat.Description
} }
result = append(result, sgRule) result = append(result, sgRule)
@ -290,7 +290,7 @@ func expandAzureRmSecurityRules(d *schema.ResourceData) ([]network.SecurityRule,
name := data["name"].(string) name := data["name"].(string)
rule := network.SecurityRule{ rule := network.SecurityRule{
Name: &name, Name: &name,
Properties: &properties, SecurityRulePropertiesFormat: &properties,
} }
rules = append(rules, rule) rules = append(rules, rule)
@ -306,6 +306,6 @@ func networkSecurityGroupStateRefreshFunc(client *ArmClient, resourceGroupName s
return nil, "", fmt.Errorf("Error issuing read request in networkSecurityGroupStateRefreshFunc to Azure ARM for NSG '%s' (RG: '%s'): %s", sgName, resourceGroupName, err) return nil, "", fmt.Errorf("Error issuing read request in networkSecurityGroupStateRefreshFunc to Azure ARM for NSG '%s' (RG: '%s'): %s", sgName, resourceGroupName, err)
} }
return res, *res.Properties.ProvisioningState, nil return res, *res.SecurityGroupPropertiesFormat.ProvisioningState, nil
} }
} }

View File

@ -180,7 +180,7 @@ func testCheckAzureRMNetworkSecurityGroupDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("Network Security Group still exists:\n%#v", resp.Properties) return fmt.Errorf("Network Security Group still exists:\n%#v", resp.SecurityGroupPropertiesFormat)
} }
} }

View File

@ -141,7 +141,7 @@ func resourceArmNetworkSecurityRuleCreate(d *schema.ResourceData, meta interface
sgr := network.SecurityRule{ sgr := network.SecurityRule{
Name: &name, Name: &name,
Properties: &properties, SecurityRulePropertiesFormat: &properties,
} }
_, err := secClient.CreateOrUpdate(resGroup, nsgName, name, sgr, make(chan struct{})) _, err := secClient.CreateOrUpdate(resGroup, nsgName, name, sgr, make(chan struct{}))
@ -184,16 +184,16 @@ func resourceArmNetworkSecurityRuleRead(d *schema.ResourceData, meta interface{}
} }
d.Set("resource_group_name", resGroup) d.Set("resource_group_name", resGroup)
d.Set("access", resp.Properties.Access) d.Set("access", resp.SecurityRulePropertiesFormat.Access)
d.Set("destination_address_prefix", resp.Properties.DestinationAddressPrefix) d.Set("destination_address_prefix", resp.SecurityRulePropertiesFormat.DestinationAddressPrefix)
d.Set("destination_port_range", resp.Properties.DestinationPortRange) d.Set("destination_port_range", resp.SecurityRulePropertiesFormat.DestinationPortRange)
d.Set("direction", resp.Properties.Direction) d.Set("direction", resp.SecurityRulePropertiesFormat.Direction)
d.Set("description", resp.Properties.Description) d.Set("description", resp.SecurityRulePropertiesFormat.Description)
d.Set("name", resp.Name) d.Set("name", resp.Name)
d.Set("priority", resp.Properties.Priority) d.Set("priority", resp.SecurityRulePropertiesFormat.Priority)
d.Set("protocol", resp.Properties.Protocol) d.Set("protocol", resp.SecurityRulePropertiesFormat.Protocol)
d.Set("source_address_prefix", resp.Properties.SourceAddressPrefix) d.Set("source_address_prefix", resp.SecurityRulePropertiesFormat.SourceAddressPrefix)
d.Set("source_port_range", resp.Properties.SourcePortRange) d.Set("source_port_range", resp.SecurityRulePropertiesFormat.SourcePortRange)
return nil return nil
} }

View File

@ -148,7 +148,7 @@ func testCheckAzureRMNetworkSecurityRuleDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("Network Security Rule still exists:\n%#v", resp.Properties) return fmt.Errorf("Network Security Rule still exists:\n%#v", resp.SecurityRulePropertiesFormat)
} }
} }

View File

@ -127,7 +127,7 @@ func resourceArmPublicIpCreate(d *schema.ResourceData, meta interface{}) error {
publicIp := network.PublicIPAddress{ publicIp := network.PublicIPAddress{
Name: &name, Name: &name,
Location: &location, Location: &location,
Properties: &properties, PublicIPAddressPropertiesFormat: &properties,
Tags: expandTags(tags), Tags: expandTags(tags),
} }
@ -171,14 +171,14 @@ func resourceArmPublicIpRead(d *schema.ResourceData, meta interface{}) error {
d.Set("resource_group_name", resGroup) d.Set("resource_group_name", resGroup)
d.Set("location", resp.Location) d.Set("location", resp.Location)
d.Set("name", resp.Name) d.Set("name", resp.Name)
d.Set("public_ip_address_allocation", strings.ToLower(string(resp.Properties.PublicIPAllocationMethod))) d.Set("public_ip_address_allocation", strings.ToLower(string(resp.PublicIPAddressPropertiesFormat.PublicIPAllocationMethod)))
if resp.Properties.DNSSettings != nil && resp.Properties.DNSSettings.Fqdn != nil && *resp.Properties.DNSSettings.Fqdn != "" { if resp.PublicIPAddressPropertiesFormat.DNSSettings != nil && resp.PublicIPAddressPropertiesFormat.DNSSettings.Fqdn != nil && *resp.PublicIPAddressPropertiesFormat.DNSSettings.Fqdn != "" {
d.Set("fqdn", resp.Properties.DNSSettings.Fqdn) d.Set("fqdn", resp.PublicIPAddressPropertiesFormat.DNSSettings.Fqdn)
} }
if resp.Properties.IPAddress != nil && *resp.Properties.IPAddress != "" { if resp.PublicIPAddressPropertiesFormat.IPAddress != nil && *resp.PublicIPAddressPropertiesFormat.IPAddress != "" {
d.Set("ip_address", resp.Properties.IPAddress) d.Set("ip_address", resp.PublicIPAddressPropertiesFormat.IPAddress)
} }
flattenAndSetTags(d, resp.Tags) flattenAndSetTags(d, resp.Tags)

View File

@ -305,7 +305,7 @@ func testCheckAzureRMPublicIpDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("Public IP still exists:\n%#v", resp.Properties) return fmt.Errorf("Public IP still exists:\n%#v", resp.PublicIPAddressPropertiesFormat)
} }
} }

View File

@ -87,7 +87,7 @@ func resourceArmRouteCreate(d *schema.ResourceData, meta interface{}) error {
route := network.Route{ route := network.Route{
Name: &name, Name: &name,
Properties: &properties, RoutePropertiesFormat: &properties,
} }
_, err := routesClient.CreateOrUpdate(resGroup, rtName, name, route, make(chan struct{})) _, err := routesClient.CreateOrUpdate(resGroup, rtName, name, route, make(chan struct{}))
@ -130,11 +130,11 @@ func resourceArmRouteRead(d *schema.ResourceData, meta interface{}) error {
d.Set("name", routeName) d.Set("name", routeName)
d.Set("resource_group_name", resGroup) d.Set("resource_group_name", resGroup)
d.Set("route_table_name", rtName) d.Set("route_table_name", rtName)
d.Set("address_prefix", resp.Properties.AddressPrefix) d.Set("address_prefix", resp.RoutePropertiesFormat.AddressPrefix)
d.Set("next_hop_type", string(resp.Properties.NextHopType)) d.Set("next_hop_type", string(resp.RoutePropertiesFormat.NextHopType))
if resp.Properties.NextHopIPAddress != nil { if resp.RoutePropertiesFormat.NextHopIPAddress != nil {
d.Set("next_hop_in_ip_address", resp.Properties.NextHopIPAddress) d.Set("next_hop_in_ip_address", resp.RoutePropertiesFormat.NextHopIPAddress)
} }
return nil return nil

View File

@ -105,7 +105,7 @@ func resourceArmRouteTableCreate(d *schema.ResourceData, meta interface{}) error
} }
if len(routes) > 0 { if len(routes) > 0 {
routeSet.Properties = &network.RouteTablePropertiesFormat{ routeSet.RouteTablePropertiesFormat = &network.RouteTablePropertiesFormat{
Routes: &routes, Routes: &routes,
} }
} }
@ -152,13 +152,13 @@ func resourceArmRouteTableRead(d *schema.ResourceData, meta interface{}) error {
d.Set("resource_group_name", resGroup) d.Set("resource_group_name", resGroup)
d.Set("location", resp.Location) d.Set("location", resp.Location)
if resp.Properties.Routes != nil { if resp.RouteTablePropertiesFormat.Routes != nil {
d.Set("route", schema.NewSet(resourceArmRouteTableRouteHash, flattenAzureRmRouteTableRoutes(resp.Properties.Routes))) d.Set("route", schema.NewSet(resourceArmRouteTableRouteHash, flattenAzureRmRouteTableRoutes(resp.RouteTablePropertiesFormat.Routes)))
} }
subnets := []string{} subnets := []string{}
if resp.Properties.Subnets != nil { if resp.RouteTablePropertiesFormat.Subnets != nil {
for _, subnet := range *resp.Properties.Subnets { for _, subnet := range *resp.RouteTablePropertiesFormat.Subnets {
id := subnet.ID id := subnet.ID
subnets = append(subnets, *id) subnets = append(subnets, *id)
} }
@ -207,7 +207,7 @@ func expandAzureRmRouteTableRoutes(d *schema.ResourceData) ([]network.Route, err
name := data["name"].(string) name := data["name"].(string)
route := network.Route{ route := network.Route{
Name: &name, Name: &name,
Properties: &properties, RoutePropertiesFormat: &properties,
} }
routes = append(routes, route) routes = append(routes, route)
@ -222,10 +222,10 @@ func flattenAzureRmRouteTableRoutes(routes *[]network.Route) []interface{} {
for _, route := range *routes { for _, route := range *routes {
r := make(map[string]interface{}) r := make(map[string]interface{})
r["name"] = *route.Name r["name"] = *route.Name
r["address_prefix"] = *route.Properties.AddressPrefix r["address_prefix"] = *route.RoutePropertiesFormat.AddressPrefix
r["next_hop_type"] = string(route.Properties.NextHopType) r["next_hop_type"] = string(route.RoutePropertiesFormat.NextHopType)
if route.Properties.NextHopIPAddress != nil { if route.RoutePropertiesFormat.NextHopIPAddress != nil {
r["next_hop_in_ip_address"] = *route.Properties.NextHopIPAddress r["next_hop_in_ip_address"] = *route.RoutePropertiesFormat.NextHopIPAddress
} }
results = append(results, r) results = append(results, r)
} }

View File

@ -242,7 +242,7 @@ func testCheckAzureRMRouteTableDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("Route Table still exists:\n%#v", resp.Properties) return fmt.Errorf("Route Table still exists:\n%#v", resp.RouteTablePropertiesFormat)
} }
} }

View File

@ -155,7 +155,7 @@ func testCheckAzureRMRouteDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("Route still exists:\n%#v", resp.Properties) return fmt.Errorf("Route still exists:\n%#v", resp.RoutePropertiesFormat)
} }
} }

View File

@ -140,7 +140,7 @@ func testCheckAzureRMServiceBusNamespaceDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("ServiceBus Namespace still exists:\n%#v", resp.Properties) return fmt.Errorf("ServiceBus Namespace still exists:\n%#v", resp.NamespaceProperties)
} }
} }

View File

@ -106,15 +106,15 @@ func resourceArmServiceBusSubscriptionCreate(d *schema.ResourceData, meta interf
parameters := servicebus.SubscriptionCreateOrUpdateParameters{ parameters := servicebus.SubscriptionCreateOrUpdateParameters{
Location: &location, Location: &location,
Properties: &servicebus.SubscriptionProperties{}, SubscriptionProperties: &servicebus.SubscriptionProperties{},
} }
if autoDeleteOnIdle := d.Get("auto_delete_on_idle").(string); autoDeleteOnIdle != "" { if autoDeleteOnIdle := d.Get("auto_delete_on_idle").(string); autoDeleteOnIdle != "" {
parameters.Properties.AutoDeleteOnIdle = &autoDeleteOnIdle parameters.SubscriptionProperties.AutoDeleteOnIdle = &autoDeleteOnIdle
} }
if lockDuration := d.Get("lock_duration").(string); lockDuration != "" { if lockDuration := d.Get("lock_duration").(string); lockDuration != "" {
parameters.Properties.LockDuration = &lockDuration parameters.SubscriptionProperties.LockDuration = &lockDuration
} }
deadLetteringFilterExceptions := d.Get("dead_lettering_on_filter_evaluation_exceptions").(bool) deadLetteringFilterExceptions := d.Get("dead_lettering_on_filter_evaluation_exceptions").(bool)
@ -123,11 +123,11 @@ func resourceArmServiceBusSubscriptionCreate(d *schema.ResourceData, meta interf
maxDeliveryCount := int32(d.Get("max_delivery_count").(int)) maxDeliveryCount := int32(d.Get("max_delivery_count").(int))
requiresSession := d.Get("requires_session").(bool) requiresSession := d.Get("requires_session").(bool)
parameters.Properties.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringFilterExceptions parameters.SubscriptionProperties.DeadLetteringOnFilterEvaluationExceptions = &deadLetteringFilterExceptions
parameters.Properties.DeadLetteringOnMessageExpiration = &deadLetteringExpiration parameters.SubscriptionProperties.DeadLetteringOnMessageExpiration = &deadLetteringExpiration
parameters.Properties.EnableBatchedOperations = &enableBatchedOps parameters.SubscriptionProperties.EnableBatchedOperations = &enableBatchedOps
parameters.Properties.MaxDeliveryCount = &maxDeliveryCount parameters.SubscriptionProperties.MaxDeliveryCount = &maxDeliveryCount
parameters.Properties.RequiresSession = &requiresSession parameters.SubscriptionProperties.RequiresSession = &requiresSession
_, err := client.CreateOrUpdate(resGroup, namespaceName, topicName, name, parameters) _, err := client.CreateOrUpdate(resGroup, namespaceName, topicName, name, parameters)
if err != nil { if err != nil {
@ -176,7 +176,7 @@ func resourceArmServiceBusSubscriptionRead(d *schema.ResourceData, meta interfac
d.Set("topic_name", topicName) d.Set("topic_name", topicName)
d.Set("location", azureRMNormalizeLocation(*resp.Location)) d.Set("location", azureRMNormalizeLocation(*resp.Location))
props := resp.Properties props := resp.SubscriptionProperties
d.Set("auto_delete_on_idle", props.AutoDeleteOnIdle) d.Set("auto_delete_on_idle", props.AutoDeleteOnIdle)
d.Set("default_message_ttl", props.DefaultMessageTimeToLive) d.Set("default_message_ttl", props.DefaultMessageTimeToLive)
d.Set("lock_duration", props.LockDuration) d.Set("lock_duration", props.LockDuration)

View File

@ -105,7 +105,7 @@ func testCheckAzureRMServiceBusSubscriptionDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("ServiceBus Subscription still exists:\n%#v", resp.Properties) return fmt.Errorf("ServiceBus Subscription still exists:\n%#v", resp.SubscriptionProperties)
} }
} }

View File

@ -111,19 +111,19 @@ func resourceArmServiceBusTopicCreate(d *schema.ResourceData, meta interface{})
parameters := servicebus.TopicCreateOrUpdateParameters{ parameters := servicebus.TopicCreateOrUpdateParameters{
Name: &name, Name: &name,
Location: &location, Location: &location,
Properties: &servicebus.TopicProperties{}, TopicProperties: &servicebus.TopicProperties{},
} }
if autoDeleteOnIdle := d.Get("auto_delete_on_idle").(string); autoDeleteOnIdle != "" { if autoDeleteOnIdle := d.Get("auto_delete_on_idle").(string); autoDeleteOnIdle != "" {
parameters.Properties.AutoDeleteOnIdle = &autoDeleteOnIdle parameters.TopicProperties.AutoDeleteOnIdle = &autoDeleteOnIdle
} }
if defaultTTL := d.Get("default_message_ttl").(string); defaultTTL != "" { if defaultTTL := d.Get("default_message_ttl").(string); defaultTTL != "" {
parameters.Properties.DefaultMessageTimeToLive = &defaultTTL parameters.TopicProperties.DefaultMessageTimeToLive = &defaultTTL
} }
if duplicateWindow := d.Get("duplicate_detection_history_time_window").(string); duplicateWindow != "" { if duplicateWindow := d.Get("duplicate_detection_history_time_window").(string); duplicateWindow != "" {
parameters.Properties.DuplicateDetectionHistoryTimeWindow = &duplicateWindow parameters.TopicProperties.DuplicateDetectionHistoryTimeWindow = &duplicateWindow
} }
enableBatchedOps := d.Get("enable_batched_operations").(bool) enableBatchedOps := d.Get("enable_batched_operations").(bool)
@ -134,13 +134,13 @@ func resourceArmServiceBusTopicCreate(d *schema.ResourceData, meta interface{})
requiresDuplicateDetection := d.Get("requires_duplicate_detection").(bool) requiresDuplicateDetection := d.Get("requires_duplicate_detection").(bool)
supportOrdering := d.Get("support_ordering").(bool) supportOrdering := d.Get("support_ordering").(bool)
parameters.Properties.EnableBatchedOperations = &enableBatchedOps parameters.TopicProperties.EnableBatchedOperations = &enableBatchedOps
parameters.Properties.EnableExpress = &enableExpress parameters.TopicProperties.EnableExpress = &enableExpress
parameters.Properties.FilteringMessagesBeforePublishing = &enableFiltering parameters.TopicProperties.FilteringMessagesBeforePublishing = &enableFiltering
parameters.Properties.EnablePartitioning = &enablePartitioning parameters.TopicProperties.EnablePartitioning = &enablePartitioning
parameters.Properties.MaxSizeInMegabytes = &maxSize parameters.TopicProperties.MaxSizeInMegabytes = &maxSize
parameters.Properties.RequiresDuplicateDetection = &requiresDuplicateDetection parameters.TopicProperties.RequiresDuplicateDetection = &requiresDuplicateDetection
parameters.Properties.SupportOrdering = &supportOrdering parameters.TopicProperties.SupportOrdering = &supportOrdering
_, err := client.CreateOrUpdate(resGroup, namespaceName, name, parameters) _, err := client.CreateOrUpdate(resGroup, namespaceName, name, parameters)
if err != nil { if err != nil {
@ -185,7 +185,7 @@ func resourceArmServiceBusTopicRead(d *schema.ResourceData, meta interface{}) er
d.Set("namespace_name", namespaceName) d.Set("namespace_name", namespaceName)
d.Set("location", azureRMNormalizeLocation(*resp.Location)) d.Set("location", azureRMNormalizeLocation(*resp.Location))
props := resp.Properties props := resp.TopicProperties
d.Set("auto_delete_on_idle", props.AutoDeleteOnIdle) d.Set("auto_delete_on_idle", props.AutoDeleteOnIdle)
d.Set("default_message_ttl", props.DefaultMessageTimeToLive) d.Set("default_message_ttl", props.DefaultMessageTimeToLive)

View File

@ -136,7 +136,7 @@ func testCheckAzureRMServiceBusTopicDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("ServiceBus Topic still exists:\n%#v", resp.Properties) return fmt.Errorf("ServiceBus Topic still exists:\n%#v", resp.TopicProperties)
} }
} }

View File

@ -164,7 +164,7 @@ func resourceArmStorageAccountCreate(d *schema.ResourceData, meta interface{}) e
Sku: &sku, Sku: &sku,
Tags: expandTags(tags), Tags: expandTags(tags),
Kind: storage.Kind(accountKind), Kind: storage.Kind(accountKind),
Properties: &storage.AccountPropertiesCreateParameters{ AccountPropertiesCreateParameters: &storage.AccountPropertiesCreateParameters{
Encryption: &storage.Encryption{ Encryption: &storage.Encryption{
Services: &storage.EncryptionServices{ Services: &storage.EncryptionServices{
Blob: &storage.EncryptionService{ Blob: &storage.EncryptionService{
@ -184,7 +184,7 @@ func resourceArmStorageAccountCreate(d *schema.ResourceData, meta interface{}) e
accessTier = blobStorageAccountDefaultAccessTier accessTier = blobStorageAccountDefaultAccessTier
} }
opts.Properties.AccessTier = storage.AccessTier(accessTier.(string)) opts.AccountPropertiesCreateParameters.AccessTier = storage.AccessTier(accessTier.(string))
} }
// Create // Create
@ -272,7 +272,7 @@ func resourceArmStorageAccountUpdate(d *schema.ResourceData, meta interface{}) e
accessTier := d.Get("access_tier").(string) accessTier := d.Get("access_tier").(string)
opts := storage.AccountUpdateParameters{ opts := storage.AccountUpdateParameters{
Properties: &storage.AccountPropertiesUpdateParameters{ AccountPropertiesUpdateParameters: &storage.AccountPropertiesUpdateParameters{
AccessTier: storage.AccessTier(accessTier), AccessTier: storage.AccessTier(accessTier),
}, },
} }
@ -302,7 +302,7 @@ func resourceArmStorageAccountUpdate(d *schema.ResourceData, meta interface{}) e
enableBlobEncryption := d.Get("enable_blob_encryption").(bool) enableBlobEncryption := d.Get("enable_blob_encryption").(bool)
opts := storage.AccountUpdateParameters{ opts := storage.AccountUpdateParameters{
Properties: &storage.AccountPropertiesUpdateParameters{ AccountPropertiesUpdateParameters: &storage.AccountPropertiesUpdateParameters{
Encryption: &storage.Encryption{ Encryption: &storage.Encryption{
Services: &storage.EncryptionServices{ Services: &storage.EncryptionServices{
Blob: &storage.EncryptionService{ Blob: &storage.EncryptionService{
@ -356,41 +356,41 @@ func resourceArmStorageAccountRead(d *schema.ResourceData, meta interface{}) err
d.Set("location", resp.Location) d.Set("location", resp.Location)
d.Set("account_kind", resp.Kind) d.Set("account_kind", resp.Kind)
d.Set("account_type", resp.Sku.Name) d.Set("account_type", resp.Sku.Name)
d.Set("primary_location", resp.Properties.PrimaryLocation) d.Set("primary_location", resp.AccountProperties.PrimaryLocation)
d.Set("secondary_location", resp.Properties.SecondaryLocation) d.Set("secondary_location", resp.AccountProperties.SecondaryLocation)
if resp.Properties.AccessTier != "" { if resp.AccountProperties.AccessTier != "" {
d.Set("access_tier", resp.Properties.AccessTier) d.Set("access_tier", resp.AccountProperties.AccessTier)
} }
if resp.Properties.PrimaryEndpoints != nil { if resp.AccountProperties.PrimaryEndpoints != nil {
d.Set("primary_blob_endpoint", resp.Properties.PrimaryEndpoints.Blob) d.Set("primary_blob_endpoint", resp.AccountProperties.PrimaryEndpoints.Blob)
d.Set("primary_queue_endpoint", resp.Properties.PrimaryEndpoints.Queue) d.Set("primary_queue_endpoint", resp.AccountProperties.PrimaryEndpoints.Queue)
d.Set("primary_table_endpoint", resp.Properties.PrimaryEndpoints.Table) d.Set("primary_table_endpoint", resp.AccountProperties.PrimaryEndpoints.Table)
d.Set("primary_file_endpoint", resp.Properties.PrimaryEndpoints.File) d.Set("primary_file_endpoint", resp.AccountProperties.PrimaryEndpoints.File)
} }
if resp.Properties.SecondaryEndpoints != nil { if resp.AccountProperties.SecondaryEndpoints != nil {
if resp.Properties.SecondaryEndpoints.Blob != nil { if resp.AccountProperties.SecondaryEndpoints.Blob != nil {
d.Set("secondary_blob_endpoint", resp.Properties.SecondaryEndpoints.Blob) d.Set("secondary_blob_endpoint", resp.AccountProperties.SecondaryEndpoints.Blob)
} else { } else {
d.Set("secondary_blob_endpoint", "") d.Set("secondary_blob_endpoint", "")
} }
if resp.Properties.SecondaryEndpoints.Queue != nil { if resp.AccountProperties.SecondaryEndpoints.Queue != nil {
d.Set("secondary_queue_endpoint", resp.Properties.SecondaryEndpoints.Queue) d.Set("secondary_queue_endpoint", resp.AccountProperties.SecondaryEndpoints.Queue)
} else { } else {
d.Set("secondary_queue_endpoint", "") d.Set("secondary_queue_endpoint", "")
} }
if resp.Properties.SecondaryEndpoints.Table != nil { if resp.AccountProperties.SecondaryEndpoints.Table != nil {
d.Set("secondary_table_endpoint", resp.Properties.SecondaryEndpoints.Table) d.Set("secondary_table_endpoint", resp.AccountProperties.SecondaryEndpoints.Table)
} else { } else {
d.Set("secondary_table_endpoint", "") d.Set("secondary_table_endpoint", "")
} }
} }
if resp.Properties.Encryption != nil { if resp.AccountProperties.Encryption != nil {
if resp.Properties.Encryption.Services.Blob != nil { if resp.AccountProperties.Encryption.Services.Blob != nil {
d.Set("enable_blob_encryption", resp.Properties.Encryption.Services.Blob.Enabled) d.Set("enable_blob_encryption", resp.AccountProperties.Encryption.Services.Blob.Enabled)
} }
} }
@ -452,6 +452,6 @@ func storageAccountStateRefreshFunc(client *ArmClient, resourceGroupName string,
return nil, "", fmt.Errorf("Error issuing read request in storageAccountStateRefreshFunc to Azure ARM for Storage Account '%s' (RG: '%s'): %s", storageAccountName, resourceGroupName, err) return nil, "", fmt.Errorf("Error issuing read request in storageAccountStateRefreshFunc to Azure ARM for Storage Account '%s' (RG: '%s'): %s", storageAccountName, resourceGroupName, err)
} }
return res, string(res.Properties.ProvisioningState), nil return res, string(res.AccountProperties.ProvisioningState), nil
} }
} }

View File

@ -237,7 +237,7 @@ func testCheckAzureRMStorageAccountDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("Storage Account still exists:\n%#v", resp.Properties) return fmt.Errorf("Storage Account still exists:\n%#v", resp.AccountProperties)
} }
} }

View File

@ -63,9 +63,10 @@ func resourceArmStorageShareCreate(d *schema.ResourceData, meta interface{}) err
} }
name := d.Get("name").(string) name := d.Get("name").(string)
metaData := make(map[string]string) // TODO: support MetaData
log.Printf("[INFO] Creating share %q in storage account %q", name, storageAccountName) log.Printf("[INFO] Creating share %q in storage account %q", name, storageAccountName)
err = fileClient.CreateShare(name) err = fileClient.CreateShare(name, metaData)
log.Printf("[INFO] Setting share %q properties in storage account %q", name, storageAccountName) log.Printf("[INFO] Setting share %q properties in storage account %q", name, storageAccountName)
fileClient.SetShareProperties(name, storage.ShareHeaders{Quota: strconv.Itoa(d.Get("quota").(int))}) fileClient.SetShareProperties(name, storage.ShareHeaders{Quota: strconv.Itoa(d.Get("quota").(int))})

View File

@ -6,7 +6,6 @@ import (
"net/http" "net/http"
"github.com/Azure/azure-sdk-for-go/arm/network" "github.com/Azure/azure-sdk-for-go/arm/network"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/schema"
) )
@ -101,7 +100,7 @@ func resourceArmSubnetCreate(d *schema.ResourceData, meta interface{}) error {
subnet := network.Subnet{ subnet := network.Subnet{
Name: &name, Name: &name,
Properties: &properties, SubnetPropertiesFormat: &properties,
} }
_, err := subnetClient.CreateOrUpdate(resGroup, vnetName, name, subnet, make(chan struct{})) _, err := subnetClient.CreateOrUpdate(resGroup, vnetName, name, subnet, make(chan struct{}))
@ -146,19 +145,19 @@ func resourceArmSubnetRead(d *schema.ResourceData, meta interface{}) error {
d.Set("name", name) d.Set("name", name)
d.Set("resource_group_name", resGroup) d.Set("resource_group_name", resGroup)
d.Set("virtual_network_name", vnetName) d.Set("virtual_network_name", vnetName)
d.Set("address_prefix", resp.Properties.AddressPrefix) d.Set("address_prefix", resp.SubnetPropertiesFormat.AddressPrefix)
if resp.Properties.NetworkSecurityGroup != nil { if resp.SubnetPropertiesFormat.NetworkSecurityGroup != nil {
d.Set("network_security_group_id", resp.Properties.NetworkSecurityGroup.ID) d.Set("network_security_group_id", resp.SubnetPropertiesFormat.NetworkSecurityGroup.ID)
} }
if resp.Properties.RouteTable != nil { if resp.SubnetPropertiesFormat.RouteTable != nil {
d.Set("route_table_id", resp.Properties.RouteTable.ID) d.Set("route_table_id", resp.SubnetPropertiesFormat.RouteTable.ID)
} }
if resp.Properties.IPConfigurations != nil { if resp.SubnetPropertiesFormat.IPConfigurations != nil {
ips := make([]string, 0, len(*resp.Properties.IPConfigurations)) ips := make([]string, 0, len(*resp.SubnetPropertiesFormat.IPConfigurations))
for _, ip := range *resp.Properties.IPConfigurations { for _, ip := range *resp.SubnetPropertiesFormat.IPConfigurations {
ips = append(ips, *ip.ID) ips = append(ips, *ip.ID)
} }
@ -190,14 +189,3 @@ func resourceArmSubnetDelete(d *schema.ResourceData, meta interface{}) error {
return err return err
} }
func subnetRuleStateRefreshFunc(client *ArmClient, resourceGroupName string, virtualNetworkName string, subnetName string) resource.StateRefreshFunc {
return func() (interface{}, string, error) {
res, err := client.subnetClient.Get(resourceGroupName, virtualNetworkName, subnetName, "")
if err != nil {
return nil, "", fmt.Errorf("Error issuing read request in subnetRuleStateRefreshFunc to Azure ARM for subnet '%s' (RG: '%s') (VNN: '%s'): %s", subnetName, resourceGroupName, virtualNetworkName, err)
}
return res, *res.Properties.ProvisioningState, nil
}
}

View File

@ -127,7 +127,7 @@ func testCheckAzureRMSubnetDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("Subnet still exists:\n%#v", resp.Properties) return fmt.Errorf("Subnet still exists:\n%#v", resp.SubnetPropertiesFormat)
} }
} }

View File

@ -156,7 +156,7 @@ func testCheckAzureRMTemplateDeploymentDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("Template Deployment still exists:\n%#v", resp.Properties) return fmt.Errorf("Template Deployment still exists:\n%#v", resp.VirtualMachineProperties)
} }
} }

View File

@ -110,7 +110,7 @@ func resourceArmTrafficManagerEndpointCreate(d *schema.ResourceData, meta interf
params := trafficmanager.Endpoint{ params := trafficmanager.Endpoint{
Name: &name, Name: &name,
Type: &fullEndpointType, Type: &fullEndpointType,
Properties: getArmTrafficManagerEndpointProperties(d), EndpointProperties: getArmTrafficManagerEndpointProperties(d),
} }
_, err := client.CreateOrUpdate(resGroup, profileName, endpointType, name, params) _, err := client.CreateOrUpdate(resGroup, profileName, endpointType, name, params)
@ -162,7 +162,7 @@ func resourceArmTrafficManagerEndpointRead(d *schema.ResourceData, meta interfac
return fmt.Errorf("Error making Read request on TrafficManager Endpoint %s: %s", name, err) return fmt.Errorf("Error making Read request on TrafficManager Endpoint %s: %s", name, err)
} }
endpoint := *resp.Properties endpoint := *resp.EndpointProperties
d.Set("resource_group_name", resGroup) d.Set("resource_group_name", resGroup)
d.Set("name", resp.Name) d.Set("name", resp.Name)

View File

@ -254,7 +254,7 @@ func testCheckAzureRMTrafficManagerEndpointDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("Traffic Manager Endpoint sitll exists:\n%#v", resp.Properties) return fmt.Errorf("Traffic Manager Endpoint sitll exists:\n%#v", resp.EndpointProperties)
} }
} }

View File

@ -119,7 +119,7 @@ func resourceArmTrafficManagerProfileCreate(d *schema.ResourceData, meta interfa
profile := trafficmanager.Profile{ profile := trafficmanager.Profile{
Name: &name, Name: &name,
Location: &location, Location: &location,
Properties: getArmTrafficManagerProfileProperties(d), ProfileProperties: getArmTrafficManagerProfileProperties(d),
Tags: expandTags(tags), Tags: expandTags(tags),
} }
@ -160,7 +160,7 @@ func resourceArmTrafficManagerProfileRead(d *schema.ResourceData, meta interface
return fmt.Errorf("Error making Read request on Traffic Manager Profile %s: %s", name, err) return fmt.Errorf("Error making Read request on Traffic Manager Profile %s: %s", name, err)
} }
profile := *resp.Properties profile := *resp.ProfileProperties
// update appropriate values // update appropriate values
d.Set("resource_group_name", resGroup) d.Set("resource_group_name", resGroup)

View File

@ -166,7 +166,7 @@ func testCheckAzureRMTrafficManagerProfileDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("Traffic Manager profile sitll exists:\n%#v", resp.Properties) return fmt.Errorf("Traffic Manager profile sitll exists:\n%#v", resp.ProfileProperties)
} }
} }

View File

@ -523,7 +523,7 @@ func resourceArmVirtualMachineCreate(d *schema.ResourceData, meta interface{}) e
vm := compute.VirtualMachine{ vm := compute.VirtualMachine{
Name: &name, Name: &name,
Location: &location, Location: &location,
Properties: &properties, VirtualMachineProperties: &properties,
Tags: expandedTags, Tags: expandedTags,
} }
@ -584,58 +584,58 @@ func resourceArmVirtualMachineRead(d *schema.ResourceData, meta interface{}) err
} }
} }
if resp.Properties.AvailabilitySet != nil { if resp.VirtualMachineProperties.AvailabilitySet != nil {
d.Set("availability_set_id", strings.ToLower(*resp.Properties.AvailabilitySet.ID)) d.Set("availability_set_id", strings.ToLower(*resp.VirtualMachineProperties.AvailabilitySet.ID))
} }
d.Set("vm_size", resp.Properties.HardwareProfile.VMSize) d.Set("vm_size", resp.VirtualMachineProperties.HardwareProfile.VMSize)
if resp.Properties.StorageProfile.ImageReference != nil { if resp.VirtualMachineProperties.StorageProfile.ImageReference != nil {
if err := d.Set("storage_image_reference", schema.NewSet(resourceArmVirtualMachineStorageImageReferenceHash, flattenAzureRmVirtualMachineImageReference(resp.Properties.StorageProfile.ImageReference))); err != nil { if err := d.Set("storage_image_reference", schema.NewSet(resourceArmVirtualMachineStorageImageReferenceHash, flattenAzureRmVirtualMachineImageReference(resp.VirtualMachineProperties.StorageProfile.ImageReference))); err != nil {
return fmt.Errorf("[DEBUG] Error setting Virtual Machine Storage Image Reference error: %#v", err) return fmt.Errorf("[DEBUG] Error setting Virtual Machine Storage Image Reference error: %#v", err)
} }
} }
if err := d.Set("storage_os_disk", schema.NewSet(resourceArmVirtualMachineStorageOsDiskHash, flattenAzureRmVirtualMachineOsDisk(resp.Properties.StorageProfile.OsDisk))); err != nil { if err := d.Set("storage_os_disk", schema.NewSet(resourceArmVirtualMachineStorageOsDiskHash, flattenAzureRmVirtualMachineOsDisk(resp.VirtualMachineProperties.StorageProfile.OsDisk))); err != nil {
return fmt.Errorf("[DEBUG] Error setting Virtual Machine Storage OS Disk error: %#v", err) return fmt.Errorf("[DEBUG] Error setting Virtual Machine Storage OS Disk error: %#v", err)
} }
if resp.Properties.StorageProfile.DataDisks != nil { if resp.VirtualMachineProperties.StorageProfile.DataDisks != nil {
if err := d.Set("storage_data_disk", flattenAzureRmVirtualMachineDataDisk(resp.Properties.StorageProfile.DataDisks)); err != nil { if err := d.Set("storage_data_disk", flattenAzureRmVirtualMachineDataDisk(resp.VirtualMachineProperties.StorageProfile.DataDisks)); err != nil {
return fmt.Errorf("[DEBUG] Error setting Virtual Machine Storage Data Disks error: %#v", err) return fmt.Errorf("[DEBUG] Error setting Virtual Machine Storage Data Disks error: %#v", err)
} }
} }
if err := d.Set("os_profile", schema.NewSet(resourceArmVirtualMachineStorageOsProfileHash, flattenAzureRmVirtualMachineOsProfile(resp.Properties.OsProfile))); err != nil { if err := d.Set("os_profile", schema.NewSet(resourceArmVirtualMachineStorageOsProfileHash, flattenAzureRmVirtualMachineOsProfile(resp.VirtualMachineProperties.OsProfile))); err != nil {
return fmt.Errorf("[DEBUG] Error setting Virtual Machine Storage OS Profile: %#v", err) return fmt.Errorf("[DEBUG] Error setting Virtual Machine Storage OS Profile: %#v", err)
} }
if resp.Properties.OsProfile.WindowsConfiguration != nil { if resp.VirtualMachineProperties.OsProfile.WindowsConfiguration != nil {
if err := d.Set("os_profile_windows_config", flattenAzureRmVirtualMachineOsProfileWindowsConfiguration(resp.Properties.OsProfile.WindowsConfiguration)); err != nil { if err := d.Set("os_profile_windows_config", flattenAzureRmVirtualMachineOsProfileWindowsConfiguration(resp.VirtualMachineProperties.OsProfile.WindowsConfiguration)); err != nil {
return fmt.Errorf("[DEBUG] Error setting Virtual Machine Storage OS Profile Windows Configuration: %#v", err) return fmt.Errorf("[DEBUG] Error setting Virtual Machine Storage OS Profile Windows Configuration: %#v", err)
} }
} }
if resp.Properties.OsProfile.LinuxConfiguration != nil { if resp.VirtualMachineProperties.OsProfile.LinuxConfiguration != nil {
if err := d.Set("os_profile_linux_config", flattenAzureRmVirtualMachineOsProfileLinuxConfiguration(resp.Properties.OsProfile.LinuxConfiguration)); err != nil { if err := d.Set("os_profile_linux_config", flattenAzureRmVirtualMachineOsProfileLinuxConfiguration(resp.VirtualMachineProperties.OsProfile.LinuxConfiguration)); err != nil {
return fmt.Errorf("[DEBUG] Error setting Virtual Machine Storage OS Profile Linux Configuration: %#v", err) return fmt.Errorf("[DEBUG] Error setting Virtual Machine Storage OS Profile Linux Configuration: %#v", err)
} }
} }
if resp.Properties.OsProfile.Secrets != nil { if resp.VirtualMachineProperties.OsProfile.Secrets != nil {
if err := d.Set("os_profile_secrets", flattenAzureRmVirtualMachineOsProfileSecrets(resp.Properties.OsProfile.Secrets)); err != nil { if err := d.Set("os_profile_secrets", flattenAzureRmVirtualMachineOsProfileSecrets(resp.VirtualMachineProperties.OsProfile.Secrets)); err != nil {
return fmt.Errorf("[DEBUG] Error setting Virtual Machine Storage OS Profile Secrets: %#v", err) return fmt.Errorf("[DEBUG] Error setting Virtual Machine Storage OS Profile Secrets: %#v", err)
} }
} }
if resp.Properties.DiagnosticsProfile != nil && resp.Properties.DiagnosticsProfile.BootDiagnostics != nil { if resp.VirtualMachineProperties.DiagnosticsProfile != nil && resp.VirtualMachineProperties.DiagnosticsProfile.BootDiagnostics != nil {
if err := d.Set("boot_diagnostics", flattenAzureRmVirtualMachineDiagnosticsProfile(resp.Properties.DiagnosticsProfile.BootDiagnostics)); err != nil { if err := d.Set("boot_diagnostics", flattenAzureRmVirtualMachineDiagnosticsProfile(resp.VirtualMachineProperties.DiagnosticsProfile.BootDiagnostics)); err != nil {
return fmt.Errorf("[DEBUG] Error setting Virtual Machine Diagnostics Profile: %#v", err) return fmt.Errorf("[DEBUG] Error setting Virtual Machine Diagnostics Profile: %#v", err)
} }
} }
if resp.Properties.NetworkProfile != nil { if resp.VirtualMachineProperties.NetworkProfile != nil {
if err := d.Set("network_interface_ids", flattenAzureRmVirtualMachineNetworkInterfaces(resp.Properties.NetworkProfile)); err != nil { if err := d.Set("network_interface_ids", flattenAzureRmVirtualMachineNetworkInterfaces(resp.VirtualMachineProperties.NetworkProfile)); err != nil {
return fmt.Errorf("[DEBUG] Error setting Virtual Machine Storage Network Interfaces: %#v", err) return fmt.Errorf("[DEBUG] Error setting Virtual Machine Storage Network Interfaces: %#v", err)
} }
} }

View File

@ -97,7 +97,7 @@ func resourceArmVirtualMachineExtensionsCreate(d *schema.ResourceData, meta inte
extension := compute.VirtualMachineExtension{ extension := compute.VirtualMachineExtension{
Location: &location, Location: &location,
Properties: &compute.VirtualMachineExtensionProperties{ VirtualMachineExtensionProperties: &compute.VirtualMachineExtensionProperties{
Publisher: &publisher, Publisher: &publisher,
Type: &extensionType, Type: &extensionType,
TypeHandlerVersion: &typeHandlerVersion, TypeHandlerVersion: &typeHandlerVersion,
@ -111,7 +111,7 @@ func resourceArmVirtualMachineExtensionsCreate(d *schema.ResourceData, meta inte
if err != nil { if err != nil {
return fmt.Errorf("unable to parse settings: %s", err) return fmt.Errorf("unable to parse settings: %s", err)
} }
extension.Properties.Settings = &settings extension.VirtualMachineExtensionProperties.Settings = &settings
} }
if protectedSettingsString := d.Get("protected_settings").(string); protectedSettingsString != "" { if protectedSettingsString := d.Get("protected_settings").(string); protectedSettingsString != "" {
@ -119,7 +119,7 @@ func resourceArmVirtualMachineExtensionsCreate(d *schema.ResourceData, meta inte
if err != nil { if err != nil {
return fmt.Errorf("unable to parse protected_settings: %s", err) return fmt.Errorf("unable to parse protected_settings: %s", err)
} }
extension.Properties.ProtectedSettings = &protectedSettings extension.VirtualMachineExtensionProperties.ProtectedSettings = &protectedSettings
} }
_, err := client.CreateOrUpdate(resGroup, vmName, name, extension, make(chan struct{})) _, err := client.CreateOrUpdate(resGroup, vmName, name, extension, make(chan struct{}))
@ -165,13 +165,13 @@ func resourceArmVirtualMachineExtensionsRead(d *schema.ResourceData, meta interf
d.Set("location", azureRMNormalizeLocation(*resp.Location)) d.Set("location", azureRMNormalizeLocation(*resp.Location))
d.Set("virtual_machine_name", vmName) d.Set("virtual_machine_name", vmName)
d.Set("resource_group_name", resGroup) d.Set("resource_group_name", resGroup)
d.Set("publisher", resp.Properties.Publisher) d.Set("publisher", resp.VirtualMachineExtensionProperties.Publisher)
d.Set("type", resp.Properties.Type) d.Set("type", resp.VirtualMachineExtensionProperties.Type)
d.Set("type_handler_version", resp.Properties.TypeHandlerVersion) d.Set("type_handler_version", resp.VirtualMachineExtensionProperties.TypeHandlerVersion)
d.Set("auto_upgrade_minor_version", resp.Properties.AutoUpgradeMinorVersion) d.Set("auto_upgrade_minor_version", resp.VirtualMachineExtensionProperties.AutoUpgradeMinorVersion)
if resp.Properties.Settings != nil { if resp.VirtualMachineExtensionProperties.Settings != nil {
settings, err := flattenArmVirtualMachineExtensionSettings(*resp.Properties.Settings) settings, err := flattenArmVirtualMachineExtensionSettings(*resp.VirtualMachineExtensionProperties.Settings)
if err != nil { if err != nil {
return fmt.Errorf("unable to parse settings from response: %s", err) return fmt.Errorf("unable to parse settings from response: %s", err)
} }

View File

@ -127,7 +127,7 @@ func testCheckAzureRMVirtualMachineExtensionDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("Virtual Machine Extension still exists:\n%#v", resp.Properties) return fmt.Errorf("Virtual Machine Extension still exists:\n%#v", resp.VirtualMachineExtensionProperties)
} }
} }

View File

@ -8,7 +8,6 @@ import (
"github.com/Azure/azure-sdk-for-go/arm/compute" "github.com/Azure/azure-sdk-for-go/arm/compute"
"github.com/hashicorp/terraform/helper/hashcode" "github.com/hashicorp/terraform/helper/hashcode"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/schema"
) )
@ -395,7 +394,7 @@ func resourceArmVirtualMachineScaleSetCreate(d *schema.ResourceData, meta interf
Location: &location, Location: &location,
Tags: expandTags(tags), Tags: expandTags(tags),
Sku: sku, Sku: sku,
Properties: &scaleSetProps, VirtualMachineScaleSetProperties: &scaleSetProps,
} }
_, vmErr := vmScaleSetClient.CreateOrUpdate(resGroup, name, scaleSetParams, make(chan struct{})) _, vmErr := vmScaleSetClient.CreateOrUpdate(resGroup, name, scaleSetParams, make(chan struct{}))
if vmErr != nil { if vmErr != nil {
@ -442,41 +441,43 @@ func resourceArmVirtualMachineScaleSetRead(d *schema.ResourceData, meta interfac
return fmt.Errorf("[DEBUG] Error setting Virtual Machine Scale Set Sku error: %#v", err) return fmt.Errorf("[DEBUG] Error setting Virtual Machine Scale Set Sku error: %#v", err)
} }
d.Set("upgrade_policy_mode", resp.Properties.UpgradePolicy.Mode) properties := resp.VirtualMachineScaleSetProperties
if err := d.Set("os_profile", flattenAzureRMVirtualMachineScaleSetOsProfile(resp.Properties.VirtualMachineProfile.OsProfile)); err != nil { d.Set("upgrade_policy_mode", properties.UpgradePolicy.Mode)
if err := d.Set("os_profile", flattenAzureRMVirtualMachineScaleSetOsProfile(properties.VirtualMachineProfile.OsProfile)); err != nil {
return fmt.Errorf("[DEBUG] Error setting Virtual Machine Scale Set OS Profile error: %#v", err) return fmt.Errorf("[DEBUG] Error setting Virtual Machine Scale Set OS Profile error: %#v", err)
} }
if resp.Properties.VirtualMachineProfile.OsProfile.Secrets != nil { if properties.VirtualMachineProfile.OsProfile.Secrets != nil {
if err := d.Set("os_profile_secrets", flattenAzureRmVirtualMachineScaleSetOsProfileSecrets(resp.Properties.VirtualMachineProfile.OsProfile.Secrets)); err != nil { if err := d.Set("os_profile_secrets", flattenAzureRmVirtualMachineScaleSetOsProfileSecrets(properties.VirtualMachineProfile.OsProfile.Secrets)); err != nil {
return fmt.Errorf("[DEBUG] Error setting Virtual Machine Scale Set OS Profile Secrets error: %#v", err) return fmt.Errorf("[DEBUG] Error setting Virtual Machine Scale Set OS Profile Secrets error: %#v", err)
} }
} }
if resp.Properties.VirtualMachineProfile.OsProfile.WindowsConfiguration != nil { if properties.VirtualMachineProfile.OsProfile.WindowsConfiguration != nil {
if err := d.Set("os_profile_windows_config", flattenAzureRmVirtualMachineScaleSetOsProfileWindowsConfig(resp.Properties.VirtualMachineProfile.OsProfile.WindowsConfiguration)); err != nil { if err := d.Set("os_profile_windows_config", flattenAzureRmVirtualMachineScaleSetOsProfileWindowsConfig(properties.VirtualMachineProfile.OsProfile.WindowsConfiguration)); err != nil {
return fmt.Errorf("[DEBUG] Error setting Virtual Machine Scale Set OS Profile Windows config error: %#v", err) return fmt.Errorf("[DEBUG] Error setting Virtual Machine Scale Set OS Profile Windows config error: %#v", err)
} }
} }
if resp.Properties.VirtualMachineProfile.OsProfile.LinuxConfiguration != nil { if properties.VirtualMachineProfile.OsProfile.LinuxConfiguration != nil {
if err := d.Set("os_profile_linux_config", flattenAzureRmVirtualMachineScaleSetOsProfileLinuxConfig(resp.Properties.VirtualMachineProfile.OsProfile.LinuxConfiguration)); err != nil { if err := d.Set("os_profile_linux_config", flattenAzureRmVirtualMachineScaleSetOsProfileLinuxConfig(properties.VirtualMachineProfile.OsProfile.LinuxConfiguration)); err != nil {
return fmt.Errorf("[DEBUG] Error setting Virtual Machine Scale Set OS Profile Windows config error: %#v", err) return fmt.Errorf("[DEBUG] Error setting Virtual Machine Scale Set OS Profile Windows config error: %#v", err)
} }
} }
if err := d.Set("network_profile", flattenAzureRmVirtualMachineScaleSetNetworkProfile(resp.Properties.VirtualMachineProfile.NetworkProfile)); err != nil { if err := d.Set("network_profile", flattenAzureRmVirtualMachineScaleSetNetworkProfile(properties.VirtualMachineProfile.NetworkProfile)); err != nil {
return fmt.Errorf("[DEBUG] Error setting Virtual Machine Scale Set Network Profile error: %#v", err) return fmt.Errorf("[DEBUG] Error setting Virtual Machine Scale Set Network Profile error: %#v", err)
} }
if resp.Properties.VirtualMachineProfile.StorageProfile.ImageReference != nil { if properties.VirtualMachineProfile.StorageProfile.ImageReference != nil {
if err := d.Set("storage_profile_image_reference", flattenAzureRmVirtualMachineScaleSetStorageProfileImageReference(resp.Properties.VirtualMachineProfile.StorageProfile.ImageReference)); err != nil { if err := d.Set("storage_profile_image_reference", flattenAzureRmVirtualMachineScaleSetStorageProfileImageReference(properties.VirtualMachineProfile.StorageProfile.ImageReference)); err != nil {
return fmt.Errorf("[DEBUG] Error setting Virtual Machine Scale Set Storage Profile Image Reference error: %#v", err) return fmt.Errorf("[DEBUG] Error setting Virtual Machine Scale Set Storage Profile Image Reference error: %#v", err)
} }
} }
if err := d.Set("storage_profile_os_disk", flattenAzureRmVirtualMachineScaleSetStorageProfileOSDisk(resp.Properties.VirtualMachineProfile.StorageProfile.OsDisk)); err != nil { if err := d.Set("storage_profile_os_disk", flattenAzureRmVirtualMachineScaleSetStorageProfileOSDisk(properties.VirtualMachineProfile.StorageProfile.OsDisk)); err != nil {
return fmt.Errorf("[DEBUG] Error setting Virtual Machine Scale Set Storage Profile OS Disk error: %#v", err) return fmt.Errorf("[DEBUG] Error setting Virtual Machine Scale Set Storage Profile OS Disk error: %#v", err)
} }
@ -602,22 +603,24 @@ func flattenAzureRmVirtualMachineScaleSetNetworkProfile(profile *compute.Virtual
for _, netConfig := range *networkConfigurations { for _, netConfig := range *networkConfigurations {
s := map[string]interface{}{ s := map[string]interface{}{
"name": *netConfig.Name, "name": *netConfig.Name,
"primary": *netConfig.Properties.Primary, "primary": *netConfig.VirtualMachineScaleSetNetworkConfigurationProperties.Primary,
} }
if netConfig.Properties.IPConfigurations != nil { if netConfig.VirtualMachineScaleSetNetworkConfigurationProperties.IPConfigurations != nil {
ipConfigs := make([]map[string]interface{}, 0, len(*netConfig.Properties.IPConfigurations)) ipConfigs := make([]map[string]interface{}, 0, len(*netConfig.VirtualMachineScaleSetNetworkConfigurationProperties.IPConfigurations))
for _, ipConfig := range *netConfig.Properties.IPConfigurations { for _, ipConfig := range *netConfig.VirtualMachineScaleSetNetworkConfigurationProperties.IPConfigurations {
config := make(map[string]interface{}) config := make(map[string]interface{})
config["name"] = *ipConfig.Name config["name"] = *ipConfig.Name
if ipConfig.Properties.Subnet != nil { properties := ipConfig.VirtualMachineScaleSetIPConfigurationProperties
config["subnet_id"] = *ipConfig.Properties.Subnet.ID
if ipConfig.VirtualMachineScaleSetIPConfigurationProperties.Subnet != nil {
config["subnet_id"] = *properties.Subnet.ID
} }
if ipConfig.Properties.LoadBalancerBackendAddressPools != nil { if properties.LoadBalancerBackendAddressPools != nil {
addressPools := make([]string, 0, len(*ipConfig.Properties.LoadBalancerBackendAddressPools)) addressPools := make([]string, 0, len(*properties.LoadBalancerBackendAddressPools))
for _, pool := range *ipConfig.Properties.LoadBalancerBackendAddressPools { for _, pool := range *properties.LoadBalancerBackendAddressPools {
addressPools = append(addressPools, *pool.ID) addressPools = append(addressPools, *pool.ID)
} }
config["load_balancer_backend_address_pool_ids"] = addressPools config["load_balancer_backend_address_pool_ids"] = addressPools
@ -687,17 +690,6 @@ func flattenAzureRmVirtualMachineScaleSetSku(sku *compute.Sku) []interface{} {
return []interface{}{result} return []interface{}{result}
} }
func virtualMachineScaleSetStateRefreshFunc(client *ArmClient, resourceGroupName string, scaleSetName string) resource.StateRefreshFunc {
return func() (interface{}, string, error) {
res, err := client.vmScaleSetClient.Get(resourceGroupName, scaleSetName)
if err != nil {
return nil, "", fmt.Errorf("Error issuing read request in virtualMachineScaleSetStateRefreshFunc to Azure ARM for Virtual Machine Scale Set '%s' (RG: '%s'): %s", scaleSetName, resourceGroupName, err)
}
return res, *res.Properties.ProvisioningState, nil
}
}
func resourceArmVirtualMachineScaleSetStorageProfileImageReferenceHash(v interface{}) int { func resourceArmVirtualMachineScaleSetStorageProfileImageReferenceHash(v interface{}) int {
var buf bytes.Buffer var buf bytes.Buffer
m := v.(map[string]interface{}) m := v.(map[string]interface{})
@ -815,7 +807,7 @@ func expandAzureRmVirtualMachineScaleSetNetworkProfile(d *schema.ResourceData) *
ipConfiguration := compute.VirtualMachineScaleSetIPConfiguration{ ipConfiguration := compute.VirtualMachineScaleSetIPConfiguration{
Name: &name, Name: &name,
Properties: &compute.VirtualMachineScaleSetIPConfigurationProperties{ VirtualMachineScaleSetIPConfigurationProperties: &compute.VirtualMachineScaleSetIPConfigurationProperties{
Subnet: &compute.APIEntityReference{ Subnet: &compute.APIEntityReference{
ID: &subnetId, ID: &subnetId,
}, },
@ -831,7 +823,7 @@ func expandAzureRmVirtualMachineScaleSetNetworkProfile(d *schema.ResourceData) *
nProfile := compute.VirtualMachineScaleSetNetworkConfiguration{ nProfile := compute.VirtualMachineScaleSetNetworkConfiguration{
Name: &name, Name: &name,
Properties: &compute.VirtualMachineScaleSetNetworkConfigurationProperties{ VirtualMachineScaleSetNetworkConfigurationProperties: &compute.VirtualMachineScaleSetNetworkConfigurationProperties{
Primary: &primary, Primary: &primary,
IPConfigurations: &ipConfigurations, IPConfigurations: &ipConfigurations,
}, },

View File

@ -120,7 +120,7 @@ func testCheckAzureRMVirtualMachineScaleSetDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("Virtual Machine Scale Set still exists:\n%#v", resp.Properties) return fmt.Errorf("Virtual Machine Scale Set still exists:\n%#v", resp.VirtualMachineScaleSetProperties)
} }
} }

View File

@ -451,7 +451,7 @@ func testCheckAzureRMVirtualMachineDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("Virtual Machine still exists:\n%#v", resp.Properties) return fmt.Errorf("Virtual Machine still exists:\n%#v", resp.VirtualMachineProperties)
} }
} }

View File

@ -7,7 +7,6 @@ import (
"github.com/Azure/azure-sdk-for-go/arm/network" "github.com/Azure/azure-sdk-for-go/arm/network"
"github.com/hashicorp/terraform/helper/hashcode" "github.com/hashicorp/terraform/helper/hashcode"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/schema"
) )
@ -94,7 +93,7 @@ func resourceArmVirtualNetworkCreate(d *schema.ResourceData, meta interface{}) e
vnet := network.VirtualNetwork{ vnet := network.VirtualNetwork{
Name: &name, Name: &name,
Location: &location, Location: &location,
Properties: getVirtualNetworkProperties(d), VirtualNetworkPropertiesFormat: getVirtualNetworkProperties(d),
Tags: expandTags(tags), Tags: expandTags(tags),
} }
@ -135,7 +134,7 @@ func resourceArmVirtualNetworkRead(d *schema.ResourceData, meta interface{}) err
return fmt.Errorf("Error making Read request on Azure virtual network %s: %s", name, err) return fmt.Errorf("Error making Read request on Azure virtual network %s: %s", name, err)
} }
vnet := *resp.Properties vnet := *resp.VirtualNetworkPropertiesFormat
// update appropriate values // update appropriate values
d.Set("resource_group_name", resGroup) d.Set("resource_group_name", resGroup)
@ -151,9 +150,9 @@ func resourceArmVirtualNetworkRead(d *schema.ResourceData, meta interface{}) err
s := map[string]interface{}{} s := map[string]interface{}{}
s["name"] = *subnet.Name s["name"] = *subnet.Name
s["address_prefix"] = *subnet.Properties.AddressPrefix s["address_prefix"] = *subnet.SubnetPropertiesFormat.AddressPrefix
if subnet.Properties.NetworkSecurityGroup != nil { if subnet.SubnetPropertiesFormat.NetworkSecurityGroup != nil {
s["security_group"] = *subnet.Properties.NetworkSecurityGroup.ID s["security_group"] = *subnet.SubnetPropertiesFormat.NetworkSecurityGroup.ID
} }
subnets.Add(s) subnets.Add(s)
@ -213,11 +212,11 @@ func getVirtualNetworkProperties(d *schema.ResourceData) *network.VirtualNetwork
var subnetObj network.Subnet var subnetObj network.Subnet
subnetObj.Name = &name subnetObj.Name = &name
subnetObj.Properties = &network.SubnetPropertiesFormat{} subnetObj.SubnetPropertiesFormat = &network.SubnetPropertiesFormat{}
subnetObj.Properties.AddressPrefix = &prefix subnetObj.SubnetPropertiesFormat.AddressPrefix = &prefix
if secGroup != "" { if secGroup != "" {
subnetObj.Properties.NetworkSecurityGroup = &network.SecurityGroup{ subnetObj.SubnetPropertiesFormat.NetworkSecurityGroup = &network.SecurityGroup{
ID: &secGroup, ID: &secGroup,
} }
} }
@ -246,14 +245,3 @@ func resourceAzureSubnetHash(v interface{}) int {
} }
return hashcode.String(subnet) return hashcode.String(subnet)
} }
func virtualNetworkStateRefreshFunc(client *ArmClient, resourceGroupName string, networkName string) resource.StateRefreshFunc {
return func() (interface{}, string, error) {
res, err := client.vnetClient.Get(resourceGroupName, networkName, "")
if err != nil {
return nil, "", fmt.Errorf("Error issuing read request in virtualNetworkStateRefreshFunc to Azure ARM for virtual network '%s' (RG: '%s'): %s", networkName, resourceGroupName, err)
}
return res, *res.Properties.ProvisioningState, nil
}
}

View File

@ -87,7 +87,7 @@ func resourceArmVirtualNetworkPeeringCreate(d *schema.ResourceData, meta interfa
peer := network.VirtualNetworkPeering{ peer := network.VirtualNetworkPeering{
Name: &name, Name: &name,
Properties: getVirtualNetworkPeeringProperties(d), VirtualNetworkPeeringPropertiesFormat: getVirtualNetworkPeeringProperties(d),
} }
peerMutex.Lock() peerMutex.Lock()
@ -131,7 +131,7 @@ func resourceArmVirtualNetworkPeeringRead(d *schema.ResourceData, meta interface
return fmt.Errorf("Error making Read request on Azure virtual network peering %s: %s", name, err) return fmt.Errorf("Error making Read request on Azure virtual network peering %s: %s", name, err)
} }
peer := *resp.Properties peer := *resp.VirtualNetworkPeeringPropertiesFormat
// update appropriate values // update appropriate values
d.Set("resource_group_name", resGroup) d.Set("resource_group_name", resGroup)

View File

@ -181,7 +181,7 @@ func testCheckAzureRMVirtualNetworkPeeringDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("Virtual Network Peering sitll exists:\n%#v", resp.Properties) return fmt.Errorf("Virtual Network Peering sitll exists:\n%#v", resp.VirtualNetworkPeeringPropertiesFormat)
} }
} }

View File

@ -164,7 +164,7 @@ func testCheckAzureRMVirtualNetworkDestroy(s *terraform.State) error {
} }
if resp.StatusCode != http.StatusNotFound { if resp.StatusCode != http.StatusNotFound {
return fmt.Errorf("Virtual Network sitll exists:\n%#v", resp.Properties) return fmt.Errorf("Virtual Network sitll exists:\n%#v", resp.VirtualNetworkPropertiesFormat)
} }
} }

View File

@ -75,41 +75,6 @@ func TestAccDMERecordCName(t *testing.T) {
}) })
} }
/*
ANAME can't be tested under sandbox, as the value of the ANAME must be a
resolvable address.
func TestAccDMERecordAName(t *testing.T) {
var record dnsmadeeasy.Record
domainid := os.Getenv("DME_DOMAINID")
resource.Test(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
Providers: testAccProviders,
CheckDestroy: testAccCheckDMERecordDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: fmt.Sprintf(testDMERecordConfigAName, domainid),
Check: resource.ComposeTestCheckFunc(
testAccCheckDMERecordExists("dme_record.test", &record),
resource.TestCheckResourceAttr(
"dme_record.test", "domainid", domainid),
resource.TestCheckResourceAttr(
"dme_record.test", "name", "testaname"),
resource.TestCheckResourceAttr(
"dme_record.test", "type", "ANAME"),
resource.TestCheckResourceAttr(
"dme_record.test", "value", "foo"),
resource.TestCheckResourceAttr(
"dme_record.test", "ttl", "2000"),
),
},
},
})
}
*/
func TestAccDMERecordMX(t *testing.T) { func TestAccDMERecordMX(t *testing.T) {
var record dnsmadeeasy.Record var record dnsmadeeasy.Record
domainid := os.Getenv("DME_DOMAINID") domainid := os.Getenv("DME_DOMAINID")

View File

@ -1,9 +1,8 @@
// Package cdn implements the Azure ARM Cdn service API version 2016-04-02. // Package cdn implements the Azure ARM Cdn service API version 2016-10-02.
// //
// Use these APIs to manage Azure CDN resources through the Azure Resource // Use these APIs to manage Azure CDN resources through the Azure Resource
// Manager. You must make sure that requests made to these resources are // Manager. You must make sure that requests made to these resources are
// secure. For more information, see // secure.
// https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.
package cdn package cdn
// Copyright (c) Microsoft and contributors. All rights reserved. // Copyright (c) Microsoft and contributors. All rights reserved.
@ -26,11 +25,14 @@ package cdn
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
"net/http"
) )
const ( const (
// APIVersion is the version of the Cdn // APIVersion is the version of the Cdn
APIVersion = "2016-04-02" APIVersion = "2016-10-02"
// DefaultBaseURI is the default URI used for the service Cdn // DefaultBaseURI is the default URI used for the service Cdn
DefaultBaseURI = "https://management.azure.com" DefaultBaseURI = "https://management.azure.com"
@ -58,3 +60,148 @@ func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
SubscriptionID: subscriptionID, SubscriptionID: subscriptionID,
} }
} }
// CheckNameAvailability check the availability of a resource name without
// creating the resource. This is needed for resources where name is globally
// unique, such as a CDN endpoint.
//
// checkNameAvailabilityInput is input to check.
func (client ManagementClient) CheckNameAvailability(checkNameAvailabilityInput CheckNameAvailabilityInput) (result CheckNameAvailabilityOutput, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: checkNameAvailabilityInput,
Constraints: []validation.Constraint{{Target: "checkNameAvailabilityInput.Name", Name: validation.Null, Rule: true, Chain: nil},
{Target: "checkNameAvailabilityInput.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.ManagementClient", "CheckNameAvailability")
}
req, err := client.CheckNameAvailabilityPreparer(checkNameAvailabilityInput)
if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.ManagementClient", "CheckNameAvailability", nil, "Failure preparing request")
}
resp, err := client.CheckNameAvailabilitySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "cdn.ManagementClient", "CheckNameAvailability", resp, "Failure sending request")
}
result, err = client.CheckNameAvailabilityResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "cdn.ManagementClient", "CheckNameAvailability", resp, "Failure responding to request")
}
return
}
// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request.
func (client ManagementClient) CheckNameAvailabilityPreparer(checkNameAvailabilityInput CheckNameAvailabilityInput) (*http.Request, error) {
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
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
// http.Response Body if it receives an error.
func (client ManagementClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always
// closes the http.Response Body.
func (client ManagementClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameAvailabilityOutput, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListOperations lists all of the available CDN REST API operations.
func (client ManagementClient) ListOperations() (result OperationListResult, err error) {
req, err := client.ListOperationsPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.ManagementClient", "ListOperations", nil, "Failure preparing request")
}
resp, err := client.ListOperationsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "cdn.ManagementClient", "ListOperations", resp, "Failure sending request")
}
result, err = client.ListOperationsResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "cdn.ManagementClient", "ListOperations", resp, "Failure responding to request")
}
return
}
// ListOperationsPreparer prepares the ListOperations request.
func (client ManagementClient) ListOperationsPreparer() (*http.Request, error) {
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPath("/providers/Microsoft.Cdn/operations"),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListOperationsSender sends the ListOperations request. The method will close the
// http.Response Body if it receives an error.
func (client ManagementClient) ListOperationsSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// ListOperationsResponder handles the response to the ListOperations request. The method always
// closes the http.Response Body.
func (client ManagementClient) ListOperationsResponder(resp *http.Response) (result OperationListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// ListOperationsNextResults retrieves the next set of results, if any.
func (client ManagementClient) ListOperationsNextResults(lastResults OperationListResult) (result OperationListResult, err error) {
req, err := lastResults.OperationListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.ManagementClient", "ListOperations", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListOperationsSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "cdn.ManagementClient", "ListOperations", resp, "Failure sending next results request")
}
result, err = client.ListOperationsResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "cdn.ManagementClient", "ListOperations", resp, "Failure responding to next results request")
}
return
}

View File

@ -27,8 +27,7 @@ import (
// CustomDomainsClient is the use these APIs to manage Azure CDN resources // CustomDomainsClient is the use these APIs to manage Azure CDN resources
// through the Azure Resource Manager. You must make sure that requests made // through the Azure Resource Manager. You must make sure that requests made
// to these resources are secure. For more information, see // to these resources are secure.
// https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.
type CustomDomainsClient struct { type CustomDomainsClient struct {
ManagementClient ManagementClient
} }
@ -45,24 +44,30 @@ func NewCustomDomainsClientWithBaseURI(baseURI string, subscriptionID string) Cu
return CustomDomainsClient{NewWithBaseURI(baseURI, subscriptionID)} return CustomDomainsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// Create sends the create request. This method may poll for completion. // Create creates a new CDN custom domain within an endpoint. This method may
// Polling can be canceled by passing the cancel channel argument. The // poll for completion. Polling can be canceled by passing the cancel channel
// channel will be used to cancel polling and any outstanding HTTP requests. // argument. The channel will be used to cancel polling and any outstanding
// HTTP requests.
// //
// customDomainName is name of the custom domain within an endpoint. // resourceGroupName is name of the Resource group within the Azure
// customDomainProperties is custom domain properties required for creation. // subscription. profileName is name of the CDN profile which is unique
// endpointName is name of the endpoint within the CDN profile. profileName // within the resource group. endpointName is name of the endpoint under the
// is name of the CDN profile within the resource group. resourceGroupName is // profile which is unique globally. customDomainName is name of the custom
// name of the resource group within the Azure subscription. // domain within an endpoint. customDomainProperties is custom domain
func (client CustomDomainsClient) Create(customDomainName string, customDomainProperties CustomDomainParameters, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) { // properties required for creation.
func (client CustomDomainsClient) Create(resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainProperties CustomDomainParameters, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
{TargetValue: customDomainProperties, {TargetValue: customDomainProperties,
Constraints: []validation.Constraint{{Target: "customDomainProperties.Properties", Name: validation.Null, Rule: false, Constraints: []validation.Constraint{{Target: "customDomainProperties.CustomDomainPropertiesParameters", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "customDomainProperties.Properties.HostName", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { Chain: []validation.Constraint{{Target: "customDomainProperties.CustomDomainPropertiesParameters.HostName", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.CustomDomainsClient", "Create") return result, validation.NewErrorWithValidationError(err, "cdn.CustomDomainsClient", "Create")
} }
req, err := client.CreatePreparer(customDomainName, customDomainProperties, endpointName, profileName, resourceGroupName, cancel) req, err := client.CreatePreparer(resourceGroupName, profileName, endpointName, customDomainName, customDomainProperties, cancel)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Create", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Create", nil, "Failure preparing request")
} }
@ -82,7 +87,7 @@ func (client CustomDomainsClient) Create(customDomainName string, customDomainPr
} }
// CreatePreparer prepares the Create request. // 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) { func (client CustomDomainsClient) CreatePreparer(resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainProperties CustomDomainParameters, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"customDomainName": autorest.Encode("path", customDomainName), "customDomainName": autorest.Encode("path", customDomainName),
"endpointName": autorest.Encode("path", endpointName), "endpointName": autorest.Encode("path", endpointName),
@ -125,37 +130,46 @@ func (client CustomDomainsClient) CreateResponder(resp *http.Response) (result a
return return
} }
// DeleteIfExists sends the delete if exists request. This method may poll for // Delete deletes an existing CDN custom domain within an endpoint. This
// completion. Polling can be canceled by passing the cancel channel // method may poll for completion. Polling can be canceled by passing the
// argument. The channel will be used to cancel polling and any outstanding // cancel channel argument. The channel will be used to cancel polling and
// HTTP requests. // any outstanding HTTP requests.
// //
// customDomainName is name of the custom domain within an endpoint. // resourceGroupName is name of the Resource group within the Azure
// endpointName is name of the endpoint within the CDN profile. profileName // subscription. profileName is name of the CDN profile which is unique
// is name of the CDN profile within the resource group. resourceGroupName is // within the resource group. endpointName is name of the endpoint under the
// name of the resource group within the Azure subscription. // profile which is unique globally. customDomainName is name of the custom
func (client CustomDomainsClient) DeleteIfExists(customDomainName string, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) { // domain within an endpoint.
req, err := client.DeleteIfExistsPreparer(customDomainName, endpointName, profileName, resourceGroupName, cancel) func (client CustomDomainsClient) Delete(resourceGroupName string, profileName string, endpointName string, customDomainName string, cancel <-chan struct{}) (result autorest.Response, err error) {
if err != nil { if err := validation.Validate([]validation.Validation{
return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DeleteIfExists", nil, "Failure preparing request") {TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.CustomDomainsClient", "Delete")
} }
resp, err := client.DeleteIfExistsSender(req) req, err := client.DeletePreparer(resourceGroupName, profileName, endpointName, customDomainName, cancel)
if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil { if err != nil {
result.Response = resp result.Response = resp
return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DeleteIfExists", resp, "Failure sending request") return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Delete", resp, "Failure sending request")
} }
result, err = client.DeleteIfExistsResponder(resp) result, err = client.DeleteResponder(resp)
if err != nil { if err != nil {
err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DeleteIfExists", resp, "Failure responding to request") err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Delete", resp, "Failure responding to request")
} }
return return
} }
// DeleteIfExistsPreparer prepares the DeleteIfExists request. // DeletePreparer prepares the Delete request.
func (client CustomDomainsClient) DeleteIfExistsPreparer(customDomainName string, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) { func (client CustomDomainsClient) DeletePreparer(resourceGroupName string, profileName string, endpointName string, customDomainName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"customDomainName": autorest.Encode("path", customDomainName), "customDomainName": autorest.Encode("path", customDomainName),
"endpointName": autorest.Encode("path", endpointName), "endpointName": autorest.Encode("path", endpointName),
@ -176,17 +190,17 @@ func (client CustomDomainsClient) DeleteIfExistsPreparer(customDomainName string
return preparer.Prepare(&http.Request{Cancel: cancel}) return preparer.Prepare(&http.Request{Cancel: cancel})
} }
// DeleteIfExistsSender sends the DeleteIfExists request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client CustomDomainsClient) DeleteIfExistsSender(req *http.Request) (*http.Response, error) { func (client CustomDomainsClient) DeleteSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, return autorest.SendWithSender(client,
req, req,
azure.DoPollForAsynchronous(client.PollingDelay)) azure.DoPollForAsynchronous(client.PollingDelay))
} }
// DeleteIfExistsResponder handles the response to the DeleteIfExists request. The method always // DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body. // closes the http.Response Body.
func (client CustomDomainsClient) DeleteIfExistsResponder(resp *http.Response) (result autorest.Response, err error) { func (client CustomDomainsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond( err = autorest.Respond(
resp, resp,
client.ByInspecting(), client.ByInspecting(),
@ -196,14 +210,23 @@ func (client CustomDomainsClient) DeleteIfExistsResponder(resp *http.Response) (
return return
} }
// Get sends the get request. // Get gets an existing CDN custom domain within an endpoint.
// //
// customDomainName is name of the custom domain within an endpoint. // resourceGroupName is name of the Resource group within the Azure
// endpointName is name of the endpoint within the CDN profile. profileName // subscription. profileName is name of the CDN profile which is unique
// is name of the CDN profile within the resource group. resourceGroupName is // within the resource group. endpointName is name of the endpoint under the
// name of the resource group within the Azure subscription. // profile which is unique globally. customDomainName is name of the custom
func (client CustomDomainsClient) Get(customDomainName string, endpointName string, profileName string, resourceGroupName string) (result CustomDomain, err error) { // domain within an endpoint.
req, err := client.GetPreparer(customDomainName, endpointName, profileName, resourceGroupName) func (client CustomDomainsClient) Get(resourceGroupName string, profileName string, endpointName string, customDomainName string) (result CustomDomain, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.CustomDomainsClient", "Get")
}
req, err := client.GetPreparer(resourceGroupName, profileName, endpointName, customDomainName)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Get", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Get", nil, "Failure preparing request")
} }
@ -223,7 +246,7 @@ func (client CustomDomainsClient) Get(customDomainName string, endpointName stri
} }
// GetPreparer prepares the Get request. // GetPreparer prepares the Get request.
func (client CustomDomainsClient) GetPreparer(customDomainName string, endpointName string, profileName string, resourceGroupName string) (*http.Request, error) { func (client CustomDomainsClient) GetPreparer(resourceGroupName string, profileName string, endpointName string, customDomainName string) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"customDomainName": autorest.Encode("path", customDomainName), "customDomainName": autorest.Encode("path", customDomainName),
"endpointName": autorest.Encode("path", endpointName), "endpointName": autorest.Encode("path", endpointName),
@ -263,13 +286,22 @@ func (client CustomDomainsClient) GetResponder(resp *http.Response) (result Cust
return return
} }
// ListByEndpoint sends the list by endpoint request. // ListByEndpoint lists the existing CDN custom domains within an endpoint.
// //
// endpointName is name of the endpoint within the CDN profile. profileName is // resourceGroupName is name of the Resource group within the Azure
// name of the CDN profile within the resource group. resourceGroupName is // subscription. profileName is name of the CDN profile which is unique
// name of the resource group within the Azure subscription. // within the resource group. endpointName is name of the endpoint under the
func (client CustomDomainsClient) ListByEndpoint(endpointName string, profileName string, resourceGroupName string) (result CustomDomainListResult, err error) { // profile which is unique globally.
req, err := client.ListByEndpointPreparer(endpointName, profileName, resourceGroupName) func (client CustomDomainsClient) ListByEndpoint(resourceGroupName string, profileName string, endpointName string) (result CustomDomainListResult, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.CustomDomainsClient", "ListByEndpoint")
}
req, err := client.ListByEndpointPreparer(resourceGroupName, profileName, endpointName)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "ListByEndpoint", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "ListByEndpoint", nil, "Failure preparing request")
} }
@ -289,7 +321,7 @@ func (client CustomDomainsClient) ListByEndpoint(endpointName string, profileNam
} }
// ListByEndpointPreparer prepares the ListByEndpoint request. // ListByEndpointPreparer prepares the ListByEndpoint request.
func (client CustomDomainsClient) ListByEndpointPreparer(endpointName string, profileName string, resourceGroupName string) (*http.Request, error) { func (client CustomDomainsClient) ListByEndpointPreparer(resourceGroupName string, profileName string, endpointName string) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"endpointName": autorest.Encode("path", endpointName), "endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName), "profileName": autorest.Encode("path", profileName),
@ -328,72 +360,26 @@ func (client CustomDomainsClient) ListByEndpointResponder(resp *http.Response) (
return return
} }
// Update sends the update request. // ListByEndpointNextResults retrieves the next set of results, if any.
// func (client CustomDomainsClient) ListByEndpointNextResults(lastResults CustomDomainListResult) (result CustomDomainListResult, err error) {
// customDomainName is name of the custom domain within an endpoint. req, err := lastResults.CustomDomainListResultPreparer()
// 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 { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Update", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "ListByEndpoint", nil, "Failure preparing next results request")
}
if req == nil {
return
} }
resp, err := client.UpdateSender(req) resp, err := client.ListByEndpointSender(req)
if err != nil { if err != nil {
result.Response = autorest.Response{Response: resp} result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Update", resp, "Failure sending request") return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "ListByEndpoint", resp, "Failure sending next results request")
} }
result, err = client.UpdateResponder(resp) result, err = client.ListByEndpointResponder(resp)
if err != nil { if err != nil {
err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Update", resp, "Failure responding to request") err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "ListByEndpoint", resp, "Failure responding to next results request")
} }
return return
} }
// 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": 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": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}", pathParameters),
autorest.WithJSON(customDomainProperties),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// UpdateSender sends the Update request. The method will close the
// http.Response Body if it receives an error.
func (client CustomDomainsClient) UpdateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// UpdateResponder handles the response to the Update request. The method always
// closes the http.Response Body.
func (client CustomDomainsClient) UpdateResponder(resp *http.Response) (result ErrorResponse, 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

@ -27,8 +27,7 @@ import (
// EndpointsClient is the use these APIs to manage Azure CDN resources through // EndpointsClient is the use these APIs to manage Azure CDN resources through
// the Azure Resource Manager. You must make sure that requests made to these // the Azure Resource Manager. You must make sure that requests made to these
// resources are secure. For more information, see // resources are secure.
// https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.
type EndpointsClient struct { type EndpointsClient struct {
ManagementClient ManagementClient
} }
@ -44,24 +43,32 @@ func NewEndpointsClientWithBaseURI(baseURI string, subscriptionID string) Endpoi
return EndpointsClient{NewWithBaseURI(baseURI, subscriptionID)} return EndpointsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// Create sends the create request. This method may poll for completion. // Create creates a new CDN endpoint with the specified parameters. This
// Polling can be canceled by passing the cancel channel argument. The // method may poll for completion. Polling can be canceled by passing the
// channel will be used to cancel polling and any outstanding HTTP requests. // 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. // resourceGroupName is name of the Resource group within the Azure
// endpointProperties is endpoint properties profileName is name of the CDN // subscription. profileName is name of the CDN profile which is unique
// profile within the resource group. resourceGroupName is name of the // within the resource group. endpointName is name of the endpoint under the
// resource group within the Azure subscription. // profile which is unique globally. endpoint is endpoint properties
func (client EndpointsClient) Create(endpointName string, endpointProperties EndpointCreateParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) { func (client EndpointsClient) Create(resourceGroupName string, profileName string, endpointName string, endpoint Endpoint, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: endpointProperties, {TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "endpointProperties.Location", Name: validation.Null, Rule: true, Chain: nil}, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "endpointProperties.Properties", Name: validation.Null, Rule: false, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
Chain: []validation.Constraint{{Target: "endpointProperties.Properties.Origins", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
{TargetValue: endpoint,
Constraints: []validation.Constraint{{Target: "endpoint.EndpointProperties", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "endpoint.EndpointProperties.Origins", Name: validation.Null, Rule: true, Chain: nil},
{Target: "endpoint.EndpointProperties.HostName", Name: validation.ReadOnly, Rule: true, Chain: nil},
{Target: "endpoint.EndpointProperties.ResourceState", Name: validation.ReadOnly, Rule: true, Chain: nil},
{Target: "endpoint.EndpointProperties.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil},
}}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.EndpointsClient", "Create") return result, validation.NewErrorWithValidationError(err, "cdn.EndpointsClient", "Create")
} }
req, err := client.CreatePreparer(endpointName, endpointProperties, profileName, resourceGroupName, cancel) req, err := client.CreatePreparer(resourceGroupName, profileName, endpointName, endpoint, cancel)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Create", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Create", nil, "Failure preparing request")
} }
@ -81,7 +88,7 @@ func (client EndpointsClient) Create(endpointName string, endpointProperties End
} }
// CreatePreparer prepares the Create request. // CreatePreparer prepares the Create request.
func (client EndpointsClient) CreatePreparer(endpointName string, endpointProperties EndpointCreateParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) { func (client EndpointsClient) CreatePreparer(resourceGroupName string, profileName string, endpointName string, endpoint Endpoint, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"endpointName": autorest.Encode("path", endpointName), "endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName), "profileName": autorest.Encode("path", profileName),
@ -98,7 +105,7 @@ func (client EndpointsClient) CreatePreparer(endpointName string, endpointProper
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", pathParameters),
autorest.WithJSON(endpointProperties), autorest.WithJSON(endpoint),
autorest.WithQueryParameters(queryParameters)) autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel}) return preparer.Prepare(&http.Request{Cancel: cancel})
} }
@ -123,36 +130,45 @@ func (client EndpointsClient) CreateResponder(resp *http.Response) (result autor
return return
} }
// DeleteIfExists sends the delete if exists request. This method may poll for // Delete deletes an existing CDN endpoint with the specified parameters. This
// completion. Polling can be canceled by passing the cancel channel // method may poll for completion. Polling can be canceled by passing the
// argument. The channel will be used to cancel polling and any outstanding // cancel channel argument. The channel will be used to cancel polling and
// HTTP requests. // any outstanding HTTP requests.
// //
// endpointName is name of the endpoint within the CDN profile. profileName is // resourceGroupName is name of the Resource group within the Azure
// name of the CDN profile within the resource group. resourceGroupName is // subscription. profileName is name of the CDN profile which is unique
// name of the resource group within the Azure subscription. // within the resource group. endpointName is name of the endpoint under the
func (client EndpointsClient) DeleteIfExists(endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) { // profile which is unique globally.
req, err := client.DeleteIfExistsPreparer(endpointName, profileName, resourceGroupName, cancel) func (client EndpointsClient) Delete(resourceGroupName string, profileName string, endpointName string, cancel <-chan struct{}) (result autorest.Response, err error) {
if err != nil { if err := validation.Validate([]validation.Validation{
return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "DeleteIfExists", nil, "Failure preparing request") {TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.EndpointsClient", "Delete")
} }
resp, err := client.DeleteIfExistsSender(req) req, err := client.DeletePreparer(resourceGroupName, profileName, endpointName, cancel)
if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil { if err != nil {
result.Response = resp result.Response = resp
return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "DeleteIfExists", resp, "Failure sending request") return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Delete", resp, "Failure sending request")
} }
result, err = client.DeleteIfExistsResponder(resp) result, err = client.DeleteResponder(resp)
if err != nil { if err != nil {
err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "DeleteIfExists", resp, "Failure responding to request") err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Delete", resp, "Failure responding to request")
} }
return return
} }
// DeleteIfExistsPreparer prepares the DeleteIfExists request. // DeletePreparer prepares the Delete request.
func (client EndpointsClient) DeleteIfExistsPreparer(endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) { func (client EndpointsClient) DeletePreparer(resourceGroupName string, profileName string, endpointName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"endpointName": autorest.Encode("path", endpointName), "endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName), "profileName": autorest.Encode("path", profileName),
@ -172,17 +188,17 @@ func (client EndpointsClient) DeleteIfExistsPreparer(endpointName string, profil
return preparer.Prepare(&http.Request{Cancel: cancel}) return preparer.Prepare(&http.Request{Cancel: cancel})
} }
// DeleteIfExistsSender sends the DeleteIfExists request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client EndpointsClient) DeleteIfExistsSender(req *http.Request) (*http.Response, error) { func (client EndpointsClient) DeleteSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, return autorest.SendWithSender(client,
req, req,
azure.DoPollForAsynchronous(client.PollingDelay)) azure.DoPollForAsynchronous(client.PollingDelay))
} }
// DeleteIfExistsResponder handles the response to the DeleteIfExists request. The method always // DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body. // closes the http.Response Body.
func (client EndpointsClient) DeleteIfExistsResponder(resp *http.Response) (result autorest.Response, err error) { func (client EndpointsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond( err = autorest.Respond(
resp, resp,
client.ByInspecting(), client.ByInspecting(),
@ -192,13 +208,23 @@ func (client EndpointsClient) DeleteIfExistsResponder(resp *http.Response) (resu
return return
} }
// Get sends the get request. // Get gets an existing CDN endpoint with the specified endpoint name under
// the specified subscription, resource group and profile.
// //
// endpointName is name of the endpoint within the CDN profile. profileName is // resourceGroupName is name of the Resource group within the Azure
// name of the CDN profile within the resource group. resourceGroupName is // subscription. profileName is name of the CDN profile which is unique
// name of the resource group within the Azure subscription. // within the resource group. endpointName is name of the endpoint under the
func (client EndpointsClient) Get(endpointName string, profileName string, resourceGroupName string) (result Endpoint, err error) { // profile which is unique globally.
req, err := client.GetPreparer(endpointName, profileName, resourceGroupName) func (client EndpointsClient) Get(resourceGroupName string, profileName string, endpointName string) (result Endpoint, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.EndpointsClient", "Get")
}
req, err := client.GetPreparer(resourceGroupName, profileName, endpointName)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Get", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Get", nil, "Failure preparing request")
} }
@ -218,7 +244,7 @@ func (client EndpointsClient) Get(endpointName string, profileName string, resou
} }
// GetPreparer prepares the Get request. // GetPreparer prepares the Get request.
func (client EndpointsClient) GetPreparer(endpointName string, profileName string, resourceGroupName string) (*http.Request, error) { func (client EndpointsClient) GetPreparer(resourceGroupName string, profileName string, endpointName string) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"endpointName": autorest.Encode("path", endpointName), "endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName), "profileName": autorest.Encode("path", profileName),
@ -257,13 +283,21 @@ func (client EndpointsClient) GetResponder(resp *http.Response) (result Endpoint
return return
} }
// ListByProfile sends the list by profile request. // ListByProfile lists existing CDN endpoints.
// //
// profileName is name of the CDN profile within the resource group. // resourceGroupName is name of the Resource group within the Azure
// resourceGroupName is name of the resource group within the Azure // subscription. profileName is name of the CDN profile which is unique
// subscription. // within the resource group.
func (client EndpointsClient) ListByProfile(profileName string, resourceGroupName string) (result EndpointListResult, err error) { func (client EndpointsClient) ListByProfile(resourceGroupName string, profileName string) (result EndpointListResult, err error) {
req, err := client.ListByProfilePreparer(profileName, resourceGroupName) if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.EndpointsClient", "ListByProfile")
}
req, err := client.ListByProfilePreparer(resourceGroupName, profileName)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ListByProfile", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ListByProfile", nil, "Failure preparing request")
} }
@ -283,7 +317,7 @@ func (client EndpointsClient) ListByProfile(profileName string, resourceGroupNam
} }
// ListByProfilePreparer prepares the ListByProfile request. // ListByProfilePreparer prepares the ListByProfile request.
func (client EndpointsClient) ListByProfilePreparer(profileName string, resourceGroupName string) (*http.Request, error) { func (client EndpointsClient) ListByProfilePreparer(resourceGroupName string, profileName string) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"profileName": autorest.Encode("path", profileName), "profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName), "resourceGroupName": autorest.Encode("path", resourceGroupName),
@ -321,24 +355,52 @@ func (client EndpointsClient) ListByProfileResponder(resp *http.Response) (resul
return return
} }
// LoadContent sends the load content request. This method may poll for // ListByProfileNextResults retrieves the next set of results, if any.
// completion. Polling can be canceled by passing the cancel channel func (client EndpointsClient) ListByProfileNextResults(lastResults EndpointListResult) (result EndpointListResult, err error) {
// argument. The channel will be used to cancel polling and any outstanding req, err := lastResults.EndpointListResultPreparer()
// HTTP requests. if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ListByProfile", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListByProfileSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ListByProfile", resp, "Failure sending next results request")
}
result, err = client.ListByProfileResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ListByProfile", resp, "Failure responding to next results request")
}
return
}
// LoadContent forcibly pre-loads CDN endpoint content. Available for Verizon
// Profiles. 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. // resourceGroupName is name of the Resource group within the Azure
// contentFilePaths is the path to the content to be loaded. Path should // subscription. profileName is name of the CDN profile which is unique
// describe a file. profileName is name of the CDN profile within the // within the resource group. endpointName is name of the endpoint under the
// resource group. resourceGroupName is name of the resource group within the // profile which is unique globally. contentFilePaths is the path to the
// Azure subscription. // content to be loaded. Path should describe a file.
func (client EndpointsClient) LoadContent(endpointName string, contentFilePaths LoadParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) { func (client EndpointsClient) LoadContent(resourceGroupName string, profileName string, endpointName string, contentFilePaths LoadParameters, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
{TargetValue: contentFilePaths, {TargetValue: contentFilePaths,
Constraints: []validation.Constraint{{Target: "contentFilePaths.ContentPaths", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { Constraints: []validation.Constraint{{Target: "contentFilePaths.ContentPaths", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.EndpointsClient", "LoadContent") return result, validation.NewErrorWithValidationError(err, "cdn.EndpointsClient", "LoadContent")
} }
req, err := client.LoadContentPreparer(endpointName, contentFilePaths, profileName, resourceGroupName, cancel) req, err := client.LoadContentPreparer(resourceGroupName, profileName, endpointName, contentFilePaths, cancel)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "LoadContent", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "LoadContent", nil, "Failure preparing request")
} }
@ -358,7 +420,7 @@ func (client EndpointsClient) LoadContent(endpointName string, contentFilePaths
} }
// LoadContentPreparer prepares the LoadContent request. // LoadContentPreparer prepares the LoadContent request.
func (client EndpointsClient) LoadContentPreparer(endpointName string, contentFilePaths LoadParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) { func (client EndpointsClient) LoadContentPreparer(resourceGroupName string, profileName string, endpointName string, contentFilePaths LoadParameters, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"endpointName": autorest.Encode("path", endpointName), "endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName), "profileName": autorest.Encode("path", profileName),
@ -400,24 +462,29 @@ func (client EndpointsClient) LoadContentResponder(resp *http.Response) (result
return return
} }
// PurgeContent sends the purge content request. This method may poll for // PurgeContent forcibly purges CDN endpoint content. This method may poll for
// completion. Polling can be canceled by passing the cancel channel // completion. Polling can be canceled by passing the cancel channel
// argument. The channel will be used to cancel polling and any outstanding // argument. The channel will be used to cancel polling and any outstanding
// HTTP requests. // HTTP requests.
// //
// endpointName is name of the endpoint within the CDN profile. // resourceGroupName is name of the Resource group within the Azure
// contentFilePaths is the path to the content to be purged. Path can // subscription. profileName is name of the CDN profile which is unique
// describe a file or directory. profileName is name of the CDN profile // within the resource group. endpointName is name of the endpoint under the
// within the resource group. resourceGroupName is name of the resource group // profile which is unique globally. contentFilePaths is the path to the
// within the Azure subscription. // content to be purged. Path can describe a file or directory using the
func (client EndpointsClient) PurgeContent(endpointName string, contentFilePaths PurgeParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) { // wildcard. e.g. '/my/directory/*' or '/my/file.exe/'
func (client EndpointsClient) PurgeContent(resourceGroupName string, profileName string, endpointName string, contentFilePaths PurgeParameters, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
{TargetValue: contentFilePaths, {TargetValue: contentFilePaths,
Constraints: []validation.Constraint{{Target: "contentFilePaths.ContentPaths", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { Constraints: []validation.Constraint{{Target: "contentFilePaths.ContentPaths", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.EndpointsClient", "PurgeContent") return result, validation.NewErrorWithValidationError(err, "cdn.EndpointsClient", "PurgeContent")
} }
req, err := client.PurgeContentPreparer(endpointName, contentFilePaths, profileName, resourceGroupName, cancel) req, err := client.PurgeContentPreparer(resourceGroupName, profileName, endpointName, contentFilePaths, cancel)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "PurgeContent", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "PurgeContent", nil, "Failure preparing request")
} }
@ -437,7 +504,7 @@ func (client EndpointsClient) PurgeContent(endpointName string, contentFilePaths
} }
// PurgeContentPreparer prepares the PurgeContent request. // PurgeContentPreparer prepares the PurgeContent request.
func (client EndpointsClient) PurgeContentPreparer(endpointName string, contentFilePaths PurgeParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) { func (client EndpointsClient) PurgeContentPreparer(resourceGroupName string, profileName string, endpointName string, contentFilePaths PurgeParameters, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"endpointName": autorest.Encode("path", endpointName), "endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName), "profileName": autorest.Encode("path", profileName),
@ -479,15 +546,25 @@ func (client EndpointsClient) PurgeContentResponder(resp *http.Response) (result
return return
} }
// Start sends the start request. This method may poll for completion. Polling // Start starts an existing stopped CDN endpoint. This method may poll for
// can be canceled by passing the cancel channel argument. The channel will // completion. Polling can be canceled by passing the cancel channel
// be used to cancel polling and any outstanding HTTP requests. // 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 // resourceGroupName is name of the Resource group within the Azure
// name of the CDN profile within the resource group. resourceGroupName is // subscription. profileName is name of the CDN profile which is unique
// name of the resource group within the Azure subscription. // within the resource group. endpointName is name of the endpoint under the
func (client EndpointsClient) Start(endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) { // profile which is unique globally.
req, err := client.StartPreparer(endpointName, profileName, resourceGroupName, cancel) func (client EndpointsClient) Start(resourceGroupName string, profileName string, endpointName string, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.EndpointsClient", "Start")
}
req, err := client.StartPreparer(resourceGroupName, profileName, endpointName, cancel)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Start", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Start", nil, "Failure preparing request")
} }
@ -507,7 +584,7 @@ func (client EndpointsClient) Start(endpointName string, profileName string, res
} }
// StartPreparer prepares the Start request. // StartPreparer prepares the Start request.
func (client EndpointsClient) StartPreparer(endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) { func (client EndpointsClient) StartPreparer(resourceGroupName string, profileName string, endpointName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"endpointName": autorest.Encode("path", endpointName), "endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName), "profileName": autorest.Encode("path", profileName),
@ -547,15 +624,25 @@ func (client EndpointsClient) StartResponder(resp *http.Response) (result autore
return return
} }
// Stop sends the stop request. This method may poll for completion. Polling // Stop stops an existing running CDN endpoint. This method may poll for
// can be canceled by passing the cancel channel argument. The channel will // completion. Polling can be canceled by passing the cancel channel
// be used to cancel polling and any outstanding HTTP requests. // 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 // resourceGroupName is name of the Resource group within the Azure
// name of the CDN profile within the resource group. resourceGroupName is // subscription. profileName is name of the CDN profile which is unique
// name of the resource group within the Azure subscription. // within the resource group. endpointName is name of the endpoint under the
func (client EndpointsClient) Stop(endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) { // profile which is unique globally.
req, err := client.StopPreparer(endpointName, profileName, resourceGroupName, cancel) func (client EndpointsClient) Stop(resourceGroupName string, profileName string, endpointName string, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.EndpointsClient", "Stop")
}
req, err := client.StopPreparer(resourceGroupName, profileName, endpointName, cancel)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Stop", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Stop", nil, "Failure preparing request")
} }
@ -575,7 +662,7 @@ func (client EndpointsClient) Stop(endpointName string, profileName string, reso
} }
// StopPreparer prepares the Stop request. // StopPreparer prepares the Stop request.
func (client EndpointsClient) StopPreparer(endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) { func (client EndpointsClient) StopPreparer(resourceGroupName string, profileName string, endpointName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"endpointName": autorest.Encode("path", endpointName), "endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName), "profileName": autorest.Encode("path", profileName),
@ -615,16 +702,29 @@ func (client EndpointsClient) StopResponder(resp *http.Response) (result autores
return return
} }
// Update sends the update request. This method may poll for completion. // Update updates an existing CDN endpoint with the specified parameters. Only
// Polling can be canceled by passing the cancel channel argument. The // tags and OriginHostHeader can be updated after creating an endpoint. To
// channel will be used to cancel polling and any outstanding HTTP requests. // update origins, use the Update Origin operation. To update custom domains,
// use the Update Custom Domain operation. 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. // resourceGroupName is name of the Resource group within the Azure
// endpointProperties is endpoint properties profileName is name of the CDN // subscription. profileName is name of the CDN profile which is unique
// profile within the resource group. resourceGroupName is name of the // within the resource group. endpointName is name of the endpoint under the
// resource group within the Azure subscription. // profile which is unique globally. endpointUpdateProperties is endpoint
func (client EndpointsClient) Update(endpointName string, endpointProperties EndpointUpdateParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) { // update properties
req, err := client.UpdatePreparer(endpointName, endpointProperties, profileName, resourceGroupName, cancel) func (client EndpointsClient) Update(resourceGroupName string, profileName string, endpointName string, endpointUpdateProperties EndpointUpdateParameters, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.EndpointsClient", "Update")
}
req, err := client.UpdatePreparer(resourceGroupName, profileName, endpointName, endpointUpdateProperties, cancel)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Update", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Update", nil, "Failure preparing request")
} }
@ -644,7 +744,7 @@ func (client EndpointsClient) Update(endpointName string, endpointProperties End
} }
// UpdatePreparer prepares the Update request. // UpdatePreparer prepares the Update request.
func (client EndpointsClient) UpdatePreparer(endpointName string, endpointProperties EndpointUpdateParameters, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) { func (client EndpointsClient) UpdatePreparer(resourceGroupName string, profileName string, endpointName string, endpointUpdateProperties EndpointUpdateParameters, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"endpointName": autorest.Encode("path", endpointName), "endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName), "profileName": autorest.Encode("path", profileName),
@ -661,7 +761,7 @@ func (client EndpointsClient) UpdatePreparer(endpointName string, endpointProper
autorest.AsPatch(), autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", pathParameters),
autorest.WithJSON(endpointProperties), autorest.WithJSON(endpointUpdateProperties),
autorest.WithQueryParameters(queryParameters)) autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel}) return preparer.Prepare(&http.Request{Cancel: cancel})
} }
@ -686,20 +786,26 @@ func (client EndpointsClient) UpdateResponder(resp *http.Response) (result autor
return return
} }
// ValidateCustomDomain sends the validate custom domain request. // ValidateCustomDomain validates a custom domain mapping to ensure it maps to
// the correct CNAME in DNS.
// //
// endpointName is name of the endpoint within the CDN profile. // resourceGroupName is name of the Resource group within the Azure
// customDomainProperties is custom domain to validate. profileName is name // subscription. profileName is name of the CDN profile which is unique
// of the CDN profile within the resource group. resourceGroupName is name of // within the resource group. endpointName is name of the endpoint under the
// the resource group within the Azure subscription. // profile which is unique globally. customDomainProperties is custom domain
func (client EndpointsClient) ValidateCustomDomain(endpointName string, customDomainProperties ValidateCustomDomainInput, profileName string, resourceGroupName string) (result ValidateCustomDomainOutput, err error) { // to validate.
func (client EndpointsClient) ValidateCustomDomain(resourceGroupName string, profileName string, endpointName string, customDomainProperties ValidateCustomDomainInput) (result ValidateCustomDomainOutput, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
{TargetValue: customDomainProperties, {TargetValue: customDomainProperties,
Constraints: []validation.Constraint{{Target: "customDomainProperties.HostName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { Constraints: []validation.Constraint{{Target: "customDomainProperties.HostName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.EndpointsClient", "ValidateCustomDomain") return result, validation.NewErrorWithValidationError(err, "cdn.EndpointsClient", "ValidateCustomDomain")
} }
req, err := client.ValidateCustomDomainPreparer(endpointName, customDomainProperties, profileName, resourceGroupName) req, err := client.ValidateCustomDomainPreparer(resourceGroupName, profileName, endpointName, customDomainProperties)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ValidateCustomDomain", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ValidateCustomDomain", nil, "Failure preparing request")
} }
@ -719,7 +825,7 @@ func (client EndpointsClient) ValidateCustomDomain(endpointName string, customDo
} }
// ValidateCustomDomainPreparer prepares the ValidateCustomDomain request. // ValidateCustomDomainPreparer prepares the ValidateCustomDomain request.
func (client EndpointsClient) ValidateCustomDomainPreparer(endpointName string, customDomainProperties ValidateCustomDomainInput, profileName string, resourceGroupName string) (*http.Request, error) { func (client EndpointsClient) ValidateCustomDomainPreparer(resourceGroupName string, profileName string, endpointName string, customDomainProperties ValidateCustomDomainInput) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"endpointName": autorest.Encode("path", endpointName), "endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName), "profileName": autorest.Encode("path", profileName),

View File

@ -20,6 +20,8 @@ package cdn
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/to"
"net/http"
) )
// CustomDomainResourceState enumerates the values for custom domain resource // CustomDomainResourceState enumerates the values for custom domain resource
@ -59,6 +61,16 @@ const (
EndpointResourceStateStopping EndpointResourceState = "Stopping" EndpointResourceStateStopping EndpointResourceState = "Stopping"
) )
// GeoFilterActions enumerates the values for geo filter actions.
type GeoFilterActions string
const (
// Allow specifies the allow state for geo filter actions.
Allow GeoFilterActions = "Allow"
// Block specifies the block state for geo filter actions.
Block GeoFilterActions = "Block"
)
// OriginResourceState enumerates the values for origin resource state. // OriginResourceState enumerates the values for origin resource state.
type OriginResourceState string type OriginResourceState string
@ -92,21 +104,6 @@ const (
ProfileResourceStateDisabled ProfileResourceState = "Disabled" ProfileResourceStateDisabled ProfileResourceState = "Disabled"
) )
// ProvisioningState enumerates the values for provisioning state.
type ProvisioningState string
const (
// ProvisioningStateCreating specifies the provisioning state creating
// state for provisioning state.
ProvisioningStateCreating ProvisioningState = "Creating"
// ProvisioningStateFailed specifies the provisioning state failed state
// for provisioning state.
ProvisioningStateFailed ProvisioningState = "Failed"
// ProvisioningStateSucceeded specifies the provisioning state succeeded
// state for provisioning state.
ProvisioningStateSucceeded ProvisioningState = "Succeeded"
)
// QueryStringCachingBehavior enumerates the values for query string caching // QueryStringCachingBehavior enumerates the values for query string caching
// behavior. // behavior.
type QueryStringCachingBehavior string type QueryStringCachingBehavior string
@ -144,6 +141,8 @@ const (
PremiumVerizon SkuName = "Premium_Verizon" PremiumVerizon SkuName = "Premium_Verizon"
// StandardAkamai specifies the standard akamai state for sku name. // StandardAkamai specifies the standard akamai state for sku name.
StandardAkamai SkuName = "Standard_Akamai" StandardAkamai SkuName = "Standard_Akamai"
// StandardChinaCdn specifies the standard china cdn state for sku name.
StandardChinaCdn SkuName = "Standard_ChinaCdn"
// StandardVerizon specifies the standard verizon state for sku name. // StandardVerizon specifies the standard verizon state for sku name.
StandardVerizon SkuName = "Standard_Verizon" StandardVerizon SkuName = "Standard_Verizon"
) )
@ -157,54 +156,74 @@ type CheckNameAvailabilityInput struct {
// CheckNameAvailabilityOutput is output of check name availability API. // CheckNameAvailabilityOutput is output of check name availability API.
type CheckNameAvailabilityOutput struct { type CheckNameAvailabilityOutput struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
NameAvailable *bool `json:"NameAvailable,omitempty"` NameAvailable *bool `json:"nameAvailable,omitempty"`
Reason *string `json:"Reason,omitempty"` Reason *string `json:"reason,omitempty"`
Message *string `json:"Message,omitempty"` Message *string `json:"message,omitempty"`
} }
// CustomDomain is cDN CustomDomain represents a mapping between a user // CustomDomain is cDN CustomDomain represents a mapping between a
// specified domain name and a CDN endpoint. This is to use custom domain // user-specified domain name and a CDN endpoint. This is to use custom
// names to represent the URLs for branding purposes. // domain names to represent the URLs for branding purposes.
type CustomDomain struct { type CustomDomain struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
ID *string `json:"id,omitempty"` ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"` Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"` Type *string `json:"type,omitempty"`
Properties *CustomDomainProperties `json:"properties,omitempty"` Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
*CustomDomainProperties `json:"properties,omitempty"`
} }
// CustomDomainListResult is // CustomDomainListResult is result of the request to list custom domains. It
// contains a list of custom domain objects and a URL link to get the next
// set of results.
type CustomDomainListResult struct { type CustomDomainListResult struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
Value *[]CustomDomain `json:"value,omitempty"` Value *[]CustomDomain `json:"value,omitempty"`
NextLink *string `json:"nextLink,omitempty"`
} }
// CustomDomainParameters is customDomain properties required for custom // CustomDomainListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client CustomDomainListResult) CustomDomainListResultPreparer() (*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)))
}
// CustomDomainParameters is the customDomain JSON object required for custom
// domain creation or update. // domain creation or update.
type CustomDomainParameters struct { type CustomDomainParameters struct {
Properties *CustomDomainPropertiesParameters `json:"properties,omitempty"` *CustomDomainPropertiesParameters `json:"properties,omitempty"`
} }
// CustomDomainProperties is // CustomDomainProperties is the JSON object that contains the properties of
// the custom domain to create.
type CustomDomainProperties struct { type CustomDomainProperties struct {
HostName *string `json:"hostName,omitempty"` HostName *string `json:"hostName,omitempty"`
ResourceState CustomDomainResourceState `json:"resourceState,omitempty"` ResourceState CustomDomainResourceState `json:"resourceState,omitempty"`
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` ValidationData *string `json:"validationData,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
} }
// CustomDomainPropertiesParameters is // CustomDomainPropertiesParameters is the JSON object that contains the
// properties of the custom domain to create.
type CustomDomainPropertiesParameters struct { type CustomDomainPropertiesParameters struct {
HostName *string `json:"hostName,omitempty"` HostName *string `json:"hostName,omitempty"`
} }
// DeepCreatedOrigin is deep created origins within a CDN endpoint. // DeepCreatedOrigin is origins to be added when creating a CDN endpoint.
type DeepCreatedOrigin struct { type DeepCreatedOrigin struct {
Name *string `json:"name,omitempty"` Name *string `json:"name,omitempty"`
Properties *DeepCreatedOriginProperties `json:"properties,omitempty"` *DeepCreatedOriginProperties `json:"properties,omitempty"`
} }
// DeepCreatedOriginProperties is properties of deep created origin on a CDN // DeepCreatedOriginProperties is properties of origins Properties of the
// endpoint. // origin created on the CDN endpoint.
type DeepCreatedOriginProperties struct { type DeepCreatedOriginProperties struct {
HostName *string `json:"hostName,omitempty"` HostName *string `json:"hostName,omitempty"`
HTTPPort *int32 `json:"httpPort,omitempty"` HTTPPort *int32 `json:"httpPort,omitempty"`
@ -222,26 +241,33 @@ type Endpoint struct {
Type *string `json:"type,omitempty"` Type *string `json:"type,omitempty"`
Location *string `json:"location,omitempty"` Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"` Tags *map[string]*string `json:"tags,omitempty"`
Properties *EndpointProperties `json:"properties,omitempty"` *EndpointProperties `json:"properties,omitempty"`
} }
// EndpointCreateParameters is endpoint properties required for new endpoint // EndpointListResult is result of the request to list endpoints. It contains
// creation. // a list of endpoint objects and a URL link to get the the next set of
type EndpointCreateParameters struct { // results.
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Properties *EndpointPropertiesCreateParameters `json:"properties,omitempty"`
}
// EndpointListResult is
type EndpointListResult struct { type EndpointListResult struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
Value *[]Endpoint `json:"value,omitempty"` Value *[]Endpoint `json:"value,omitempty"`
NextLink *string `json:"nextLink,omitempty"`
} }
// EndpointProperties is // EndpointListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client EndpointListResult) EndpointListResultPreparer() (*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)))
}
// EndpointProperties is the JSON object that contains the properties of the
// endpoint to create.
type EndpointProperties struct { type EndpointProperties struct {
HostName *string `json:"hostName,omitempty"`
OriginHostHeader *string `json:"originHostHeader,omitempty"` OriginHostHeader *string `json:"originHostHeader,omitempty"`
OriginPath *string `json:"originPath,omitempty"` OriginPath *string `json:"originPath,omitempty"`
ContentTypesToCompress *[]string `json:"contentTypesToCompress,omitempty"` ContentTypesToCompress *[]string `json:"contentTypesToCompress,omitempty"`
@ -249,24 +275,17 @@ type EndpointProperties struct {
IsHTTPAllowed *bool `json:"isHttpAllowed,omitempty"` IsHTTPAllowed *bool `json:"isHttpAllowed,omitempty"`
IsHTTPSAllowed *bool `json:"isHttpsAllowed,omitempty"` IsHTTPSAllowed *bool `json:"isHttpsAllowed,omitempty"`
QueryStringCachingBehavior QueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"` QueryStringCachingBehavior QueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"`
OptimizationType *string `json:"optimizationType,omitempty"`
GeoFilters *[]GeoFilter `json:"geoFilters,omitempty"`
HostName *string `json:"hostName,omitempty"`
Origins *[]DeepCreatedOrigin `json:"origins,omitempty"` Origins *[]DeepCreatedOrigin `json:"origins,omitempty"`
ResourceState EndpointResourceState `json:"resourceState,omitempty"` ResourceState EndpointResourceState `json:"resourceState,omitempty"`
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"`
} }
// EndpointPropertiesCreateParameters is // EndpointPropertiesUpdateParameters is result of the request to list
type EndpointPropertiesCreateParameters struct { // endpoints. It contains a list of endpoints and a URL link to get the next
OriginHostHeader *string `json:"originHostHeader,omitempty"` // set of results.
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"`
Origins *[]DeepCreatedOrigin `json:"origins,omitempty"`
}
// EndpointPropertiesUpdateParameters is
type EndpointPropertiesUpdateParameters struct { type EndpointPropertiesUpdateParameters struct {
OriginHostHeader *string `json:"originHostHeader,omitempty"` OriginHostHeader *string `json:"originHostHeader,omitempty"`
OriginPath *string `json:"originPath,omitempty"` OriginPath *string `json:"originPath,omitempty"`
@ -275,22 +294,31 @@ type EndpointPropertiesUpdateParameters struct {
IsHTTPAllowed *bool `json:"isHttpAllowed,omitempty"` IsHTTPAllowed *bool `json:"isHttpAllowed,omitempty"`
IsHTTPSAllowed *bool `json:"isHttpsAllowed,omitempty"` IsHTTPSAllowed *bool `json:"isHttpsAllowed,omitempty"`
QueryStringCachingBehavior QueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"` QueryStringCachingBehavior QueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"`
OptimizationType *string `json:"optimizationType,omitempty"`
GeoFilters *[]GeoFilter `json:"geoFilters,omitempty"`
} }
// EndpointUpdateParameters is endpoint properties required for new endpoint // EndpointUpdateParameters is endpoint properties required for new endpoint
// creation. // creation.
type EndpointUpdateParameters struct { type EndpointUpdateParameters struct {
Tags *map[string]*string `json:"tags,omitempty"` Tags *map[string]*string `json:"tags,omitempty"`
Properties *EndpointPropertiesUpdateParameters `json:"properties,omitempty"` *EndpointPropertiesUpdateParameters `json:"properties,omitempty"`
} }
// ErrorResponse is // ErrorResponse is error reponse indicates CDN service is not able to process
// the incoming request. The reason is provided in the error message.
type ErrorResponse struct { type ErrorResponse struct {
autorest.Response `json:"-"`
Code *string `json:"code,omitempty"` Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"` Message *string `json:"message,omitempty"`
} }
// GeoFilter is geo filter of a CDN endpoint.
type GeoFilter struct {
RelativePath *string `json:"relativePath,omitempty"`
Action GeoFilterActions `json:"action,omitempty"`
CountryCodes *[]string `json:"countryCodes,omitempty"`
}
// LoadParameters is parameters required for endpoint load. // LoadParameters is parameters required for endpoint load.
type LoadParameters struct { type LoadParameters struct {
ContentPaths *[]string `json:"contentPaths,omitempty"` ContentPaths *[]string `json:"contentPaths,omitempty"`
@ -302,17 +330,32 @@ type Operation struct {
Display *OperationDisplay `json:"display,omitempty"` Display *OperationDisplay `json:"display,omitempty"`
} }
// OperationDisplay is // OperationDisplay is the object that represents the operation.
type OperationDisplay struct { type OperationDisplay struct {
Provider *string `json:"provider,omitempty"` Provider *string `json:"provider,omitempty"`
Resource *string `json:"resource,omitempty"` Resource *string `json:"resource,omitempty"`
Operation *string `json:"operation,omitempty"` Operation *string `json:"operation,omitempty"`
} }
// OperationListResult is // OperationListResult is result of the request to list CDN operations. It
// contains a list of operations and a URL link to get the next set of
// results.
type OperationListResult struct { type OperationListResult struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
Value *[]Operation `json:"value,omitempty"` Value *[]Operation `json:"value,omitempty"`
NextLink *string `json:"nextLink,omitempty"`
}
// OperationListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client OperationListResult) OperationListResultPreparer() (*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)))
} }
// Origin is cDN origin is the source of the content being delivered via CDN. // Origin is cDN origin is the source of the content being delivered via CDN.
@ -324,36 +367,55 @@ type Origin struct {
ID *string `json:"id,omitempty"` ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"` Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"` Type *string `json:"type,omitempty"`
Properties *OriginProperties `json:"properties,omitempty"` Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
*OriginProperties `json:"properties,omitempty"`
} }
// OriginListResult is // OriginListResult is result of the request to list origins. It contains a
// list of origin objects and a URL link to get the next set of results.
type OriginListResult struct { type OriginListResult struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
Value *[]Origin `json:"value,omitempty"` Value *[]Origin `json:"value,omitempty"`
NextLink *string `json:"nextLink,omitempty"`
} }
// OriginParameters is origin properties needed for origin creation or update. // OriginListResultPreparer prepares a request to retrieve the next set of results. It returns
type OriginParameters struct { // nil if no more results exist.
Properties *OriginPropertiesParameters `json:"properties,omitempty"` func (client OriginListResult) OriginListResultPreparer() (*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)))
} }
// OriginProperties is // OriginProperties is the JSON object that contains the properties of the
// origin to create.
type OriginProperties struct { type OriginProperties struct {
HostName *string `json:"hostName,omitempty"` HostName *string `json:"hostName,omitempty"`
HTTPPort *int32 `json:"httpPort,omitempty"` HTTPPort *int32 `json:"httpPort,omitempty"`
HTTPSPort *int32 `json:"httpsPort,omitempty"` HTTPSPort *int32 `json:"httpsPort,omitempty"`
ResourceState OriginResourceState `json:"resourceState,omitempty"` ResourceState OriginResourceState `json:"resourceState,omitempty"`
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"`
} }
// OriginPropertiesParameters is // OriginPropertiesParameters is the JSON object that contains the properties
// of the origin to create.
type OriginPropertiesParameters struct { type OriginPropertiesParameters struct {
HostName *string `json:"hostName,omitempty"` HostName *string `json:"hostName,omitempty"`
HTTPPort *int32 `json:"httpPort,omitempty"` HTTPPort *int32 `json:"httpPort,omitempty"`
HTTPSPort *int32 `json:"httpsPort,omitempty"` HTTPSPort *int32 `json:"httpsPort,omitempty"`
} }
// OriginUpdateParameters is origin properties needed for origin creation or
// update.
type OriginUpdateParameters struct {
*OriginPropertiesParameters `json:"properties,omitempty"`
}
// Profile is cDN profile represents the top level resource and the entry // Profile is cDN profile represents the top level resource and the entry
// point into the CDN API. This allows users to set up a logical grouping of // point into the CDN API. This allows users to set up a logical grouping of
// endpoints in addition to creating shared configuration settings and // endpoints in addition to creating shared configuration settings and
@ -366,26 +428,34 @@ type Profile struct {
Location *string `json:"location,omitempty"` Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"` Tags *map[string]*string `json:"tags,omitempty"`
Sku *Sku `json:"sku,omitempty"` Sku *Sku `json:"sku,omitempty"`
Properties *ProfileProperties `json:"properties,omitempty"` *ProfileProperties `json:"properties,omitempty"`
} }
// ProfileCreateParameters is profile properties required for profile creation. // ProfileListResult is result of the request to list profiles. It contains a
type ProfileCreateParameters struct { // list of profile objects and a URL link to get the the next set of results.
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
Sku *Sku `json:"sku,omitempty"`
}
// ProfileListResult is
type ProfileListResult struct { type ProfileListResult struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
Value *[]Profile `json:"value,omitempty"` Value *[]Profile `json:"value,omitempty"`
NextLink *string `json:"nextLink,omitempty"`
} }
// ProfileProperties is // ProfileListResultPreparer prepares a request to retrieve the next set of results. It returns
// nil if no more results exist.
func (client ProfileListResult) ProfileListResultPreparer() (*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)))
}
// ProfileProperties is the JSON object that contains the properties of the
// profile to create.
type ProfileProperties struct { type ProfileProperties struct {
ResourceState ProfileResourceState `json:"resourceState,omitempty"` ResourceState ProfileResourceState `json:"resourceState,omitempty"`
ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"`
} }
// ProfileUpdateParameters is profile properties required for profile update. // ProfileUpdateParameters is profile properties required for profile update.
@ -398,11 +468,13 @@ type PurgeParameters struct {
ContentPaths *[]string `json:"contentPaths,omitempty"` ContentPaths *[]string `json:"contentPaths,omitempty"`
} }
// Resource is // Resource is the Resource definition.
type Resource struct { type Resource struct {
ID *string `json:"id,omitempty"` ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"` Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"` Type *string `json:"type,omitempty"`
Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"`
} }
// Sku is the SKU (pricing tier) of the CDN profile. // Sku is the SKU (pricing tier) of the CDN profile.
@ -416,15 +488,6 @@ type SsoURI struct {
SsoURIValue *string `json:"ssoUriValue,omitempty"` SsoURIValue *string `json:"ssoUriValue,omitempty"`
} }
// TrackedResource is aRM tracked resource
type TrackedResource struct {
ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
Type *string `json:"type,omitempty"`
Location *string `json:"location,omitempty"`
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 { type ValidateCustomDomainInput struct {
HostName *string `json:"hostName,omitempty"` HostName *string `json:"hostName,omitempty"`

View File

@ -1,111 +0,0 @@
package cdn
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
"net/http"
)
// NameAvailabilityClient is the use these APIs to manage Azure CDN resources
// through the Azure Resource Manager. You must make sure that requests made
// to these resources are secure. For more information, see
// https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.
type NameAvailabilityClient struct {
ManagementClient
}
// 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)}
}
// CheckNameAvailability sends the check name availability request.
//
// checkNameAvailabilityInput is input to check.
func (client NameAvailabilityClient) CheckNameAvailability(checkNameAvailabilityInput CheckNameAvailabilityInput) (result CheckNameAvailabilityOutput, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: checkNameAvailabilityInput,
Constraints: []validation.Constraint{{Target: "checkNameAvailabilityInput.Name", Name: validation.Null, Rule: true, Chain: nil},
{Target: "checkNameAvailabilityInput.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.NameAvailabilityClient", "CheckNameAvailability")
}
req, err := client.CheckNameAvailabilityPreparer(checkNameAvailabilityInput)
if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.NameAvailabilityClient", "CheckNameAvailability", nil, "Failure preparing request")
}
resp, err := client.CheckNameAvailabilitySender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "cdn.NameAvailabilityClient", "CheckNameAvailability", resp, "Failure sending request")
}
result, err = client.CheckNameAvailabilityResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "cdn.NameAvailabilityClient", "CheckNameAvailability", resp, "Failure responding to request")
}
return
}
// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request.
func (client NameAvailabilityClient) CheckNameAvailabilityPreparer(checkNameAvailabilityInput CheckNameAvailabilityInput) (*http.Request, error) {
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
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
// http.Response Body if it receives an error.
func (client NameAvailabilityClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always
// closes the http.Response Body.
func (client NameAvailabilityClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameAvailabilityOutput, 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,98 +0,0 @@
package cdn
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
// Changes may cause incorrect behavior and will be lost if the code is
// regenerated.
import (
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"net/http"
)
// OperationsClient is the use these APIs to manage Azure CDN resources
// through the Azure Resource Manager. You must make sure that requests made
// to these resources are secure. For more information, see
// https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.
type OperationsClient struct {
ManagementClient
}
// 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)}
}
// List sends the list request.
func (client OperationsClient) List() (result OperationListResult, err error) {
req, err := client.ListPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.OperationsClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "cdn.OperationsClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "cdn.OperationsClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client OperationsClient) ListPreparer() (*http.Request, error) {
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
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
// http.Response Body if it receives an error.
func (client OperationsClient) 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 OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, 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

@ -27,8 +27,7 @@ import (
// OriginsClient is the use these APIs to manage Azure CDN resources through // OriginsClient is the use these APIs to manage Azure CDN resources through
// the Azure Resource Manager. You must make sure that requests made to these // the Azure Resource Manager. You must make sure that requests made to these
// resources are secure. For more information, see // resources are secure.
// https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.
type OriginsClient struct { type OriginsClient struct {
ManagementClient ManagementClient
} }
@ -43,166 +42,23 @@ func NewOriginsClientWithBaseURI(baseURI string, subscriptionID string) OriginsC
return OriginsClient{NewWithBaseURI(baseURI, subscriptionID)} return OriginsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// Create sends the create request. This method may poll for completion. // Get gets an existing CDN origin within an endpoint.
// 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 // resourceGroupName is name of the Resource group within the Azure
// unique under endpoint originProperties is origin properties endpointName // subscription. profileName is name of the CDN profile which is unique
// is name of the endpoint within the CDN profile. profileName is name of the // within the resource group. endpointName is name of the endpoint under the
// CDN profile within the resource group. resourceGroupName is name of the // profile which is unique globally. originName is name of the origin which
// resource group within the Azure subscription. // is unique within the endpoint.
func (client OriginsClient) Create(originName string, originProperties OriginParameters, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) { func (client OriginsClient) Get(resourceGroupName string, profileName string, endpointName string, originName string) (result Origin, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: originProperties, {TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "originProperties.Properties", Name: validation.Null, Rule: false, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
Chain: []validation.Constraint{{Target: "originProperties.Properties.HostName", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
return result, validation.NewErrorWithValidationError(err, "cdn.OriginsClient", "Create") {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.OriginsClient", "Get")
} }
req, err := client.CreatePreparer(originName, originProperties, endpointName, profileName, resourceGroupName, cancel) req, err := client.GetPreparer(resourceGroupName, profileName, endpointName, originName)
if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "Create", nil, "Failure preparing request")
}
resp, err := client.CreateSender(req)
if err != nil {
result.Response = resp
return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "Create", resp, "Failure sending request")
}
result, err = client.CreateResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "Create", resp, "Failure responding to request")
}
return
}
// 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": 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": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}", pathParameters),
autorest.WithJSON(originProperties),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel})
}
// CreateSender sends the Create request. The method will close the
// http.Response Body if it receives an error.
func (client OriginsClient) CreateSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// CreateResponder handles the response to the Create request. The method always
// closes the http.Response Body.
func (client OriginsClient) CreateResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted),
autorest.ByClosing())
result.Response = resp
return
}
// DeleteIfExists sends the delete if exists 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. 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 {
return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "DeleteIfExists", nil, "Failure preparing request")
}
resp, err := client.DeleteIfExistsSender(req)
if err != nil {
result.Response = resp
return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "DeleteIfExists", resp, "Failure sending request")
}
result, err = client.DeleteIfExistsResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "DeleteIfExists", resp, "Failure responding to request")
}
return
}
// 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": 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": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsDelete(),
autorest.WithBaseURL(client.BaseURI),
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
// http.Response Body if it receives an error.
func (client OriginsClient) DeleteIfExistsSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client,
req,
azure.DoPollForAsynchronous(client.PollingDelay))
}
// DeleteIfExistsResponder handles the response to the DeleteIfExists request. The method always
// closes the http.Response Body.
func (client OriginsClient) DeleteIfExistsResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent),
autorest.ByClosing())
result.Response = resp
return
}
// Get sends the get request.
//
// 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.
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 { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "Get", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "Get", nil, "Failure preparing request")
} }
@ -222,7 +78,7 @@ func (client OriginsClient) Get(originName string, endpointName string, profileN
} }
// GetPreparer prepares the Get request. // GetPreparer prepares the Get request.
func (client OriginsClient) GetPreparer(originName string, endpointName string, profileName string, resourceGroupName string) (*http.Request, error) { func (client OriginsClient) GetPreparer(resourceGroupName string, profileName string, endpointName string, originName string) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"endpointName": autorest.Encode("path", endpointName), "endpointName": autorest.Encode("path", endpointName),
"originName": autorest.Encode("path", originName), "originName": autorest.Encode("path", originName),
@ -262,13 +118,22 @@ func (client OriginsClient) GetResponder(resp *http.Response) (result Origin, er
return return
} }
// ListByEndpoint sends the list by endpoint request. // ListByEndpoint lists the existing CDN origins within an endpoint.
// //
// endpointName is name of the endpoint within the CDN profile. profileName is // resourceGroupName is name of the Resource group within the Azure
// name of the CDN profile within the resource group. resourceGroupName is // subscription. profileName is name of the CDN profile which is unique
// name of the resource group within the Azure subscription. // within the resource group. endpointName is name of the endpoint under the
func (client OriginsClient) ListByEndpoint(endpointName string, profileName string, resourceGroupName string) (result OriginListResult, err error) { // profile which is unique globally.
req, err := client.ListByEndpointPreparer(endpointName, profileName, resourceGroupName) func (client OriginsClient) ListByEndpoint(resourceGroupName string, profileName string, endpointName string) (result OriginListResult, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.OriginsClient", "ListByEndpoint")
}
req, err := client.ListByEndpointPreparer(resourceGroupName, profileName, endpointName)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "ListByEndpoint", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "ListByEndpoint", nil, "Failure preparing request")
} }
@ -288,7 +153,7 @@ func (client OriginsClient) ListByEndpoint(endpointName string, profileName stri
} }
// ListByEndpointPreparer prepares the ListByEndpoint request. // ListByEndpointPreparer prepares the ListByEndpoint request.
func (client OriginsClient) ListByEndpointPreparer(endpointName string, profileName string, resourceGroupName string) (*http.Request, error) { func (client OriginsClient) ListByEndpointPreparer(resourceGroupName string, profileName string, endpointName string) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"endpointName": autorest.Encode("path", endpointName), "endpointName": autorest.Encode("path", endpointName),
"profileName": autorest.Encode("path", profileName), "profileName": autorest.Encode("path", profileName),
@ -327,17 +192,50 @@ func (client OriginsClient) ListByEndpointResponder(resp *http.Response) (result
return return
} }
// Update sends the update request. This method may poll for completion. // ListByEndpointNextResults retrieves the next set of results, if any.
// Polling can be canceled by passing the cancel channel argument. The func (client OriginsClient) ListByEndpointNextResults(lastResults OriginListResult) (result OriginListResult, err error) {
// channel will be used to cancel polling and any outstanding HTTP requests. req, err := lastResults.OriginListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "ListByEndpoint", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListByEndpointSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "ListByEndpoint", resp, "Failure sending next results request")
}
result, err = client.ListByEndpointResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "ListByEndpoint", resp, "Failure responding to next results request")
}
return
}
// Update updates an existing CDN origin within an endpoint. 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. Must be unique within endpoint. // resourceGroupName is name of the Resource group within the Azure
// originProperties is origin properties endpointName is name of the endpoint // subscription. profileName is name of the CDN profile which is unique
// within the CDN profile. profileName is name of the CDN profile within the // within the resource group. endpointName is name of the endpoint under the
// resource group. resourceGroupName is name of the resource group within the // profile which is unique globally. originName is name of the origin which
// Azure subscription. // is unique within the endpoint. originUpdateProperties is origin properties
func (client OriginsClient) Update(originName string, originProperties OriginParameters, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) { func (client OriginsClient) Update(resourceGroupName string, profileName string, endpointName string, originName string, originUpdateProperties OriginUpdateParameters, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.UpdatePreparer(originName, originProperties, endpointName, profileName, resourceGroupName, cancel) if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.OriginsClient", "Update")
}
req, err := client.UpdatePreparer(resourceGroupName, profileName, endpointName, originName, originUpdateProperties, cancel)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "Update", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "Update", nil, "Failure preparing request")
} }
@ -357,7 +255,7 @@ func (client OriginsClient) Update(originName string, originProperties OriginPar
} }
// UpdatePreparer prepares the Update request. // UpdatePreparer prepares the Update request.
func (client OriginsClient) UpdatePreparer(originName string, originProperties OriginParameters, endpointName string, profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) { func (client OriginsClient) UpdatePreparer(resourceGroupName string, profileName string, endpointName string, originName string, originUpdateProperties OriginUpdateParameters, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"endpointName": autorest.Encode("path", endpointName), "endpointName": autorest.Encode("path", endpointName),
"originName": autorest.Encode("path", originName), "originName": autorest.Encode("path", originName),
@ -375,7 +273,7 @@ func (client OriginsClient) UpdatePreparer(originName string, originProperties O
autorest.AsPatch(), autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}", pathParameters),
autorest.WithJSON(originProperties), autorest.WithJSON(originUpdateProperties),
autorest.WithQueryParameters(queryParameters)) autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel}) return preparer.Prepare(&http.Request{Cancel: cancel})
} }

View File

@ -27,8 +27,7 @@ import (
// ProfilesClient is the use these APIs to manage Azure CDN resources through // ProfilesClient is the use these APIs to manage Azure CDN resources through
// the Azure Resource Manager. You must make sure that requests made to these // the Azure Resource Manager. You must make sure that requests made to these
// resources are secure. For more information, see // resources are secure.
// https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx.
type ProfilesClient struct { type ProfilesClient struct {
ManagementClient ManagementClient
} }
@ -44,23 +43,31 @@ func NewProfilesClientWithBaseURI(baseURI string, subscriptionID string) Profile
return ProfilesClient{NewWithBaseURI(baseURI, subscriptionID)} return ProfilesClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// Create sends the create request. This method may poll for completion. // Create creates a new CDN profile with a profile name under the specified
// subscription and resource group. This method may poll for completion.
// Polling can be canceled by passing the cancel channel argument. The // Polling can be canceled by passing the cancel channel argument. The
// channel will be used to cancel polling and any outstanding HTTP requests. // channel will be used to cancel polling and any outstanding HTTP requests.
// //
// profileName is name of the CDN profile within the resource group. // resourceGroupName is name of the Resource group within the Azure
// profileProperties is profile properties needed for creation. // subscription. profileName is name of the CDN profile which is unique
// resourceGroupName is name of the resource group within the Azure // within the resource group. profile is profile properties needed to create
// subscription. // a new profile.
func (client ProfilesClient) Create(profileName string, profileProperties ProfileCreateParameters, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) { func (client ProfilesClient) Create(resourceGroupName string, profileName string, profile Profile, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: profileProperties, {TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "profileProperties.Location", Name: validation.Null, Rule: true, Chain: nil}, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "profileProperties.Sku", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}},
{TargetValue: profile,
Constraints: []validation.Constraint{{Target: "profile.Sku", Name: validation.Null, Rule: true, Chain: nil},
{Target: "profile.ProfileProperties", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "profile.ProfileProperties.ResourceState", Name: validation.ReadOnly, Rule: true, Chain: nil},
{Target: "profile.ProfileProperties.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil},
}}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.ProfilesClient", "Create") return result, validation.NewErrorWithValidationError(err, "cdn.ProfilesClient", "Create")
} }
req, err := client.CreatePreparer(profileName, profileProperties, resourceGroupName, cancel) req, err := client.CreatePreparer(resourceGroupName, profileName, profile, cancel)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Create", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Create", nil, "Failure preparing request")
} }
@ -80,7 +87,7 @@ func (client ProfilesClient) Create(profileName string, profileProperties Profil
} }
// CreatePreparer prepares the Create request. // CreatePreparer prepares the Create request.
func (client ProfilesClient) CreatePreparer(profileName string, profileProperties ProfileCreateParameters, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) { func (client ProfilesClient) CreatePreparer(resourceGroupName string, profileName string, profile Profile, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"profileName": autorest.Encode("path", profileName), "profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName), "resourceGroupName": autorest.Encode("path", resourceGroupName),
@ -96,7 +103,7 @@ func (client ProfilesClient) CreatePreparer(profileName string, profilePropertie
autorest.AsPut(), autorest.AsPut(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", pathParameters),
autorest.WithJSON(profileProperties), autorest.WithJSON(profile),
autorest.WithQueryParameters(queryParameters)) autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel}) return preparer.Prepare(&http.Request{Cancel: cancel})
} }
@ -121,36 +128,46 @@ func (client ProfilesClient) CreateResponder(resp *http.Response) (result autore
return return
} }
// DeleteIfExists sends the delete if exists request. This method may poll for // Delete deletes an existing CDN profile with the specified parameters.
// Deleting a profile will result in the deletion of all subresources
// including endpoints, origins and custom domains. This method may poll for
// completion. Polling can be canceled by passing the cancel channel // completion. Polling can be canceled by passing the cancel channel
// argument. The channel will be used to cancel polling and any outstanding // argument. The channel will be used to cancel polling and any outstanding
// HTTP requests. // HTTP requests.
// //
// profileName is name of the CDN profile within the resource group. // resourceGroupName is name of the Resource group within the Azure
// resourceGroupName is name of the resource group within the Azure // subscription. profileName is name of the CDN profile which is unique
// subscription. // within the resource group.
func (client ProfilesClient) DeleteIfExists(profileName string, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) { func (client ProfilesClient) Delete(resourceGroupName string, profileName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.DeleteIfExistsPreparer(profileName, resourceGroupName, cancel) if err := validation.Validate([]validation.Validation{
if err != nil { {TargetValue: resourceGroupName,
return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "DeleteIfExists", nil, "Failure preparing request") Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.ProfilesClient", "Delete")
} }
resp, err := client.DeleteIfExistsSender(req) req, err := client.DeletePreparer(resourceGroupName, profileName, cancel)
if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Delete", nil, "Failure preparing request")
}
resp, err := client.DeleteSender(req)
if err != nil { if err != nil {
result.Response = resp result.Response = resp
return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "DeleteIfExists", resp, "Failure sending request") return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Delete", resp, "Failure sending request")
} }
result, err = client.DeleteIfExistsResponder(resp) result, err = client.DeleteResponder(resp)
if err != nil { if err != nil {
err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "DeleteIfExists", resp, "Failure responding to request") err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Delete", resp, "Failure responding to request")
} }
return return
} }
// DeleteIfExistsPreparer prepares the DeleteIfExists request. // DeletePreparer prepares the Delete request.
func (client ProfilesClient) DeleteIfExistsPreparer(profileName string, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) { func (client ProfilesClient) DeletePreparer(resourceGroupName string, profileName string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"profileName": autorest.Encode("path", profileName), "profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName), "resourceGroupName": autorest.Encode("path", resourceGroupName),
@ -169,17 +186,17 @@ func (client ProfilesClient) DeleteIfExistsPreparer(profileName string, resource
return preparer.Prepare(&http.Request{Cancel: cancel}) return preparer.Prepare(&http.Request{Cancel: cancel})
} }
// DeleteIfExistsSender sends the DeleteIfExists request. The method will close the // DeleteSender sends the Delete request. The method will close the
// http.Response Body if it receives an error. // http.Response Body if it receives an error.
func (client ProfilesClient) DeleteIfExistsSender(req *http.Request) (*http.Response, error) { func (client ProfilesClient) DeleteSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, return autorest.SendWithSender(client,
req, req,
azure.DoPollForAsynchronous(client.PollingDelay)) azure.DoPollForAsynchronous(client.PollingDelay))
} }
// DeleteIfExistsResponder handles the response to the DeleteIfExists request. The method always // DeleteResponder handles the response to the Delete request. The method always
// closes the http.Response Body. // closes the http.Response Body.
func (client ProfilesClient) DeleteIfExistsResponder(resp *http.Response) (result autorest.Response, err error) { func (client ProfilesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) {
err = autorest.Respond( err = autorest.Respond(
resp, resp,
client.ByInspecting(), client.ByInspecting(),
@ -189,13 +206,26 @@ func (client ProfilesClient) DeleteIfExistsResponder(resp *http.Response) (resul
return return
} }
// GenerateSsoURI sends the generate sso uri request. // GenerateSsoURI generates a dynamic SSO URI used to sign in to the CDN
// supplemental portal. Supplemnetal portal is used to configure advanced
// feature capabilities that are not yet available in the Azure portal, such
// as core reports in a standard profile; rules engine, advanced HTTP
// reports, and real-time stats and alerts in a premium profile. The SSO URI
// changes approximately every 10 minutes.
// //
// profileName is name of the CDN profile within the resource group. // resourceGroupName is name of the Resource group within the Azure
// resourceGroupName is name of the resource group within the Azure // subscription. profileName is name of the CDN profile which is unique
// subscription. // within the resource group.
func (client ProfilesClient) GenerateSsoURI(profileName string, resourceGroupName string) (result SsoURI, err error) { func (client ProfilesClient) GenerateSsoURI(resourceGroupName string, profileName string) (result SsoURI, err error) {
req, err := client.GenerateSsoURIPreparer(profileName, resourceGroupName) if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.ProfilesClient", "GenerateSsoURI")
}
req, err := client.GenerateSsoURIPreparer(resourceGroupName, profileName)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "GenerateSsoURI", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "GenerateSsoURI", nil, "Failure preparing request")
} }
@ -215,7 +245,7 @@ func (client ProfilesClient) GenerateSsoURI(profileName string, resourceGroupNam
} }
// GenerateSsoURIPreparer prepares the GenerateSsoURI request. // GenerateSsoURIPreparer prepares the GenerateSsoURI request.
func (client ProfilesClient) GenerateSsoURIPreparer(profileName string, resourceGroupName string) (*http.Request, error) { func (client ProfilesClient) GenerateSsoURIPreparer(resourceGroupName string, profileName string) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"profileName": autorest.Encode("path", profileName), "profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName), "resourceGroupName": autorest.Encode("path", resourceGroupName),
@ -253,13 +283,22 @@ func (client ProfilesClient) GenerateSsoURIResponder(resp *http.Response) (resul
return return
} }
// Get sends the get request. // Get gets a CDN profile with the specified profile name under the specified
// subscription and resource group.
// //
// profileName is name of the CDN profile within the resource group. // resourceGroupName is name of the Resource group within the Azure
// resourceGroupName is name of the resource group within the Azure // subscription. profileName is name of the CDN profile which is unique
// subscription. // within the resource group.
func (client ProfilesClient) Get(profileName string, resourceGroupName string) (result Profile, err error) { func (client ProfilesClient) Get(resourceGroupName string, profileName string) (result Profile, err error) {
req, err := client.GetPreparer(profileName, resourceGroupName) if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.ProfilesClient", "Get")
}
req, err := client.GetPreparer(resourceGroupName, profileName)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Get", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Get", nil, "Failure preparing request")
} }
@ -279,7 +318,7 @@ func (client ProfilesClient) Get(profileName string, resourceGroupName string) (
} }
// GetPreparer prepares the Get request. // GetPreparer prepares the Get request.
func (client ProfilesClient) GetPreparer(profileName string, resourceGroupName string) (*http.Request, error) { func (client ProfilesClient) GetPreparer(resourceGroupName string, profileName string) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"profileName": autorest.Encode("path", profileName), "profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName), "resourceGroupName": autorest.Encode("path", resourceGroupName),
@ -317,11 +356,101 @@ func (client ProfilesClient) GetResponder(resp *http.Response) (result Profile,
return return
} }
// ListByResourceGroup sends the list by resource group request. // List lists all the CDN profiles within an Azure subscription.
func (client ProfilesClient) List() (result ProfileListResult, err error) {
req, err := client.ListPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "List", nil, "Failure preparing request")
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "List", resp, "Failure sending request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "List", resp, "Failure responding to request")
}
return
}
// ListPreparer prepares the List request.
func (client ProfilesClient) ListPreparer() (*http.Request, error) {
pathParameters := map[string]interface{}{
"subscriptionId": autorest.Encode("path", client.SubscriptionID),
}
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/profiles", pathParameters),
autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{})
}
// ListSender sends the List request. The method will close the
// http.Response Body if it receives an error.
func (client ProfilesClient) 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 ProfilesClient) ListResponder(resp *http.Response) (result ProfileListResult, 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 ProfilesClient) ListNextResults(lastResults ProfileListResult) (result ProfileListResult, err error) {
req, err := lastResults.ProfileListResultPreparer()
if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "List", nil, "Failure preparing next results request")
}
if req == nil {
return
}
resp, err := client.ListSender(req)
if err != nil {
result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "List", resp, "Failure sending next results request")
}
result, err = client.ListResponder(resp)
if err != nil {
err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "List", resp, "Failure responding to next results request")
}
return
}
// ListByResourceGroup lists all the CDN profiles within a resource group.
// //
// resourceGroupName is name of the resource group within the Azure // resourceGroupName is name of the Resource group within the Azure
// subscription. // subscription.
func (client ProfilesClient) ListByResourceGroup(resourceGroupName string) (result ProfileListResult, err error) { func (client ProfilesClient) ListByResourceGroup(resourceGroupName string) (result ProfileListResult, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.ProfilesClient", "ListByResourceGroup")
}
req, err := client.ListByResourceGroupPreparer(resourceGroupName) req, err := client.ListByResourceGroupPreparer(resourceGroupName)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListByResourceGroup", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListByResourceGroup", nil, "Failure preparing request")
@ -379,74 +508,50 @@ func (client ProfilesClient) ListByResourceGroupResponder(resp *http.Response) (
return return
} }
// ListBySubscriptionID sends the list by subscription id request. // ListByResourceGroupNextResults retrieves the next set of results, if any.
func (client ProfilesClient) ListBySubscriptionID() (result ProfileListResult, err error) { func (client ProfilesClient) ListByResourceGroupNextResults(lastResults ProfileListResult) (result ProfileListResult, err error) {
req, err := client.ListBySubscriptionIDPreparer() req, err := lastResults.ProfileListResultPreparer()
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListBySubscriptionID", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListByResourceGroup", nil, "Failure preparing next results request")
}
if req == nil {
return
} }
resp, err := client.ListBySubscriptionIDSender(req) resp, err := client.ListByResourceGroupSender(req)
if err != nil { if err != nil {
result.Response = autorest.Response{Response: resp} result.Response = autorest.Response{Response: resp}
return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListBySubscriptionID", resp, "Failure sending request") return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListByResourceGroup", resp, "Failure sending next results request")
} }
result, err = client.ListBySubscriptionIDResponder(resp) result, err = client.ListByResourceGroupResponder(resp)
if err != nil { if err != nil {
err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListBySubscriptionID", resp, "Failure responding to request") err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListByResourceGroup", resp, "Failure responding to next results request")
} }
return return
} }
// ListBySubscriptionIDPreparer prepares the ListBySubscriptionID request. // Update updates an existing CDN profile with the specified profile name
func (client ProfilesClient) ListBySubscriptionIDPreparer() (*http.Request, error) { // under the specified subscription and resource group. This method may poll
pathParameters := map[string]interface{}{ // for completion. Polling can be canceled by passing the cancel channel
"subscriptionId": autorest.Encode("path", client.SubscriptionID), // argument. The channel will be used to cancel polling and any outstanding
} // HTTP requests.
queryParameters := map[string]interface{}{
"api-version": client.APIVersion,
}
preparer := autorest.CreatePreparer(
autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI),
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
// http.Response Body if it receives an error.
func (client ProfilesClient) ListBySubscriptionIDSender(req *http.Request) (*http.Response, error) {
return autorest.SendWithSender(client, req)
}
// ListBySubscriptionIDResponder handles the response to the ListBySubscriptionID request. The method always
// closes the http.Response Body.
func (client ProfilesClient) ListBySubscriptionIDResponder(resp *http.Response) (result ProfileListResult, err error) {
err = autorest.Respond(
resp,
client.ByInspecting(),
azure.WithErrorUnlessStatusCode(http.StatusOK),
autorest.ByUnmarshallingJSON(&result),
autorest.ByClosing())
result.Response = autorest.Response{Response: resp}
return
}
// 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. // resourceGroupName is name of the Resource group within the Azure
// profileProperties is profile properties needed for update. // subscription. profileName is name of the CDN profile which is unique
// resourceGroupName is name of the resource group within the Azure // within the resource group. profileUpdateParameters is profile properties
// subscription. // needed to update an existing profile.
func (client ProfilesClient) Update(profileName string, profileProperties ProfileUpdateParameters, resourceGroupName string, cancel <-chan struct{}) (result autorest.Response, err error) { func (client ProfilesClient) Update(resourceGroupName string, profileName string, profileUpdateParameters ProfileUpdateParameters, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.UpdatePreparer(profileName, profileProperties, resourceGroupName, cancel) if err := validation.Validate([]validation.Validation{
{TargetValue: resourceGroupName,
Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil},
{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil},
{Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "cdn.ProfilesClient", "Update")
}
req, err := client.UpdatePreparer(resourceGroupName, profileName, profileUpdateParameters, cancel)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Update", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Update", nil, "Failure preparing request")
} }
@ -466,7 +571,7 @@ func (client ProfilesClient) Update(profileName string, profileProperties Profil
} }
// UpdatePreparer prepares the Update request. // UpdatePreparer prepares the Update request.
func (client ProfilesClient) UpdatePreparer(profileName string, profileProperties ProfileUpdateParameters, resourceGroupName string, cancel <-chan struct{}) (*http.Request, error) { func (client ProfilesClient) UpdatePreparer(resourceGroupName string, profileName string, profileUpdateParameters ProfileUpdateParameters, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"profileName": autorest.Encode("path", profileName), "profileName": autorest.Encode("path", profileName),
"resourceGroupName": autorest.Encode("path", resourceGroupName), "resourceGroupName": autorest.Encode("path", resourceGroupName),
@ -482,7 +587,7 @@ func (client ProfilesClient) UpdatePreparer(profileName string, profilePropertie
autorest.AsPatch(), autorest.AsPatch(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", pathParameters),
autorest.WithJSON(profileProperties), autorest.WithJSON(profileUpdateParameters),
autorest.WithQueryParameters(queryParameters)) autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel}) return preparer.Prepare(&http.Request{Cancel: cancel})
} }

View File

@ -23,9 +23,9 @@ import (
) )
const ( const (
major = "6" major = "7"
minor = "0" minor = "0"
patch = "0" patch = "1"
// Always begin a "tag" with a dash (as per http://semver.org) // Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta" tag = "-beta"
semVerFormat = "%s.%s.%s%s" semVerFormat = "%s.%s.%s%s"
@ -34,7 +34,7 @@ const (
// UserAgent returns the UserAgent string to use when sending http.Requests. // UserAgent returns the UserAgent string to use when sending http.Requests.
func UserAgent() string { func UserAgent() string {
return fmt.Sprintf(userAgentFormat, Version(), "cdn", "2016-04-02") return fmt.Sprintf(userAgentFormat, Version(), "cdn", "2016-10-02")
} }
// Version returns the semantic version (see http://semver.org) of the client. // Version returns the semantic version (see http://semver.org) of the client.

View File

@ -42,16 +42,16 @@ func NewAvailabilitySetsClientWithBaseURI(baseURI string, subscriptionID string)
return AvailabilitySetsClient{NewWithBaseURI(baseURI, subscriptionID)} return AvailabilitySetsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate the operation to create or update the availability set. // CreateOrUpdate create or update an availability set.
// //
// resourceGroupName is the name of the resource group. name is parameters // resourceGroupName is the name of the resource group. name is the name of
// supplied to the Create Availability Set operation. parameters is // the availability set. parameters is parameters supplied to the Create
// parameters supplied to the Create Availability Set operation. // Availability Set operation.
func (client AvailabilitySetsClient) CreateOrUpdate(resourceGroupName string, name string, parameters AvailabilitySet) (result AvailabilitySet, err error) { func (client AvailabilitySetsClient) CreateOrUpdate(resourceGroupName string, name string, parameters AvailabilitySet) (result AvailabilitySet, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: parameters, {TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, Constraints: []validation.Constraint{{Target: "parameters.AvailabilitySetProperties", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.Statuses", Name: validation.ReadOnly, Rule: true, Chain: nil}}}}}}); err != nil { Chain: []validation.Constraint{{Target: "parameters.AvailabilitySetProperties.Statuses", Name: validation.ReadOnly, Rule: true, Chain: nil}}}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate") return result, validation.NewErrorWithValidationError(err, "compute.AvailabilitySetsClient", "CreateOrUpdate")
} }
@ -115,7 +115,7 @@ func (client AvailabilitySetsClient) CreateOrUpdateResponder(resp *http.Response
return return
} }
// Delete the operation to delete the availability set. // Delete delete an availability set.
// //
// resourceGroupName is the name of the resource group. availabilitySetName is // resourceGroupName is the name of the resource group. availabilitySetName is
// the name of the availability set. // the name of the availability set.
@ -177,7 +177,7 @@ func (client AvailabilitySetsClient) DeleteResponder(resp *http.Response) (resul
return return
} }
// Get the operation to get the availability set. // Get retrieves information about an availability set.
// //
// resourceGroupName is the name of the resource group. availabilitySetName is // resourceGroupName is the name of the resource group. availabilitySetName is
// the name of the availability set. // the name of the availability set.
@ -240,7 +240,7 @@ func (client AvailabilitySetsClient) GetResponder(resp *http.Response) (result A
return return
} }
// List the operation to list the availability sets. // List lists all availability sets in a resource group.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
func (client AvailabilitySetsClient) List(resourceGroupName string) (result AvailabilitySetListResult, err error) { func (client AvailabilitySetsClient) List(resourceGroupName string) (result AvailabilitySetListResult, err error) {

View File

@ -365,7 +365,7 @@ type APIErrorBase struct {
Message *string `json:"message,omitempty"` Message *string `json:"message,omitempty"`
} }
// AvailabilitySet is create or update Availability Set parameters. // AvailabilitySet is create or update availability set parameters.
type AvailabilitySet struct { type AvailabilitySet struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
ID *string `json:"id,omitempty"` ID *string `json:"id,omitempty"`
@ -373,7 +373,7 @@ type AvailabilitySet struct {
Type *string `json:"type,omitempty"` Type *string `json:"type,omitempty"`
Location *string `json:"location,omitempty"` Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"` Tags *map[string]*string `json:"tags,omitempty"`
Properties *AvailabilitySetProperties `json:"properties,omitempty"` *AvailabilitySetProperties `json:"properties,omitempty"`
} }
// AvailabilitySetListResult is the List Availability Set operation response. // AvailabilitySetListResult is the List Availability Set operation response.
@ -477,7 +477,7 @@ type KeyVaultSecretReference struct {
SourceVault *SubResource `json:"sourceVault,omitempty"` SourceVault *SubResource `json:"sourceVault,omitempty"`
} }
// LinuxConfiguration is describes Windows Configuration of the OS Profile. // LinuxConfiguration is describes Windows configuration of the OS Profile.
type LinuxConfiguration struct { type LinuxConfiguration struct {
DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"`
SSH *SSHConfiguration `json:"ssh,omitempty"` SSH *SSHConfiguration `json:"ssh,omitempty"`
@ -523,7 +523,7 @@ type LongRunningOperationProperties struct {
// NetworkInterfaceReference is describes a network interface reference. // NetworkInterfaceReference is describes a network interface reference.
type NetworkInterfaceReference struct { type NetworkInterfaceReference struct {
ID *string `json:"id,omitempty"` ID *string `json:"id,omitempty"`
Properties *NetworkInterfaceReferenceProperties `json:"properties,omitempty"` *NetworkInterfaceReferenceProperties `json:"properties,omitempty"`
} }
// NetworkInterfaceReferenceProperties is describes a network interface // NetworkInterfaceReferenceProperties is describes a network interface
@ -581,7 +581,7 @@ type PurchasePlan struct {
Product *string `json:"product,omitempty"` Product *string `json:"product,omitempty"`
} }
// Resource is the Resource model definition. // Resource is the resource model definition.
type Resource struct { type Resource struct {
ID *string `json:"id,omitempty"` ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"` Name *string `json:"name,omitempty"`
@ -668,7 +668,7 @@ type VirtualMachine struct {
Location *string `json:"location,omitempty"` Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"` Tags *map[string]*string `json:"tags,omitempty"`
Plan *Plan `json:"plan,omitempty"` Plan *Plan `json:"plan,omitempty"`
Properties *VirtualMachineProperties `json:"properties,omitempty"` *VirtualMachineProperties `json:"properties,omitempty"`
Resources *[]VirtualMachineExtension `json:"resources,omitempty"` Resources *[]VirtualMachineExtension `json:"resources,omitempty"`
} }
@ -691,7 +691,7 @@ type VirtualMachineCaptureParameters struct {
type VirtualMachineCaptureResult struct { type VirtualMachineCaptureResult struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
ID *string `json:"id,omitempty"` ID *string `json:"id,omitempty"`
Properties *VirtualMachineCaptureResultProperties `json:"properties,omitempty"` *VirtualMachineCaptureResultProperties `json:"properties,omitempty"`
} }
// VirtualMachineCaptureResultProperties is compute-specific operation // VirtualMachineCaptureResultProperties is compute-specific operation
@ -708,7 +708,7 @@ type VirtualMachineExtension struct {
Type *string `json:"type,omitempty"` Type *string `json:"type,omitempty"`
Location *string `json:"location,omitempty"` Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"` Tags *map[string]*string `json:"tags,omitempty"`
Properties *VirtualMachineExtensionProperties `json:"properties,omitempty"` *VirtualMachineExtensionProperties `json:"properties,omitempty"`
} }
// VirtualMachineExtensionHandlerInstanceView is the instance view of a // VirtualMachineExtensionHandlerInstanceView is the instance view of a
@ -727,7 +727,7 @@ type VirtualMachineExtensionImage struct {
Type *string `json:"type,omitempty"` Type *string `json:"type,omitempty"`
Location *string `json:"location,omitempty"` Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"` Tags *map[string]*string `json:"tags,omitempty"`
Properties *VirtualMachineExtensionImageProperties `json:"properties,omitempty"` *VirtualMachineExtensionImageProperties `json:"properties,omitempty"`
} }
// VirtualMachineExtensionImageProperties is describes the properties of a // VirtualMachineExtensionImageProperties is describes the properties of a
@ -771,7 +771,7 @@ type VirtualMachineImage struct {
Name *string `json:"name,omitempty"` Name *string `json:"name,omitempty"`
Location *string `json:"location,omitempty"` Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"` Tags *map[string]*string `json:"tags,omitempty"`
Properties *VirtualMachineImageProperties `json:"properties,omitempty"` *VirtualMachineImageProperties `json:"properties,omitempty"`
} }
// VirtualMachineImageProperties is describes the properties of a Virtual // VirtualMachineImageProperties is describes the properties of a Virtual
@ -844,7 +844,7 @@ type VirtualMachineScaleSet struct {
Location *string `json:"location,omitempty"` Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"` Tags *map[string]*string `json:"tags,omitempty"`
Sku *Sku `json:"sku,omitempty"` Sku *Sku `json:"sku,omitempty"`
Properties *VirtualMachineScaleSetProperties `json:"properties,omitempty"` *VirtualMachineScaleSetProperties `json:"properties,omitempty"`
} }
// VirtualMachineScaleSetExtension is describes a Virtual Machine Scale Set // VirtualMachineScaleSetExtension is describes a Virtual Machine Scale Set
@ -852,7 +852,7 @@ type VirtualMachineScaleSet struct {
type VirtualMachineScaleSetExtension struct { type VirtualMachineScaleSetExtension struct {
ID *string `json:"id,omitempty"` ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"` Name *string `json:"name,omitempty"`
Properties *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"` *VirtualMachineScaleSetExtensionProperties `json:"properties,omitempty"`
} }
// VirtualMachineScaleSetExtensionProfile is describes a virtual machine scale // VirtualMachineScaleSetExtensionProfile is describes a virtual machine scale
@ -893,7 +893,7 @@ type VirtualMachineScaleSetInstanceViewStatusesSummary struct {
type VirtualMachineScaleSetIPConfiguration struct { type VirtualMachineScaleSetIPConfiguration struct {
ID *string `json:"id,omitempty"` ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"` Name *string `json:"name,omitempty"`
Properties *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"` *VirtualMachineScaleSetIPConfigurationProperties `json:"properties,omitempty"`
} }
// VirtualMachineScaleSetIPConfigurationProperties is describes a virtual // VirtualMachineScaleSetIPConfigurationProperties is describes a virtual
@ -970,7 +970,7 @@ func (client VirtualMachineScaleSetListWithLinkResult) VirtualMachineScaleSetLis
type VirtualMachineScaleSetNetworkConfiguration struct { type VirtualMachineScaleSetNetworkConfiguration struct {
ID *string `json:"id,omitempty"` ID *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"` Name *string `json:"name,omitempty"`
Properties *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"` *VirtualMachineScaleSetNetworkConfigurationProperties `json:"properties,omitempty"`
} }
// VirtualMachineScaleSetNetworkConfigurationProperties is describes a virtual // VirtualMachineScaleSetNetworkConfigurationProperties is describes a virtual
@ -1052,7 +1052,7 @@ type VirtualMachineScaleSetVM struct {
Tags *map[string]*string `json:"tags,omitempty"` Tags *map[string]*string `json:"tags,omitempty"`
InstanceID *string `json:"instanceId,omitempty"` InstanceID *string `json:"instanceId,omitempty"`
Sku *Sku `json:"sku,omitempty"` Sku *Sku `json:"sku,omitempty"`
Properties *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"` *VirtualMachineScaleSetVMProperties `json:"properties,omitempty"`
Plan *Plan `json:"plan,omitempty"` Plan *Plan `json:"plan,omitempty"`
Resources *[]VirtualMachineExtension `json:"resources,omitempty"` Resources *[]VirtualMachineExtension `json:"resources,omitempty"`
} }
@ -1064,14 +1064,14 @@ type VirtualMachineScaleSetVMExtensionsSummary struct {
StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"` StatusesSummary *[]VirtualMachineStatusCodeCount `json:"statusesSummary,omitempty"`
} }
// VirtualMachineScaleSetVMInstanceIDs is specifies the list of virtual // VirtualMachineScaleSetVMInstanceIDs is specifies a list of virtual machine
// machine scale set instance IDs. // instance IDs from the VM scale set.
type VirtualMachineScaleSetVMInstanceIDs struct { type VirtualMachineScaleSetVMInstanceIDs struct {
InstanceIds *[]string `json:"instanceIds,omitempty"` InstanceIds *[]string `json:"instanceIds,omitempty"`
} }
// VirtualMachineScaleSetVMInstanceRequiredIDs is specifies the list of // VirtualMachineScaleSetVMInstanceRequiredIDs is specifies a list of virtual
// virtual machine scale set instance IDs. // machine instance IDs from the VM scale set.
type VirtualMachineScaleSetVMInstanceRequiredIDs struct { type VirtualMachineScaleSetVMInstanceRequiredIDs struct {
InstanceIds *[]string `json:"instanceIds,omitempty"` InstanceIds *[]string `json:"instanceIds,omitempty"`
} }

View File

@ -42,9 +42,11 @@ func NewUsageOperationsClientWithBaseURI(baseURI string, subscriptionID string)
return UsageOperationsClient{NewWithBaseURI(baseURI, subscriptionID)} return UsageOperationsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// List lists compute usages for a subscription. // List gets, for the specified location, the current compute resource usage
// information as well as the limits for compute resources under the
// subscription.
// //
// location is the location upon which resource usage is queried. // location is the location for which resource usage is queried.
func (client UsageOperationsClient) List(location string) (result ListUsagesResult, err error) { func (client UsageOperationsClient) List(location string) (result ListUsagesResult, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: location, {TargetValue: location,

View File

@ -23,9 +23,9 @@ import (
) )
const ( const (
major = "6" major = "7"
minor = "0" minor = "0"
patch = "0" patch = "1"
// Always begin a "tag" with a dash (as per http://semver.org) // Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta" tag = "-beta"
semVerFormat = "%s.%s.%s%s" semVerFormat = "%s.%s.%s%s"

View File

@ -55,8 +55,8 @@ func NewVirtualMachineExtensionsClientWithBaseURI(baseURI string, subscriptionID
func (client VirtualMachineExtensionsClient) CreateOrUpdate(resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualMachineExtensionsClient) CreateOrUpdate(resourceGroupName string, vmName string, vmExtensionName string, extensionParameters VirtualMachineExtension, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: extensionParameters, {TargetValue: extensionParameters,
Constraints: []validation.Constraint{{Target: "extensionParameters.Properties", Name: validation.Null, Rule: false, Constraints: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "extensionParameters.Properties.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil}}}}}}); err != nil { Chain: []validation.Constraint{{Target: "extensionParameters.VirtualMachineExtensionProperties.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil}}}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate") return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachineExtensionsClient", "CreateOrUpdate")
} }

View File

@ -43,6 +43,9 @@ func NewVirtualMachineImagesClientWithBaseURI(baseURI string, subscriptionID str
// Get gets a virtual machine image. // Get gets a virtual machine image.
// //
// location is the name of a supported Azure region. publisherName is a valid
// image publisher. offer is a valid image publisher offer. skus is a valid
// image SKU. version is a valid image SKU version.
func (client VirtualMachineImagesClient) Get(location string, publisherName string, offer string, skus string, version string) (result VirtualMachineImage, err error) { func (client VirtualMachineImagesClient) Get(location string, publisherName string, offer string, skus string, version string) (result VirtualMachineImage, err error) {
req, err := client.GetPreparer(location, publisherName, offer, skus, version) req, err := client.GetPreparer(location, publisherName, offer, skus, version)
if err != nil { if err != nil {
@ -105,9 +108,12 @@ func (client VirtualMachineImagesClient) GetResponder(resp *http.Response) (resu
return return
} }
// List gets a list of virtual machine images. // List gets a list of all virtual machine image versions for the specified
// location, publisher, offer, and SKU.
// //
// filter is the filter to apply on the operation. // location is the name of a supported Azure region. publisherName is a valid
// image publisher. offer is a valid image publisher offer. skus is a valid
// image SKU. filter is the filter to apply on the operation.
func (client VirtualMachineImagesClient) List(location string, publisherName string, offer string, skus string, filter string, top *int32, orderby string) (result ListVirtualMachineImageResource, err error) { func (client VirtualMachineImagesClient) List(location string, publisherName string, offer string, skus string, filter string, top *int32, orderby string) (result ListVirtualMachineImageResource, err error) {
req, err := client.ListPreparer(location, publisherName, offer, skus, filter, top, orderby) req, err := client.ListPreparer(location, publisherName, offer, skus, filter, top, orderby)
if err != nil { if err != nil {
@ -178,8 +184,11 @@ func (client VirtualMachineImagesClient) ListResponder(resp *http.Response) (res
return return
} }
// ListOffers gets a list of virtual machine image offers. // ListOffers gets a list of virtual machine image offers for the specified
// location and publisher.
// //
// location is the name of a supported Azure region. publisherName is a valid
// image publisher.
func (client VirtualMachineImagesClient) ListOffers(location string, publisherName string) (result ListVirtualMachineImageResource, err error) { func (client VirtualMachineImagesClient) ListOffers(location string, publisherName string) (result ListVirtualMachineImageResource, err error) {
req, err := client.ListOffersPreparer(location, publisherName) req, err := client.ListOffersPreparer(location, publisherName)
if err != nil { if err != nil {
@ -239,8 +248,10 @@ func (client VirtualMachineImagesClient) ListOffersResponder(resp *http.Response
return return
} }
// ListPublishers gets a list of virtual machine image publishers. // ListPublishers gets a list of virtual machine image publishers for the
// specified Azure location.
// //
// location is the name of a supported Azure region.
func (client VirtualMachineImagesClient) ListPublishers(location string) (result ListVirtualMachineImageResource, err error) { func (client VirtualMachineImagesClient) ListPublishers(location string) (result ListVirtualMachineImageResource, err error) {
req, err := client.ListPublishersPreparer(location) req, err := client.ListPublishersPreparer(location)
if err != nil { if err != nil {
@ -299,8 +310,11 @@ func (client VirtualMachineImagesClient) ListPublishersResponder(resp *http.Resp
return return
} }
// ListSkus gets a list of virtual machine image skus. // ListSkus gets a list of virtual machine image SKUs for the specified
// location, publisher, and offer.
// //
// location is the name of a supported Azure region. publisherName is a valid
// image publisher. offer is a valid image publisher offer.
func (client VirtualMachineImagesClient) ListSkus(location string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) { func (client VirtualMachineImagesClient) ListSkus(location string, publisherName string, offer string) (result ListVirtualMachineImageResource, err error) {
req, err := client.ListSkusPreparer(location, publisherName, offer) req, err := client.ListSkusPreparer(location, publisherName, offer)
if err != nil { if err != nil {

View File

@ -132,26 +132,26 @@ func (client VirtualMachinesClient) CaptureResponder(resp *http.Response) (resul
func (client VirtualMachinesClient) CreateOrUpdate(resourceGroupName string, vmName string, parameters VirtualMachine, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualMachinesClient) CreateOrUpdate(resourceGroupName string, vmName string, parameters VirtualMachine, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: parameters, {TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineProperties", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.StorageProfile", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.StorageProfile.OsDisk", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.StorageProfile.OsDisk.EncryptionSettings", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil}, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SecretURL", Name: validation.Null, Rule: true, Chain: nil},
{Target: "parameters.Properties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.DiskEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
}}, }},
{Target: "parameters.Properties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false, {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil}, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.KeyURL", Name: validation.Null, Rule: true, Chain: nil},
{Target: "parameters.Properties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.EncryptionSettings.KeyEncryptionKey.SourceVault", Name: validation.Null, Rule: true, Chain: nil},
}}, }},
}}, }},
{Target: "parameters.Properties.StorageProfile.OsDisk.Name", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.Name", Name: validation.Null, Rule: true, Chain: nil},
{Target: "parameters.Properties.StorageProfile.OsDisk.Vhd", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.VirtualMachineProperties.StorageProfile.OsDisk.Vhd", Name: validation.Null, Rule: true, Chain: nil},
}}, }},
}}, }},
{Target: "parameters.Properties.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil}, {Target: "parameters.VirtualMachineProperties.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil},
{Target: "parameters.Properties.InstanceView", Name: validation.ReadOnly, Rule: true, Chain: nil}, {Target: "parameters.VirtualMachineProperties.InstanceView", Name: validation.ReadOnly, Rule: true, Chain: nil},
{Target: "parameters.Properties.VMID", Name: validation.ReadOnly, Rule: true, Chain: nil}, {Target: "parameters.VirtualMachineProperties.VMID", Name: validation.ReadOnly, Rule: true, Chain: nil},
}}, }},
{Target: "parameters.Resources", Name: validation.ReadOnly, Rule: true, Chain: nil}}}}); err != nil { {Target: "parameters.Resources", Name: validation.ReadOnly, Rule: true, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachinesClient", "CreateOrUpdate") return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachinesClient", "CreateOrUpdate")
@ -218,9 +218,9 @@ func (client VirtualMachinesClient) CreateOrUpdateResponder(resp *http.Response)
return return
} }
// Deallocate shuts down the Virtual Machine and releases the compute // Deallocate shuts down the virtual machine and releases the compute
// resources. You are not billed for the compute resources that this Virtual // resources. You are not billed for the compute resources that this virtual
// Machine uses. This method may poll for completion. Polling can be canceled // 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 // by passing the cancel channel argument. The channel will be used to cancel
// polling and any outstanding HTTP requests. // polling and any outstanding HTTP requests.
// //
@ -353,7 +353,7 @@ func (client VirtualMachinesClient) DeleteResponder(resp *http.Response) (result
return return
} }
// Generalize sets the state of the VM as Generalized. // Generalize sets the state of the virtual machine to generalized.
// //
// resourceGroupName is the name of the resource group. vmName is the name of // resourceGroupName is the name of the resource group. vmName is the name of
// the virtual machine. // the virtual machine.
@ -415,7 +415,8 @@ func (client VirtualMachinesClient) GeneralizeResponder(resp *http.Response) (re
return return
} }
// Get the operation to get a virtual machine. // Get retrieves information about the model view or the instance view of a
// virtual machine.
// //
// resourceGroupName is the name of the resource group. vmName is the name of // 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 // the virtual machine. expand is the expand expression to apply on the
@ -482,7 +483,9 @@ func (client VirtualMachinesClient) GetResponder(resp *http.Response) (result Vi
return return
} }
// List the operation to list virtual machines under a resource group. // List lists all of the virtual machines in the specified resource group. Use
// the nextLink property in the response to get the next page of virtual
// machines.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
func (client VirtualMachinesClient) List(resourceGroupName string) (result VirtualMachineListResult, err error) { func (client VirtualMachinesClient) List(resourceGroupName string) (result VirtualMachineListResult, err error) {
@ -567,9 +570,9 @@ func (client VirtualMachinesClient) ListNextResults(lastResults VirtualMachineLi
return return
} }
// ListAll gets the list of Virtual Machines in the subscription. Use nextLink // ListAll lists all of the virtual machines in the specified subscription.
// property in the response to get the next page of Virtual Machines. Do this // Use the nextLink property in the response to get the next page of virtual
// till nextLink is not null to fetch all the Virtual Machines. // machines.
func (client VirtualMachinesClient) ListAll() (result VirtualMachineListResult, err error) { func (client VirtualMachinesClient) ListAll() (result VirtualMachineListResult, err error) {
req, err := client.ListAllPreparer() req, err := client.ListAllPreparer()
if err != nil { if err != nil {
@ -651,8 +654,8 @@ func (client VirtualMachinesClient) ListAllNextResults(lastResults VirtualMachin
return return
} }
// ListAvailableSizes lists all available virtual machine sizes it can be // ListAvailableSizes lists all available virtual machine sizes to which the
// resized to for a virtual machine. // specified virtual machine can be resized.
// //
// resourceGroupName is the name of the resource group. vmName is the name of // resourceGroupName is the name of the resource group. vmName is the name of
// the virtual machine. // the virtual machine.
@ -715,10 +718,12 @@ func (client VirtualMachinesClient) ListAvailableSizesResponder(resp *http.Respo
return return
} }
// PowerOff the operation to power off (stop) a virtual machine. This method // PowerOff the operation to power off (stop) a virtual machine. The virtual
// may poll for completion. Polling can be canceled by passing the cancel // machine can be restarted with the same provisioned resources. You are
// channel argument. The channel will be used to cancel polling and any // still charged for this virtual machine. This method may poll for
// outstanding HTTP requests. // 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 // resourceGroupName is the name of the resource group. vmName is the name of
// the virtual machine. // the virtual machine.

View File

@ -42,26 +42,24 @@ func NewVirtualMachineScaleSetsClientWithBaseURI(baseURI string, subscriptionID
return VirtualMachineScaleSetsClient{NewWithBaseURI(baseURI, subscriptionID)} return VirtualMachineScaleSetsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate allows you to create or update a virtual machine scale set // CreateOrUpdate create or update a VM scale set. This method may poll for
// by providing parameters or a path to pre-configured parameter file. This // completion. Polling can be canceled by passing the cancel channel
// method may poll for completion. Polling can be canceled by passing the // argument. The channel will be used to cancel polling and any outstanding
// cancel channel argument. The channel will be used to cancel polling and // HTTP requests.
// any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. name is parameters // resourceGroupName is the name of the resource group. name is the name of
// supplied to the Create Virtual Machine Scale Set operation. parameters is // the VM scale set to create or update. parameters is the scale set object.
// parameters supplied to the Create Virtual Machine Scale Set operation.
func (client VirtualMachineScaleSetsClient) CreateOrUpdate(resourceGroupName string, name string, parameters VirtualMachineScaleSet, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualMachineScaleSetsClient) CreateOrUpdate(resourceGroupName string, name string, parameters VirtualMachineScaleSet, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: parameters, {TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, Constraints: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.VirtualMachineProfile", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.VirtualMachineProfile", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.VirtualMachineProfile.StorageProfile", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.VirtualMachineProfile.StorageProfile", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.VirtualMachineProfile.StorageProfile.OsDisk", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.VirtualMachineProfile.StorageProfile.OsDisk", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.VirtualMachineProfile.StorageProfile.OsDisk.Name", Name: validation.Null, Rule: true, Chain: nil}}}, Chain: []validation.Constraint{{Target: "parameters.VirtualMachineScaleSetProperties.VirtualMachineProfile.StorageProfile.OsDisk.Name", Name: validation.Null, Rule: true, Chain: nil}}},
}}, }},
}}, }},
{Target: "parameters.Properties.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil}, {Target: "parameters.VirtualMachineScaleSetProperties.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil},
}}}}}); err != nil { }}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate") return result, validation.NewErrorWithValidationError(err, "compute.VirtualMachineScaleSetsClient", "CreateOrUpdate")
} }
@ -127,16 +125,16 @@ func (client VirtualMachineScaleSetsClient) CreateOrUpdateResponder(resp *http.R
return return
} }
// Deallocate allows you to deallocate virtual machines in a virtual machine // Deallocate deallocates specific virtual machines in a VM scale set. Shuts
// scale set. Shuts down the virtual machines and releases the compute // down the virtual machines and releases the compute resources. You are not
// resources. You are not billed for the compute resources that this virtual // billed for the compute resources that this virtual machine scale set
// machine scale set uses. This method may poll for completion. Polling can // deallocates. This method may poll for completion. Polling can be canceled
// be canceled by passing the cancel channel argument. The channel will be // by passing the cancel channel argument. The channel will be used to cancel
// used to cancel polling and any outstanding HTTP requests. // polling and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. vmScaleSetName is the // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. vmInstanceIDs is the list of // name of the VM scale set. vmInstanceIDs is a list of virtual machine
// virtual machine scale set instance IDs. // instance IDs from the VM scale set.
func (client VirtualMachineScaleSetsClient) Deallocate(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualMachineScaleSetsClient) Deallocate(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.DeallocatePreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel) req, err := client.DeallocatePreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel)
if err != nil { if err != nil {
@ -202,13 +200,12 @@ func (client VirtualMachineScaleSetsClient) DeallocateResponder(resp *http.Respo
return return
} }
// Delete allows you to delete a virtual machine scale set. This method may // Delete deletes a VM scale set. This method may poll for completion. Polling
// poll for completion. Polling can be canceled by passing the cancel channel // can be canceled by passing the cancel channel argument. The channel will
// argument. The channel will be used to cancel polling and any outstanding // be used to cancel polling and any outstanding HTTP requests.
// HTTP requests.
// //
// resourceGroupName is the name of the resource group. vmScaleSetName is the // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. // name of the VM scale set.
func (client VirtualMachineScaleSetsClient) Delete(resourceGroupName string, vmScaleSetName string, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualMachineScaleSetsClient) Delete(resourceGroupName string, vmScaleSetName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, vmScaleSetName, cancel) req, err := client.DeletePreparer(resourceGroupName, vmScaleSetName, cancel)
if err != nil { if err != nil {
@ -269,14 +266,14 @@ func (client VirtualMachineScaleSetsClient) DeleteResponder(resp *http.Response)
return return
} }
// DeleteInstances allows you to delete virtual machines in a virtual machine // DeleteInstances deletes virtual machines in a VM scale set. This method may
// scale set. This method may poll for completion. Polling can be canceled by // poll for completion. Polling can be canceled by passing the cancel channel
// passing the cancel channel argument. The channel will be used to cancel // argument. The channel will be used to cancel polling and any outstanding
// polling and any outstanding HTTP requests. // HTTP requests.
// //
// resourceGroupName is the name of the resource group. vmScaleSetName is the // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. vmInstanceIDs is the list of // name of the VM scale set. vmInstanceIDs is a list of virtual machine
// virtual machine scale set instance IDs. // instance IDs from the VM scale set.
func (client VirtualMachineScaleSetsClient) DeleteInstances(resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualMachineScaleSetsClient) DeleteInstances(resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: vmInstanceIDs, {TargetValue: vmInstanceIDs,
@ -348,7 +345,7 @@ func (client VirtualMachineScaleSetsClient) DeleteInstancesResponder(resp *http.
// Get display information about 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 // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. // name of the VM scale set.
func (client VirtualMachineScaleSetsClient) Get(resourceGroupName string, vmScaleSetName string) (result VirtualMachineScaleSet, err error) { func (client VirtualMachineScaleSetsClient) Get(resourceGroupName string, vmScaleSetName string) (result VirtualMachineScaleSet, err error) {
req, err := client.GetPreparer(resourceGroupName, vmScaleSetName) req, err := client.GetPreparer(resourceGroupName, vmScaleSetName)
if err != nil { if err != nil {
@ -408,10 +405,10 @@ func (client VirtualMachineScaleSetsClient) GetResponder(resp *http.Response) (r
return return
} }
// GetInstanceView displays status of a virtual machine scale set instance. // GetInstanceView gets the status of a VM scale set instance.
// //
// resourceGroupName is the name of the resource group. vmScaleSetName is the // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. // name of the VM scale set.
func (client VirtualMachineScaleSetsClient) GetInstanceView(resourceGroupName string, vmScaleSetName string) (result VirtualMachineScaleSetInstanceView, err error) { func (client VirtualMachineScaleSetsClient) GetInstanceView(resourceGroupName string, vmScaleSetName string) (result VirtualMachineScaleSetInstanceView, err error) {
req, err := client.GetInstanceViewPreparer(resourceGroupName, vmScaleSetName) req, err := client.GetInstanceViewPreparer(resourceGroupName, vmScaleSetName)
if err != nil { if err != nil {
@ -471,7 +468,7 @@ func (client VirtualMachineScaleSetsClient) GetInstanceViewResponder(resp *http.
return return
} }
// List lists all virtual machine scale sets under a resource group. // List gets a list of all VM scale sets under a resource group.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
func (client VirtualMachineScaleSetsClient) List(resourceGroupName string) (result VirtualMachineScaleSetListResult, err error) { func (client VirtualMachineScaleSetsClient) List(resourceGroupName string) (result VirtualMachineScaleSetListResult, err error) {
@ -556,10 +553,10 @@ func (client VirtualMachineScaleSetsClient) ListNextResults(lastResults VirtualM
return return
} }
// ListAll lists all Virtual Machine Scale Sets in the subscription. Use // ListAll gets a list of all VM Scale Sets in the subscription, regardless of
// nextLink property in the response to get the next page of Virtual Machine // the associated resource group. Use nextLink property in the response to
// Scale Sets. Do this till nextLink is not null to fetch all the Virtual // get the next page of VM Scale Sets. Do this till nextLink is not null to
// Machine Scale Sets. // fetch all the VM Scale Sets.
func (client VirtualMachineScaleSetsClient) ListAll() (result VirtualMachineScaleSetListWithLinkResult, err error) { func (client VirtualMachineScaleSetsClient) ListAll() (result VirtualMachineScaleSetListWithLinkResult, err error) {
req, err := client.ListAllPreparer() req, err := client.ListAllPreparer()
if err != nil { if err != nil {
@ -641,12 +638,11 @@ func (client VirtualMachineScaleSetsClient) ListAllNextResults(lastResults Virtu
return return
} }
// ListSkus displays available skus for your virtual machine scale set // ListSkus gets a list of SKUs available for your VM scale set, including the
// including the minimum and maximum vm instances allowed for a particular // minimum and maximum VM instances allowed for each SKU.
// sku.
// //
// resourceGroupName is the name of the resource group. vmScaleSetName is the // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. // name of the VM scale set.
func (client VirtualMachineScaleSetsClient) ListSkus(resourceGroupName string, vmScaleSetName string) (result VirtualMachineScaleSetListSkusResult, err error) { func (client VirtualMachineScaleSetsClient) ListSkus(resourceGroupName string, vmScaleSetName string) (result VirtualMachineScaleSetListSkusResult, err error) {
req, err := client.ListSkusPreparer(resourceGroupName, vmScaleSetName) req, err := client.ListSkusPreparer(resourceGroupName, vmScaleSetName)
if err != nil { if err != nil {
@ -730,16 +726,16 @@ func (client VirtualMachineScaleSetsClient) ListSkusNextResults(lastResults Virt
return return
} }
// PowerOff allows you to power off (stop) virtual machines in a virtual // PowerOff power off (stop) one or more virtual machines in a VM scale set.
// machine scale set. Note that resources are still attached and you are // Note that resources are still attached and you are getting charged for the
// getting charged for the resources. Use deallocate to release resources. // resources. Instead, use deallocate to release resources and avoid charges.
// This method may poll for completion. Polling can be canceled by passing // This method may poll for completion. Polling can be canceled by passing
// the cancel channel argument. The channel will be used to cancel polling // the cancel channel argument. The channel will be used to cancel polling
// and any outstanding HTTP requests. // and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. vmScaleSetName is the // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. vmInstanceIDs is the list of // name of the VM scale set. vmInstanceIDs is a list of virtual machine
// virtual machine scale set instance IDs. // instance IDs from the VM scale set.
func (client VirtualMachineScaleSetsClient) PowerOff(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualMachineScaleSetsClient) PowerOff(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.PowerOffPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel) req, err := client.PowerOffPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel)
if err != nil { if err != nil {
@ -805,14 +801,13 @@ func (client VirtualMachineScaleSetsClient) PowerOffResponder(resp *http.Respons
return return
} }
// Reimage allows you to re-image(update the version of the installed // Reimage reimages (upgrade the operating system) one or more virtual
// operating system) virtual machines in a virtual machine scale set. This // machines in a VM scale set. This method may poll for completion. Polling
// method may poll for completion. Polling can be canceled by passing the // can be canceled by passing the cancel channel argument. The channel will
// cancel channel argument. The channel will be used to cancel polling and // be used to cancel polling and any outstanding HTTP requests.
// any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. vmScaleSetName is the // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. // name of the VM scale set.
func (client VirtualMachineScaleSetsClient) Reimage(resourceGroupName string, vmScaleSetName string, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualMachineScaleSetsClient) Reimage(resourceGroupName string, vmScaleSetName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.ReimagePreparer(resourceGroupName, vmScaleSetName, cancel) req, err := client.ReimagePreparer(resourceGroupName, vmScaleSetName, cancel)
if err != nil { if err != nil {
@ -873,14 +868,14 @@ func (client VirtualMachineScaleSetsClient) ReimageResponder(resp *http.Response
return return
} }
// Restart allows you to restart virtual machines in a virtual machine scale // Restart restarts one or more virtual machines in a VM scale set. This
// set. This method may poll for completion. Polling can be canceled by // method may poll for completion. Polling can be canceled by passing the
// passing the cancel channel argument. The channel will be used to cancel // cancel channel argument. The channel will be used to cancel polling and
// polling and any outstanding HTTP requests. // any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. vmScaleSetName is the // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. vmInstanceIDs is the list of // name of the VM scale set. vmInstanceIDs is a list of virtual machine
// virtual machine scale set instance IDs. // instance IDs from the VM scale set.
func (client VirtualMachineScaleSetsClient) Restart(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualMachineScaleSetsClient) Restart(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.RestartPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel) req, err := client.RestartPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel)
if err != nil { if err != nil {
@ -946,14 +941,14 @@ func (client VirtualMachineScaleSetsClient) RestartResponder(resp *http.Response
return return
} }
// Start allows you to start virtual machines in a virtual machine scale set. // Start starts one or more virtual machines in a VM scale set. This method
// This method may poll for completion. Polling can be canceled by passing // may poll for completion. Polling can be canceled by passing the cancel
// the cancel channel argument. The channel will be used to cancel polling // channel argument. The channel will be used to cancel polling and any
// and any outstanding HTTP requests. // outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. vmScaleSetName is the // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. vmInstanceIDs is the list of // name of the VM scale set. vmInstanceIDs is a list of virtual machine
// virtual machine scale set instance IDs. // instance IDs from the VM scale set.
func (client VirtualMachineScaleSetsClient) Start(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualMachineScaleSetsClient) Start(resourceGroupName string, vmScaleSetName string, vmInstanceIDs *VirtualMachineScaleSetVMInstanceIDs, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.StartPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel) req, err := client.StartPreparer(resourceGroupName, vmScaleSetName, vmInstanceIDs, cancel)
if err != nil { if err != nil {
@ -1019,14 +1014,14 @@ func (client VirtualMachineScaleSetsClient) StartResponder(resp *http.Response)
return return
} }
// UpdateInstances allows you to manually upgrade virtual machines in a // UpdateInstances upgrades one or more virtual machines to the latest SKU set
// virtual machine scale set. This method may poll for completion. Polling // in the VM scale set model. This method may poll for completion. Polling
// can be canceled by passing the cancel channel argument. The channel will // can be canceled by passing the cancel channel argument. The channel will
// be used to cancel polling and any outstanding HTTP requests. // be used to cancel polling and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. vmScaleSetName is the // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. vmInstanceIDs is the list of // name of the VM scale set. vmInstanceIDs is a list of virtual machine
// virtual machine scale set instance IDs. // instance IDs from the VM scale set.
func (client VirtualMachineScaleSetsClient) UpdateInstances(resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualMachineScaleSetsClient) UpdateInstances(resourceGroupName string, vmScaleSetName string, vmInstanceIDs VirtualMachineScaleSetVMInstanceRequiredIDs, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: vmInstanceIDs, {TargetValue: vmInstanceIDs,

View File

@ -41,16 +41,16 @@ func NewVirtualMachineScaleSetVMsClientWithBaseURI(baseURI string, subscriptionI
return VirtualMachineScaleSetVMsClient{NewWithBaseURI(baseURI, subscriptionID)} return VirtualMachineScaleSetVMsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// Deallocate allows you to deallocate a virtual machine scale set virtual // Deallocate deallocates a specific virtual machine in a VM scale set. Shuts
// machine. Shuts down the virtual machine and releases the compute // down the virtual machine and releases the compute resources it uses. You
// resources. You are not billed for the compute resources that this virtual // are not billed for the compute resources of this virtual machine once it
// machine uses. This method may poll for completion. Polling can be canceled // is deallocated. This method may poll for completion. Polling can be
// by passing the cancel channel argument. The channel will be used to cancel // canceled by passing the cancel channel argument. The channel will be used
// polling and any outstanding HTTP requests. // to cancel polling and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. vmScaleSetName is the // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. instanceID is the instance id of // name of the VM scale set. instanceID is the instance ID of the virtual
// the virtual machine. // machine.
func (client VirtualMachineScaleSetVMsClient) Deallocate(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualMachineScaleSetVMsClient) Deallocate(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.DeallocatePreparer(resourceGroupName, vmScaleSetName, instanceID, cancel) req, err := client.DeallocatePreparer(resourceGroupName, vmScaleSetName, instanceID, cancel)
if err != nil { if err != nil {
@ -112,14 +112,14 @@ func (client VirtualMachineScaleSetVMsClient) DeallocateResponder(resp *http.Res
return return
} }
// Delete allows you to delete a virtual machine scale set. This method may // Delete deletes a virtual machine from a VM scale set. This method may poll
// poll for completion. Polling can be canceled by passing the cancel channel // for completion. Polling can be canceled by passing the cancel channel
// argument. The channel will be used to cancel polling and any outstanding // argument. The channel will be used to cancel polling and any outstanding
// HTTP requests. // HTTP requests.
// //
// resourceGroupName is the name of the resource group. vmScaleSetName is the // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. instanceID is the instance id of // name of the VM scale set. instanceID is the instance ID of the virtual
// the virtual machine. // machine.
func (client VirtualMachineScaleSetVMsClient) Delete(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualMachineScaleSetVMsClient) Delete(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, vmScaleSetName, instanceID, cancel) req, err := client.DeletePreparer(resourceGroupName, vmScaleSetName, instanceID, cancel)
if err != nil { if err != nil {
@ -181,11 +181,11 @@ func (client VirtualMachineScaleSetVMsClient) DeleteResponder(resp *http.Respons
return return
} }
// Get displays information about a virtual machine scale set virtual machine. // Get gets a virtual machine from a VM scale set.
// //
// resourceGroupName is the name of the resource group. vmScaleSetName is the // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. instanceID is the instance id of // name of the VM scale set. instanceID is the instance ID of the virtual
// the virtual machine. // machine.
func (client VirtualMachineScaleSetVMsClient) Get(resourceGroupName string, vmScaleSetName string, instanceID string) (result VirtualMachineScaleSetVM, err error) { func (client VirtualMachineScaleSetVMsClient) Get(resourceGroupName string, vmScaleSetName string, instanceID string) (result VirtualMachineScaleSetVM, err error) {
req, err := client.GetPreparer(resourceGroupName, vmScaleSetName, instanceID) req, err := client.GetPreparer(resourceGroupName, vmScaleSetName, instanceID)
if err != nil { if err != nil {
@ -246,12 +246,11 @@ func (client VirtualMachineScaleSetVMsClient) GetResponder(resp *http.Response)
return return
} }
// GetInstanceView displays the status of a virtual machine scale set virtual // GetInstanceView gets the status of a virtual machine from a VM scale set.
// machine.
// //
// resourceGroupName is the name of the resource group. vmScaleSetName is the // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. instanceID is the instance id of // name of the VM scale set. instanceID is the instance ID of the virtual
// the virtual machine. // machine.
func (client VirtualMachineScaleSetVMsClient) GetInstanceView(resourceGroupName string, vmScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMInstanceView, err error) { func (client VirtualMachineScaleSetVMsClient) GetInstanceView(resourceGroupName string, vmScaleSetName string, instanceID string) (result VirtualMachineScaleSetVMInstanceView, err error) {
req, err := client.GetInstanceViewPreparer(resourceGroupName, vmScaleSetName, instanceID) req, err := client.GetInstanceViewPreparer(resourceGroupName, vmScaleSetName, instanceID)
if err != nil { if err != nil {
@ -312,13 +311,12 @@ func (client VirtualMachineScaleSetVMsClient) GetInstanceViewResponder(resp *htt
return return
} }
// List lists all virtual machines in a VM scale sets. // List gets a list of all virtual machines in a VM scale sets.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// virtualMachineScaleSetName is the name of the virtual machine scale set. // virtualMachineScaleSetName is the name of the VM scale set. filter is the
// filter is the filter to apply on the operation. selectParameter is the // filter to apply to the operation. selectParameter is the list parameters.
// list parameters. expand is the expand expression to apply on the // expand is the expand expression to apply to the operation.
// operation.
func (client VirtualMachineScaleSetVMsClient) List(resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResult, err error) { func (client VirtualMachineScaleSetVMsClient) List(resourceGroupName string, virtualMachineScaleSetName string, filter string, selectParameter string, expand string) (result VirtualMachineScaleSetVMListResult, err error) {
req, err := client.ListPreparer(resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand) req, err := client.ListPreparer(resourceGroupName, virtualMachineScaleSetName, filter, selectParameter, expand)
if err != nil { if err != nil {
@ -411,14 +409,16 @@ func (client VirtualMachineScaleSetVMsClient) ListNextResults(lastResults Virtua
return return
} }
// PowerOff allows you to power off (stop) a virtual machine in a VM scale // PowerOff power off (stop) a virtual machine in a VM scale set. Note that
// set. This method may poll for completion. Polling can be canceled by // resources are still attached and you are getting charged for the
// passing the cancel channel argument. The channel will be used to cancel // resources. Instead, use deallocate to release resources and avoid charges.
// polling and any outstanding HTTP requests. // This method may poll for completion. Polling can be canceled by passing
// the cancel channel argument. The channel will be used to cancel polling
// and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. vmScaleSetName is the // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. instanceID is the instance id of // name of the VM scale set. instanceID is the instance ID of the virtual
// the virtual machine. // machine.
func (client VirtualMachineScaleSetVMsClient) PowerOff(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualMachineScaleSetVMsClient) PowerOff(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.PowerOffPreparer(resourceGroupName, vmScaleSetName, instanceID, cancel) req, err := client.PowerOffPreparer(resourceGroupName, vmScaleSetName, instanceID, cancel)
if err != nil { if err != nil {
@ -480,15 +480,14 @@ func (client VirtualMachineScaleSetVMsClient) PowerOffResponder(resp *http.Respo
return return
} }
// Reimage allows you to re-image(update the version of the installed // Reimage reimages (upgrade the operating system) a specific virtual machine
// operating system) a virtual machine scale set instance. This method may // in a VM scale set. This method may poll for completion. Polling can be
// poll for completion. Polling can be canceled by passing the cancel channel // canceled by passing the cancel channel argument. The channel will be used
// argument. The channel will be used to cancel polling and any outstanding // to cancel polling and any outstanding HTTP requests.
// HTTP requests.
// //
// resourceGroupName is the name of the resource group. vmScaleSetName is the // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. instanceID is the instance id of // name of the VM scale set. instanceID is the instance ID of the virtual
// the virtual machine. // machine.
func (client VirtualMachineScaleSetVMsClient) Reimage(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) { 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) req, err := client.ReimagePreparer(resourceGroupName, vmScaleSetName, instanceID, cancel)
if err != nil { if err != nil {
@ -550,14 +549,14 @@ func (client VirtualMachineScaleSetVMsClient) ReimageResponder(resp *http.Respon
return return
} }
// Restart allows you to restart a virtual machine in a VM scale set. This // Restart restarts a virtual machine in a VM scale set. This method may poll
// method may poll for completion. Polling can be canceled by passing the // for completion. Polling can be canceled by passing the cancel channel
// cancel channel argument. The channel will be used to cancel polling and // argument. The channel will be used to cancel polling and any outstanding
// any outstanding HTTP requests. // HTTP requests.
// //
// resourceGroupName is the name of the resource group. vmScaleSetName is the // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. instanceID is the instance id of // name of the VM scale set. instanceID is the instance ID of the virtual
// the virtual machine. // machine.
func (client VirtualMachineScaleSetVMsClient) Restart(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualMachineScaleSetVMsClient) Restart(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.RestartPreparer(resourceGroupName, vmScaleSetName, instanceID, cancel) req, err := client.RestartPreparer(resourceGroupName, vmScaleSetName, instanceID, cancel)
if err != nil { if err != nil {
@ -619,14 +618,14 @@ func (client VirtualMachineScaleSetVMsClient) RestartResponder(resp *http.Respon
return return
} }
// Start allows you to start a virtual machine in a VM scale set. This method // Start starts a virtual machine in a VM scale set. This method may poll for
// may poll for completion. Polling can be canceled by passing the cancel // completion. Polling can be canceled by passing the cancel channel
// channel argument. The channel will be used to cancel polling and any // argument. The channel will be used to cancel polling and any outstanding
// outstanding HTTP requests. // HTTP requests.
// //
// resourceGroupName is the name of the resource group. vmScaleSetName is the // resourceGroupName is the name of the resource group. vmScaleSetName is the
// name of the virtual machine scale set. instanceID is the instance id of // name of the VM scale set. instanceID is the instance ID of the virtual
// the virtual machine. // machine.
func (client VirtualMachineScaleSetVMsClient) Start(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualMachineScaleSetVMsClient) Start(resourceGroupName string, vmScaleSetName string, instanceID string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.StartPreparer(resourceGroupName, vmScaleSetName, instanceID, cancel) req, err := client.StartPreparer(resourceGroupName, vmScaleSetName, instanceID, cancel)
if err != nil { if err != nil {

View File

@ -1,7 +1,7 @@
// Package eventhub implements the Azure ARM Eventhub service API version // Package eventhub implements the Azure ARM Eventhub service API version
// 2015-08-01. // 2015-08-01.
// //
// Azure EventHub client // Azure Event Hubs client
package eventhub package eventhub
// Copyright (c) Microsoft and contributors. All rights reserved. // Copyright (c) Microsoft and contributors. All rights reserved.

View File

@ -25,7 +25,7 @@ import (
"net/http" "net/http"
) )
// ConsumerGroupsClient is the azure EventHub client // ConsumerGroupsClient is the azure Event Hubs client
type ConsumerGroupsClient struct { type ConsumerGroupsClient struct {
ManagementClient ManagementClient
} }
@ -42,13 +42,13 @@ func NewConsumerGroupsClientWithBaseURI(baseURI string, subscriptionID string) C
return ConsumerGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} return ConsumerGroupsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate creates/Updates a consumer group as a nested resource within // CreateOrUpdate creates or updates an Event Hubs consumer group as a nested
// a namespace. // resource within a namespace.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group. namespaceName is the
// namespace name. eventHubName is the Event Hub name. consumerGroupName is // namespace name. eventHubName is the Event Hub name. consumerGroupName is
// the Consumer Group name. parameters is parameters supplied to create a // the consumer group name. parameters is parameters supplied to create a
// Consumer Group Resource. // consumer group resource.
func (client ConsumerGroupsClient) CreateOrUpdate(resourceGroupName string, namespaceName string, eventHubName string, consumerGroupName string, parameters ConsumerGroupCreateOrUpdateParameters) (result ConsumerGroupResource, err error) { func (client ConsumerGroupsClient) CreateOrUpdate(resourceGroupName string, namespaceName string, eventHubName string, consumerGroupName string, parameters ConsumerGroupCreateOrUpdateParameters) (result ConsumerGroupResource, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: parameters, {TargetValue: parameters,
@ -118,12 +118,12 @@ func (client ConsumerGroupsClient) CreateOrUpdateResponder(resp *http.Response)
return return
} }
// Delete deletes an ConsumerGroup from the specified EventHub and resource // Delete deletes a consumer group from the specified Event Hub and resource
// group. // group.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group. namespaceName is the
// namespace name. eventHubName is the Event Hub name. consumerGroupName is // namespace name. eventHubName is the Event Hub name. consumerGroupName is
// the Consumer Group name. // the Cconsumer group name.
func (client ConsumerGroupsClient) Delete(resourceGroupName string, namespaceName string, eventHubName string, consumerGroupName string) (result autorest.Response, err error) { func (client ConsumerGroupsClient) Delete(resourceGroupName string, namespaceName string, eventHubName string, consumerGroupName string) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, namespaceName, eventHubName, consumerGroupName) req, err := client.DeletePreparer(resourceGroupName, namespaceName, eventHubName, consumerGroupName)
if err != nil { if err != nil {
@ -184,11 +184,11 @@ func (client ConsumerGroupsClient) DeleteResponder(resp *http.Response) (result
return return
} }
// Get returns an Consumer Group description for the specified Consumer Group. // Get gets a description for the specified consumer group.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group. namespaceName is the
// namespace name. eventHubName is the Event Hub name. consumerGroupName is // namespace name. eventHubName is the Event Hub name. consumerGroupName is
// the Consumer Group name. // the consumer group name.
func (client ConsumerGroupsClient) Get(resourceGroupName string, namespaceName string, eventHubName string, consumerGroupName string) (result ConsumerGroupResource, err error) { func (client ConsumerGroupsClient) Get(resourceGroupName string, namespaceName string, eventHubName string, consumerGroupName string) (result ConsumerGroupResource, err error) {
req, err := client.GetPreparer(resourceGroupName, namespaceName, eventHubName, consumerGroupName) req, err := client.GetPreparer(resourceGroupName, namespaceName, eventHubName, consumerGroupName)
if err != nil { if err != nil {
@ -250,7 +250,7 @@ func (client ConsumerGroupsClient) GetResponder(resp *http.Response) (result Con
return return
} }
// ListAll enumerates the consumer groups in a namespace. An empty feed is // ListAll gets all the consumer groups in a namespace. An empty feed is
// returned if no consumer group exists in the namespace. // returned if no consumer group exists in the namespace.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group. namespaceName is the

View File

@ -25,7 +25,7 @@ import (
"net/http" "net/http"
) )
// EventHubsClient is the azure EventHub client // EventHubsClient is the azure Event Hubs client
type EventHubsClient struct { type EventHubsClient struct {
ManagementClient ManagementClient
} }
@ -41,12 +41,12 @@ func NewEventHubsClientWithBaseURI(baseURI string, subscriptionID string) EventH
return EventHubsClient{NewWithBaseURI(baseURI, subscriptionID)} return EventHubsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate creates/Updates a new Event Hub as a nested resource within // CreateOrUpdate creates or updates a new Event Hub as a nested resource
// a namespace. // within a namespace.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group. namespaceName is the
// namespace name. eventHubName is the Event Hub name. parameters is // namespace name. eventHubName is the Event Hub name. parameters is
// parameters supplied to create a EventHub Resource. // parameters supplied to create an Event Hub resource.
func (client EventHubsClient) CreateOrUpdate(resourceGroupName string, namespaceName string, eventHubName string, parameters CreateOrUpdateParameters) (result ResourceType, err error) { func (client EventHubsClient) CreateOrUpdate(resourceGroupName string, namespaceName string, eventHubName string, parameters CreateOrUpdateParameters) (result ResourceType, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: parameters, {TargetValue: parameters,
@ -115,18 +115,18 @@ func (client EventHubsClient) CreateOrUpdateResponder(resp *http.Response) (resu
return return
} }
// CreateOrUpdateAuthorizationRule creates an authorization rule for the // CreateOrUpdateAuthorizationRule creates or updates an authorization rule
// specified Event Hub. // for the specified Event Hub.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group. namespaceName is the
// namespace name. eventHubName is the Event Hub name. authorizationRuleName // namespace name. eventHubName is the Event Hub name. authorizationRuleName
// is aauthorization Rule Name. parameters is the shared access authorization // is the authorization rule name. parameters is the shared access
// rule. // authorization rule.
func (client EventHubsClient) CreateOrUpdateAuthorizationRule(resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (result SharedAccessAuthorizationRuleResource, err error) { func (client EventHubsClient) CreateOrUpdateAuthorizationRule(resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (result SharedAccessAuthorizationRuleResource, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: parameters, {TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, Constraints: []validation.Constraint{{Target: "parameters.SharedAccessAuthorizationRuleProperties", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.Rights", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { Chain: []validation.Constraint{{Target: "parameters.SharedAccessAuthorizationRuleProperties.Rights", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "eventhub.EventHubsClient", "CreateOrUpdateAuthorizationRule") return result, validation.NewErrorWithValidationError(err, "eventhub.EventHubsClient", "CreateOrUpdateAuthorizationRule")
} }
@ -192,10 +192,10 @@ func (client EventHubsClient) CreateOrUpdateAuthorizationRuleResponder(resp *htt
return return
} }
// Delete deletes an Event hub from the specified namespace and resource group. // Delete deletes an Event Hub from the specified namespace and resource group.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group. namespaceName is the
// namespace name. eventHubName is the EventHub name. // namespace name. eventHubName is the name of the Event Hub to delete.
func (client EventHubsClient) Delete(resourceGroupName string, namespaceName string, eventHubName string) (result autorest.Response, err error) { func (client EventHubsClient) Delete(resourceGroupName string, namespaceName string, eventHubName string) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, namespaceName, eventHubName) req, err := client.DeletePreparer(resourceGroupName, namespaceName, eventHubName)
if err != nil { if err != nil {
@ -255,11 +255,11 @@ func (client EventHubsClient) DeleteResponder(resp *http.Response) (result autor
return return
} }
// DeleteAuthorizationRule deletes a EventHub authorization rule // DeleteAuthorizationRule deletes an Event Hubs authorization rule.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group. namespaceName is the
// namespace name. eventHubName is the Eventhub name. authorizationRuleName // namespace name. eventHubName is the Event Hub name. authorizationRuleName
// is authorization Rule Name. // is the authorization rule name.
func (client EventHubsClient) DeleteAuthorizationRule(resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string) (result autorest.Response, err error) { func (client EventHubsClient) DeleteAuthorizationRule(resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string) (result autorest.Response, err error) {
req, err := client.DeleteAuthorizationRulePreparer(resourceGroupName, namespaceName, eventHubName, authorizationRuleName) req, err := client.DeleteAuthorizationRulePreparer(resourceGroupName, namespaceName, eventHubName, authorizationRuleName)
if err != nil { if err != nil {
@ -320,7 +320,7 @@ func (client EventHubsClient) DeleteAuthorizationRuleResponder(resp *http.Respon
return return
} }
// Get returns an Event Hub description for the specified Event Hub. // Get gets an Event Hubs description for the specified Event Hub.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group. namespaceName is the
// namespace name. eventHubName is the Event Hub name. // namespace name. eventHubName is the Event Hub name.
@ -384,11 +384,12 @@ func (client EventHubsClient) GetResponder(resp *http.Response) (result Resource
return return
} }
// GetAuthorizationRule authorization rule for a EventHub by name. // GetAuthorizationRule gets an authorization rule for an Event Hub by rule
// name.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group. namespaceName is the
// namespace name eventHubName is the Event Hub name. authorizationRuleName // namespace name. eventHubName is the Event Hub name. authorizationRuleName
// is authorization rule name. // is the authorization rule name.
func (client EventHubsClient) GetAuthorizationRule(resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string) (result SharedAccessAuthorizationRuleResource, err error) { func (client EventHubsClient) GetAuthorizationRule(resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string) (result SharedAccessAuthorizationRuleResource, err error) {
req, err := client.GetAuthorizationRulePreparer(resourceGroupName, namespaceName, eventHubName, authorizationRuleName) req, err := client.GetAuthorizationRulePreparer(resourceGroupName, namespaceName, eventHubName, authorizationRuleName)
if err != nil { if err != nil {
@ -450,7 +451,7 @@ func (client EventHubsClient) GetAuthorizationRuleResponder(resp *http.Response)
return return
} }
// ListAll enumerates the Event Hubs in a namespace. // ListAll gets all the Event Hubs in a namespace.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group. namespaceName is the
// namespace name. // namespace name.
@ -537,10 +538,10 @@ func (client EventHubsClient) ListAllNextResults(lastResults ListResult) (result
return return
} }
// ListAuthorizationRules authorization rules for a EventHub. // ListAuthorizationRules gets the authorization rules for an Event Hub.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group. namespaceName is the
// NameSpace name eventHubName is the EventHub name. // namespace name eventHubName is the Event Hub name.
func (client EventHubsClient) ListAuthorizationRules(resourceGroupName string, namespaceName string, eventHubName string) (result SharedAccessAuthorizationRuleListResult, err error) { func (client EventHubsClient) ListAuthorizationRules(resourceGroupName string, namespaceName string, eventHubName string) (result SharedAccessAuthorizationRuleListResult, err error) {
req, err := client.ListAuthorizationRulesPreparer(resourceGroupName, namespaceName, eventHubName) req, err := client.ListAuthorizationRulesPreparer(resourceGroupName, namespaceName, eventHubName)
if err != nil { if err != nil {
@ -625,12 +626,12 @@ func (client EventHubsClient) ListAuthorizationRulesNextResults(lastResults Shar
return return
} }
// ListKeys returns the ACS and SAS connection strings for the Event Hub. // ListKeys gets the ACS and SAS connection strings for the Event Hub.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group. namespaceName is the
// namespace name. eventHubName is the event hub name. authorizationRuleName // namespace name. eventHubName is the Event Hub name. authorizationRuleName
// is the connection string of the namespace for the specified // is the connection string of the namespace for the specified authorization
// authorizationRule. // rule.
func (client EventHubsClient) ListKeys(resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string) (result ResourceListKeys, err error) { func (client EventHubsClient) ListKeys(resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string) (result ResourceListKeys, err error) {
req, err := client.ListKeysPreparer(resourceGroupName, namespaceName, eventHubName, authorizationRuleName) req, err := client.ListKeysPreparer(resourceGroupName, namespaceName, eventHubName, authorizationRuleName)
if err != nil { if err != nil {
@ -696,10 +697,10 @@ func (client EventHubsClient) ListKeysResponder(resp *http.Response) (result Res
// Hub. // Hub.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group. namespaceName is the
// namespace name. eventHubName is the event hub name. authorizationRuleName // namespace name. eventHubName is the Event Hub name. authorizationRuleName
// is the connection string of the EventHub for the specified // is the connection string of the Event Hub for the specified authorization
// authorizationRule. parameters is parameters supplied to regenerate Auth // rule. parameters is parameters supplied to regenerate the authorization
// Rule. // rule.
func (client EventHubsClient) RegenerateKeys(resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string, parameters RegenerateKeysParameters) (result ResourceListKeys, err error) { func (client EventHubsClient) RegenerateKeys(resourceGroupName string, namespaceName string, eventHubName string, authorizationRuleName string, parameters RegenerateKeysParameters) (result ResourceListKeys, err error) {
req, err := client.RegenerateKeysPreparer(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters) req, err := client.RegenerateKeysPreparer(resourceGroupName, namespaceName, eventHubName, authorizationRuleName, parameters)
if err != nil { if err != nil {

View File

@ -140,16 +140,16 @@ const (
SkuTierStandard SkuTier = "Standard" SkuTierStandard SkuTier = "Standard"
) )
// ConsumerGroupCreateOrUpdateParameters is parameters supplied to the // ConsumerGroupCreateOrUpdateParameters is parameters supplied to the Create
// CreateOrUpdate Consumer Group operation. // Or Update Consumer Group operation.
type ConsumerGroupCreateOrUpdateParameters struct { type ConsumerGroupCreateOrUpdateParameters struct {
Location *string `json:"location,omitempty"` Location *string `json:"location,omitempty"`
Type *string `json:"type,omitempty"` Type *string `json:"type,omitempty"`
Name *string `json:"name,omitempty"` Name *string `json:"name,omitempty"`
Properties *ConsumerGroupProperties `json:"properties,omitempty"` *ConsumerGroupProperties `json:"properties,omitempty"`
} }
// ConsumerGroupListResult is the response of the List Consumer Group // ConsumerGroupListResult is the response to the List Consumer Group
// operation. // operation.
type ConsumerGroupListResult struct { type ConsumerGroupListResult struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
@ -177,7 +177,7 @@ type ConsumerGroupProperties struct {
UserMetadata *string `json:"userMetadata,omitempty"` UserMetadata *string `json:"userMetadata,omitempty"`
} }
// ConsumerGroupResource is description of Consumer Group Resource. // ConsumerGroupResource is description of the consumer group resource.
type ConsumerGroupResource struct { type ConsumerGroupResource struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
ID *string `json:"id,omitempty"` ID *string `json:"id,omitempty"`
@ -185,7 +185,7 @@ type ConsumerGroupResource struct {
Type *string `json:"type,omitempty"` Type *string `json:"type,omitempty"`
Location *string `json:"location,omitempty"` Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"` Tags *map[string]*string `json:"tags,omitempty"`
Properties *ConsumerGroupProperties `json:"properties,omitempty"` *ConsumerGroupProperties `json:"properties,omitempty"`
} }
// CreateOrUpdateParameters is parameters supplied to the Create Or Update // CreateOrUpdateParameters is parameters supplied to the Create Or Update
@ -197,7 +197,7 @@ type CreateOrUpdateParameters struct {
Properties *Properties `json:"properties,omitempty"` Properties *Properties `json:"properties,omitempty"`
} }
// ListResult is the response of the List EventHub operation. // ListResult is the response of the List Event Hubs operation.
type ListResult struct { type ListResult struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
Value *[]ResourceType `json:"value,omitempty"` Value *[]ResourceType `json:"value,omitempty"`
@ -216,13 +216,13 @@ func (client ListResult) ListResultPreparer() (*http.Request, error) {
autorest.WithBaseURL(to.String(client.NextLink))) autorest.WithBaseURL(to.String(client.NextLink)))
} }
// NamespaceCreateOrUpdateParameters is parameters supplied to the // NamespaceCreateOrUpdateParameters is parameters supplied to the Create Or
// CreateOrUpdate Namespace operation. // Update Namespace operation.
type NamespaceCreateOrUpdateParameters struct { type NamespaceCreateOrUpdateParameters struct {
Location *string `json:"location,omitempty"` Location *string `json:"location,omitempty"`
Sku *Sku `json:"sku,omitempty"` Sku *Sku `json:"sku,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"` Tags *map[string]*string `json:"tags,omitempty"`
Properties *NamespaceProperties `json:"properties,omitempty"` *NamespaceProperties `json:"properties,omitempty"`
} }
// NamespaceListResult is the response of the List Namespace operation. // NamespaceListResult is the response of the List Namespace operation.
@ -244,7 +244,7 @@ func (client NamespaceListResult) NamespaceListResultPreparer() (*http.Request,
autorest.WithBaseURL(to.String(client.NextLink))) autorest.WithBaseURL(to.String(client.NextLink)))
} }
// NamespaceProperties is properties of the Namespace. // NamespaceProperties is properties of the namespace.
type NamespaceProperties struct { type NamespaceProperties struct {
ProvisioningState *string `json:"provisioningState,omitempty"` ProvisioningState *string `json:"provisioningState,omitempty"`
Status NamespaceState `json:"status,omitempty"` Status NamespaceState `json:"status,omitempty"`
@ -255,7 +255,7 @@ type NamespaceProperties struct {
Enabled *bool `json:"enabled,omitempty"` Enabled *bool `json:"enabled,omitempty"`
} }
// NamespaceResource is description of a Namespace resource. // NamespaceResource is description of a namespace resource.
type NamespaceResource struct { type NamespaceResource struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
ID *string `json:"id,omitempty"` ID *string `json:"id,omitempty"`
@ -264,7 +264,7 @@ type NamespaceResource struct {
Location *string `json:"location,omitempty"` Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"` Tags *map[string]*string `json:"tags,omitempty"`
Sku *Sku `json:"sku,omitempty"` Sku *Sku `json:"sku,omitempty"`
Properties *NamespaceProperties `json:"properties,omitempty"` *NamespaceProperties `json:"properties,omitempty"`
} }
// Properties is // Properties is
@ -277,7 +277,8 @@ type Properties struct {
UpdatedAt *date.Time `json:"updatedAt,omitempty"` UpdatedAt *date.Time `json:"updatedAt,omitempty"`
} }
// RegenerateKeysParameters is parameters supplied to the Regenerate Auth Rule. // RegenerateKeysParameters is parameters supplied to the Regenerate
// Authorization Rule operation.
type RegenerateKeysParameters struct { type RegenerateKeysParameters struct {
Policykey Policykey `json:"Policykey,omitempty"` Policykey Policykey `json:"Policykey,omitempty"`
} }
@ -301,7 +302,7 @@ type ResourceListKeys struct {
KeyName *string `json:"keyName,omitempty"` KeyName *string `json:"keyName,omitempty"`
} }
// ResourceType is description of EventHub Resource. // ResourceType is description of the Event Hub resource.
type ResourceType struct { type ResourceType struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
ID *string `json:"id,omitempty"` ID *string `json:"id,omitempty"`
@ -309,18 +310,18 @@ type ResourceType struct {
Type *string `json:"type,omitempty"` Type *string `json:"type,omitempty"`
Location *string `json:"location,omitempty"` Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"` Tags *map[string]*string `json:"tags,omitempty"`
Properties *Properties `json:"properties,omitempty"` *Properties `json:"properties,omitempty"`
} }
// SharedAccessAuthorizationRuleCreateOrUpdateParameters is parameters // SharedAccessAuthorizationRuleCreateOrUpdateParameters is parameters
// supplied to the CreateOrUpdate AuthorizationRules. // supplied to the Create Or Update Authorization Rules operation.
type SharedAccessAuthorizationRuleCreateOrUpdateParameters struct { type SharedAccessAuthorizationRuleCreateOrUpdateParameters struct {
Location *string `json:"location,omitempty"` Location *string `json:"location,omitempty"`
Name *string `json:"name,omitempty"` Name *string `json:"name,omitempty"`
Properties *SharedAccessAuthorizationRuleProperties `json:"properties,omitempty"` *SharedAccessAuthorizationRuleProperties `json:"properties,omitempty"`
} }
// SharedAccessAuthorizationRuleListResult is the response of the List // SharedAccessAuthorizationRuleListResult is the response from the List
// Namespace operation. // Namespace operation.
type SharedAccessAuthorizationRuleListResult struct { type SharedAccessAuthorizationRuleListResult struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
@ -346,8 +347,8 @@ type SharedAccessAuthorizationRuleProperties struct {
Rights *[]AccessRights `json:"rights,omitempty"` Rights *[]AccessRights `json:"rights,omitempty"`
} }
// SharedAccessAuthorizationRuleResource is description of a Namespace // SharedAccessAuthorizationRuleResource is description of a namespace
// AuthorizationRules. // authorization rule.
type SharedAccessAuthorizationRuleResource struct { type SharedAccessAuthorizationRuleResource struct {
autorest.Response `json:"-"` autorest.Response `json:"-"`
ID *string `json:"id,omitempty"` ID *string `json:"id,omitempty"`
@ -355,10 +356,10 @@ type SharedAccessAuthorizationRuleResource struct {
Type *string `json:"type,omitempty"` Type *string `json:"type,omitempty"`
Location *string `json:"location,omitempty"` Location *string `json:"location,omitempty"`
Tags *map[string]*string `json:"tags,omitempty"` Tags *map[string]*string `json:"tags,omitempty"`
Properties *SharedAccessAuthorizationRuleProperties `json:"properties,omitempty"` *SharedAccessAuthorizationRuleProperties `json:"properties,omitempty"`
} }
// Sku is sku of the Namespace. // Sku is sKU of the namespace.
type Sku struct { type Sku struct {
Name SkuName `json:"name,omitempty"` Name SkuName `json:"name,omitempty"`
Tier SkuTier `json:"tier,omitempty"` Tier SkuTier `json:"tier,omitempty"`

View File

@ -25,7 +25,7 @@ import (
"net/http" "net/http"
) )
// NamespacesClient is the azure EventHub client // NamespacesClient is the azure Event Hubs client
type NamespacesClient struct { type NamespacesClient struct {
ManagementClient ManagementClient
} }
@ -41,15 +41,15 @@ func NewNamespacesClientWithBaseURI(baseURI string, subscriptionID string) Names
return NamespacesClient{NewWithBaseURI(baseURI, subscriptionID)} return NamespacesClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate creates Updates namespace. Once created, this namespace's // CreateOrUpdate creates or updates a namespace. Once created, this
// resource manifest is immutable. This operation is idempotent. This method // namespace's resource manifest is immutable. This operation is idempotent.
// may poll for completion. Polling can be canceled by passing the cancel // This method may poll for completion. Polling can be canceled by passing
// channel argument. The channel will be used to cancel polling and any // the cancel channel argument. The channel will be used to cancel polling
// outstanding HTTP requests. // and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group. namespaceName is the
// namespace name. parameters is parameters supplied to create a Namespace // namespace name. parameters is parameters for creating a namespace
// Resource. // resource.
func (client NamespacesClient) CreateOrUpdate(resourceGroupName string, namespaceName string, parameters NamespaceCreateOrUpdateParameters, cancel <-chan struct{}) (result autorest.Response, err error) { func (client NamespacesClient) CreateOrUpdate(resourceGroupName string, namespaceName string, parameters NamespaceCreateOrUpdateParameters, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: parameters, {TargetValue: parameters,
@ -118,17 +118,18 @@ func (client NamespacesClient) CreateOrUpdateResponder(resp *http.Response) (res
return return
} }
// CreateOrUpdateAuthorizationRule creates an authorization rule for a // CreateOrUpdateAuthorizationRule creates or updates an authorization rule
// namespace // for a namespace.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group in which the namespace
// namespace name. authorizationRuleName is namespace Aauthorization Rule // lives. namespaceName is the namespace name. authorizationRuleName is
// Name. parameters is the shared access authorization rule. // namespace authorization rule name. parameters is the shared access
// authorization rule.
func (client NamespacesClient) CreateOrUpdateAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (result SharedAccessAuthorizationRuleResource, err error) { func (client NamespacesClient) CreateOrUpdateAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters SharedAccessAuthorizationRuleCreateOrUpdateParameters) (result SharedAccessAuthorizationRuleResource, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: parameters, {TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, Constraints: []validation.Constraint{{Target: "parameters.SharedAccessAuthorizationRuleProperties", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.Rights", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { Chain: []validation.Constraint{{Target: "parameters.SharedAccessAuthorizationRuleProperties.Rights", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "eventhub.NamespacesClient", "CreateOrUpdateAuthorizationRule") return result, validation.NewErrorWithValidationError(err, "eventhub.NamespacesClient", "CreateOrUpdateAuthorizationRule")
} }
@ -199,8 +200,8 @@ func (client NamespacesClient) CreateOrUpdateAuthorizationRuleResponder(resp *ht
// argument. The channel will be used to cancel polling and any outstanding // argument. The channel will be used to cancel polling and any outstanding
// HTTP requests. // HTTP requests.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group in which the namespace
// namespace name. // lives. namespaceName is the name of the namespace to delete.
func (client NamespacesClient) Delete(resourceGroupName string, namespaceName string, cancel <-chan struct{}) (result autorest.Response, err error) { func (client NamespacesClient) Delete(resourceGroupName string, namespaceName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, namespaceName, cancel) req, err := client.DeletePreparer(resourceGroupName, namespaceName, cancel)
if err != nil { if err != nil {
@ -261,10 +262,11 @@ func (client NamespacesClient) DeleteResponder(resp *http.Response) (result auto
return return
} }
// DeleteAuthorizationRule deletes a namespace authorization rule // DeleteAuthorizationRule deletes an authorization rule for a namespace.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group in which the namespace
// namespace name. authorizationRuleName is authorization Rule Name. // lives. namespaceName is the namespace name. authorizationRuleName is
// authorization rule name.
func (client NamespacesClient) DeleteAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string) (result autorest.Response, err error) { func (client NamespacesClient) DeleteAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string) (result autorest.Response, err error) {
req, err := client.DeleteAuthorizationRulePreparer(resourceGroupName, namespaceName, authorizationRuleName) req, err := client.DeleteAuthorizationRulePreparer(resourceGroupName, namespaceName, authorizationRuleName)
if err != nil { if err != nil {
@ -324,10 +326,10 @@ func (client NamespacesClient) DeleteAuthorizationRuleResponder(resp *http.Respo
return return
} }
// Get returns the description for the specified namespace. // Get gets the description of the specified namespace.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group in which the namespace
// namespace name. // lives. namespaceName is the name of the specified namespace.
func (client NamespacesClient) Get(resourceGroupName string, namespaceName string) (result NamespaceResource, err error) { func (client NamespacesClient) Get(resourceGroupName string, namespaceName string) (result NamespaceResource, err error) {
req, err := client.GetPreparer(resourceGroupName, namespaceName) req, err := client.GetPreparer(resourceGroupName, namespaceName)
if err != nil { if err != nil {
@ -387,10 +389,12 @@ func (client NamespacesClient) GetResponder(resp *http.Response) (result Namespa
return return
} }
// GetAuthorizationRule authorization rule for a namespace by name. // GetAuthorizationRule gets an authorization rule for a namespace by rule
// name.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group in which the namespace
// namespace name authorizationRuleName is authorization rule name. // lives. namespaceName is the namespace name. authorizationRuleName is
// authorization rule name.
func (client NamespacesClient) GetAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string) (result SharedAccessAuthorizationRuleResource, err error) { func (client NamespacesClient) GetAuthorizationRule(resourceGroupName string, namespaceName string, authorizationRuleName string) (result SharedAccessAuthorizationRuleResource, err error) {
req, err := client.GetAuthorizationRulePreparer(resourceGroupName, namespaceName, authorizationRuleName) req, err := client.GetAuthorizationRulePreparer(resourceGroupName, namespaceName, authorizationRuleName)
if err != nil { if err != nil {
@ -451,10 +455,10 @@ func (client NamespacesClient) GetAuthorizationRuleResponder(resp *http.Response
return return
} }
// ListAuthorizationRules authorization rules for a namespace. // ListAuthorizationRules gets a list of authorization rules for a namespace.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group in which the namespace
// namespace name // lives. namespaceName is the namespace name.
func (client NamespacesClient) ListAuthorizationRules(resourceGroupName string, namespaceName string) (result SharedAccessAuthorizationRuleListResult, err error) { func (client NamespacesClient) ListAuthorizationRules(resourceGroupName string, namespaceName string) (result SharedAccessAuthorizationRuleListResult, err error) {
req, err := client.ListAuthorizationRulesPreparer(resourceGroupName, namespaceName) req, err := client.ListAuthorizationRulesPreparer(resourceGroupName, namespaceName)
if err != nil { if err != nil {
@ -538,7 +542,7 @@ func (client NamespacesClient) ListAuthorizationRulesNextResults(lastResults Sha
return return
} }
// ListByResourceGroup lists the available namespaces within a resourceGroup. // ListByResourceGroup lists the available namespaces within a resource group.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
func (client NamespacesClient) ListByResourceGroup(resourceGroupName string) (result NamespaceListResult, err error) { func (client NamespacesClient) ListByResourceGroup(resourceGroupName string) (result NamespaceListResult, err error) {
@ -623,8 +627,8 @@ func (client NamespacesClient) ListByResourceGroupNextResults(lastResults Namesp
return return
} }
// ListBySubscription lists all the available namespaces within the // ListBySubscription lists all the available namespaces within a
// subscription irrespective of the resourceGroups. // subscription, irrespective of the resource groups.
func (client NamespacesClient) ListBySubscription() (result NamespaceListResult, err error) { func (client NamespacesClient) ListBySubscription() (result NamespaceListResult, err error) {
req, err := client.ListBySubscriptionPreparer() req, err := client.ListBySubscriptionPreparer()
if err != nil { if err != nil {
@ -706,10 +710,12 @@ func (client NamespacesClient) ListBySubscriptionNextResults(lastResults Namespa
return return
} }
// ListKeys primary and Secondary ConnectionStrings to the namespace // ListKeys gets the primary and secondary connection strings for the
// namespace.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group in which the namespace
// namespace name. authorizationRuleName is the authorizationRule name. // lives. namespaceName is the namespace name. authorizationRuleName is the
// authorization rule name.
func (client NamespacesClient) ListKeys(resourceGroupName string, namespaceName string, authorizationRuleName string) (result ResourceListKeys, err error) { func (client NamespacesClient) ListKeys(resourceGroupName string, namespaceName string, authorizationRuleName string) (result ResourceListKeys, err error) {
req, err := client.ListKeysPreparer(resourceGroupName, namespaceName, authorizationRuleName) req, err := client.ListKeysPreparer(resourceGroupName, namespaceName, authorizationRuleName)
if err != nil { if err != nil {
@ -770,12 +776,13 @@ func (client NamespacesClient) ListKeysResponder(resp *http.Response) (result Re
return return
} }
// RegenerateKeys regenerats the Primary or Secondary ConnectionStrings to the // RegenerateKeys regenerates the primary or secondary connection strings for
// namespace // the specified namespace.
// //
// resourceGroupName is the name of the resource group. namespaceName is the // resourceGroupName is the name of the resource group in which the namespace
// namespace name. authorizationRuleName is the authorizationRule name. // lives. namespaceName is the namespace name. authorizationRuleName is the
// parameters is parameters supplied to regenerate Auth Rule. // authorization rule name. parameters is parameters required to regenerate
// the connection string.
func (client NamespacesClient) RegenerateKeys(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters RegenerateKeysParameters) (result ResourceListKeys, err error) { func (client NamespacesClient) RegenerateKeys(resourceGroupName string, namespaceName string, authorizationRuleName string, parameters RegenerateKeysParameters) (result ResourceListKeys, err error) {
req, err := client.RegenerateKeysPreparer(resourceGroupName, namespaceName, authorizationRuleName, parameters) req, err := client.RegenerateKeysPreparer(resourceGroupName, namespaceName, authorizationRuleName, parameters)
if err != nil { if err != nil {

View File

@ -23,9 +23,9 @@ import (
) )
const ( const (
major = "6" major = "7"
minor = "0" minor = "0"
patch = "0" patch = "1"
// Always begin a "tag" with a dash (as per http://semver.org) // Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta" tag = "-beta"
semVerFormat = "%s.%s.%s%s" semVerFormat = "%s.%s.%s%s"

View File

@ -23,9 +23,9 @@ import (
) )
const ( const (
major = "6" major = "7"
minor = "0" minor = "0"
patch = "0" patch = "1"
// Always begin a "tag" with a dash (as per http://semver.org) // Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta" tag = "-beta"
semVerFormat = "%s.%s.%s%s" semVerFormat = "%s.%s.%s%s"

View File

@ -46,9 +46,8 @@ func NewApplicationGatewaysClientWithBaseURI(baseURI string, subscriptionID stri
return ApplicationGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} return ApplicationGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// BackendHealth the BackendHealth operation gets the backend health of // BackendHealth gets the backend health of the specified application gateway
// application gateway in the specified resource group through Network // in a resource group. This method may poll for completion. Polling can be
// resource provider. This method may poll for completion. Polling can be
// canceled by passing the cancel channel argument. The channel will be used // canceled by passing the cancel channel argument. The channel will be used
// to cancel polling and any outstanding HTTP requests. // to cancel polling and any outstanding HTTP requests.
// //
@ -118,21 +117,21 @@ func (client ApplicationGatewaysClient) BackendHealthResponder(resp *http.Respon
return return
} }
// CreateOrUpdate the Put ApplicationGateway operation creates/updates a // CreateOrUpdate creates or updates the specified application gateway. This
// ApplicationGateway This method may poll for completion. Polling can be // method may poll for completion. Polling can be canceled by passing the
// canceled by passing the cancel channel argument. The channel will be used // cancel channel argument. The channel will be used to cancel polling and
// to cancel polling and any outstanding HTTP requests. // any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. applicationGatewayName // resourceGroupName is the name of the resource group. applicationGatewayName
// is the name of the ApplicationGateway. parameters is parameters supplied // is the name of the application gateway. parameters is parameters supplied
// to the create/delete ApplicationGateway operation // to the create or update application gateway operation.
func (client ApplicationGatewaysClient) CreateOrUpdate(resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway, cancel <-chan struct{}) (result autorest.Response, err error) { func (client ApplicationGatewaysClient) CreateOrUpdate(resourceGroupName string, applicationGatewayName string, parameters ApplicationGateway, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: parameters, {TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, Constraints: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.WebApplicationFirewallConfiguration", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.WebApplicationFirewallConfiguration.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, Chain: []validation.Constraint{{Target: "parameters.ApplicationGatewayPropertiesFormat.WebApplicationFirewallConfiguration.Enabled", Name: validation.Null, Rule: true, Chain: nil}}},
{Target: "parameters.Properties.OperationalState", Name: validation.ReadOnly, Rule: true, Chain: nil}, {Target: "parameters.ApplicationGatewayPropertiesFormat.OperationalState", Name: validation.ReadOnly, Rule: true, Chain: nil},
}}}}}); err != nil { }}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "network.ApplicationGatewaysClient", "CreateOrUpdate") return result, validation.NewErrorWithValidationError(err, "network.ApplicationGatewaysClient", "CreateOrUpdate")
} }
@ -198,10 +197,10 @@ func (client ApplicationGatewaysClient) CreateOrUpdateResponder(resp *http.Respo
return return
} }
// Delete the delete ApplicationGateway operation deletes the specified // Delete deletes the specified application gateway. This method may poll for
// application gateway. This method may poll for completion. Polling can be // completion. Polling can be canceled by passing the cancel channel
// canceled by passing the cancel channel argument. The channel will be used // argument. The channel will be used to cancel polling and any outstanding
// to cancel polling and any outstanding HTTP requests. // HTTP requests.
// //
// resourceGroupName is the name of the resource group. applicationGatewayName // resourceGroupName is the name of the resource group. applicationGatewayName
// is the name of the application gateway. // is the name of the application gateway.
@ -265,8 +264,7 @@ func (client ApplicationGatewaysClient) DeleteResponder(resp *http.Response) (re
return return
} }
// Get the Get ApplicationGateway operation retrieves information about the // Get gets the specified application gateway.
// specified application gateway.
// //
// resourceGroupName is the name of the resource group. applicationGatewayName // resourceGroupName is the name of the resource group. applicationGatewayName
// is the name of the application gateway. // is the name of the application gateway.
@ -329,8 +327,7 @@ func (client ApplicationGatewaysClient) GetResponder(resp *http.Response) (resul
return return
} }
// List the List ApplicationGateway operation retrieves all the application // List lists all application gateways in a resource group.
// gateways in a resource group.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
func (client ApplicationGatewaysClient) List(resourceGroupName string) (result ApplicationGatewayListResult, err error) { func (client ApplicationGatewaysClient) List(resourceGroupName string) (result ApplicationGatewayListResult, err error) {
@ -415,8 +412,7 @@ func (client ApplicationGatewaysClient) ListNextResults(lastResults ApplicationG
return return
} }
// ListAll the List ApplicationGateway operation retrieves all the application // ListAll gets all the application gateways in a subscription.
// gateways in a subscription.
func (client ApplicationGatewaysClient) ListAll() (result ApplicationGatewayListResult, err error) { func (client ApplicationGatewaysClient) ListAll() (result ApplicationGatewayListResult, err error) {
req, err := client.ListAllPreparer() req, err := client.ListAllPreparer()
if err != nil { if err != nil {
@ -498,11 +494,10 @@ func (client ApplicationGatewaysClient) ListAllNextResults(lastResults Applicati
return return
} }
// Start the Start ApplicationGateway operation starts application gateway in // Start starts the specified application gateway. This method may poll for
// the specified resource group through Network resource provider. This // completion. Polling can be canceled by passing the cancel channel
// method may poll for completion. Polling can be canceled by passing the // argument. The channel will be used to cancel polling and any outstanding
// cancel channel argument. The channel will be used to cancel polling and // HTTP requests.
// any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. applicationGatewayName // resourceGroupName is the name of the resource group. applicationGatewayName
// is the name of the application gateway. // is the name of the application gateway.
@ -566,11 +561,10 @@ func (client ApplicationGatewaysClient) StartResponder(resp *http.Response) (res
return return
} }
// Stop the STOP ApplicationGateway operation stops application gateway in the // Stop stops the specified application gateway in a resource group. This
// specified resource group through Network resource provider. This method // method may poll for completion. Polling can be canceled by passing the
// may poll for completion. Polling can be canceled by passing the cancel // cancel channel argument. The channel will be used to cancel polling and
// channel argument. The channel will be used to cancel polling and any // any outstanding HTTP requests.
// outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. applicationGatewayName // resourceGroupName is the name of the resource group. applicationGatewayName
// is the name of the application gateway. // is the name of the application gateway.

View File

@ -65,7 +65,7 @@ func NewWithBaseURI(baseURI string, subscriptionID string) ManagementClient {
// CheckDNSNameAvailability checks whether a domain name in the cloudapp.net // CheckDNSNameAvailability checks whether a domain name in the cloudapp.net
// zone is available for use. // zone is available for use.
// //
// location is the location of the domain name domainNameLabel is the domain // location is the location of the domain name. domainNameLabel is the domain
// name to be verified. It must conform to the following regular expression: // name to be verified. It must conform to the following regular expression:
// ^[a-z][a-z0-9-]{1,61}[a-z0-9]$. // ^[a-z][a-z0-9-]{1,61}[a-z0-9]$.
func (client ManagementClient) CheckDNSNameAvailability(location string, domainNameLabel string) (result DNSNameAvailabilityResult, err error) { func (client ManagementClient) CheckDNSNameAvailability(location string, domainNameLabel string) (result DNSNameAvailabilityResult, err error) {

View File

@ -45,16 +45,15 @@ func NewExpressRouteCircuitAuthorizationsClientWithBaseURI(baseURI string, subsc
return ExpressRouteCircuitAuthorizationsClient{NewWithBaseURI(baseURI, subscriptionID)} return ExpressRouteCircuitAuthorizationsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate the Put Authorization operation creates/updates an // CreateOrUpdate creates or updates an authorization in the specified express
// authorization in the specified ExpressRouteCircuits This method may poll // route circuit. This method may poll for completion. Polling can be
// for completion. Polling can be canceled by passing the cancel channel // canceled by passing the cancel channel argument. The channel will be used
// argument. The channel will be used to cancel polling and any outstanding // to cancel polling and any outstanding HTTP requests.
// HTTP requests.
// //
// resourceGroupName is the name of the resource group. circuitName is the // resourceGroupName is the name of the resource group. circuitName is the
// name of the express route circuit. authorizationName is the name of the // name of the express route circuit. authorizationName is the name of the
// authorization. authorizationParameters is parameters supplied to the // authorization. authorizationParameters is parameters supplied to the
// create/update ExpressRouteCircuitAuthorization operation // create or update express route circuit authorization operation.
func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization, cancel <-chan struct{}) (result autorest.Response, err error) { func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(resourceGroupName string, circuitName string, authorizationName string, authorizationParameters ExpressRouteCircuitAuthorization, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.CreateOrUpdatePreparer(resourceGroupName, circuitName, authorizationName, authorizationParameters, cancel) req, err := client.CreateOrUpdatePreparer(resourceGroupName, circuitName, authorizationName, authorizationParameters, cancel)
if err != nil { if err != nil {
@ -118,11 +117,10 @@ func (client ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateResponder(re
return return
} }
// Delete the delete authorization operation deletes the specified // Delete deletes the specified authorization from the specified express route
// authorization from the specified ExpressRouteCircuit. This method may poll // circuit. This method may poll for completion. Polling can be canceled by
// for completion. Polling can be canceled by passing the cancel channel // passing the cancel channel argument. The channel will be used to cancel
// argument. The channel will be used to cancel polling and any outstanding // polling and any outstanding HTTP requests.
// HTTP requests.
// //
// resourceGroupName is the name of the resource group. circuitName is the // resourceGroupName is the name of the resource group. circuitName is the
// name of the express route circuit. authorizationName is the name of the // name of the express route circuit. authorizationName is the name of the
@ -188,8 +186,8 @@ func (client ExpressRouteCircuitAuthorizationsClient) DeleteResponder(resp *http
return return
} }
// Get the GET authorization operation retrieves the specified authorization // Get gets the specified authorization from the specified express route
// from the specified ExpressRouteCircuit. // circuit.
// //
// resourceGroupName is the name of the resource group. circuitName is the // resourceGroupName is the name of the resource group. circuitName is the
// name of the express route circuit. authorizationName is the name of the // name of the express route circuit. authorizationName is the name of the
@ -254,8 +252,7 @@ func (client ExpressRouteCircuitAuthorizationsClient) GetResponder(resp *http.Re
return return
} }
// List the List authorization operation retrieves all the authorizations in // List gets all authorizations in an express route circuit.
// an ExpressRouteCircuit.
// //
// resourceGroupName is the name of the resource group. circuitName is the // resourceGroupName is the name of the resource group. circuitName is the
// name of the circuit. // name of the circuit.

View File

@ -45,15 +45,15 @@ func NewExpressRouteCircuitPeeringsClientWithBaseURI(baseURI string, subscriptio
return ExpressRouteCircuitPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)} return ExpressRouteCircuitPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate the Put Peering operation creates/updates an peering in the // CreateOrUpdate creates or updates a peering in the specified express route
// specified ExpressRouteCircuits This method may poll for completion. // circuits. This method may poll for completion. Polling can be canceled by
// Polling can be canceled by passing the cancel channel argument. The // passing the cancel channel argument. The channel will be used to cancel
// channel will be used to cancel polling and any outstanding HTTP requests. // polling and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. circuitName is the // resourceGroupName is the name of the resource group. circuitName is the
// name of the express route circuit. peeringName is the name of the peering. // name of the express route circuit. peeringName is the name of the peering.
// peeringParameters is parameters supplied to the create/update // peeringParameters is parameters supplied to the create or update express
// ExpressRouteCircuit Peering operation // route circuit peering operation.
func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering, cancel <-chan struct{}) (result autorest.Response, err error) { func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdate(resourceGroupName string, circuitName string, peeringName string, peeringParameters ExpressRouteCircuitPeering, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.CreateOrUpdatePreparer(resourceGroupName, circuitName, peeringName, peeringParameters, cancel) req, err := client.CreateOrUpdatePreparer(resourceGroupName, circuitName, peeringName, peeringParameters, cancel)
if err != nil { if err != nil {
@ -117,10 +117,10 @@ func (client ExpressRouteCircuitPeeringsClient) CreateOrUpdateResponder(resp *ht
return return
} }
// Delete the delete peering operation deletes the specified peering from the // Delete deletes the specified peering from the specified express route
// ExpressRouteCircuit. This method may poll for completion. Polling can be // circuit. This method may poll for completion. Polling can be canceled by
// canceled by passing the cancel channel argument. The channel will be used // passing the cancel channel argument. The channel will be used to cancel
// to cancel polling and any outstanding HTTP requests. // polling and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. circuitName is the // resourceGroupName is the name of the resource group. circuitName is the
// name of the express route circuit. peeringName is the name of the peering. // name of the express route circuit. peeringName is the name of the peering.
@ -185,8 +185,8 @@ func (client ExpressRouteCircuitPeeringsClient) DeleteResponder(resp *http.Respo
return return
} }
// Get the GET peering operation retrieves the specified authorization from // Get gets the specified authorization from the specified express route
// the ExpressRouteCircuit. // circuit.
// //
// resourceGroupName is the name of the resource group. circuitName is the // resourceGroupName is the name of the resource group. circuitName is the
// name of the express route circuit. peeringName is the name of the peering. // name of the express route circuit. peeringName is the name of the peering.
@ -250,11 +250,10 @@ func (client ExpressRouteCircuitPeeringsClient) GetResponder(resp *http.Response
return return
} }
// List the List peering operation retrieves all the peerings in an // List gets all peerings in a specified express route circuit.
// ExpressRouteCircuit.
// //
// resourceGroupName is the name of the resource group. circuitName is the // resourceGroupName is the name of the resource group. circuitName is the
// name of the circuit. // name of the express route circuit.
func (client ExpressRouteCircuitPeeringsClient) List(resourceGroupName string, circuitName string) (result ExpressRouteCircuitPeeringListResult, err error) { func (client ExpressRouteCircuitPeeringsClient) List(resourceGroupName string, circuitName string) (result ExpressRouteCircuitPeeringListResult, err error) {
req, err := client.ListPreparer(resourceGroupName, circuitName) req, err := client.ListPreparer(resourceGroupName, circuitName)
if err != nil { if err != nil {

View File

@ -45,14 +45,14 @@ func NewExpressRouteCircuitsClientWithBaseURI(baseURI string, subscriptionID str
return ExpressRouteCircuitsClient{NewWithBaseURI(baseURI, subscriptionID)} return ExpressRouteCircuitsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate the Put ExpressRouteCircuit operation creates/updates a // CreateOrUpdate creates or updates an express route circuit. This method may
// ExpressRouteCircuit This method may poll for completion. Polling can be // poll for completion. Polling can be canceled by passing the cancel channel
// canceled by passing the cancel channel argument. The channel will be used // argument. The channel will be used to cancel polling and any outstanding
// to cancel polling and any outstanding HTTP requests. // HTTP requests.
// //
// resourceGroupName is the name of the resource group. circuitName is the // resourceGroupName is the name of the resource group. circuitName is the
// name of the circuit. parameters is parameters supplied to the // name of the circuit. parameters is parameters supplied to the create or
// create/delete ExpressRouteCircuit operation // update express route circuit operation.
func (client ExpressRouteCircuitsClient) CreateOrUpdate(resourceGroupName string, circuitName string, parameters ExpressRouteCircuit, cancel <-chan struct{}) (result autorest.Response, err error) { func (client ExpressRouteCircuitsClient) CreateOrUpdate(resourceGroupName string, circuitName string, parameters ExpressRouteCircuit, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.CreateOrUpdatePreparer(resourceGroupName, circuitName, parameters, cancel) req, err := client.CreateOrUpdatePreparer(resourceGroupName, circuitName, parameters, cancel)
if err != nil { if err != nil {
@ -115,13 +115,13 @@ func (client ExpressRouteCircuitsClient) CreateOrUpdateResponder(resp *http.Resp
return return
} }
// Delete the delete ExpressRouteCircuit operation deletes the specified // Delete deletes the specified express route circuit. This method may poll
// ExpressRouteCircuit. This method may poll for completion. Polling can be // for completion. Polling can be canceled by passing the cancel channel
// canceled by passing the cancel channel argument. The channel will be used // argument. The channel will be used to cancel polling and any outstanding
// to cancel polling and any outstanding HTTP requests. // HTTP requests.
// //
// resourceGroupName is the name of the resource group. circuitName is the // resourceGroupName is the name of the resource group. circuitName is the
// name of the express route Circuit. // name of the express route circuit.
func (client ExpressRouteCircuitsClient) Delete(resourceGroupName string, circuitName string, cancel <-chan struct{}) (result autorest.Response, err error) { func (client ExpressRouteCircuitsClient) Delete(resourceGroupName string, circuitName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, circuitName, cancel) req, err := client.DeletePreparer(resourceGroupName, circuitName, cancel)
if err != nil { if err != nil {
@ -182,11 +182,10 @@ func (client ExpressRouteCircuitsClient) DeleteResponder(resp *http.Response) (r
return return
} }
// Get the Get ExpressRouteCircuit operation retrieves information about the // Get gets information about the specified express route circuit.
// specified ExpressRouteCircuit.
// //
// resourceGroupName is the name of the resource group. circuitName is the // resourceGroupName is the name of the resource group. circuitName is the
// name of the circuit. // name of express route circuit.
func (client ExpressRouteCircuitsClient) Get(resourceGroupName string, circuitName string) (result ExpressRouteCircuit, err error) { func (client ExpressRouteCircuitsClient) Get(resourceGroupName string, circuitName string) (result ExpressRouteCircuit, err error) {
req, err := client.GetPreparer(resourceGroupName, circuitName) req, err := client.GetPreparer(resourceGroupName, circuitName)
if err != nil { if err != nil {
@ -246,11 +245,11 @@ func (client ExpressRouteCircuitsClient) GetResponder(resp *http.Response) (resu
return return
} }
// GetPeeringStats the List stats ExpressRouteCircuit operation retrieves all // GetPeeringStats gets all stats from an express route circuit in a resource
// the stats from a ExpressRouteCircuits in a resource group. // group.
// //
// resourceGroupName is the name of the resource group. circuitName is the // resourceGroupName is the name of the resource group. circuitName is the
// name of the circuit. peeringName is the name of the peering. // name of the express route circuit. peeringName is the name of the peering.
func (client ExpressRouteCircuitsClient) GetPeeringStats(resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitStats, err error) { func (client ExpressRouteCircuitsClient) GetPeeringStats(resourceGroupName string, circuitName string, peeringName string) (result ExpressRouteCircuitStats, err error) {
req, err := client.GetPeeringStatsPreparer(resourceGroupName, circuitName, peeringName) req, err := client.GetPeeringStatsPreparer(resourceGroupName, circuitName, peeringName)
if err != nil { if err != nil {
@ -311,11 +310,11 @@ func (client ExpressRouteCircuitsClient) GetPeeringStatsResponder(resp *http.Res
return return
} }
// GetStats the List stats ExpressRouteCircuit operation retrieves all the // GetStats gets all the stats from an express route circuit in a resource
// stats from a ExpressRouteCircuits in a resource group. // group.
// //
// resourceGroupName is the name of the resource group. circuitName is the // resourceGroupName is the name of the resource group. circuitName is the
// name of the circuit. // name of the express route circuit.
func (client ExpressRouteCircuitsClient) GetStats(resourceGroupName string, circuitName string) (result ExpressRouteCircuitStats, err error) { func (client ExpressRouteCircuitsClient) GetStats(resourceGroupName string, circuitName string) (result ExpressRouteCircuitStats, err error) {
req, err := client.GetStatsPreparer(resourceGroupName, circuitName) req, err := client.GetStatsPreparer(resourceGroupName, circuitName)
if err != nil { if err != nil {
@ -375,8 +374,7 @@ func (client ExpressRouteCircuitsClient) GetStatsResponder(resp *http.Response)
return return
} }
// List the List ExpressRouteCircuit operation retrieves all the // List gets all the express route circuits in a resource group.
// ExpressRouteCircuits in a resource group.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
func (client ExpressRouteCircuitsClient) List(resourceGroupName string) (result ExpressRouteCircuitListResult, err error) { func (client ExpressRouteCircuitsClient) List(resourceGroupName string) (result ExpressRouteCircuitListResult, err error) {
@ -461,8 +459,7 @@ func (client ExpressRouteCircuitsClient) ListNextResults(lastResults ExpressRout
return return
} }
// ListAll the List ExpressRouteCircuit operation retrieves all the // ListAll gets all the express route circuits in a subscription.
// ExpressRouteCircuits in a subscription.
func (client ExpressRouteCircuitsClient) ListAll() (result ExpressRouteCircuitListResult, err error) { func (client ExpressRouteCircuitsClient) ListAll() (result ExpressRouteCircuitListResult, err error) {
req, err := client.ListAllPreparer() req, err := client.ListAllPreparer()
if err != nil { if err != nil {
@ -544,16 +541,15 @@ func (client ExpressRouteCircuitsClient) ListAllNextResults(lastResults ExpressR
return return
} }
// ListArpTable the ListArpTable from ExpressRouteCircuit operation retrieves // ListArpTable gets the currently advertised ARP table associated with the
// the currently advertised arp table associated with the // express route circuit in a resource group. This method may poll for
// ExpressRouteCircuits in a resource group. This method may poll for
// completion. Polling can be canceled by passing the cancel channel // completion. Polling can be canceled by passing the cancel channel
// argument. The channel will be used to cancel polling and any outstanding // argument. The channel will be used to cancel polling and any outstanding
// HTTP requests. // HTTP requests.
// //
// resourceGroupName is the name of the resource group. circuitName is the // resourceGroupName is the name of the resource group. circuitName is the
// name of the circuit. peeringName is the name of the peering. devicePath is // name of the express route circuit. peeringName is the name of the peering.
// the path of the device. // 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) { 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) req, err := client.ListArpTablePreparer(resourceGroupName, circuitName, peeringName, devicePath, cancel)
if err != nil { if err != nil {
@ -616,16 +612,15 @@ func (client ExpressRouteCircuitsClient) ListArpTableResponder(resp *http.Respon
return return
} }
// ListRoutesTable the ListRoutesTable from ExpressRouteCircuit operation // ListRoutesTable gets the currently advertised routes table associated with
// retrieves the currently advertised routes table associated with the // the express route circuit in a resource group. This method may poll for
// ExpressRouteCircuits in a resource group. This method may poll for
// completion. Polling can be canceled by passing the cancel channel // completion. Polling can be canceled by passing the cancel channel
// argument. The channel will be used to cancel polling and any outstanding // argument. The channel will be used to cancel polling and any outstanding
// HTTP requests. // HTTP requests.
// //
// resourceGroupName is the name of the resource group. circuitName is the // resourceGroupName is the name of the resource group. circuitName is the
// name of the circuit. peeringName is the name of the peering. devicePath is // name of the express route circuit. peeringName is the name of the peering.
// the path of the device. // 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) { 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) req, err := client.ListRoutesTablePreparer(resourceGroupName, circuitName, peeringName, devicePath, cancel)
if err != nil { if err != nil {
@ -688,16 +683,15 @@ func (client ExpressRouteCircuitsClient) ListRoutesTableResponder(resp *http.Res
return return
} }
// ListRoutesTableSummary the ListRoutesTable from ExpressRouteCircuit // ListRoutesTableSummary gets the currently advertised routes table summary
// operation retrieves the currently advertised routes table associated with // associated with the express route circuit in a resource group. This method
// the ExpressRouteCircuits in a resource group. This method may poll for // may poll for completion. Polling can be canceled by passing the cancel
// completion. Polling can be canceled by passing the cancel channel // channel argument. The channel will be used to cancel polling and any
// argument. The channel will be used to cancel polling and any outstanding // outstanding HTTP requests.
// HTTP requests.
// //
// resourceGroupName is the name of the resource group. circuitName is the // resourceGroupName is the name of the resource group. circuitName is the
// name of the circuit. peeringName is the name of the peering. devicePath is // name of the express route circuit. peeringName is the name of the peering.
// the path of the device. // 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) { 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) req, err := client.ListRoutesTableSummaryPreparer(resourceGroupName, circuitName, peeringName, devicePath, cancel)
if err != nil { if err != nil {

View File

@ -45,8 +45,7 @@ func NewExpressRouteServiceProvidersClientWithBaseURI(baseURI string, subscripti
return ExpressRouteServiceProvidersClient{NewWithBaseURI(baseURI, subscriptionID)} return ExpressRouteServiceProvidersClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// List the List ExpressRouteServiceProvider operation retrieves all the // List gets all the available express route service providers.
// available ExpressRouteServiceProviders.
func (client ExpressRouteServiceProvidersClient) List() (result ExpressRouteServiceProviderListResult, err error) { func (client ExpressRouteServiceProvidersClient) List() (result ExpressRouteServiceProviderListResult, err error) {
req, err := client.ListPreparer() req, err := client.ListPreparer()
if err != nil { if err != nil {

View File

@ -45,22 +45,22 @@ func NewInterfacesClientWithBaseURI(baseURI string, subscriptionID string) Inter
return InterfacesClient{NewWithBaseURI(baseURI, subscriptionID)} return InterfacesClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate the Put NetworkInterface operation creates/updates a // CreateOrUpdate creates or updates a network interface. This method may poll
// networkInterface This method may poll for completion. Polling can be // for completion. Polling can be canceled by passing the cancel channel
// canceled by passing the cancel channel argument. The channel will be used // argument. The channel will be used to cancel polling and any outstanding
// to cancel polling and any outstanding HTTP requests. // HTTP requests.
// //
// resourceGroupName is the name of the resource group. networkInterfaceName // resourceGroupName is the name of the resource group. networkInterfaceName
// is the name of the network interface. parameters is parameters supplied to // is the name of the network interface. parameters is parameters supplied to
// the create/update NetworkInterface operation // the create or update network interface operation.
func (client InterfacesClient) CreateOrUpdate(resourceGroupName string, networkInterfaceName string, parameters Interface, cancel <-chan struct{}) (result autorest.Response, err error) { func (client InterfacesClient) CreateOrUpdate(resourceGroupName string, networkInterfaceName string, parameters Interface, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: parameters, {TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, Constraints: []validation.Constraint{{Target: "parameters.InterfacePropertiesFormat", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.NetworkSecurityGroup", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.InterfacePropertiesFormat.NetworkSecurityGroup", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.NetworkSecurityGroup.Properties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.InterfacePropertiesFormat.NetworkSecurityGroup.SecurityGroupPropertiesFormat", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.NetworkSecurityGroup.Properties.NetworkInterfaces", Name: validation.ReadOnly, Rule: true, Chain: nil}, Chain: []validation.Constraint{{Target: "parameters.InterfacePropertiesFormat.NetworkSecurityGroup.SecurityGroupPropertiesFormat.NetworkInterfaces", Name: validation.ReadOnly, Rule: true, Chain: nil},
{Target: "parameters.Properties.NetworkSecurityGroup.Properties.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil}, {Target: "parameters.InterfacePropertiesFormat.NetworkSecurityGroup.SecurityGroupPropertiesFormat.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil},
}}, }},
}}, }},
}}}}}); err != nil { }}}}}); err != nil {
@ -128,10 +128,10 @@ func (client InterfacesClient) CreateOrUpdateResponder(resp *http.Response) (res
return return
} }
// Delete the delete netwokInterface operation deletes the specified // Delete deletes the specified network interface. This method may poll for
// netwokInterface. This method may poll for completion. Polling can be // completion. Polling can be canceled by passing the cancel channel
// canceled by passing the cancel channel argument. The channel will be used // argument. The channel will be used to cancel polling and any outstanding
// to cancel polling and any outstanding HTTP requests. // HTTP requests.
// //
// resourceGroupName is the name of the resource group. networkInterfaceName // resourceGroupName is the name of the resource group. networkInterfaceName
// is the name of the network interface. // is the name of the network interface.
@ -195,11 +195,10 @@ func (client InterfacesClient) DeleteResponder(resp *http.Response) (result auto
return return
} }
// Get the Get network interface operation retrieves information about the // Get gets information about the specified network interface.
// specified network interface.
// //
// resourceGroupName is the name of the resource group. networkInterfaceName // resourceGroupName is the name of the resource group. networkInterfaceName
// is the name of the network interface. expand is expand references // is the name of the network interface. expand is expands referenced
// resources. // resources.
func (client InterfacesClient) Get(resourceGroupName string, networkInterfaceName string, expand string) (result Interface, err error) { func (client InterfacesClient) Get(resourceGroupName string, networkInterfaceName string, expand string) (result Interface, err error) {
req, err := client.GetPreparer(resourceGroupName, networkInterfaceName, expand) req, err := client.GetPreparer(resourceGroupName, networkInterfaceName, expand)
@ -263,11 +262,10 @@ func (client InterfacesClient) GetResponder(resp *http.Response) (result Interfa
return return
} }
// GetEffectiveRouteTable the get effective routetable operation retrieves all // GetEffectiveRouteTable gets all route tables applied to a network
// the route tables applied on a networkInterface. This method may poll for // interface. This method may poll for completion. Polling can be canceled by
// completion. Polling can be canceled by passing the cancel channel // passing the cancel channel argument. The channel will be used to cancel
// argument. The channel will be used to cancel polling and any outstanding // polling and any outstanding HTTP requests.
// HTTP requests.
// //
// resourceGroupName is the name of the resource group. networkInterfaceName // resourceGroupName is the name of the resource group. networkInterfaceName
// is the name of the network interface. // is the name of the network interface.
@ -331,14 +329,13 @@ func (client InterfacesClient) GetEffectiveRouteTableResponder(resp *http.Respon
return return
} }
// GetVirtualMachineScaleSetNetworkInterface the Get network interface // GetVirtualMachineScaleSetNetworkInterface get the specified network
// operation retrieves information about the specified network interface in a // interface in a virtual machine scale set.
// virtual machine scale set.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// virtualMachineScaleSetName is the name of the virtual machine scale set. // virtualMachineScaleSetName is the name of the virtual machine scale set.
// virtualmachineIndex is the virtual machine index. networkInterfaceName is // virtualmachineIndex is the virtual machine index. networkInterfaceName is
// the name of the network interface. expand is expand references resources. // the name of the network interface. expand is expands referenced resources.
func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterface(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (result Interface, err error) { func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterface(resourceGroupName string, virtualMachineScaleSetName string, virtualmachineIndex string, networkInterfaceName string, expand string) (result Interface, err error) {
req, err := client.GetVirtualMachineScaleSetNetworkInterfacePreparer(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand) req, err := client.GetVirtualMachineScaleSetNetworkInterfacePreparer(resourceGroupName, virtualMachineScaleSetName, virtualmachineIndex, networkInterfaceName, expand)
if err != nil { if err != nil {
@ -403,8 +400,7 @@ func (client InterfacesClient) GetVirtualMachineScaleSetNetworkInterfaceResponde
return return
} }
// List the List networkInterfaces operation retrieves all the // List gets all network interfaces in a resource group.
// networkInterfaces in a resource group.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
func (client InterfacesClient) List(resourceGroupName string) (result InterfaceListResult, err error) { func (client InterfacesClient) List(resourceGroupName string) (result InterfaceListResult, err error) {
@ -489,8 +485,7 @@ func (client InterfacesClient) ListNextResults(lastResults InterfaceListResult)
return return
} }
// ListAll the List networkInterfaces operation retrieves all the // ListAll gets all network interfaces in a subscription.
// networkInterfaces in a subscription.
func (client InterfacesClient) ListAll() (result InterfaceListResult, err error) { func (client InterfacesClient) ListAll() (result InterfaceListResult, err error) {
req, err := client.ListAllPreparer() req, err := client.ListAllPreparer()
if err != nil { if err != nil {
@ -572,11 +567,10 @@ func (client InterfacesClient) ListAllNextResults(lastResults InterfaceListResul
return return
} }
// ListEffectiveNetworkSecurityGroups the list effective network security // ListEffectiveNetworkSecurityGroups gets all network security groups applied
// group operation retrieves all the network security groups applied on a // to a network interface. This method may poll for completion. Polling can
// networkInterface. This method may poll for completion. Polling can be // be canceled by passing the cancel channel argument. The channel will be
// canceled by passing the cancel channel argument. The channel will be used // used to cancel polling and any outstanding HTTP requests.
// to cancel polling and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. networkInterfaceName // resourceGroupName is the name of the resource group. networkInterfaceName
// is the name of the network interface. // is the name of the network interface.
@ -640,9 +634,8 @@ func (client InterfacesClient) ListEffectiveNetworkSecurityGroupsResponder(resp
return return
} }
// ListVirtualMachineScaleSetNetworkInterfaces the list network interface // ListVirtualMachineScaleSetNetworkInterfaces gets all network interfaces in
// operation retrieves information about all network interfaces in a virtual // a virtual machine scale set.
// machine scale set.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// virtualMachineScaleSetName is the name of the virtual machine scale set. // virtualMachineScaleSetName is the name of the virtual machine scale set.
@ -729,9 +722,8 @@ func (client InterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesNextRe
return return
} }
// ListVirtualMachineScaleSetVMNetworkInterfaces the list network interface // ListVirtualMachineScaleSetVMNetworkInterfaces gets information about all
// operation retrieves information about all network interfaces in a virtual // network interfaces in a virtual machine in a virtual machine scale set.
// machine from a virtual machine scale set.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// virtualMachineScaleSetName is the name of the virtual machine scale set. // virtualMachineScaleSetName is the name of the virtual machine scale set.

View File

@ -45,14 +45,14 @@ func NewLoadBalancersClientWithBaseURI(baseURI string, subscriptionID string) Lo
return LoadBalancersClient{NewWithBaseURI(baseURI, subscriptionID)} return LoadBalancersClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate the Put LoadBalancer operation creates/updates a // CreateOrUpdate creates or updates a load balancer. This method may poll for
// LoadBalancer This method may poll for completion. Polling can be canceled // completion. Polling can be canceled by passing the cancel channel
// by passing the cancel channel argument. The channel will be used to cancel // argument. The channel will be used to cancel polling and any outstanding
// polling and any outstanding HTTP requests. // HTTP requests.
// //
// resourceGroupName is the name of the resource group. loadBalancerName is // resourceGroupName is the name of the resource group. loadBalancerName is
// the name of the loadBalancer. parameters is parameters supplied to the // the name of the load balancer. parameters is parameters supplied to the
// create/delete LoadBalancer operation // create or update load balancer operation.
func (client LoadBalancersClient) CreateOrUpdate(resourceGroupName string, loadBalancerName string, parameters LoadBalancer, cancel <-chan struct{}) (result autorest.Response, err error) { func (client LoadBalancersClient) CreateOrUpdate(resourceGroupName string, loadBalancerName string, parameters LoadBalancer, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.CreateOrUpdatePreparer(resourceGroupName, loadBalancerName, parameters, cancel) req, err := client.CreateOrUpdatePreparer(resourceGroupName, loadBalancerName, parameters, cancel)
if err != nil { if err != nil {
@ -115,13 +115,13 @@ func (client LoadBalancersClient) CreateOrUpdateResponder(resp *http.Response) (
return return
} }
// Delete the delete LoadBalancer operation deletes the specified load // Delete deletes the specified load balancer. This method may poll for
// balancer. This method may poll for completion. Polling can be canceled by // completion. Polling can be canceled by passing the cancel channel
// passing the cancel channel argument. The channel will be used to cancel // argument. The channel will be used to cancel polling and any outstanding
// polling and any outstanding HTTP requests. // HTTP requests.
// //
// resourceGroupName is the name of the resource group. loadBalancerName is // resourceGroupName is the name of the resource group. loadBalancerName is
// the name of the loadBalancer. // the name of the load balancer.
func (client LoadBalancersClient) Delete(resourceGroupName string, loadBalancerName string, cancel <-chan struct{}) (result autorest.Response, err error) { func (client LoadBalancersClient) Delete(resourceGroupName string, loadBalancerName string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.DeletePreparer(resourceGroupName, loadBalancerName, cancel) req, err := client.DeletePreparer(resourceGroupName, loadBalancerName, cancel)
if err != nil { if err != nil {
@ -182,11 +182,10 @@ func (client LoadBalancersClient) DeleteResponder(resp *http.Response) (result a
return return
} }
// Get the Get LoadBalancer operation retrieves information about the // Get gets the specified load balancer.
// specified LoadBalancer.
// //
// resourceGroupName is the name of the resource group. loadBalancerName is // resourceGroupName is the name of the resource group. loadBalancerName is
// the name of the loadBalancer. expand is expand references resources. // the name of the load balancer. expand is expands referenced resources.
func (client LoadBalancersClient) Get(resourceGroupName string, loadBalancerName string, expand string) (result LoadBalancer, err error) { func (client LoadBalancersClient) Get(resourceGroupName string, loadBalancerName string, expand string) (result LoadBalancer, err error) {
req, err := client.GetPreparer(resourceGroupName, loadBalancerName, expand) req, err := client.GetPreparer(resourceGroupName, loadBalancerName, expand)
if err != nil { if err != nil {
@ -249,8 +248,7 @@ func (client LoadBalancersClient) GetResponder(resp *http.Response) (result Load
return return
} }
// List the List loadBalancer operation retrieves all the load balancers in a // List gets all the load balancers in a resource group.
// resource group.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
func (client LoadBalancersClient) List(resourceGroupName string) (result LoadBalancerListResult, err error) { func (client LoadBalancersClient) List(resourceGroupName string) (result LoadBalancerListResult, err error) {
@ -335,8 +333,7 @@ func (client LoadBalancersClient) ListNextResults(lastResults LoadBalancerListRe
return return
} }
// ListAll the List loadBalancer operation retrieves all the load balancers in // ListAll gets all the load balancers in a subscription.
// a subscription.
func (client LoadBalancersClient) ListAll() (result LoadBalancerListResult, err error) { func (client LoadBalancersClient) ListAll() (result LoadBalancerListResult, err error) {
req, err := client.ListAllPreparer() req, err := client.ListAllPreparer()
if err != nil { if err != nil {

View File

@ -21,6 +21,7 @@ package network
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
"net/http" "net/http"
) )
@ -45,17 +46,25 @@ func NewLocalNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID str
return LocalNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} return LocalNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate the Put LocalNetworkGateway operation creates/updates a // CreateOrUpdate creates or updates a local network gateway in the specified
// local network gateway in the specified resource group through Network // resource group. This method may poll for completion. Polling can be
// resource provider. This method may poll for completion. Polling can be
// canceled by passing the cancel channel argument. The channel will be used // canceled by passing the cancel channel argument. The channel will be used
// to cancel polling and any outstanding HTTP requests. // to cancel polling and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// localNetworkGatewayName is the name of the local network gateway. // localNetworkGatewayName is the name of the local network gateway.
// parameters is parameters supplied to the Begin Create or update Local // parameters is parameters supplied to the create or update local network
// Network Gateway operation through Network resource provider. // gateway operation.
func (client LocalNetworkGatewaysClient) CreateOrUpdate(resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway, cancel <-chan struct{}) (result autorest.Response, err error) { func (client LocalNetworkGatewaysClient) CreateOrUpdate(resourceGroupName string, localNetworkGatewayName string, parameters LocalNetworkGateway, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.LocalNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true,
Chain: []validation.Constraint{{Target: "parameters.LocalNetworkGatewayPropertiesFormat.LocalNetworkAddressSpace", Name: validation.Null, Rule: true, Chain: nil},
{Target: "parameters.LocalNetworkGatewayPropertiesFormat.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil},
}}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "network.LocalNetworkGatewaysClient", "CreateOrUpdate")
}
req, err := client.CreateOrUpdatePreparer(resourceGroupName, localNetworkGatewayName, parameters, cancel) req, err := client.CreateOrUpdatePreparer(resourceGroupName, localNetworkGatewayName, parameters, cancel)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "network.LocalNetworkGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request")
@ -117,8 +126,7 @@ func (client LocalNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Resp
return return
} }
// Delete the Delete LocalNetworkGateway operation deletes the specified local // Delete deletes the specified local network gateway. This method may poll
// network Gateway through Network resource provider. This method may poll
// for completion. Polling can be canceled by passing the cancel channel // for completion. Polling can be canceled by passing the cancel channel
// argument. The channel will be used to cancel polling and any outstanding // argument. The channel will be used to cancel polling and any outstanding
// HTTP requests. // HTTP requests.
@ -185,8 +193,7 @@ func (client LocalNetworkGatewaysClient) DeleteResponder(resp *http.Response) (r
return return
} }
// Get the Get LocalNetworkGateway operation retrieves information about the // Get gets the specified local network gateway in a resource group.
// specified local network gateway through Network resource provider.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// localNetworkGatewayName is the name of the local network gateway. // localNetworkGatewayName is the name of the local network gateway.
@ -249,8 +256,7 @@ func (client LocalNetworkGatewaysClient) GetResponder(resp *http.Response) (resu
return return
} }
// List the List LocalNetworkGateways operation retrieves all the local // List gets all the local network gateways in a resource group.
// network gateways stored.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
func (client LocalNetworkGatewaysClient) List(resourceGroupName string) (result LocalNetworkGatewayListResult, err error) { func (client LocalNetworkGatewaysClient) List(resourceGroupName string) (result LocalNetworkGatewayListResult, err error) {

File diff suppressed because it is too large Load Diff

View File

@ -46,39 +46,39 @@ func NewPublicIPAddressesClientWithBaseURI(baseURI string, subscriptionID string
return PublicIPAddressesClient{NewWithBaseURI(baseURI, subscriptionID)} return PublicIPAddressesClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate the Put PublicIPAddress operation creates/updates a // CreateOrUpdate creates or updates a static or dynamic public IP address.
// stable/dynamic PublicIP address This method may poll for completion. // This method may poll for completion. Polling can be canceled by passing
// Polling can be canceled by passing the cancel channel argument. The // the cancel channel argument. The channel will be used to cancel polling
// channel will be used to cancel polling and any outstanding HTTP requests. // and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. publicIPAddressName is // resourceGroupName is the name of the resource group. publicIPAddressName is
// the name of the publicIpAddress. parameters is parameters supplied to the // the name of the public IP address. parameters is parameters supplied to
// create/update PublicIPAddress operation // the create or update public IP address operation.
func (client PublicIPAddressesClient) CreateOrUpdate(resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress, cancel <-chan struct{}) (result autorest.Response, err error) { func (client PublicIPAddressesClient) CreateOrUpdate(resourceGroupName string, publicIPAddressName string, parameters PublicIPAddress, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: parameters, {TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, Constraints: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.IPConfiguration", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.IPConfiguration.Properties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.IPConfiguration.Properties.Subnet", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.IPConfiguration.Properties.Subnet.Properties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet.SubnetPropertiesFormat", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.IPConfiguration.Properties.Subnet.Properties.NetworkSecurityGroup", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet.SubnetPropertiesFormat.NetworkSecurityGroup", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.IPConfiguration.Properties.Subnet.Properties.NetworkSecurityGroup.Properties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet.SubnetPropertiesFormat.NetworkSecurityGroup.SecurityGroupPropertiesFormat", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.IPConfiguration.Properties.Subnet.Properties.NetworkSecurityGroup.Properties.NetworkInterfaces", Name: validation.ReadOnly, Rule: true, Chain: nil}, Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet.SubnetPropertiesFormat.NetworkSecurityGroup.SecurityGroupPropertiesFormat.NetworkInterfaces", Name: validation.ReadOnly, Rule: true, Chain: nil},
{Target: "parameters.Properties.IPConfiguration.Properties.Subnet.Properties.NetworkSecurityGroup.Properties.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil}, {Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet.SubnetPropertiesFormat.NetworkSecurityGroup.SecurityGroupPropertiesFormat.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil},
}}, }},
}}, }},
{Target: "parameters.Properties.IPConfiguration.Properties.Subnet.Properties.RouteTable", Name: validation.Null, Rule: false, {Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet.SubnetPropertiesFormat.RouteTable", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.IPConfiguration.Properties.Subnet.Properties.RouteTable.Properties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet.SubnetPropertiesFormat.RouteTable.RouteTablePropertiesFormat", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.IPConfiguration.Properties.Subnet.Properties.RouteTable.Properties.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil}}}, Chain: []validation.Constraint{{Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet.SubnetPropertiesFormat.RouteTable.RouteTablePropertiesFormat.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil}}},
}}, }},
{Target: "parameters.Properties.IPConfiguration.Properties.Subnet.Properties.IPConfigurations", Name: validation.ReadOnly, Rule: true, Chain: nil}, {Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.Subnet.SubnetPropertiesFormat.IPConfigurations", Name: validation.ReadOnly, Rule: true, Chain: nil},
}}, }},
}}, }},
{Target: "parameters.Properties.IPConfiguration.Properties.PublicIPAddress", Name: validation.Null, Rule: false, Chain: nil}, {Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration.IPConfigurationPropertiesFormat.PublicIPAddress", Name: validation.Null, Rule: false, Chain: nil},
}}, }},
}}, }},
{Target: "parameters.Properties.IPConfiguration", Name: validation.ReadOnly, Rule: true, Chain: nil}, {Target: "parameters.PublicIPAddressPropertiesFormat.IPConfiguration", Name: validation.ReadOnly, Rule: true, Chain: nil},
}}}}}); err != nil { }}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "network.PublicIPAddressesClient", "CreateOrUpdate") return result, validation.NewErrorWithValidationError(err, "network.PublicIPAddressesClient", "CreateOrUpdate")
} }
@ -144,10 +144,10 @@ func (client PublicIPAddressesClient) CreateOrUpdateResponder(resp *http.Respons
return return
} }
// Delete the delete publicIpAddress operation deletes the specified // Delete deletes the specified public IP address. This method may poll for
// publicIpAddress. This method may poll for completion. Polling can be // completion. Polling can be canceled by passing the cancel channel
// canceled by passing the cancel channel argument. The channel will be used // argument. The channel will be used to cancel polling and any outstanding
// to cancel polling and any outstanding HTTP requests. // HTTP requests.
// //
// resourceGroupName is the name of the resource group. publicIPAddressName is // resourceGroupName is the name of the resource group. publicIPAddressName is
// the name of the subnet. // the name of the subnet.
@ -211,11 +211,10 @@ func (client PublicIPAddressesClient) DeleteResponder(resp *http.Response) (resu
return return
} }
// Get the Get publicIpAddress operation retrieves information about the // Get gets the specified public IP address in a specified resource group.
// specified pubicIpAddress
// //
// resourceGroupName is the name of the resource group. publicIPAddressName is // resourceGroupName is the name of the resource group. publicIPAddressName is
// the name of the subnet. expand is expand references resources. // the name of the subnet. expand is expands referenced resources.
func (client PublicIPAddressesClient) Get(resourceGroupName string, publicIPAddressName string, expand string) (result PublicIPAddress, err error) { func (client PublicIPAddressesClient) Get(resourceGroupName string, publicIPAddressName string, expand string) (result PublicIPAddress, err error) {
req, err := client.GetPreparer(resourceGroupName, publicIPAddressName, expand) req, err := client.GetPreparer(resourceGroupName, publicIPAddressName, expand)
if err != nil { if err != nil {
@ -278,8 +277,7 @@ func (client PublicIPAddressesClient) GetResponder(resp *http.Response) (result
return return
} }
// List the List publicIpAddress operation retrieves all the publicIpAddresses // List gets all public IP addresses in a resource group.
// in a resource group.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
func (client PublicIPAddressesClient) List(resourceGroupName string) (result PublicIPAddressListResult, err error) { func (client PublicIPAddressesClient) List(resourceGroupName string) (result PublicIPAddressListResult, err error) {
@ -364,8 +362,7 @@ func (client PublicIPAddressesClient) ListNextResults(lastResults PublicIPAddres
return return
} }
// ListAll the List publicIpAddress operation retrieves all the // ListAll gets all the public IP addresses in a subscription.
// publicIpAddresses in a subscription.
func (client PublicIPAddressesClient) ListAll() (result PublicIPAddressListResult, err error) { func (client PublicIPAddressesClient) ListAll() (result PublicIPAddressListResult, err error) {
req, err := client.ListAllPreparer() req, err := client.ListAllPreparer()
if err != nil { if err != nil {

View File

@ -43,15 +43,15 @@ func NewRoutesClientWithBaseURI(baseURI string, subscriptionID string) RoutesCli
return RoutesClient{NewWithBaseURI(baseURI, subscriptionID)} return RoutesClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate the Put route operation creates/updates a route in the // CreateOrUpdate creates or updates a route in the specified route table.
// specified route table This method may poll for completion. Polling can be // This method may poll for completion. Polling can be canceled by passing
// canceled by passing the cancel channel argument. The channel will be used // the cancel channel argument. The channel will be used to cancel polling
// to cancel polling and any outstanding HTTP requests. // and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. routeTableName is the // resourceGroupName is the name of the resource group. routeTableName is the
// name of the route table. routeName is the name of the route. // name of the route table. routeName is the name of the route.
// routeParameters is parameters supplied to the create/update route // routeParameters is parameters supplied to the create or update route
// operation // operation.
func (client RoutesClient) CreateOrUpdate(resourceGroupName string, routeTableName string, routeName string, routeParameters Route, cancel <-chan struct{}) (result autorest.Response, err error) { func (client RoutesClient) CreateOrUpdate(resourceGroupName string, routeTableName string, routeName string, routeParameters Route, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.CreateOrUpdatePreparer(resourceGroupName, routeTableName, routeName, routeParameters, cancel) req, err := client.CreateOrUpdatePreparer(resourceGroupName, routeTableName, routeName, routeParameters, cancel)
if err != nil { if err != nil {
@ -115,10 +115,10 @@ func (client RoutesClient) CreateOrUpdateResponder(resp *http.Response) (result
return return
} }
// Delete the delete route operation deletes the specified route from a route // Delete deletes the specified route from a route table. This method may poll
// table. This method may poll for completion. Polling can be canceled by // for completion. Polling can be canceled by passing the cancel channel
// passing the cancel channel argument. The channel will be used to cancel // argument. The channel will be used to cancel polling and any outstanding
// polling and any outstanding HTTP requests. // HTTP requests.
// //
// resourceGroupName is the name of the resource group. routeTableName is the // resourceGroupName is the name of the resource group. routeTableName is the
// name of the route table. routeName is the name of the route. // name of the route table. routeName is the name of the route.
@ -183,8 +183,7 @@ func (client RoutesClient) DeleteResponder(resp *http.Response) (result autorest
return return
} }
// Get the Get route operation retrieves information about the specified route // Get gets the specified route from a route table.
// from the route table.
// //
// resourceGroupName is the name of the resource group. routeTableName is the // resourceGroupName is the name of the resource group. routeTableName is the
// name of the route table. routeName is the name of the route. // name of the route table. routeName is the name of the route.
@ -248,8 +247,7 @@ func (client RoutesClient) GetResponder(resp *http.Response) (result Route, err
return return
} }
// List the List network security rule operation retrieves all the routes in a // List gets all routes in a route table.
// route table.
// //
// resourceGroupName is the name of the resource group. routeTableName is the // resourceGroupName is the name of the resource group. routeTableName is the
// name of the route table. // name of the route table.

View File

@ -45,19 +45,19 @@ func NewRouteTablesClientWithBaseURI(baseURI string, subscriptionID string) Rout
return RouteTablesClient{NewWithBaseURI(baseURI, subscriptionID)} return RouteTablesClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate the Put RouteTable operation creates/updates a route table // CreateOrUpdate create or updates a route table in a specified resource
// in the specified resource group. This method may poll for completion. // group. This method may poll for completion. Polling can be canceled by
// Polling can be canceled by passing the cancel channel argument. The // passing the cancel channel argument. The channel will be used to cancel
// channel will be used to cancel polling and any outstanding HTTP requests. // polling and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. routeTableName is the // resourceGroupName is the name of the resource group. routeTableName is the
// name of the route table. parameters is parameters supplied to the // name of the route table. parameters is parameters supplied to the create
// create/update Route Table operation // or update route table operation.
func (client RouteTablesClient) CreateOrUpdate(resourceGroupName string, routeTableName string, parameters RouteTable, cancel <-chan struct{}) (result autorest.Response, err error) { func (client RouteTablesClient) CreateOrUpdate(resourceGroupName string, routeTableName string, parameters RouteTable, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: parameters, {TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, Constraints: []validation.Constraint{{Target: "parameters.RouteTablePropertiesFormat", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil}}}}}}); err != nil { Chain: []validation.Constraint{{Target: "parameters.RouteTablePropertiesFormat.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil}}}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "network.RouteTablesClient", "CreateOrUpdate") return result, validation.NewErrorWithValidationError(err, "network.RouteTablesClient", "CreateOrUpdate")
} }
@ -122,10 +122,10 @@ func (client RouteTablesClient) CreateOrUpdateResponder(resp *http.Response) (re
return return
} }
// Delete the Delete RouteTable operation deletes the specified Route Table // Delete deletes the specified route table. This method may poll for
// This method may poll for completion. Polling can be canceled by passing // completion. Polling can be canceled by passing the cancel channel
// the cancel channel argument. The channel will be used to cancel polling // argument. The channel will be used to cancel polling and any outstanding
// and any outstanding HTTP requests. // HTTP requests.
// //
// resourceGroupName is the name of the resource group. routeTableName is the // resourceGroupName is the name of the resource group. routeTableName is the
// name of the route table. // name of the route table.
@ -189,11 +189,10 @@ func (client RouteTablesClient) DeleteResponder(resp *http.Response) (result aut
return return
} }
// Get the Get RouteTables operation retrieves information about the specified // Get gets the specified route table.
// route table.
// //
// resourceGroupName is the name of the resource group. routeTableName is the // resourceGroupName is the name of the resource group. routeTableName is the
// name of the route table. expand is expand references resources. // name of the route table. expand is expands referenced resources.
func (client RouteTablesClient) Get(resourceGroupName string, routeTableName string, expand string) (result RouteTable, err error) { func (client RouteTablesClient) Get(resourceGroupName string, routeTableName string, expand string) (result RouteTable, err error) {
req, err := client.GetPreparer(resourceGroupName, routeTableName, expand) req, err := client.GetPreparer(resourceGroupName, routeTableName, expand)
if err != nil { if err != nil {
@ -256,7 +255,7 @@ func (client RouteTablesClient) GetResponder(resp *http.Response) (result RouteT
return return
} }
// List the list RouteTables returns all route tables in a resource group // List gets all route tables in a resource group.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
func (client RouteTablesClient) List(resourceGroupName string) (result RouteTableListResult, err error) { func (client RouteTablesClient) List(resourceGroupName string) (result RouteTableListResult, err error) {
@ -341,7 +340,7 @@ func (client RouteTablesClient) ListNextResults(lastResults RouteTableListResult
return return
} }
// ListAll the list RouteTables returns all route tables in a subscription // ListAll gets all route tables in a subscription.
func (client RouteTablesClient) ListAll() (result RouteTableListResult, err error) { func (client RouteTablesClient) ListAll() (result RouteTableListResult, err error) {
req, err := client.ListAllPreparer() req, err := client.ListAllPreparer()
if err != nil { if err != nil {

View File

@ -46,22 +46,21 @@ func NewSecurityGroupsClientWithBaseURI(baseURI string, subscriptionID string) S
return SecurityGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} return SecurityGroupsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate the Put NetworkSecurityGroup operation creates/updates a // CreateOrUpdate creates or updates a network security group in the specified
// network security group in the specified resource group. This method may // resource group. This method may poll for completion. Polling can be
// poll for completion. Polling can be canceled by passing the cancel channel // canceled by passing the cancel channel argument. The channel will be used
// argument. The channel will be used to cancel polling and any outstanding // to cancel polling and any outstanding HTTP requests.
// HTTP requests.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// networkSecurityGroupName is the name of the network security group. // networkSecurityGroupName is the name of the network security group.
// parameters is parameters supplied to the create/update Network Security // parameters is parameters supplied to the create or update network security
// Group operation // group operation.
func (client SecurityGroupsClient) CreateOrUpdate(resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup, cancel <-chan struct{}) (result autorest.Response, err error) { func (client SecurityGroupsClient) CreateOrUpdate(resourceGroupName string, networkSecurityGroupName string, parameters SecurityGroup, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: parameters, {TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, Constraints: []validation.Constraint{{Target: "parameters.SecurityGroupPropertiesFormat", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.Properties.NetworkInterfaces", Name: validation.ReadOnly, Rule: true, Chain: nil}, Chain: []validation.Constraint{{Target: "parameters.SecurityGroupPropertiesFormat.NetworkInterfaces", Name: validation.ReadOnly, Rule: true, Chain: nil},
{Target: "parameters.Properties.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil}, {Target: "parameters.SecurityGroupPropertiesFormat.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil},
}}}}}); err != nil { }}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "network.SecurityGroupsClient", "CreateOrUpdate") return result, validation.NewErrorWithValidationError(err, "network.SecurityGroupsClient", "CreateOrUpdate")
} }
@ -127,10 +126,10 @@ func (client SecurityGroupsClient) CreateOrUpdateResponder(resp *http.Response)
return return
} }
// Delete the Delete NetworkSecurityGroup operation deletes the specified // Delete deletes the specified network security group. This method may poll
// network security group This method may poll for completion. Polling can be // for completion. Polling can be canceled by passing the cancel channel
// canceled by passing the cancel channel argument. The channel will be used // argument. The channel will be used to cancel polling and any outstanding
// to cancel polling and any outstanding HTTP requests. // HTTP requests.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// networkSecurityGroupName is the name of the network security group. // networkSecurityGroupName is the name of the network security group.
@ -194,12 +193,11 @@ func (client SecurityGroupsClient) DeleteResponder(resp *http.Response) (result
return return
} }
// Get the Get NetworkSecurityGroups operation retrieves information about the // Get gets the specified network security group.
// specified network security group.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// networkSecurityGroupName is the name of the network security group. expand // networkSecurityGroupName is the name of the network security group. expand
// is expand references resources. // is expands referenced resources.
func (client SecurityGroupsClient) Get(resourceGroupName string, networkSecurityGroupName string, expand string) (result SecurityGroup, err error) { func (client SecurityGroupsClient) Get(resourceGroupName string, networkSecurityGroupName string, expand string) (result SecurityGroup, err error) {
req, err := client.GetPreparer(resourceGroupName, networkSecurityGroupName, expand) req, err := client.GetPreparer(resourceGroupName, networkSecurityGroupName, expand)
if err != nil { if err != nil {
@ -262,8 +260,7 @@ func (client SecurityGroupsClient) GetResponder(resp *http.Response) (result Sec
return return
} }
// List the list NetworkSecurityGroups returns all network security groups in // List gets all network security groups in a resource group.
// a resource group
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
func (client SecurityGroupsClient) List(resourceGroupName string) (result SecurityGroupListResult, err error) { func (client SecurityGroupsClient) List(resourceGroupName string) (result SecurityGroupListResult, err error) {
@ -348,8 +345,7 @@ func (client SecurityGroupsClient) ListNextResults(lastResults SecurityGroupList
return return
} }
// ListAll the list NetworkSecurityGroups returns all network security groups // ListAll gets all network security groups in a subscription.
// in a subscription
func (client SecurityGroupsClient) ListAll() (result SecurityGroupListResult, err error) { func (client SecurityGroupsClient) ListAll() (result SecurityGroupListResult, err error) {
req, err := client.ListAllPreparer() req, err := client.ListAllPreparer()
if err != nil { if err != nil {

View File

@ -46,23 +46,22 @@ func NewSecurityRulesClientWithBaseURI(baseURI string, subscriptionID string) Se
return SecurityRulesClient{NewWithBaseURI(baseURI, subscriptionID)} return SecurityRulesClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate the Put network security rule operation creates/updates a // CreateOrUpdate creates or updates a security rule in the specified network
// security rule in the specified network security group This method may poll // security group. This method may poll for completion. Polling can be
// for completion. Polling can be canceled by passing the cancel channel // canceled by passing the cancel channel argument. The channel will be used
// argument. The channel will be used to cancel polling and any outstanding // to cancel polling and any outstanding HTTP requests.
// HTTP requests.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// networkSecurityGroupName is the name of the network security group. // networkSecurityGroupName is the name of the network security group.
// securityRuleName is the name of the security rule. securityRuleParameters // securityRuleName is the name of the security rule. securityRuleParameters
// is parameters supplied to the create/update network security rule // is parameters supplied to the create or update network security rule
// operation // operation.
func (client SecurityRulesClient) CreateOrUpdate(resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule, cancel <-chan struct{}) (result autorest.Response, err error) { func (client SecurityRulesClient) CreateOrUpdate(resourceGroupName string, networkSecurityGroupName string, securityRuleName string, securityRuleParameters SecurityRule, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: securityRuleParameters, {TargetValue: securityRuleParameters,
Constraints: []validation.Constraint{{Target: "securityRuleParameters.Properties", Name: validation.Null, Rule: false, Constraints: []validation.Constraint{{Target: "securityRuleParameters.SecurityRulePropertiesFormat", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "securityRuleParameters.Properties.SourceAddressPrefix", Name: validation.Null, Rule: true, Chain: nil}, Chain: []validation.Constraint{{Target: "securityRuleParameters.SecurityRulePropertiesFormat.SourceAddressPrefix", Name: validation.Null, Rule: true, Chain: nil},
{Target: "securityRuleParameters.Properties.DestinationAddressPrefix", Name: validation.Null, Rule: true, Chain: nil}, {Target: "securityRuleParameters.SecurityRulePropertiesFormat.DestinationAddressPrefix", Name: validation.Null, Rule: true, Chain: nil},
}}}}}); err != nil { }}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "network.SecurityRulesClient", "CreateOrUpdate") return result, validation.NewErrorWithValidationError(err, "network.SecurityRulesClient", "CreateOrUpdate")
} }
@ -129,10 +128,10 @@ func (client SecurityRulesClient) CreateOrUpdateResponder(resp *http.Response) (
return return
} }
// Delete the delete network security rule operation deletes the specified // Delete deletes the specified network security rule. This method may poll
// network security rule. This method may poll for completion. Polling can be // for completion. Polling can be canceled by passing the cancel channel
// canceled by passing the cancel channel argument. The channel will be used // argument. The channel will be used to cancel polling and any outstanding
// to cancel polling and any outstanding HTTP requests. // HTTP requests.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// networkSecurityGroupName is the name of the network security group. // networkSecurityGroupName is the name of the network security group.
@ -198,8 +197,7 @@ func (client SecurityRulesClient) DeleteResponder(resp *http.Response) (result a
return return
} }
// Get the Get NetworkSecurityRule operation retrieves information about the // Get get the specified network security rule.
// specified network security rule.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// networkSecurityGroupName is the name of the network security group. // networkSecurityGroupName is the name of the network security group.
@ -264,8 +262,7 @@ func (client SecurityRulesClient) GetResponder(resp *http.Response) (result Secu
return return
} }
// List the List network security rule operation retrieves all the security // List gets all security rules in a network security group.
// rules in a network security group.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// networkSecurityGroupName is the name of the network security group. // networkSecurityGroupName is the name of the network security group.

View File

@ -44,30 +44,30 @@ func NewSubnetsClientWithBaseURI(baseURI string, subscriptionID string) SubnetsC
return SubnetsClient{NewWithBaseURI(baseURI, subscriptionID)} return SubnetsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate the Put Subnet operation creates/updates a subnet in the // CreateOrUpdate creates or updates a subnet in the specified virtual
// specified virtual network This method may poll for completion. Polling can // network. This method may poll for completion. Polling can be canceled by
// be canceled by passing the cancel channel argument. The channel will be // passing the cancel channel argument. The channel will be used to cancel
// used to cancel polling and any outstanding HTTP requests. // polling and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. virtualNetworkName is // resourceGroupName is the name of the resource group. virtualNetworkName is
// the name of the virtual network. subnetName is the name of the subnet. // the name of the virtual network. subnetName is the name of the subnet.
// subnetParameters is parameters supplied to the create/update Subnet // subnetParameters is parameters supplied to the create or update subnet
// operation // operation.
func (client SubnetsClient) CreateOrUpdate(resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet, cancel <-chan struct{}) (result autorest.Response, err error) { func (client SubnetsClient) CreateOrUpdate(resourceGroupName string, virtualNetworkName string, subnetName string, subnetParameters Subnet, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: subnetParameters, {TargetValue: subnetParameters,
Constraints: []validation.Constraint{{Target: "subnetParameters.Properties", Name: validation.Null, Rule: false, Constraints: []validation.Constraint{{Target: "subnetParameters.SubnetPropertiesFormat", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "subnetParameters.Properties.NetworkSecurityGroup", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "subnetParameters.SubnetPropertiesFormat.NetworkSecurityGroup", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "subnetParameters.Properties.NetworkSecurityGroup.Properties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "subnetParameters.SubnetPropertiesFormat.NetworkSecurityGroup.SecurityGroupPropertiesFormat", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "subnetParameters.Properties.NetworkSecurityGroup.Properties.NetworkInterfaces", Name: validation.ReadOnly, Rule: true, Chain: nil}, Chain: []validation.Constraint{{Target: "subnetParameters.SubnetPropertiesFormat.NetworkSecurityGroup.SecurityGroupPropertiesFormat.NetworkInterfaces", Name: validation.ReadOnly, Rule: true, Chain: nil},
{Target: "subnetParameters.Properties.NetworkSecurityGroup.Properties.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil}, {Target: "subnetParameters.SubnetPropertiesFormat.NetworkSecurityGroup.SecurityGroupPropertiesFormat.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil},
}}, }},
}}, }},
{Target: "subnetParameters.Properties.RouteTable", Name: validation.Null, Rule: false, {Target: "subnetParameters.SubnetPropertiesFormat.RouteTable", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "subnetParameters.Properties.RouteTable.Properties", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "subnetParameters.SubnetPropertiesFormat.RouteTable.RouteTablePropertiesFormat", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "subnetParameters.Properties.RouteTable.Properties.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil}}}, Chain: []validation.Constraint{{Target: "subnetParameters.SubnetPropertiesFormat.RouteTable.RouteTablePropertiesFormat.Subnets", Name: validation.ReadOnly, Rule: true, Chain: nil}}},
}}, }},
{Target: "subnetParameters.Properties.IPConfigurations", Name: validation.ReadOnly, Rule: true, Chain: nil}, {Target: "subnetParameters.SubnetPropertiesFormat.IPConfigurations", Name: validation.ReadOnly, Rule: true, Chain: nil},
}}}}}); err != nil { }}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "network.SubnetsClient", "CreateOrUpdate") return result, validation.NewErrorWithValidationError(err, "network.SubnetsClient", "CreateOrUpdate")
} }
@ -134,10 +134,9 @@ func (client SubnetsClient) CreateOrUpdateResponder(resp *http.Response) (result
return return
} }
// Delete the delete subnet operation deletes the specified subnet. This // Delete deletes the specified subnet. This method may poll for completion.
// method may poll for completion. Polling can be canceled by passing the // Polling can be canceled by passing the cancel channel argument. The
// cancel channel argument. The channel will be used to cancel polling and // channel will be used to cancel polling and any outstanding HTTP requests.
// any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. virtualNetworkName is // resourceGroupName is the name of the resource group. virtualNetworkName is
// the name of the virtual network. subnetName is the name of the subnet. // the name of the virtual network. subnetName is the name of the subnet.
@ -202,12 +201,11 @@ func (client SubnetsClient) DeleteResponder(resp *http.Response) (result autores
return return
} }
// Get the Get subnet operation retrieves information about the specified // Get gets the specified subnet by virtual network and resource group.
// subnet.
// //
// resourceGroupName is the name of the resource group. virtualNetworkName is // resourceGroupName is the name of the resource group. virtualNetworkName is
// the name of the virtual network. subnetName is the name of the subnet. // the name of the virtual network. subnetName is the name of the subnet.
// expand is expand references resources. // expand is expands referenced resources.
func (client SubnetsClient) Get(resourceGroupName string, virtualNetworkName string, subnetName string, expand string) (result Subnet, err error) { func (client SubnetsClient) Get(resourceGroupName string, virtualNetworkName string, subnetName string, expand string) (result Subnet, err error) {
req, err := client.GetPreparer(resourceGroupName, virtualNetworkName, subnetName, expand) req, err := client.GetPreparer(resourceGroupName, virtualNetworkName, subnetName, expand)
if err != nil { if err != nil {
@ -271,8 +269,7 @@ func (client SubnetsClient) GetResponder(resp *http.Response) (result Subnet, er
return return
} }
// List the List subnets operation retrieves all the subnets in a virtual // List gets all subnets in a virtual network.
// network.
// //
// resourceGroupName is the name of the resource group. virtualNetworkName is // resourceGroupName is the name of the resource group. virtualNetworkName is
// the name of the virtual network. // the name of the virtual network.

View File

@ -46,7 +46,7 @@ func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesCli
// List lists compute usages for a subscription. // List lists compute usages for a subscription.
// //
// location is the location upon which resource usage is queried. // location is the location where resource usage is queried.
func (client UsagesClient) List(location string) (result UsagesListResult, err error) { func (client UsagesClient) List(location string) (result UsagesListResult, err error) {
if err := validation.Validate([]validation.Validation{ if err := validation.Validate([]validation.Validation{
{TargetValue: location, {TargetValue: location,

View File

@ -23,9 +23,9 @@ import (
) )
const ( const (
major = "6" major = "7"
minor = "0" minor = "0"
patch = "0" patch = "1"
// Always begin a "tag" with a dash (as per http://semver.org) // Always begin a "tag" with a dash (as per http://semver.org)
tag = "-beta" tag = "-beta"
semVerFormat = "%s.%s.%s%s" semVerFormat = "%s.%s.%s%s"

View File

@ -21,6 +21,7 @@ package network
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
"net/http" "net/http"
) )
@ -45,19 +46,46 @@ func NewVirtualNetworkGatewayConnectionsClientWithBaseURI(baseURI string, subscr
return VirtualNetworkGatewayConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} return VirtualNetworkGatewayConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate the Put VirtualNetworkGatewayConnection operation // CreateOrUpdate creates or updates a virtual network gateway connection in
// creates/updates a virtual network gateway connection in the specified // the specified resource group. This method may poll for completion. Polling
// resource group through Network resource provider. This method may poll for // can be canceled by passing the cancel channel argument. The channel will
// completion. Polling can be canceled by passing the cancel channel // be used to cancel polling and any outstanding HTTP requests.
// argument. The channel will be used to cancel polling and any outstanding
// HTTP requests.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// virtualNetworkGatewayConnectionName is the name of the virtual network // virtualNetworkGatewayConnectionName is the name of the virtual network
// gateway connection. parameters is parameters supplied to the Begin Create // gateway connection. parameters is parameters supplied to the create or
// or update Virtual Network Gateway connection operation through Network // update virtual network gateway connection operation.
// resource provider.
func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdate(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdate(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters VirtualNetworkGatewayConnection, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat", Name: validation.Null, Rule: true,
Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1", Name: validation.Null, Rule: true,
Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true,
Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.IPConfigurations", Name: validation.Null, Rule: true, Chain: nil},
{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.VirtualNetworkGatewayPropertiesFormat.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil},
}},
}},
{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true,
Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.IPConfigurations", Name: validation.Null, Rule: true, Chain: nil},
{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.VirtualNetworkGatewayPropertiesFormat.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil},
}},
}},
{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2", Name: validation.Null, Rule: false,
Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2.LocalNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true,
Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2.LocalNetworkGatewayPropertiesFormat.LocalNetworkAddressSpace", Name: validation.Null, Rule: true, Chain: nil},
{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.LocalNetworkGateway2.LocalNetworkGatewayPropertiesFormat.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil},
}},
}},
{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.ConnectionStatus", Name: validation.ReadOnly, Rule: true, Chain: nil},
{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.TunnelConnectionStatus", Name: validation.ReadOnly, Rule: true, Chain: nil},
{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.EgressBytesTransferred", Name: validation.ReadOnly, Rule: true, Chain: nil},
{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.IngressBytesTransferred", Name: validation.ReadOnly, Rule: true, Chain: nil},
{Target: "parameters.VirtualNetworkGatewayConnectionPropertiesFormat.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil},
}}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "network.VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate")
}
req, err := client.CreateOrUpdatePreparer(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, cancel) req, err := client.CreateOrUpdatePreparer(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, cancel)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request")
@ -119,11 +147,10 @@ func (client VirtualNetworkGatewayConnectionsClient) CreateOrUpdateResponder(res
return return
} }
// Delete the Delete VirtualNetworkGatewayConnection operation deletes the // Delete deletes the specified virtual network Gateway connection. This
// specified virtual network Gateway connection through Network resource // method may poll for completion. Polling can be canceled by passing the
// provider. This method may poll for completion. Polling can be canceled by // cancel channel argument. The channel will be used to cancel polling and
// passing the cancel channel argument. The channel will be used to cancel // any outstanding HTTP requests.
// polling and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// virtualNetworkGatewayConnectionName is the name of the virtual network // virtualNetworkGatewayConnectionName is the name of the virtual network
@ -188,9 +215,7 @@ func (client VirtualNetworkGatewayConnectionsClient) DeleteResponder(resp *http.
return return
} }
// Get the Get VirtualNetworkGatewayConnection operation retrieves information // Get gets the specified virtual network gateway connection by resource group.
// about the specified virtual network gateway connection through Network
// resource provider.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// virtualNetworkGatewayConnectionName is the name of the virtual network // virtualNetworkGatewayConnectionName is the name of the virtual network
@ -259,10 +284,10 @@ func (client VirtualNetworkGatewayConnectionsClient) GetResponder(resp *http.Res
// connection shared key through Network resource provider. // connection shared key through Network resource provider.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// connectionSharedKeyName is the virtual network gateway connection shared // virtualNetworkGatewayConnectionName is the virtual network gateway
// key name. // connection shared key name.
func (client VirtualNetworkGatewayConnectionsClient) GetSharedKey(resourceGroupName string, connectionSharedKeyName string) (result ConnectionSharedKeyResult, err error) { func (client VirtualNetworkGatewayConnectionsClient) GetSharedKey(resourceGroupName string, virtualNetworkGatewayConnectionName string) (result ConnectionSharedKey, err error) {
req, err := client.GetSharedKeyPreparer(resourceGroupName, connectionSharedKeyName) req, err := client.GetSharedKeyPreparer(resourceGroupName, virtualNetworkGatewayConnectionName)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "GetSharedKey", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "GetSharedKey", nil, "Failure preparing request")
} }
@ -282,11 +307,11 @@ func (client VirtualNetworkGatewayConnectionsClient) GetSharedKey(resourceGroupN
} }
// GetSharedKeyPreparer prepares the GetSharedKey request. // GetSharedKeyPreparer prepares the GetSharedKey request.
func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyPreparer(resourceGroupName string, connectionSharedKeyName string) (*http.Request, error) { func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyPreparer(resourceGroupName string, virtualNetworkGatewayConnectionName string) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"connectionSharedKeyName": autorest.Encode("path", connectionSharedKeyName),
"resourceGroupName": autorest.Encode("path", resourceGroupName), "resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
"virtualNetworkGatewayConnectionName": autorest.Encode("path", virtualNetworkGatewayConnectionName),
} }
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
@ -296,7 +321,7 @@ func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyPreparer(resour
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsGet(), autorest.AsGet(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{connectionSharedKeyName}/sharedkey", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/connections/{virtualNetworkGatewayConnectionName}/sharedkey", pathParameters),
autorest.WithQueryParameters(queryParameters)) autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{}) return preparer.Prepare(&http.Request{})
} }
@ -309,7 +334,7 @@ func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeySender(req *htt
// GetSharedKeyResponder handles the response to the GetSharedKey request. The method always // GetSharedKeyResponder handles the response to the GetSharedKey request. The method always
// closes the http.Response Body. // closes the http.Response Body.
func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyResponder(resp *http.Response) (result ConnectionSharedKeyResult, err error) { func (client VirtualNetworkGatewayConnectionsClient) GetSharedKeyResponder(resp *http.Response) (result ConnectionSharedKey, err error) {
err = autorest.Respond( err = autorest.Respond(
resp, resp,
client.ByInspecting(), client.ByInspecting(),
@ -416,9 +441,18 @@ func (client VirtualNetworkGatewayConnectionsClient) ListNextResults(lastResults
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// virtualNetworkGatewayConnectionName is the virtual network gateway // virtualNetworkGatewayConnectionName is the virtual network gateway
// connection reset shared key Name. parameters is parameters supplied to the // connection reset shared key Name. parameters is parameters supplied to the
// Begin Reset Virtual Network Gateway connection shared key operation // begin reset virtual network gateway connection shared key operation
// through Network resource provider. // through network resource provider.
func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKey(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionResetSharedKey, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.Null, Rule: true,
Chain: []validation.Constraint{{Target: "parameters.KeyLength", Name: validation.InclusiveMaximum, Rule: 128, Chain: nil},
{Target: "parameters.KeyLength", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil},
}}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey")
}
req, err := client.ResetSharedKeyPreparer(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, cancel) req, err := client.ResetSharedKeyPreparer(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, cancel)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "ResetSharedKey", nil, "Failure preparing request")
@ -493,6 +527,12 @@ func (client VirtualNetworkGatewayConnectionsClient) ResetSharedKeyResponder(res
// Virtual Network Gateway connection Shared key operation throughNetwork // Virtual Network Gateway connection Shared key operation throughNetwork
// resource provider. // resource provider.
func (client VirtualNetworkGatewayConnectionsClient) SetSharedKey(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualNetworkGatewayConnectionsClient) SetSharedKey(resourceGroupName string, virtualNetworkGatewayConnectionName string, parameters ConnectionSharedKey, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.Value", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "network.VirtualNetworkGatewayConnectionsClient", "SetSharedKey")
}
req, err := client.SetSharedKeyPreparer(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, cancel) req, err := client.SetSharedKeyPreparer(resourceGroupName, virtualNetworkGatewayConnectionName, parameters, cancel)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "SetSharedKey", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewayConnectionsClient", "SetSharedKey", nil, "Failure preparing request")

View File

@ -21,6 +21,7 @@ package network
import ( import (
"github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/validation"
"net/http" "net/http"
) )
@ -45,17 +46,25 @@ func NewVirtualNetworkGatewaysClientWithBaseURI(baseURI string, subscriptionID s
return VirtualNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} return VirtualNetworkGatewaysClient{NewWithBaseURI(baseURI, subscriptionID)}
} }
// CreateOrUpdate the Put VirtualNetworkGateway operation creates/updates a // CreateOrUpdate creates or updates a virtual network gateway in the
// virtual network gateway in the specified resource group through Network // specified resource group. This method may poll for completion. Polling can
// resource provider. This method may poll for completion. Polling can be // be canceled by passing the cancel channel argument. The channel will be
// canceled by passing the cancel channel argument. The channel will be used // used to cancel polling and any outstanding HTTP requests.
// to cancel polling and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// virtualNetworkGatewayName is the name of the virtual network gateway. // virtualNetworkGatewayName is the name of the virtual network gateway.
// parameters is parameters supplied to the Begin Create or update Virtual // parameters is parameters supplied to create or update virtual network
// Network Gateway operation through Network resource provider. // gateway operation.
func (client VirtualNetworkGatewaysClient) CreateOrUpdate(resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualNetworkGatewaysClient) CreateOrUpdate(resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, cancel <-chan struct{}) (result autorest.Response, err error) {
if err := validation.Validate([]validation.Validation{
{TargetValue: parameters,
Constraints: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat", Name: validation.Null, Rule: true,
Chain: []validation.Constraint{{Target: "parameters.VirtualNetworkGatewayPropertiesFormat.IPConfigurations", Name: validation.Null, Rule: true, Chain: nil},
{Target: "parameters.VirtualNetworkGatewayPropertiesFormat.ProvisioningState", Name: validation.ReadOnly, Rule: true, Chain: nil},
}}}}}); err != nil {
return result, validation.NewErrorWithValidationError(err, "network.VirtualNetworkGatewaysClient", "CreateOrUpdate")
}
req, err := client.CreateOrUpdatePreparer(resourceGroupName, virtualNetworkGatewayName, parameters, cancel) req, err := client.CreateOrUpdatePreparer(resourceGroupName, virtualNetworkGatewayName, parameters, cancel)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "CreateOrUpdate", nil, "Failure preparing request")
@ -117,9 +126,8 @@ func (client VirtualNetworkGatewaysClient) CreateOrUpdateResponder(resp *http.Re
return return
} }
// Delete the Delete VirtualNetworkGateway operation deletes the specified // Delete deletes the specified virtual network gateway. This method may poll
// virtual network Gateway through Network resource provider. This method may // for completion. Polling can be canceled by passing the cancel channel
// poll for completion. Polling can be canceled by passing the cancel channel
// argument. The channel will be used to cancel polling and any outstanding // argument. The channel will be used to cancel polling and any outstanding
// HTTP requests. // HTTP requests.
// //
@ -185,14 +193,13 @@ func (client VirtualNetworkGatewaysClient) DeleteResponder(resp *http.Response)
return return
} }
// Generatevpnclientpackage the Generatevpnclientpackage operation generates // Generatevpnclientpackage generates VPN client package for P2S client of the
// Vpn client package for P2S client of the virtual network gateway in the // virtual network gateway in the specified resource group.
// specified resource group through Network resource provider.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// virtualNetworkGatewayName is the name of the virtual network gateway. // virtualNetworkGatewayName is the name of the virtual network gateway.
// parameters is parameters supplied to the Begin Generating Virtual Network // parameters is parameters supplied to the generate virtual network gateway
// Gateway Vpn client package operation through Network resource provider. // VPN client package operation.
func (client VirtualNetworkGatewaysClient) Generatevpnclientpackage(resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (result String, err error) { func (client VirtualNetworkGatewaysClient) Generatevpnclientpackage(resourceGroupName string, virtualNetworkGatewayName string, parameters VpnClientParameters) (result String, err error) {
req, err := client.GeneratevpnclientpackagePreparer(resourceGroupName, virtualNetworkGatewayName, parameters) req, err := client.GeneratevpnclientpackagePreparer(resourceGroupName, virtualNetworkGatewayName, parameters)
if err != nil { if err != nil {
@ -254,8 +261,7 @@ func (client VirtualNetworkGatewaysClient) GeneratevpnclientpackageResponder(res
return return
} }
// Get the Get VirtualNetworkGateway operation retrieves information about the // Get gets the specified virtual network gateway by resource group.
// specified virtual network gateway through Network resource provider.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// virtualNetworkGatewayName is the name of the virtual network gateway. // virtualNetworkGatewayName is the name of the virtual network gateway.
@ -318,8 +324,7 @@ func (client VirtualNetworkGatewaysClient) GetResponder(resp *http.Response) (re
return return
} }
// List the List VirtualNetworkGateways operation retrieves all the virtual // List gets all virtual network gateways by resource group.
// network gateways stored.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
func (client VirtualNetworkGatewaysClient) List(resourceGroupName string) (result VirtualNetworkGatewayListResult, err error) { func (client VirtualNetworkGatewaysClient) List(resourceGroupName string) (result VirtualNetworkGatewayListResult, err error) {
@ -404,18 +409,17 @@ func (client VirtualNetworkGatewaysClient) ListNextResults(lastResults VirtualNe
return return
} }
// Reset the Reset VirtualNetworkGateway operation resets the primary of the // Reset resets the primary of the virtual network gateway in the specified
// virtual network gateway in the specified resource group through Network // resource group. This method may poll for completion. Polling can be
// resource provider. This method may poll for completion. Polling can be
// canceled by passing the cancel channel argument. The channel will be used // canceled by passing the cancel channel argument. The channel will be used
// to cancel polling and any outstanding HTTP requests. // to cancel polling and any outstanding HTTP requests.
// //
// resourceGroupName is the name of the resource group. // resourceGroupName is the name of the resource group.
// virtualNetworkGatewayName is the name of the virtual network gateway. // virtualNetworkGatewayName is the name of the virtual network gateway.
// parameters is parameters supplied to the Begin Reset Virtual Network // gatewayVip is virtual network gateway vip address supplied to the begin
// Gateway operation through Network resource provider. // reset of the active-active feature enabled gateway.
func (client VirtualNetworkGatewaysClient) Reset(resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, cancel <-chan struct{}) (result autorest.Response, err error) { func (client VirtualNetworkGatewaysClient) Reset(resourceGroupName string, virtualNetworkGatewayName string, gatewayVip string, cancel <-chan struct{}) (result autorest.Response, err error) {
req, err := client.ResetPreparer(resourceGroupName, virtualNetworkGatewayName, parameters, cancel) req, err := client.ResetPreparer(resourceGroupName, virtualNetworkGatewayName, gatewayVip, cancel)
if err != nil { if err != nil {
return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Reset", nil, "Failure preparing request") return result, autorest.NewErrorWithError(err, "network.VirtualNetworkGatewaysClient", "Reset", nil, "Failure preparing request")
} }
@ -435,7 +439,7 @@ func (client VirtualNetworkGatewaysClient) Reset(resourceGroupName string, virtu
} }
// ResetPreparer prepares the Reset request. // ResetPreparer prepares the Reset request.
func (client VirtualNetworkGatewaysClient) ResetPreparer(resourceGroupName string, virtualNetworkGatewayName string, parameters VirtualNetworkGateway, cancel <-chan struct{}) (*http.Request, error) { func (client VirtualNetworkGatewaysClient) ResetPreparer(resourceGroupName string, virtualNetworkGatewayName string, gatewayVip string, cancel <-chan struct{}) (*http.Request, error) {
pathParameters := map[string]interface{}{ pathParameters := map[string]interface{}{
"resourceGroupName": autorest.Encode("path", resourceGroupName), "resourceGroupName": autorest.Encode("path", resourceGroupName),
"subscriptionId": autorest.Encode("path", client.SubscriptionID), "subscriptionId": autorest.Encode("path", client.SubscriptionID),
@ -445,13 +449,14 @@ func (client VirtualNetworkGatewaysClient) ResetPreparer(resourceGroupName strin
queryParameters := map[string]interface{}{ queryParameters := map[string]interface{}{
"api-version": client.APIVersion, "api-version": client.APIVersion,
} }
if len(gatewayVip) > 0 {
queryParameters["gatewayVip"] = autorest.Encode("query", gatewayVip)
}
preparer := autorest.CreatePreparer( preparer := autorest.CreatePreparer(
autorest.AsJSON(),
autorest.AsPost(), autorest.AsPost(),
autorest.WithBaseURL(client.BaseURI), autorest.WithBaseURL(client.BaseURI),
autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset", pathParameters), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworkGateways/{virtualNetworkGatewayName}/reset", pathParameters),
autorest.WithJSON(parameters),
autorest.WithQueryParameters(queryParameters)) autorest.WithQueryParameters(queryParameters))
return preparer.Prepare(&http.Request{Cancel: cancel}) return preparer.Prepare(&http.Request{Cancel: cancel})
} }

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