From 3c0db224b375fe78f50591b9c49a937f6dc1e455 Mon Sep 17 00:00:00 2001 From: SwaggerToSDK Automation Date: Thu, 23 Feb 2017 01:20:09 +0000 Subject: [PATCH] Generated from 78f08e4ec83905c6697a3a4c8199c3bc37bc5b5b --- .../lib/generated/azure_mgmt_cdn.rb | 1 + .../azure_mgmt_cdn/cdn_management_client.rb | 30 +-- .../azure_mgmt_cdn/custom_domains.rb | 222 ++++++++++++++++++ .../azure_mgmt_cdn/models/custom_domain.rb | 13 + .../models/custom_https_provisioning_state.rb | 19 ++ 5 files changed, 270 insertions(+), 15 deletions(-) create mode 100644 management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/custom_https_provisioning_state.rb diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn.rb index 40328e5581..bbf0e04867 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn.rb @@ -67,6 +67,7 @@ module Models autoload :GeoFilterActions, 'generated/azure_mgmt_cdn/models/geo_filter_actions.rb' autoload :OriginResourceState, 'generated/azure_mgmt_cdn/models/origin_resource_state.rb' autoload :CustomDomainResourceState, 'generated/azure_mgmt_cdn/models/custom_domain_resource_state.rb' + autoload :CustomHttpsProvisioningState, 'generated/azure_mgmt_cdn/models/custom_https_provisioning_state.rb' autoload :ResourceType, 'generated/azure_mgmt_cdn/models/resource_type.rb' end end diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/cdn_management_client.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/cdn_management_client.rb index abb2c204bc..e3b4e7b120 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/cdn_management_client.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/cdn_management_client.rb @@ -239,8 +239,8 @@ def check_name_availability_async(check_name_availability_input, custom_headers # # @return [Array] operation results. # - def check_resource_usage(custom_headers = nil) - first_page = check_resource_usage_as_lazy(custom_headers) + def list_resource_usage(custom_headers = nil) + first_page = list_resource_usage_as_lazy(custom_headers) first_page.get_all_items end @@ -253,8 +253,8 @@ def check_resource_usage(custom_headers = nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def check_resource_usage_with_http_info(custom_headers = nil) - check_resource_usage_async(custom_headers).value! + def list_resource_usage_with_http_info(custom_headers = nil) + list_resource_usage_async(custom_headers).value! end # @@ -266,7 +266,7 @@ def check_resource_usage_with_http_info(custom_headers = nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def check_resource_usage_async(custom_headers = nil) + def list_resource_usage_async(custom_headers = nil) fail ArgumentError, 'subscription_id is nil' if subscription_id.nil? fail ArgumentError, 'api_version is nil' if api_version.nil? @@ -408,8 +408,8 @@ def list_operations_async(custom_headers = nil) # # @return [ResourceUsageListResult] operation results. # - def check_resource_usage_next(next_page_link, custom_headers = nil) - response = check_resource_usage_next_async(next_page_link, custom_headers).value! + def list_resource_usage_next(next_page_link, custom_headers = nil) + response = list_resource_usage_next_async(next_page_link, custom_headers).value! response.body unless response.nil? end @@ -424,8 +424,8 @@ def check_resource_usage_next(next_page_link, custom_headers = nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def check_resource_usage_next_with_http_info(next_page_link, custom_headers = nil) - check_resource_usage_next_async(next_page_link, custom_headers).value! + def list_resource_usage_next_with_http_info(next_page_link, custom_headers = nil) + list_resource_usage_next_async(next_page_link, custom_headers).value! end # @@ -439,7 +439,7 @@ def check_resource_usage_next_with_http_info(next_page_link, custom_headers = ni # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def check_resource_usage_next_async(next_page_link, custom_headers = nil) + def list_resource_usage_next_async(next_page_link, custom_headers = nil) fail ArgumentError, 'next_page_link is nil' if next_page_link.nil? @@ -583,8 +583,8 @@ def list_operations_next_async(next_page_link, custom_headers = nil) # # @return [ResourceUsageListResult] operation results. # - def check_resource_usage_as_lazy(custom_headers = nil) - first_page = check_resource_usage_as_lazy_as_lazy(custom_headers) + def list_resource_usage_as_lazy(custom_headers = nil) + first_page = list_resource_usage_as_lazy_as_lazy(custom_headers) first_page.get_all_items end @@ -597,8 +597,8 @@ def check_resource_usage_as_lazy(custom_headers = nil) # # @return [MsRestAzure::AzureOperationResponse] HTTP response information. # - def check_resource_usage_as_lazy_with_http_info(custom_headers = nil) - check_resource_usage_as_lazy_async(custom_headers).value! + def list_resource_usage_as_lazy_with_http_info(custom_headers = nil) + list_resource_usage_as_lazy_async(custom_headers).value! end # @@ -610,7 +610,7 @@ def check_resource_usage_as_lazy_with_http_info(custom_headers = nil) # # @return [Concurrent::Promise] Promise object which holds the HTTP response. # - def check_resource_usage_as_lazy_async(custom_headers = nil) + def list_resource_usage_as_lazy_async(custom_headers = nil) request_headers = {} diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/custom_domains.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/custom_domains.rb index 3de10b3e43..564827c2fe 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/custom_domains.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/custom_domains.rb @@ -351,6 +351,228 @@ def delete_async(resource_group_name, profile_name, endpoint_name, custom_domain promise end + # + # Disable https delivery of the custom domain. + # + # @param resource_group_name [String] Name of the Resource group within the + # Azure subscription. + # @param profile_name [String] Name of the CDN profile which is unique within + # the resource group. + # @param endpoint_name [String] Name of the endpoint under the profile which is + # unique globally. + # @param custom_domain_name [String] Name of the custom domain within an + # endpoint. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CustomDomain] operation results. + # + def disable_custom_https(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) + response = disable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Disable https delivery of the custom domain. + # + # @param resource_group_name [String] Name of the Resource group within the + # Azure subscription. + # @param profile_name [String] Name of the CDN profile which is unique within + # the resource group. + # @param endpoint_name [String] Name of the endpoint under the profile which is + # unique globally. + # @param custom_domain_name [String] Name of the custom domain within an + # endpoint. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def disable_custom_https_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) + disable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value! + end + + # + # Disable https delivery of the custom domain. + # + # @param resource_group_name [String] Name of the Resource group within the + # Azure subscription. + # @param profile_name [String] Name of the CDN profile which is unique within + # the resource group. + # @param endpoint_name [String] Name of the endpoint under the profile which is + # unique globally. + # @param custom_domain_name [String] Name of the custom domain within an + # endpoint. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def disable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'profile_name is nil' if profile_name.nil? + fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil? + fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/disableCustomHttps' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'customDomainName' => custom_domain_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 202 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = CustomDomain.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + + # + # Enable https delivery of the custom domain. + # + # @param resource_group_name [String] Name of the Resource group within the + # Azure subscription. + # @param profile_name [String] Name of the CDN profile which is unique within + # the resource group. + # @param endpoint_name [String] Name of the endpoint under the profile which is + # unique globally. + # @param custom_domain_name [String] Name of the custom domain within an + # endpoint. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [CustomDomain] operation results. + # + def enable_custom_https(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) + response = enable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value! + response.body unless response.nil? + end + + # + # Enable https delivery of the custom domain. + # + # @param resource_group_name [String] Name of the Resource group within the + # Azure subscription. + # @param profile_name [String] Name of the CDN profile which is unique within + # the resource group. + # @param endpoint_name [String] Name of the endpoint under the profile which is + # unique globally. + # @param custom_domain_name [String] Name of the custom domain within an + # endpoint. + # @param custom_headers [Hash{String => String}] A hash of custom headers that + # will be added to the HTTP request. + # + # @return [MsRestAzure::AzureOperationResponse] HTTP response information. + # + def enable_custom_https_with_http_info(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) + enable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers).value! + end + + # + # Enable https delivery of the custom domain. + # + # @param resource_group_name [String] Name of the Resource group within the + # Azure subscription. + # @param profile_name [String] Name of the CDN profile which is unique within + # the resource group. + # @param endpoint_name [String] Name of the endpoint under the profile which is + # unique globally. + # @param custom_domain_name [String] Name of the custom domain within an + # endpoint. + # @param [Hash{String => String}] A hash of custom headers that will be added + # to the HTTP request. + # + # @return [Concurrent::Promise] Promise object which holds the HTTP response. + # + def enable_custom_https_async(resource_group_name, profile_name, endpoint_name, custom_domain_name, custom_headers = nil) + fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil? + fail ArgumentError, 'profile_name is nil' if profile_name.nil? + fail ArgumentError, 'endpoint_name is nil' if endpoint_name.nil? + fail ArgumentError, 'custom_domain_name is nil' if custom_domain_name.nil? + fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil? + fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil? + + + request_headers = {} + + # Set Headers + request_headers['x-ms-client-request-id'] = SecureRandom.uuid + request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil? + path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/enableCustomHttps' + + request_url = @base_url || @client.base_url + + options = { + middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]], + path_params: {'resourceGroupName' => resource_group_name,'profileName' => profile_name,'endpointName' => endpoint_name,'customDomainName' => custom_domain_name,'subscriptionId' => @client.subscription_id}, + query_params: {'api-version' => @client.api_version}, + headers: request_headers.merge(custom_headers || {}), + base_url: request_url + } + promise = @client.make_request_async(:post, path_template, options) + + promise = promise.then do |result| + http_response = result.response + status_code = http_response.status + response_content = http_response.body + unless status_code == 202 || status_code == 200 + error_model = JSON.load(response_content) + fail MsRest::HttpOperationError.new(result.request, http_response, error_model) + end + + result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil? + # Deserialize Response + if status_code == 202 + begin + parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content) + result_mapper = CustomDomain.mapper() + result.body = @client.deserialize(result_mapper, parsed_response, 'result.body') + rescue Exception => e + fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result) + end + end + + result + end + + promise.execute + end + # # Creates a new custom domain within an endpoint. # diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/custom_domain.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/custom_domain.rb index 5d688cf84c..2b8b4c4f51 100644 --- a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/custom_domain.rb +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/custom_domain.rb @@ -20,6 +20,11 @@ class CustomDomain < MsRestAzure::Resource # domain. Possible values include: 'Creating', 'Active', 'Deleting' attr_accessor :resource_state + # @return [CustomHttpsProvisioningState] Provisioning state of Custom + # Https of the custom domain. Possible values include: 'Enabling', + # 'Enabled', 'Disabling', 'Disabled', 'Failed' + attr_accessor :custom_https_provisioning_state + # @return [String] Special validation or data may be required when # delivering CDN to some regions due to local compliance reasons. E.g. # ICP license number of a custom domain is required to deliver content in @@ -102,6 +107,14 @@ def self.mapper() name: 'String' } }, + custom_https_provisioning_state: { + required: false, + read_only: true, + serialized_name: 'properties.customHttpsProvisioningState', + type: { + name: 'String' + } + }, validation_data: { required: false, serialized_name: 'properties.validationData', diff --git a/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/custom_https_provisioning_state.rb b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/custom_https_provisioning_state.rb new file mode 100644 index 0000000000..b5fcfb1dca --- /dev/null +++ b/management/azure_mgmt_cdn/lib/generated/azure_mgmt_cdn/models/custom_https_provisioning_state.rb @@ -0,0 +1,19 @@ +# encoding: utf-8 +# Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0 +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. + +module Azure::ARM::CDN + module Models + # + # Defines values for CustomHttpsProvisioningState + # + module CustomHttpsProvisioningState + Enabling = "Enabling" + Enabled = "Enabled" + Disabling = "Disabling" + Disabled = "Disabled" + Failed = "Failed" + end + end +end