azure_mgmt_web 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/LICENSE.txt +21 -0
- data/Rakefile +5 -0
- data/azure_mgmt_web.gemspec +35 -0
- data/lib/azure_mgmt_web.rb +236 -0
- data/lib/azure_mgmt_web/certificates.rb +693 -0
- data/lib/azure_mgmt_web/classic_mobile_services.rb +208 -0
- data/lib/azure_mgmt_web/domains.rb +459 -0
- data/lib/azure_mgmt_web/global.rb +793 -0
- data/lib/azure_mgmt_web/global_domain_registration.rb +351 -0
- data/lib/azure_mgmt_web/global_resource_groups.rb +91 -0
- data/lib/azure_mgmt_web/hosting_environments.rb +2629 -0
- data/lib/azure_mgmt_web/managed_hosting_environments.rb +652 -0
- data/lib/azure_mgmt_web/models/access_control_entry_action.rb +16 -0
- data/lib/azure_mgmt_web/models/address.rb +101 -0
- data/lib/azure_mgmt_web/models/address_response.rb +105 -0
- data/lib/azure_mgmt_web/models/api_definition_info.rb +56 -0
- data/lib/azure_mgmt_web/models/application_logs_config.rb +97 -0
- data/lib/azure_mgmt_web/models/arm_plan.rb +92 -0
- data/lib/azure_mgmt_web/models/auto_heal_action_type.rb +17 -0
- data/lib/azure_mgmt_web/models/auto_heal_actions.rb +89 -0
- data/lib/azure_mgmt_web/models/auto_heal_custom_action.rb +66 -0
- data/lib/azure_mgmt_web/models/auto_heal_rules.rb +80 -0
- data/lib/azure_mgmt_web/models/auto_heal_triggers.rb +122 -0
- data/lib/azure_mgmt_web/models/azure_blob_storage_application_logs_config.rb +82 -0
- data/lib/azure_mgmt_web/models/azure_blob_storage_http_logs_config.rb +78 -0
- data/lib/azure_mgmt_web/models/azure_resource_type.rb +16 -0
- data/lib/azure_mgmt_web/models/azure_table_storage_application_logs_config.rb +70 -0
- data/lib/azure_mgmt_web/models/backup_item.rb +92 -0
- data/lib/azure_mgmt_web/models/backup_item_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/backup_item_properties.rb +215 -0
- data/lib/azure_mgmt_web/models/backup_item_status.rb +24 -0
- data/lib/azure_mgmt_web/models/backup_request.rb +92 -0
- data/lib/azure_mgmt_web/models/backup_request_properties.rb +136 -0
- data/lib/azure_mgmt_web/models/backup_restore_operation_type.rb +17 -0
- data/lib/azure_mgmt_web/models/backup_schedule.rb +118 -0
- data/lib/azure_mgmt_web/models/built_in_authentication_provider.rb +19 -0
- data/lib/azure_mgmt_web/models/certificate.rb +92 -0
- data/lib/azure_mgmt_web/models/certificate_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/certificate_properties.rb +194 -0
- data/lib/azure_mgmt_web/models/channels.rb +18 -0
- data/lib/azure_mgmt_web/models/classic_mobile_service.rb +92 -0
- data/lib/azure_mgmt_web/models/classic_mobile_service_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/classic_mobile_service_properties.rb +56 -0
- data/lib/azure_mgmt_web/models/clone_ability_result.rb +17 -0
- data/lib/azure_mgmt_web/models/cloning_info.rb +152 -0
- data/lib/azure_mgmt_web/models/compute_mode_options.rb +16 -0
- data/lib/azure_mgmt_web/models/conn_string_info.rb +79 -0
- data/lib/azure_mgmt_web/models/conn_string_value_type_pair.rb +70 -0
- data/lib/azure_mgmt_web/models/connection_string_dictionary.rb +102 -0
- data/lib/azure_mgmt_web/models/contact.rb +136 -0
- data/lib/azure_mgmt_web/models/cors_settings.rb +59 -0
- data/lib/azure_mgmt_web/models/csm_move_resource_envelope.rb +66 -0
- data/lib/azure_mgmt_web/models/csm_publishing_profile_options.rb +59 -0
- data/lib/azure_mgmt_web/models/csm_site_recovery_entity.rb +80 -0
- data/lib/azure_mgmt_web/models/csm_slot_entity.rb +67 -0
- data/lib/azure_mgmt_web/models/csm_usage_quota.rb +102 -0
- data/lib/azure_mgmt_web/models/csm_usage_quota_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/csr.rb +92 -0
- data/lib/azure_mgmt_web/models/csr_properties.rb +110 -0
- data/lib/azure_mgmt_web/models/custom_host_name_dns_record_type.rb +16 -0
- data/lib/azure_mgmt_web/models/database_backup_setting.rb +91 -0
- data/lib/azure_mgmt_web/models/database_server_type.rb +18 -0
- data/lib/azure_mgmt_web/models/deleted_site.rb +92 -0
- data/lib/azure_mgmt_web/models/deleted_site_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/deleted_site_properties.rb +365 -0
- data/lib/azure_mgmt_web/models/deployment.rb +92 -0
- data/lib/azure_mgmt_web/models/deployment_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/deployment_properties.rb +142 -0
- data/lib/azure_mgmt_web/models/domain.rb +92 -0
- data/lib/azure_mgmt_web/models/domain_availablility_check_result.rb +79 -0
- data/lib/azure_mgmt_web/models/domain_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/domain_control_center_sso_request.rb +75 -0
- data/lib/azure_mgmt_web/models/domain_properties.rb +262 -0
- data/lib/azure_mgmt_web/models/domain_purchase_consent.rb +79 -0
- data/lib/azure_mgmt_web/models/domain_recommendation_search_parameters.rb +67 -0
- data/lib/azure_mgmt_web/models/domain_registration_input.rb +92 -0
- data/lib/azure_mgmt_web/models/domain_registration_input_properties.rb +271 -0
- data/lib/azure_mgmt_web/models/domain_status.rb +35 -0
- data/lib/azure_mgmt_web/models/domain_type.rb +16 -0
- data/lib/azure_mgmt_web/models/enabled_config.rb +56 -0
- data/lib/azure_mgmt_web/models/experiments.rb +77 -0
- data/lib/azure_mgmt_web/models/file_system_application_logs_config.rb +60 -0
- data/lib/azure_mgmt_web/models/file_system_http_logs_config.rb +82 -0
- data/lib/azure_mgmt_web/models/frequency_unit.rb +16 -0
- data/lib/azure_mgmt_web/models/geo_region.rb +92 -0
- data/lib/azure_mgmt_web/models/geo_region_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/geo_region_properties.rb +74 -0
- data/lib/azure_mgmt_web/models/handler_mapping.rb +79 -0
- data/lib/azure_mgmt_web/models/host_name.rb +120 -0
- data/lib/azure_mgmt_web/models/host_name_binding.rb +92 -0
- data/lib/azure_mgmt_web/models/host_name_binding_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/host_name_binding_properties.rb +124 -0
- data/lib/azure_mgmt_web/models/host_name_ssl_state.rb +98 -0
- data/lib/azure_mgmt_web/models/host_name_type.rb +16 -0
- data/lib/azure_mgmt_web/models/hosting_environment.rb +92 -0
- data/lib/azure_mgmt_web/models/hosting_environment_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/hosting_environment_diagnostics.rb +65 -0
- data/lib/azure_mgmt_web/models/hosting_environment_profile.rb +78 -0
- data/lib/azure_mgmt_web/models/hosting_environment_properties.rb +452 -0
- data/lib/azure_mgmt_web/models/hosting_environment_status.rb +18 -0
- data/lib/azure_mgmt_web/models/http_logs_config.rb +80 -0
- data/lib/azure_mgmt_web/models/internal_load_balancing_mode.rb +17 -0
- data/lib/azure_mgmt_web/models/key_value_pair_string_string.rb +65 -0
- data/lib/azure_mgmt_web/models/localizable_string.rb +65 -0
- data/lib/azure_mgmt_web/models/log_level.rb +19 -0
- data/lib/azure_mgmt_web/models/managed_hosting_environment.rb +92 -0
- data/lib/azure_mgmt_web/models/managed_hosting_environment_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/managed_hosting_environment_properties.rb +179 -0
- data/lib/azure_mgmt_web/models/managed_hosting_environment_status.rb +17 -0
- data/lib/azure_mgmt_web/models/managed_pipeline_mode.rb +16 -0
- data/lib/azure_mgmt_web/models/metric_availabilily.rb +66 -0
- data/lib/azure_mgmt_web/models/metric_definition.rb +92 -0
- data/lib/azure_mgmt_web/models/metric_definition_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/metric_definition_properties.rb +113 -0
- data/lib/azure_mgmt_web/models/name_identifier.rb +56 -0
- data/lib/azure_mgmt_web/models/name_identifier_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/name_value_pair.rb +65 -0
- data/lib/azure_mgmt_web/models/network_access_control_entry.rb +88 -0
- data/lib/azure_mgmt_web/models/network_features.rb +94 -0
- data/lib/azure_mgmt_web/models/network_features_properties.rb +102 -0
- data/lib/azure_mgmt_web/models/notification_level.rb +18 -0
- data/lib/azure_mgmt_web/models/premier_add_on_request.rb +107 -0
- data/lib/azure_mgmt_web/models/provisioning_state.rb +19 -0
- data/lib/azure_mgmt_web/models/ramp_up_rule.rb +147 -0
- data/lib/azure_mgmt_web/models/recommendation.rb +210 -0
- data/lib/azure_mgmt_web/models/recommendation_rule.rb +146 -0
- data/lib/azure_mgmt_web/models/relay_service_connection_entity.rb +92 -0
- data/lib/azure_mgmt_web/models/relay_service_connection_entity_properties.rb +111 -0
- data/lib/azure_mgmt_web/models/requests_based_trigger.rb +66 -0
- data/lib/azure_mgmt_web/models/resource_metric.rb +171 -0
- data/lib/azure_mgmt_web/models/resource_metric_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/resource_metric_name.rb +65 -0
- data/lib/azure_mgmt_web/models/resource_metric_value.rb +106 -0
- data/lib/azure_mgmt_web/models/resource_name_availability.rb +78 -0
- data/lib/azure_mgmt_web/models/resource_name_availability_request.rb +74 -0
- data/lib/azure_mgmt_web/models/restore_request.rb +92 -0
- data/lib/azure_mgmt_web/models/restore_request_properties.rb +162 -0
- data/lib/azure_mgmt_web/models/restore_response.rb +92 -0
- data/lib/azure_mgmt_web/models/restore_response_properties.rb +57 -0
- data/lib/azure_mgmt_web/models/routing_rule.rb +58 -0
- data/lib/azure_mgmt_web/models/server_farm_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/server_farm_with_rich_sku.rb +108 -0
- data/lib/azure_mgmt_web/models/server_farm_with_rich_sku_properties.rb +164 -0
- data/lib/azure_mgmt_web/models/site.rb +92 -0
- data/lib/azure_mgmt_web/models/site_auth_settings.rb +379 -0
- data/lib/azure_mgmt_web/models/site_availability_state.rb +17 -0
- data/lib/azure_mgmt_web/models/site_cloneability.rb +157 -0
- data/lib/azure_mgmt_web/models/site_cloneability_criterion.rb +65 -0
- data/lib/azure_mgmt_web/models/site_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/site_config.rb +92 -0
- data/lib/azure_mgmt_web/models/site_config_properties.rb +554 -0
- data/lib/azure_mgmt_web/models/site_instance.rb +92 -0
- data/lib/azure_mgmt_web/models/site_instance_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/site_instance_properties.rb +56 -0
- data/lib/azure_mgmt_web/models/site_limits.rb +77 -0
- data/lib/azure_mgmt_web/models/site_load_balancing.rb +19 -0
- data/lib/azure_mgmt_web/models/site_logs_config.rb +92 -0
- data/lib/azure_mgmt_web/models/site_logs_config_properties.rb +110 -0
- data/lib/azure_mgmt_web/models/site_properties.rb +354 -0
- data/lib/azure_mgmt_web/models/site_source_control.rb +92 -0
- data/lib/azure_mgmt_web/models/site_source_control_properties.rb +92 -0
- data/lib/azure_mgmt_web/models/sku_capacity.rb +89 -0
- data/lib/azure_mgmt_web/models/sku_description.rb +93 -0
- data/lib/azure_mgmt_web/models/sku_info.rb +87 -0
- data/lib/azure_mgmt_web/models/sku_info_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/slot_config_names.rb +69 -0
- data/lib/azure_mgmt_web/models/slot_config_names_resource.rb +92 -0
- data/lib/azure_mgmt_web/models/slot_config_names_resource_properties.rb +66 -0
- data/lib/azure_mgmt_web/models/slot_difference.rb +93 -0
- data/lib/azure_mgmt_web/models/slot_difference_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/slot_difference_properties.rb +113 -0
- data/lib/azure_mgmt_web/models/slow_requests_based_trigger.rb +75 -0
- data/lib/azure_mgmt_web/models/source_control.rb +92 -0
- data/lib/azure_mgmt_web/models/source_control_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/source_control_properties.rb +94 -0
- data/lib/azure_mgmt_web/models/ssl_state.rb +17 -0
- data/lib/azure_mgmt_web/models/stamp_capacity.rb +155 -0
- data/lib/azure_mgmt_web/models/stamp_capacity_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/status_codes_based_trigger.rb +96 -0
- data/lib/azure_mgmt_web/models/status_options.rb +16 -0
- data/lib/azure_mgmt_web/models/string_dictionary.rb +86 -0
- data/lib/azure_mgmt_web/models/tld_legal_agreement.rb +83 -0
- data/lib/azure_mgmt_web/models/tld_legal_agreement_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/top_level_domain.rb +92 -0
- data/lib/azure_mgmt_web/models/top_level_domain_agreement_option.rb +57 -0
- data/lib/azure_mgmt_web/models/top_level_domain_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/top_level_domain_properties.rb +66 -0
- data/lib/azure_mgmt_web/models/unauthenticated_client_action.rb +16 -0
- data/lib/azure_mgmt_web/models/usage.rb +92 -0
- data/lib/azure_mgmt_web/models/usage_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/usage_properties.rb +136 -0
- data/lib/azure_mgmt_web/models/usage_state.rb +16 -0
- data/lib/azure_mgmt_web/models/user.rb +92 -0
- data/lib/azure_mgmt_web/models/user_properties.rb +74 -0
- data/lib/azure_mgmt_web/models/virtual_application.rb +103 -0
- data/lib/azure_mgmt_web/models/virtual_directory.rb +65 -0
- data/lib/azure_mgmt_web/models/virtual_ipmapping.rb +85 -0
- data/lib/azure_mgmt_web/models/virtual_network_profile.rb +83 -0
- data/lib/azure_mgmt_web/models/vnet_gateway.rb +93 -0
- data/lib/azure_mgmt_web/models/vnet_gateway_properties.rb +65 -0
- data/lib/azure_mgmt_web/models/vnet_info.rb +93 -0
- data/lib/azure_mgmt_web/models/vnet_info_properties.rb +106 -0
- data/lib/azure_mgmt_web/models/vnet_route.rb +92 -0
- data/lib/azure_mgmt_web/models/vnet_route_properties.rb +97 -0
- data/lib/azure_mgmt_web/models/worker_pool.rb +108 -0
- data/lib/azure_mgmt_web/models/worker_pool_collection.rb +85 -0
- data/lib/azure_mgmt_web/models/worker_pool_properties.rb +100 -0
- data/lib/azure_mgmt_web/models/worker_size_options.rb +18 -0
- data/lib/azure_mgmt_web/module_definition.rb +8 -0
- data/lib/azure_mgmt_web/provider.rb +346 -0
- data/lib/azure_mgmt_web/recommendations.rb +320 -0
- data/lib/azure_mgmt_web/server_farms.rb +1409 -0
- data/lib/azure_mgmt_web/sites.rb +11072 -0
- data/lib/azure_mgmt_web/top_level_domains.rb +226 -0
- data/lib/azure_mgmt_web/usage_operations.rb +88 -0
- data/lib/azure_mgmt_web/version.rb +8 -0
- data/lib/azure_mgmt_web/web_site_management_client.rb +118 -0
- metadata +346 -0
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
|
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
|
4
|
+
# regenerated.
|
|
5
|
+
|
|
6
|
+
module Azure::ARM::Web
|
|
7
|
+
#
|
|
8
|
+
# Use these APIs to manage Azure Websites resources through the Azure
|
|
9
|
+
# Resource Manager. All task operations conform to the HTTP/1.1 protocol
|
|
10
|
+
# specification and each operation returns an x-ms-request-id header that
|
|
11
|
+
# can be used to obtain information about the request. You must make sure
|
|
12
|
+
# that requests made to these resources are secure. For more information,
|
|
13
|
+
# see <a
|
|
14
|
+
# href="https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx">Authenticating
|
|
15
|
+
# Azure Resource Manager requests.</a>
|
|
16
|
+
#
|
|
17
|
+
class GlobalDomainRegistration
|
|
18
|
+
include Azure::ARM::Web::Models
|
|
19
|
+
include MsRestAzure
|
|
20
|
+
|
|
21
|
+
#
|
|
22
|
+
# Creates and initializes a new instance of the GlobalDomainRegistration class.
|
|
23
|
+
# @param client service class for accessing basic functionality.
|
|
24
|
+
#
|
|
25
|
+
def initialize(client)
|
|
26
|
+
@client = client
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# @return reference to the WebSiteManagementClient
|
|
30
|
+
attr_reader :client
|
|
31
|
+
|
|
32
|
+
#
|
|
33
|
+
# Lists all domains in a subscription
|
|
34
|
+
#
|
|
35
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
36
|
+
# applied to HTTP request.
|
|
37
|
+
#
|
|
38
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
39
|
+
# response.
|
|
40
|
+
#
|
|
41
|
+
def get_all_domains(custom_headers = nil)
|
|
42
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
43
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
44
|
+
request_headers = {}
|
|
45
|
+
|
|
46
|
+
# Set Headers
|
|
47
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
48
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
49
|
+
path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/domains'
|
|
50
|
+
options = {
|
|
51
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
52
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
|
53
|
+
query_params: {'api-version' => @client.api_version},
|
|
54
|
+
headers: request_headers.merge(custom_headers || {})
|
|
55
|
+
}
|
|
56
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
57
|
+
promise = request.run_promise do |req|
|
|
58
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
promise = promise.then do |http_response|
|
|
62
|
+
status_code = http_response.status
|
|
63
|
+
response_content = http_response.body
|
|
64
|
+
unless status_code == 200
|
|
65
|
+
error_model = JSON.load(response_content)
|
|
66
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# Create Result
|
|
70
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
71
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
72
|
+
# Deserialize Response
|
|
73
|
+
if status_code == 200
|
|
74
|
+
begin
|
|
75
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
76
|
+
unless parsed_response.nil?
|
|
77
|
+
parsed_response = DomainCollection.deserialize_object(parsed_response)
|
|
78
|
+
end
|
|
79
|
+
result.body = parsed_response
|
|
80
|
+
rescue Exception => e
|
|
81
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
result
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
promise.execute
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
#
|
|
92
|
+
# Generates a single sign on request for domain management portal
|
|
93
|
+
#
|
|
94
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
95
|
+
# applied to HTTP request.
|
|
96
|
+
#
|
|
97
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
98
|
+
# response.
|
|
99
|
+
#
|
|
100
|
+
def get_domain_control_center_sso_request(custom_headers = nil)
|
|
101
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
102
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
103
|
+
request_headers = {}
|
|
104
|
+
|
|
105
|
+
# Set Headers
|
|
106
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
107
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
108
|
+
path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/generateSsoRequest'
|
|
109
|
+
options = {
|
|
110
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
111
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
|
112
|
+
query_params: {'api-version' => @client.api_version},
|
|
113
|
+
headers: request_headers.merge(custom_headers || {})
|
|
114
|
+
}
|
|
115
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
|
|
116
|
+
promise = request.run_promise do |req|
|
|
117
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
promise = promise.then do |http_response|
|
|
121
|
+
status_code = http_response.status
|
|
122
|
+
response_content = http_response.body
|
|
123
|
+
unless status_code == 200
|
|
124
|
+
error_model = JSON.load(response_content)
|
|
125
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Create Result
|
|
129
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
130
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
131
|
+
# Deserialize Response
|
|
132
|
+
if status_code == 200
|
|
133
|
+
begin
|
|
134
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
135
|
+
unless parsed_response.nil?
|
|
136
|
+
parsed_response = DomainControlCenterSsoRequest.deserialize_object(parsed_response)
|
|
137
|
+
end
|
|
138
|
+
result.body = parsed_response
|
|
139
|
+
rescue Exception => e
|
|
140
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
result
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
promise.execute
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
#
|
|
151
|
+
# Validates domain registration information
|
|
152
|
+
#
|
|
153
|
+
# @param domain_registration_input [DomainRegistrationInput] Domain
|
|
154
|
+
# registration information
|
|
155
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
156
|
+
# applied to HTTP request.
|
|
157
|
+
#
|
|
158
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
159
|
+
# response.
|
|
160
|
+
#
|
|
161
|
+
def validate_domain_purchase_information(domain_registration_input, custom_headers = nil)
|
|
162
|
+
fail ArgumentError, 'domain_registration_input is nil' if domain_registration_input.nil?
|
|
163
|
+
domain_registration_input.validate unless domain_registration_input.nil?
|
|
164
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
165
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
166
|
+
request_headers = {}
|
|
167
|
+
|
|
168
|
+
# Set Headers
|
|
169
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
170
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
171
|
+
|
|
172
|
+
# Serialize Request
|
|
173
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
174
|
+
unless domain_registration_input.nil?
|
|
175
|
+
domain_registration_input = DomainRegistrationInput.serialize_object(domain_registration_input)
|
|
176
|
+
end
|
|
177
|
+
request_content = JSON.generate(domain_registration_input, quirks_mode: true)
|
|
178
|
+
path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/validateDomainRegistrationInformation'
|
|
179
|
+
options = {
|
|
180
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
181
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
|
182
|
+
query_params: {'api-version' => @client.api_version},
|
|
183
|
+
body: request_content,
|
|
184
|
+
headers: request_headers.merge(custom_headers || {})
|
|
185
|
+
}
|
|
186
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
|
|
187
|
+
promise = request.run_promise do |req|
|
|
188
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
promise = promise.then do |http_response|
|
|
192
|
+
status_code = http_response.status
|
|
193
|
+
response_content = http_response.body
|
|
194
|
+
unless status_code == 200
|
|
195
|
+
error_model = JSON.load(response_content)
|
|
196
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Create Result
|
|
200
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
201
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
202
|
+
|
|
203
|
+
result
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
promise.execute
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
#
|
|
210
|
+
# Checks if a domain is available for registration
|
|
211
|
+
#
|
|
212
|
+
# @param identifier [NameIdentifier] Name of the domain
|
|
213
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
214
|
+
# applied to HTTP request.
|
|
215
|
+
#
|
|
216
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
217
|
+
# response.
|
|
218
|
+
#
|
|
219
|
+
def check_domain_availability(identifier, custom_headers = nil)
|
|
220
|
+
fail ArgumentError, 'identifier is nil' if identifier.nil?
|
|
221
|
+
identifier.validate unless identifier.nil?
|
|
222
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
223
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
224
|
+
request_headers = {}
|
|
225
|
+
|
|
226
|
+
# Set Headers
|
|
227
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
228
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
229
|
+
|
|
230
|
+
# Serialize Request
|
|
231
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
232
|
+
unless identifier.nil?
|
|
233
|
+
identifier = NameIdentifier.serialize_object(identifier)
|
|
234
|
+
end
|
|
235
|
+
request_content = JSON.generate(identifier, quirks_mode: true)
|
|
236
|
+
path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability'
|
|
237
|
+
options = {
|
|
238
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
239
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
|
240
|
+
query_params: {'api-version' => @client.api_version},
|
|
241
|
+
body: request_content,
|
|
242
|
+
headers: request_headers.merge(custom_headers || {})
|
|
243
|
+
}
|
|
244
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
|
|
245
|
+
promise = request.run_promise do |req|
|
|
246
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
247
|
+
end
|
|
248
|
+
|
|
249
|
+
promise = promise.then do |http_response|
|
|
250
|
+
status_code = http_response.status
|
|
251
|
+
response_content = http_response.body
|
|
252
|
+
unless status_code == 200
|
|
253
|
+
error_model = JSON.load(response_content)
|
|
254
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
# Create Result
|
|
258
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
259
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
260
|
+
# Deserialize Response
|
|
261
|
+
if status_code == 200
|
|
262
|
+
begin
|
|
263
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
264
|
+
unless parsed_response.nil?
|
|
265
|
+
parsed_response = DomainAvailablilityCheckResult.deserialize_object(parsed_response)
|
|
266
|
+
end
|
|
267
|
+
result.body = parsed_response
|
|
268
|
+
rescue Exception => e
|
|
269
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
270
|
+
end
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
result
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
promise.execute
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
#
|
|
280
|
+
# Lists domain recommendations based on keywords
|
|
281
|
+
#
|
|
282
|
+
# @param parameters [DomainRecommendationSearchParameters] Domain
|
|
283
|
+
# recommendation search parameters
|
|
284
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
285
|
+
# applied to HTTP request.
|
|
286
|
+
#
|
|
287
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
288
|
+
# response.
|
|
289
|
+
#
|
|
290
|
+
def list_domain_recommendations(parameters, custom_headers = nil)
|
|
291
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
|
292
|
+
parameters.validate unless parameters.nil?
|
|
293
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
294
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
295
|
+
request_headers = {}
|
|
296
|
+
|
|
297
|
+
# Set Headers
|
|
298
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
299
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
300
|
+
|
|
301
|
+
# Serialize Request
|
|
302
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
303
|
+
unless parameters.nil?
|
|
304
|
+
parameters = DomainRecommendationSearchParameters.serialize_object(parameters)
|
|
305
|
+
end
|
|
306
|
+
request_content = JSON.generate(parameters, quirks_mode: true)
|
|
307
|
+
path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations'
|
|
308
|
+
options = {
|
|
309
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
310
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
|
311
|
+
query_params: {'api-version' => @client.api_version},
|
|
312
|
+
body: request_content,
|
|
313
|
+
headers: request_headers.merge(custom_headers || {})
|
|
314
|
+
}
|
|
315
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
|
|
316
|
+
promise = request.run_promise do |req|
|
|
317
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
promise = promise.then do |http_response|
|
|
321
|
+
status_code = http_response.status
|
|
322
|
+
response_content = http_response.body
|
|
323
|
+
unless status_code == 200
|
|
324
|
+
error_model = JSON.load(response_content)
|
|
325
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
# Create Result
|
|
329
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
330
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
331
|
+
# Deserialize Response
|
|
332
|
+
if status_code == 200
|
|
333
|
+
begin
|
|
334
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
335
|
+
unless parsed_response.nil?
|
|
336
|
+
parsed_response = NameIdentifierCollection.deserialize_object(parsed_response)
|
|
337
|
+
end
|
|
338
|
+
result.body = parsed_response
|
|
339
|
+
rescue Exception => e
|
|
340
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
341
|
+
end
|
|
342
|
+
end
|
|
343
|
+
|
|
344
|
+
result
|
|
345
|
+
end
|
|
346
|
+
|
|
347
|
+
promise.execute
|
|
348
|
+
end
|
|
349
|
+
|
|
350
|
+
end
|
|
351
|
+
end
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
|
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
|
4
|
+
# regenerated.
|
|
5
|
+
|
|
6
|
+
module Azure::ARM::Web
|
|
7
|
+
#
|
|
8
|
+
# Use these APIs to manage Azure Websites resources through the Azure
|
|
9
|
+
# Resource Manager. All task operations conform to the HTTP/1.1 protocol
|
|
10
|
+
# specification and each operation returns an x-ms-request-id header that
|
|
11
|
+
# can be used to obtain information about the request. You must make sure
|
|
12
|
+
# that requests made to these resources are secure. For more information,
|
|
13
|
+
# see <a
|
|
14
|
+
# href="https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx">Authenticating
|
|
15
|
+
# Azure Resource Manager requests.</a>
|
|
16
|
+
#
|
|
17
|
+
class GlobalResourceGroups
|
|
18
|
+
include Azure::ARM::Web::Models
|
|
19
|
+
include MsRestAzure
|
|
20
|
+
|
|
21
|
+
#
|
|
22
|
+
# Creates and initializes a new instance of the GlobalResourceGroups class.
|
|
23
|
+
# @param client service class for accessing basic functionality.
|
|
24
|
+
#
|
|
25
|
+
def initialize(client)
|
|
26
|
+
@client = client
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# @return reference to the WebSiteManagementClient
|
|
30
|
+
attr_reader :client
|
|
31
|
+
|
|
32
|
+
#
|
|
33
|
+
# @param resource_group_name [String]
|
|
34
|
+
# @param move_resource_envelope [CsmMoveResourceEnvelope]
|
|
35
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
36
|
+
# applied to HTTP request.
|
|
37
|
+
#
|
|
38
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
39
|
+
# response.
|
|
40
|
+
#
|
|
41
|
+
def move_resources(resource_group_name, move_resource_envelope, custom_headers = nil)
|
|
42
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
43
|
+
fail ArgumentError, 'move_resource_envelope is nil' if move_resource_envelope.nil?
|
|
44
|
+
move_resource_envelope.validate unless move_resource_envelope.nil?
|
|
45
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
46
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
47
|
+
request_headers = {}
|
|
48
|
+
|
|
49
|
+
# Set Headers
|
|
50
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
51
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
52
|
+
|
|
53
|
+
# Serialize Request
|
|
54
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
55
|
+
unless move_resource_envelope.nil?
|
|
56
|
+
move_resource_envelope = CsmMoveResourceEnvelope.serialize_object(move_resource_envelope)
|
|
57
|
+
end
|
|
58
|
+
request_content = JSON.generate(move_resource_envelope, quirks_mode: true)
|
|
59
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources'
|
|
60
|
+
options = {
|
|
61
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
62
|
+
path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
|
|
63
|
+
query_params: {'api-version' => @client.api_version},
|
|
64
|
+
body: request_content,
|
|
65
|
+
headers: request_headers.merge(custom_headers || {})
|
|
66
|
+
}
|
|
67
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
|
|
68
|
+
promise = request.run_promise do |req|
|
|
69
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
promise = promise.then do |http_response|
|
|
73
|
+
status_code = http_response.status
|
|
74
|
+
response_content = http_response.body
|
|
75
|
+
unless status_code == 204
|
|
76
|
+
error_model = JSON.load(response_content)
|
|
77
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
# Create Result
|
|
81
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
82
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
83
|
+
|
|
84
|
+
result
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
promise.execute
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
end
|
|
91
|
+
end
|
|
@@ -0,0 +1,2629 @@
|
|
|
1
|
+
# encoding: utf-8
|
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
|
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
|
4
|
+
# regenerated.
|
|
5
|
+
|
|
6
|
+
module Azure::ARM::Web
|
|
7
|
+
#
|
|
8
|
+
# Use these APIs to manage Azure Websites resources through the Azure
|
|
9
|
+
# Resource Manager. All task operations conform to the HTTP/1.1 protocol
|
|
10
|
+
# specification and each operation returns an x-ms-request-id header that
|
|
11
|
+
# can be used to obtain information about the request. You must make sure
|
|
12
|
+
# that requests made to these resources are secure. For more information,
|
|
13
|
+
# see <a
|
|
14
|
+
# href="https://msdn.microsoft.com/en-us/library/azure/dn790557.aspx">Authenticating
|
|
15
|
+
# Azure Resource Manager requests.</a>
|
|
16
|
+
#
|
|
17
|
+
class HostingEnvironments
|
|
18
|
+
include Azure::ARM::Web::Models
|
|
19
|
+
include MsRestAzure
|
|
20
|
+
|
|
21
|
+
#
|
|
22
|
+
# Creates and initializes a new instance of the HostingEnvironments class.
|
|
23
|
+
# @param client service class for accessing basic functionality.
|
|
24
|
+
#
|
|
25
|
+
def initialize(client)
|
|
26
|
+
@client = client
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
# @return reference to the WebSiteManagementClient
|
|
30
|
+
attr_reader :client
|
|
31
|
+
|
|
32
|
+
#
|
|
33
|
+
# Get properties of hostingEnvironment (App Service Environment).
|
|
34
|
+
#
|
|
35
|
+
# @param resource_group_name [String] Name of resource group
|
|
36
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
37
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
38
|
+
# applied to HTTP request.
|
|
39
|
+
#
|
|
40
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
41
|
+
# response.
|
|
42
|
+
#
|
|
43
|
+
def get_hosting_environment(resource_group_name, name, custom_headers = nil)
|
|
44
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
45
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
46
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
47
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
48
|
+
request_headers = {}
|
|
49
|
+
|
|
50
|
+
# Set Headers
|
|
51
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
52
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
53
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'
|
|
54
|
+
options = {
|
|
55
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
56
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
57
|
+
query_params: {'api-version' => @client.api_version},
|
|
58
|
+
headers: request_headers.merge(custom_headers || {})
|
|
59
|
+
}
|
|
60
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
61
|
+
promise = request.run_promise do |req|
|
|
62
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
promise = promise.then do |http_response|
|
|
66
|
+
status_code = http_response.status
|
|
67
|
+
response_content = http_response.body
|
|
68
|
+
unless status_code == 200
|
|
69
|
+
error_model = JSON.load(response_content)
|
|
70
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Create Result
|
|
74
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
75
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
76
|
+
# Deserialize Response
|
|
77
|
+
if status_code == 200
|
|
78
|
+
begin
|
|
79
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
80
|
+
unless parsed_response.nil?
|
|
81
|
+
parsed_response = HostingEnvironment.deserialize_object(parsed_response)
|
|
82
|
+
end
|
|
83
|
+
result.body = parsed_response
|
|
84
|
+
rescue Exception => e
|
|
85
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
result
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
promise.execute
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
#
|
|
96
|
+
# Create or update a hostingEnvironment (App Service Environment).
|
|
97
|
+
#
|
|
98
|
+
# @param resource_group_name [String] Name of resource group
|
|
99
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
100
|
+
# @param hosting_environment_envelope [HostingEnvironment] Properties of
|
|
101
|
+
# hostingEnvironment (App Service Environment)
|
|
102
|
+
# @param @client.subscription_id [String] Subscription Id
|
|
103
|
+
# @param @client.api_version [String] API Version
|
|
104
|
+
# @param @client.accept_language [String] Gets or sets the preferred language
|
|
105
|
+
# for the response.
|
|
106
|
+
#
|
|
107
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
|
108
|
+
# response.
|
|
109
|
+
#
|
|
110
|
+
def create_or_update_hosting_environment(resource_group_name, name, hosting_environment_envelope, custom_headers = nil)
|
|
111
|
+
# Send request
|
|
112
|
+
promise = begin_create_or_update_hosting_environment(resource_group_name, name, hosting_environment_envelope, custom_headers)
|
|
113
|
+
|
|
114
|
+
promise = promise.then do |response|
|
|
115
|
+
# Defining deserialization method.
|
|
116
|
+
deserialize_method = lambda do |parsed_response|
|
|
117
|
+
unless parsed_response.nil?
|
|
118
|
+
parsed_response = HostingEnvironment.deserialize_object(parsed_response)
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Waiting for response.
|
|
123
|
+
@client.get_put_operation_result(response, deserialize_method)
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
promise
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
#
|
|
130
|
+
# Create or update a hostingEnvironment (App Service Environment).
|
|
131
|
+
#
|
|
132
|
+
# @param resource_group_name [String] Name of resource group
|
|
133
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
134
|
+
# @param hosting_environment_envelope [HostingEnvironment] Properties of
|
|
135
|
+
# hostingEnvironment (App Service Environment)
|
|
136
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
137
|
+
# applied to HTTP request.
|
|
138
|
+
#
|
|
139
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
140
|
+
# response.
|
|
141
|
+
#
|
|
142
|
+
def begin_create_or_update_hosting_environment(resource_group_name, name, hosting_environment_envelope, custom_headers = nil)
|
|
143
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
144
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
145
|
+
fail ArgumentError, 'hosting_environment_envelope is nil' if hosting_environment_envelope.nil?
|
|
146
|
+
hosting_environment_envelope.validate unless hosting_environment_envelope.nil?
|
|
147
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
148
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
149
|
+
request_headers = {}
|
|
150
|
+
|
|
151
|
+
# Set Headers
|
|
152
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
153
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
154
|
+
|
|
155
|
+
# Serialize Request
|
|
156
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
157
|
+
unless hosting_environment_envelope.nil?
|
|
158
|
+
hosting_environment_envelope = HostingEnvironment.serialize_object(hosting_environment_envelope)
|
|
159
|
+
end
|
|
160
|
+
request_content = JSON.generate(hosting_environment_envelope, quirks_mode: true)
|
|
161
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'
|
|
162
|
+
options = {
|
|
163
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
164
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
165
|
+
query_params: {'api-version' => @client.api_version},
|
|
166
|
+
body: request_content,
|
|
167
|
+
headers: request_headers.merge(custom_headers || {})
|
|
168
|
+
}
|
|
169
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :put, options)
|
|
170
|
+
promise = request.run_promise do |req|
|
|
171
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
promise = promise.then do |http_response|
|
|
175
|
+
status_code = http_response.status
|
|
176
|
+
response_content = http_response.body
|
|
177
|
+
unless status_code == 200 || status_code == 202 || status_code == 400 || status_code == 404 || status_code == 409
|
|
178
|
+
error_model = JSON.load(response_content)
|
|
179
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
# Create Result
|
|
183
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
184
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
185
|
+
# Deserialize Response
|
|
186
|
+
if status_code == 200
|
|
187
|
+
begin
|
|
188
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
189
|
+
unless parsed_response.nil?
|
|
190
|
+
parsed_response = HostingEnvironment.deserialize_object(parsed_response)
|
|
191
|
+
end
|
|
192
|
+
result.body = parsed_response
|
|
193
|
+
rescue Exception => e
|
|
194
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
195
|
+
end
|
|
196
|
+
end
|
|
197
|
+
# Deserialize Response
|
|
198
|
+
if status_code == 202
|
|
199
|
+
begin
|
|
200
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
201
|
+
unless parsed_response.nil?
|
|
202
|
+
parsed_response = HostingEnvironment.deserialize_object(parsed_response)
|
|
203
|
+
end
|
|
204
|
+
result.body = parsed_response
|
|
205
|
+
rescue Exception => e
|
|
206
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
207
|
+
end
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
result
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
promise.execute
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
#
|
|
217
|
+
# Delete a hostingEnvironment (App Service Environment).
|
|
218
|
+
#
|
|
219
|
+
# @param resource_group_name [String] Name of resource group
|
|
220
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
221
|
+
# @param force_delete [Boolean] Delete even if the hostingEnvironment (App
|
|
222
|
+
# Service Environment) contains resources
|
|
223
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
|
224
|
+
# response.
|
|
225
|
+
#
|
|
226
|
+
def delete_hosting_environment(resource_group_name, name, force_delete = nil, custom_headers = nil)
|
|
227
|
+
# Send request
|
|
228
|
+
promise = begin_delete_hosting_environment(resource_group_name, name, force_delete, custom_headers)
|
|
229
|
+
|
|
230
|
+
promise = promise.then do |response|
|
|
231
|
+
# Defining deserialization method.
|
|
232
|
+
deserialize_method = lambda do |parsed_response|
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Waiting for response.
|
|
236
|
+
@client.get_post_or_delete_operation_result(response, deserialize_method)
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
promise
|
|
240
|
+
end
|
|
241
|
+
|
|
242
|
+
#
|
|
243
|
+
# Delete a hostingEnvironment (App Service Environment).
|
|
244
|
+
#
|
|
245
|
+
# @param resource_group_name [String] Name of resource group
|
|
246
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
247
|
+
# @param force_delete [Boolean] Delete even if the hostingEnvironment (App
|
|
248
|
+
# Service Environment) contains resources
|
|
249
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
250
|
+
# applied to HTTP request.
|
|
251
|
+
#
|
|
252
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
253
|
+
# response.
|
|
254
|
+
#
|
|
255
|
+
def begin_delete_hosting_environment(resource_group_name, name, force_delete = nil, custom_headers = nil)
|
|
256
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
257
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
258
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
259
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
260
|
+
request_headers = {}
|
|
261
|
+
|
|
262
|
+
# Set Headers
|
|
263
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
264
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
265
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'
|
|
266
|
+
options = {
|
|
267
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
268
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
269
|
+
query_params: {'forceDelete' => force_delete,'api-version' => @client.api_version},
|
|
270
|
+
headers: request_headers.merge(custom_headers || {})
|
|
271
|
+
}
|
|
272
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :delete, options)
|
|
273
|
+
promise = request.run_promise do |req|
|
|
274
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
275
|
+
end
|
|
276
|
+
|
|
277
|
+
promise = promise.then do |http_response|
|
|
278
|
+
status_code = http_response.status
|
|
279
|
+
response_content = http_response.body
|
|
280
|
+
unless status_code == 200 || status_code == 202 || status_code == 400 || status_code == 404 || status_code == 409
|
|
281
|
+
error_model = JSON.load(response_content)
|
|
282
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
283
|
+
end
|
|
284
|
+
|
|
285
|
+
# Create Result
|
|
286
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
287
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
288
|
+
|
|
289
|
+
result
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
promise.execute
|
|
293
|
+
end
|
|
294
|
+
|
|
295
|
+
#
|
|
296
|
+
# Get diagnostic information for hostingEnvironment (App Service Environment).
|
|
297
|
+
#
|
|
298
|
+
# @param resource_group_name [String] Name of resource group
|
|
299
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
300
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
301
|
+
# applied to HTTP request.
|
|
302
|
+
#
|
|
303
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
304
|
+
# response.
|
|
305
|
+
#
|
|
306
|
+
def get_hosting_environment_diagnostics(resource_group_name, name, custom_headers = nil)
|
|
307
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
308
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
309
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
310
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
311
|
+
request_headers = {}
|
|
312
|
+
|
|
313
|
+
# Set Headers
|
|
314
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
315
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
316
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics'
|
|
317
|
+
options = {
|
|
318
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
319
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
320
|
+
query_params: {'api-version' => @client.api_version},
|
|
321
|
+
headers: request_headers.merge(custom_headers || {})
|
|
322
|
+
}
|
|
323
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
324
|
+
promise = request.run_promise do |req|
|
|
325
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
promise = promise.then do |http_response|
|
|
329
|
+
status_code = http_response.status
|
|
330
|
+
response_content = http_response.body
|
|
331
|
+
unless status_code == 200
|
|
332
|
+
error_model = JSON.load(response_content)
|
|
333
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
# Create Result
|
|
337
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
338
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
339
|
+
# Deserialize Response
|
|
340
|
+
if status_code == 200
|
|
341
|
+
begin
|
|
342
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
343
|
+
unless parsed_response.nil?
|
|
344
|
+
deserialized_array = []
|
|
345
|
+
parsed_response.each do |element|
|
|
346
|
+
unless element.nil?
|
|
347
|
+
element = HostingEnvironmentDiagnostics.deserialize_object(element)
|
|
348
|
+
end
|
|
349
|
+
deserialized_array.push(element)
|
|
350
|
+
end
|
|
351
|
+
parsed_response = deserialized_array
|
|
352
|
+
end
|
|
353
|
+
result.body = parsed_response
|
|
354
|
+
rescue Exception => e
|
|
355
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
356
|
+
end
|
|
357
|
+
end
|
|
358
|
+
|
|
359
|
+
result
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
promise.execute
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
#
|
|
366
|
+
# Get diagnostic information for hostingEnvironment (App Service Environment).
|
|
367
|
+
#
|
|
368
|
+
# @param resource_group_name [String] Name of resource group
|
|
369
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
370
|
+
# @param diagnostics_name [String] Name of the diagnostics
|
|
371
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
372
|
+
# applied to HTTP request.
|
|
373
|
+
#
|
|
374
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
375
|
+
# response.
|
|
376
|
+
#
|
|
377
|
+
def get_hosting_environment_diagnostics_item(resource_group_name, name, diagnostics_name, custom_headers = nil)
|
|
378
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
379
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
380
|
+
fail ArgumentError, 'diagnostics_name is nil' if diagnostics_name.nil?
|
|
381
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
382
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
383
|
+
request_headers = {}
|
|
384
|
+
|
|
385
|
+
# Set Headers
|
|
386
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
387
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
388
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}'
|
|
389
|
+
options = {
|
|
390
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
391
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'diagnosticsName' => diagnostics_name,'subscriptionId' => @client.subscription_id},
|
|
392
|
+
query_params: {'api-version' => @client.api_version},
|
|
393
|
+
headers: request_headers.merge(custom_headers || {})
|
|
394
|
+
}
|
|
395
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
396
|
+
promise = request.run_promise do |req|
|
|
397
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
promise = promise.then do |http_response|
|
|
401
|
+
status_code = http_response.status
|
|
402
|
+
response_content = http_response.body
|
|
403
|
+
unless status_code == 200
|
|
404
|
+
error_model = JSON.load(response_content)
|
|
405
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
406
|
+
end
|
|
407
|
+
|
|
408
|
+
# Create Result
|
|
409
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
410
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
411
|
+
# Deserialize Response
|
|
412
|
+
if status_code == 200
|
|
413
|
+
begin
|
|
414
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
415
|
+
unless parsed_response.nil?
|
|
416
|
+
parsed_response = HostingEnvironmentDiagnostics.deserialize_object(parsed_response)
|
|
417
|
+
end
|
|
418
|
+
result.body = parsed_response
|
|
419
|
+
rescue Exception => e
|
|
420
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
421
|
+
end
|
|
422
|
+
end
|
|
423
|
+
|
|
424
|
+
result
|
|
425
|
+
end
|
|
426
|
+
|
|
427
|
+
promise.execute
|
|
428
|
+
end
|
|
429
|
+
|
|
430
|
+
#
|
|
431
|
+
# Get used, available, and total worker capacity for hostingEnvironment (App
|
|
432
|
+
# Service Environment).
|
|
433
|
+
#
|
|
434
|
+
# @param resource_group_name [String] Name of resource group
|
|
435
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
436
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
437
|
+
# applied to HTTP request.
|
|
438
|
+
#
|
|
439
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
440
|
+
# response.
|
|
441
|
+
#
|
|
442
|
+
def get_hosting_environment_capacities(resource_group_name, name, custom_headers = nil)
|
|
443
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
444
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
445
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
446
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
447
|
+
request_headers = {}
|
|
448
|
+
|
|
449
|
+
# Set Headers
|
|
450
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
451
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
452
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/compute'
|
|
453
|
+
options = {
|
|
454
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
455
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
456
|
+
query_params: {'api-version' => @client.api_version},
|
|
457
|
+
headers: request_headers.merge(custom_headers || {})
|
|
458
|
+
}
|
|
459
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
460
|
+
promise = request.run_promise do |req|
|
|
461
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
462
|
+
end
|
|
463
|
+
|
|
464
|
+
promise = promise.then do |http_response|
|
|
465
|
+
status_code = http_response.status
|
|
466
|
+
response_content = http_response.body
|
|
467
|
+
unless status_code == 200
|
|
468
|
+
error_model = JSON.load(response_content)
|
|
469
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
470
|
+
end
|
|
471
|
+
|
|
472
|
+
# Create Result
|
|
473
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
474
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
475
|
+
# Deserialize Response
|
|
476
|
+
if status_code == 200
|
|
477
|
+
begin
|
|
478
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
479
|
+
unless parsed_response.nil?
|
|
480
|
+
parsed_response = StampCapacityCollection.deserialize_object(parsed_response)
|
|
481
|
+
end
|
|
482
|
+
result.body = parsed_response
|
|
483
|
+
rescue Exception => e
|
|
484
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
485
|
+
end
|
|
486
|
+
end
|
|
487
|
+
|
|
488
|
+
result
|
|
489
|
+
end
|
|
490
|
+
|
|
491
|
+
promise.execute
|
|
492
|
+
end
|
|
493
|
+
|
|
494
|
+
#
|
|
495
|
+
# Get IP addresses assigned to the hostingEnvironment (App Service
|
|
496
|
+
# Environment).
|
|
497
|
+
#
|
|
498
|
+
# @param resource_group_name [String] Name of resource group
|
|
499
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
500
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
501
|
+
# applied to HTTP request.
|
|
502
|
+
#
|
|
503
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
504
|
+
# response.
|
|
505
|
+
#
|
|
506
|
+
def get_hosting_environment_vips(resource_group_name, name, custom_headers = nil)
|
|
507
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
508
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
509
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
510
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
511
|
+
request_headers = {}
|
|
512
|
+
|
|
513
|
+
# Set Headers
|
|
514
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
515
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
516
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/virtualip'
|
|
517
|
+
options = {
|
|
518
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
519
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
520
|
+
query_params: {'api-version' => @client.api_version},
|
|
521
|
+
headers: request_headers.merge(custom_headers || {})
|
|
522
|
+
}
|
|
523
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
524
|
+
promise = request.run_promise do |req|
|
|
525
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
526
|
+
end
|
|
527
|
+
|
|
528
|
+
promise = promise.then do |http_response|
|
|
529
|
+
status_code = http_response.status
|
|
530
|
+
response_content = http_response.body
|
|
531
|
+
unless status_code == 200
|
|
532
|
+
error_model = JSON.load(response_content)
|
|
533
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
# Create Result
|
|
537
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
538
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
539
|
+
# Deserialize Response
|
|
540
|
+
if status_code == 200
|
|
541
|
+
begin
|
|
542
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
543
|
+
unless parsed_response.nil?
|
|
544
|
+
parsed_response = AddressResponse.deserialize_object(parsed_response)
|
|
545
|
+
end
|
|
546
|
+
result.body = parsed_response
|
|
547
|
+
rescue Exception => e
|
|
548
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
549
|
+
end
|
|
550
|
+
end
|
|
551
|
+
|
|
552
|
+
result
|
|
553
|
+
end
|
|
554
|
+
|
|
555
|
+
promise.execute
|
|
556
|
+
end
|
|
557
|
+
|
|
558
|
+
#
|
|
559
|
+
# Get all hostingEnvironments (App Service Environments) in a resource group.
|
|
560
|
+
#
|
|
561
|
+
# @param resource_group_name [String] Name of resource group
|
|
562
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
563
|
+
# applied to HTTP request.
|
|
564
|
+
#
|
|
565
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
566
|
+
# response.
|
|
567
|
+
#
|
|
568
|
+
def get_hosting_environments(resource_group_name, custom_headers = nil)
|
|
569
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
570
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
571
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
572
|
+
request_headers = {}
|
|
573
|
+
|
|
574
|
+
# Set Headers
|
|
575
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
576
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
577
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments'
|
|
578
|
+
options = {
|
|
579
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
580
|
+
path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
|
|
581
|
+
query_params: {'api-version' => @client.api_version},
|
|
582
|
+
headers: request_headers.merge(custom_headers || {})
|
|
583
|
+
}
|
|
584
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
585
|
+
promise = request.run_promise do |req|
|
|
586
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
587
|
+
end
|
|
588
|
+
|
|
589
|
+
promise = promise.then do |http_response|
|
|
590
|
+
status_code = http_response.status
|
|
591
|
+
response_content = http_response.body
|
|
592
|
+
unless status_code == 200
|
|
593
|
+
error_model = JSON.load(response_content)
|
|
594
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
595
|
+
end
|
|
596
|
+
|
|
597
|
+
# Create Result
|
|
598
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
599
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
600
|
+
# Deserialize Response
|
|
601
|
+
if status_code == 200
|
|
602
|
+
begin
|
|
603
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
604
|
+
unless parsed_response.nil?
|
|
605
|
+
parsed_response = HostingEnvironmentCollection.deserialize_object(parsed_response)
|
|
606
|
+
end
|
|
607
|
+
result.body = parsed_response
|
|
608
|
+
rescue Exception => e
|
|
609
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
610
|
+
end
|
|
611
|
+
end
|
|
612
|
+
|
|
613
|
+
result
|
|
614
|
+
end
|
|
615
|
+
|
|
616
|
+
promise.execute
|
|
617
|
+
end
|
|
618
|
+
|
|
619
|
+
#
|
|
620
|
+
# Reboots all machines in a hostingEnvironment (App Service Environment).
|
|
621
|
+
#
|
|
622
|
+
# @param resource_group_name [String] Name of resource group
|
|
623
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
624
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
625
|
+
# applied to HTTP request.
|
|
626
|
+
#
|
|
627
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
628
|
+
# response.
|
|
629
|
+
#
|
|
630
|
+
def reboot_hosting_environment(resource_group_name, name, custom_headers = nil)
|
|
631
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
632
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
633
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
634
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
635
|
+
request_headers = {}
|
|
636
|
+
|
|
637
|
+
# Set Headers
|
|
638
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
639
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
640
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot'
|
|
641
|
+
options = {
|
|
642
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
643
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
644
|
+
query_params: {'api-version' => @client.api_version},
|
|
645
|
+
headers: request_headers.merge(custom_headers || {})
|
|
646
|
+
}
|
|
647
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
|
|
648
|
+
promise = request.run_promise do |req|
|
|
649
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
650
|
+
end
|
|
651
|
+
|
|
652
|
+
promise = promise.then do |http_response|
|
|
653
|
+
status_code = http_response.status
|
|
654
|
+
response_content = http_response.body
|
|
655
|
+
unless status_code == 202 || status_code == 400 || status_code == 404 || status_code == 409
|
|
656
|
+
error_model = JSON.load(response_content)
|
|
657
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
658
|
+
end
|
|
659
|
+
|
|
660
|
+
# Create Result
|
|
661
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
662
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
663
|
+
|
|
664
|
+
result
|
|
665
|
+
end
|
|
666
|
+
|
|
667
|
+
promise.execute
|
|
668
|
+
end
|
|
669
|
+
|
|
670
|
+
#
|
|
671
|
+
# List all currently running operations on the hostingEnvironment (App Service
|
|
672
|
+
# Environment)
|
|
673
|
+
#
|
|
674
|
+
# @param resource_group_name [String] Name of resource group
|
|
675
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
676
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
677
|
+
# applied to HTTP request.
|
|
678
|
+
#
|
|
679
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
680
|
+
# response.
|
|
681
|
+
#
|
|
682
|
+
def get_hosting_environment_operations(resource_group_name, name, custom_headers = nil)
|
|
683
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
684
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
685
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
686
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
687
|
+
request_headers = {}
|
|
688
|
+
|
|
689
|
+
# Set Headers
|
|
690
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
691
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
692
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations'
|
|
693
|
+
options = {
|
|
694
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
695
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
696
|
+
query_params: {'api-version' => @client.api_version},
|
|
697
|
+
headers: request_headers.merge(custom_headers || {})
|
|
698
|
+
}
|
|
699
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
700
|
+
promise = request.run_promise do |req|
|
|
701
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
702
|
+
end
|
|
703
|
+
|
|
704
|
+
promise = promise.then do |http_response|
|
|
705
|
+
status_code = http_response.status
|
|
706
|
+
response_content = http_response.body
|
|
707
|
+
unless status_code == 200
|
|
708
|
+
error_model = JSON.load(response_content)
|
|
709
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
710
|
+
end
|
|
711
|
+
|
|
712
|
+
# Create Result
|
|
713
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
714
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
715
|
+
|
|
716
|
+
result
|
|
717
|
+
end
|
|
718
|
+
|
|
719
|
+
promise.execute
|
|
720
|
+
end
|
|
721
|
+
|
|
722
|
+
#
|
|
723
|
+
# Get status of an operation on a hostingEnvironment (App Service Environment).
|
|
724
|
+
#
|
|
725
|
+
# @param resource_group_name [String] Name of resource group
|
|
726
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
727
|
+
# @param operation_id [String] operation identifier GUID
|
|
728
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
729
|
+
# applied to HTTP request.
|
|
730
|
+
#
|
|
731
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
732
|
+
# response.
|
|
733
|
+
#
|
|
734
|
+
def get_hosting_environment_operation(resource_group_name, name, operation_id, custom_headers = nil)
|
|
735
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
736
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
737
|
+
fail ArgumentError, 'operation_id is nil' if operation_id.nil?
|
|
738
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
739
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
740
|
+
request_headers = {}
|
|
741
|
+
|
|
742
|
+
# Set Headers
|
|
743
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
744
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
745
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations/{operationId}'
|
|
746
|
+
options = {
|
|
747
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
748
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'operationId' => operation_id,'subscriptionId' => @client.subscription_id},
|
|
749
|
+
query_params: {'api-version' => @client.api_version},
|
|
750
|
+
headers: request_headers.merge(custom_headers || {})
|
|
751
|
+
}
|
|
752
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
753
|
+
promise = request.run_promise do |req|
|
|
754
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
755
|
+
end
|
|
756
|
+
|
|
757
|
+
promise = promise.then do |http_response|
|
|
758
|
+
status_code = http_response.status
|
|
759
|
+
response_content = http_response.body
|
|
760
|
+
unless status_code == 200 || status_code == 202 || status_code == 404 || status_code == 500
|
|
761
|
+
error_model = JSON.load(response_content)
|
|
762
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
763
|
+
end
|
|
764
|
+
|
|
765
|
+
# Create Result
|
|
766
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
767
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
768
|
+
|
|
769
|
+
result
|
|
770
|
+
end
|
|
771
|
+
|
|
772
|
+
promise.execute
|
|
773
|
+
end
|
|
774
|
+
|
|
775
|
+
#
|
|
776
|
+
# Get global metrics of hostingEnvironment (App Service Environment).
|
|
777
|
+
#
|
|
778
|
+
# @param resource_group_name [String] Name of resource group
|
|
779
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
780
|
+
# @param details [Boolean] Include instance details
|
|
781
|
+
# @param filter [String] Return only usages/metrics specified in the filter.
|
|
782
|
+
# Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1'
|
|
783
|
+
# or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and
|
|
784
|
+
# endTime eq '2014-12-31T23:59:59Z' and timeGrain eq
|
|
785
|
+
# duration'[Hour|Minute|Day]'.
|
|
786
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
787
|
+
# applied to HTTP request.
|
|
788
|
+
#
|
|
789
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
790
|
+
# response.
|
|
791
|
+
#
|
|
792
|
+
def get_hosting_environment_metrics(resource_group_name, name, details = nil, filter = nil, custom_headers = nil)
|
|
793
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
794
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
795
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
796
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
797
|
+
request_headers = {}
|
|
798
|
+
|
|
799
|
+
# Set Headers
|
|
800
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
801
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
802
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/metrics'
|
|
803
|
+
options = {
|
|
804
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
805
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
806
|
+
query_params: {'details' => details,'$filter' => filter,'api-version' => @client.api_version},
|
|
807
|
+
headers: request_headers.merge(custom_headers || {})
|
|
808
|
+
}
|
|
809
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
810
|
+
promise = request.run_promise do |req|
|
|
811
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
812
|
+
end
|
|
813
|
+
|
|
814
|
+
promise = promise.then do |http_response|
|
|
815
|
+
status_code = http_response.status
|
|
816
|
+
response_content = http_response.body
|
|
817
|
+
unless status_code == 200
|
|
818
|
+
error_model = JSON.load(response_content)
|
|
819
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
820
|
+
end
|
|
821
|
+
|
|
822
|
+
# Create Result
|
|
823
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
824
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
825
|
+
# Deserialize Response
|
|
826
|
+
if status_code == 200
|
|
827
|
+
begin
|
|
828
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
829
|
+
unless parsed_response.nil?
|
|
830
|
+
parsed_response = ResourceMetricCollection.deserialize_object(parsed_response)
|
|
831
|
+
end
|
|
832
|
+
result.body = parsed_response
|
|
833
|
+
rescue Exception => e
|
|
834
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
835
|
+
end
|
|
836
|
+
end
|
|
837
|
+
|
|
838
|
+
result
|
|
839
|
+
end
|
|
840
|
+
|
|
841
|
+
promise.execute
|
|
842
|
+
end
|
|
843
|
+
|
|
844
|
+
#
|
|
845
|
+
# Get global metric definitions of hostingEnvironment (App Service
|
|
846
|
+
# Environment).
|
|
847
|
+
#
|
|
848
|
+
# @param resource_group_name [String] Name of resource group
|
|
849
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
850
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
851
|
+
# applied to HTTP request.
|
|
852
|
+
#
|
|
853
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
854
|
+
# response.
|
|
855
|
+
#
|
|
856
|
+
def get_hosting_environment_metric_definitions(resource_group_name, name, custom_headers = nil)
|
|
857
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
858
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
859
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
860
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
861
|
+
request_headers = {}
|
|
862
|
+
|
|
863
|
+
# Set Headers
|
|
864
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
865
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
866
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/metricdefinitions'
|
|
867
|
+
options = {
|
|
868
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
869
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
870
|
+
query_params: {'api-version' => @client.api_version},
|
|
871
|
+
headers: request_headers.merge(custom_headers || {})
|
|
872
|
+
}
|
|
873
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
874
|
+
promise = request.run_promise do |req|
|
|
875
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
876
|
+
end
|
|
877
|
+
|
|
878
|
+
promise = promise.then do |http_response|
|
|
879
|
+
status_code = http_response.status
|
|
880
|
+
response_content = http_response.body
|
|
881
|
+
unless status_code == 200
|
|
882
|
+
error_model = JSON.load(response_content)
|
|
883
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
884
|
+
end
|
|
885
|
+
|
|
886
|
+
# Create Result
|
|
887
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
888
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
889
|
+
# Deserialize Response
|
|
890
|
+
if status_code == 200
|
|
891
|
+
begin
|
|
892
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
893
|
+
unless parsed_response.nil?
|
|
894
|
+
parsed_response = MetricDefinition.deserialize_object(parsed_response)
|
|
895
|
+
end
|
|
896
|
+
result.body = parsed_response
|
|
897
|
+
rescue Exception => e
|
|
898
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
899
|
+
end
|
|
900
|
+
end
|
|
901
|
+
|
|
902
|
+
result
|
|
903
|
+
end
|
|
904
|
+
|
|
905
|
+
promise.execute
|
|
906
|
+
end
|
|
907
|
+
|
|
908
|
+
#
|
|
909
|
+
# Get global usages of hostingEnvironment (App Service Environment).
|
|
910
|
+
#
|
|
911
|
+
# @param resource_group_name [String] Name of resource group
|
|
912
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
913
|
+
# @param filter [String] Return only usages/metrics specified in the filter.
|
|
914
|
+
# Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1'
|
|
915
|
+
# or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and
|
|
916
|
+
# endTime eq '2014-12-31T23:59:59Z' and timeGrain eq
|
|
917
|
+
# duration'[Hour|Minute|Day]'.
|
|
918
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
919
|
+
# applied to HTTP request.
|
|
920
|
+
#
|
|
921
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
922
|
+
# response.
|
|
923
|
+
#
|
|
924
|
+
def get_hosting_environment_usages(resource_group_name, name, filter = nil, custom_headers = nil)
|
|
925
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
926
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
927
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
928
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
929
|
+
request_headers = {}
|
|
930
|
+
|
|
931
|
+
# Set Headers
|
|
932
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
933
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
934
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages'
|
|
935
|
+
options = {
|
|
936
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
937
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
938
|
+
query_params: {'$filter' => filter,'api-version' => @client.api_version},
|
|
939
|
+
headers: request_headers.merge(custom_headers || {})
|
|
940
|
+
}
|
|
941
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
942
|
+
promise = request.run_promise do |req|
|
|
943
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
944
|
+
end
|
|
945
|
+
|
|
946
|
+
promise = promise.then do |http_response|
|
|
947
|
+
status_code = http_response.status
|
|
948
|
+
response_content = http_response.body
|
|
949
|
+
unless status_code == 200
|
|
950
|
+
error_model = JSON.load(response_content)
|
|
951
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
952
|
+
end
|
|
953
|
+
|
|
954
|
+
# Create Result
|
|
955
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
956
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
957
|
+
# Deserialize Response
|
|
958
|
+
if status_code == 200
|
|
959
|
+
begin
|
|
960
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
961
|
+
unless parsed_response.nil?
|
|
962
|
+
parsed_response = CsmUsageQuotaCollection.deserialize_object(parsed_response)
|
|
963
|
+
end
|
|
964
|
+
result.body = parsed_response
|
|
965
|
+
rescue Exception => e
|
|
966
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
967
|
+
end
|
|
968
|
+
end
|
|
969
|
+
|
|
970
|
+
result
|
|
971
|
+
end
|
|
972
|
+
|
|
973
|
+
promise.execute
|
|
974
|
+
end
|
|
975
|
+
|
|
976
|
+
#
|
|
977
|
+
# Get metrics for a multiRole pool of a hostingEnvironment (App Service
|
|
978
|
+
# Environment).
|
|
979
|
+
#
|
|
980
|
+
# @param resource_group_name [String] Name of resource group
|
|
981
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
982
|
+
# @param start_time [String] Beginning time of metrics query
|
|
983
|
+
# @param end_time [String] End time of metrics query
|
|
984
|
+
# @param time_grain [String] Time granularity of metrics query
|
|
985
|
+
# @param details [Boolean] Include instance details
|
|
986
|
+
# @param filter [String] Return only usages/metrics specified in the filter.
|
|
987
|
+
# Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1'
|
|
988
|
+
# or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and
|
|
989
|
+
# endTime eq '2014-12-31T23:59:59Z' and timeGrain eq
|
|
990
|
+
# duration'[Hour|Minute|Day]'.
|
|
991
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
992
|
+
# applied to HTTP request.
|
|
993
|
+
#
|
|
994
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
995
|
+
# response.
|
|
996
|
+
#
|
|
997
|
+
def get_hosting_environment_multi_role_metrics(resource_group_name, name, start_time = nil, end_time = nil, time_grain = nil, details = nil, filter = nil, custom_headers = nil)
|
|
998
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
999
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1000
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1001
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1002
|
+
request_headers = {}
|
|
1003
|
+
|
|
1004
|
+
# Set Headers
|
|
1005
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1006
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1007
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metrics'
|
|
1008
|
+
options = {
|
|
1009
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1010
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
1011
|
+
query_params: {'startTime' => start_time,'endTime' => end_time,'timeGrain' => time_grain,'details' => details,'$filter' => filter,'api-version' => @client.api_version},
|
|
1012
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1013
|
+
}
|
|
1014
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
1015
|
+
promise = request.run_promise do |req|
|
|
1016
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1017
|
+
end
|
|
1018
|
+
|
|
1019
|
+
promise = promise.then do |http_response|
|
|
1020
|
+
status_code = http_response.status
|
|
1021
|
+
response_content = http_response.body
|
|
1022
|
+
unless status_code == 200
|
|
1023
|
+
error_model = JSON.load(response_content)
|
|
1024
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1025
|
+
end
|
|
1026
|
+
|
|
1027
|
+
# Create Result
|
|
1028
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1029
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1030
|
+
# Deserialize Response
|
|
1031
|
+
if status_code == 200
|
|
1032
|
+
begin
|
|
1033
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1034
|
+
unless parsed_response.nil?
|
|
1035
|
+
parsed_response = ResourceMetricCollection.deserialize_object(parsed_response)
|
|
1036
|
+
end
|
|
1037
|
+
result.body = parsed_response
|
|
1038
|
+
rescue Exception => e
|
|
1039
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1040
|
+
end
|
|
1041
|
+
end
|
|
1042
|
+
|
|
1043
|
+
result
|
|
1044
|
+
end
|
|
1045
|
+
|
|
1046
|
+
promise.execute
|
|
1047
|
+
end
|
|
1048
|
+
|
|
1049
|
+
#
|
|
1050
|
+
# Get metrics for a worker pool of a hostingEnvironment (App Service
|
|
1051
|
+
# Environment).
|
|
1052
|
+
#
|
|
1053
|
+
# @param resource_group_name [String] Name of resource group
|
|
1054
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
1055
|
+
# @param worker_pool_name [String] Name of worker pool
|
|
1056
|
+
# @param details [Boolean] Include instance details
|
|
1057
|
+
# @param filter [String] Return only usages/metrics specified in the filter.
|
|
1058
|
+
# Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1'
|
|
1059
|
+
# or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and
|
|
1060
|
+
# endTime eq '2014-12-31T23:59:59Z' and timeGrain eq
|
|
1061
|
+
# duration'[Hour|Minute|Day]'.
|
|
1062
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1063
|
+
# applied to HTTP request.
|
|
1064
|
+
#
|
|
1065
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1066
|
+
# response.
|
|
1067
|
+
#
|
|
1068
|
+
def get_hosting_environment_web_worker_metrics(resource_group_name, name, worker_pool_name, details = nil, filter = nil, custom_headers = nil)
|
|
1069
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1070
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1071
|
+
fail ArgumentError, 'worker_pool_name is nil' if worker_pool_name.nil?
|
|
1072
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1073
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1074
|
+
request_headers = {}
|
|
1075
|
+
|
|
1076
|
+
# Set Headers
|
|
1077
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1078
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1079
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metrics'
|
|
1080
|
+
options = {
|
|
1081
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1082
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'workerPoolName' => worker_pool_name,'subscriptionId' => @client.subscription_id},
|
|
1083
|
+
query_params: {'details' => details,'$filter' => filter,'api-version' => @client.api_version},
|
|
1084
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1085
|
+
}
|
|
1086
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
1087
|
+
promise = request.run_promise do |req|
|
|
1088
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1089
|
+
end
|
|
1090
|
+
|
|
1091
|
+
promise = promise.then do |http_response|
|
|
1092
|
+
status_code = http_response.status
|
|
1093
|
+
response_content = http_response.body
|
|
1094
|
+
unless status_code == 200
|
|
1095
|
+
error_model = JSON.load(response_content)
|
|
1096
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1097
|
+
end
|
|
1098
|
+
|
|
1099
|
+
# Create Result
|
|
1100
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1101
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1102
|
+
# Deserialize Response
|
|
1103
|
+
if status_code == 200
|
|
1104
|
+
begin
|
|
1105
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1106
|
+
unless parsed_response.nil?
|
|
1107
|
+
parsed_response = ResourceMetricCollection.deserialize_object(parsed_response)
|
|
1108
|
+
end
|
|
1109
|
+
result.body = parsed_response
|
|
1110
|
+
rescue Exception => e
|
|
1111
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1112
|
+
end
|
|
1113
|
+
end
|
|
1114
|
+
|
|
1115
|
+
result
|
|
1116
|
+
end
|
|
1117
|
+
|
|
1118
|
+
promise.execute
|
|
1119
|
+
end
|
|
1120
|
+
|
|
1121
|
+
#
|
|
1122
|
+
# Get metric definitions for a multiRole pool of a hostingEnvironment (App
|
|
1123
|
+
# Service Environment).
|
|
1124
|
+
#
|
|
1125
|
+
# @param resource_group_name [String] Name of resource group
|
|
1126
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
1127
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1128
|
+
# applied to HTTP request.
|
|
1129
|
+
#
|
|
1130
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1131
|
+
# response.
|
|
1132
|
+
#
|
|
1133
|
+
def get_hosting_environment_multi_role_metric_definitions(resource_group_name, name, custom_headers = nil)
|
|
1134
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1135
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1136
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1137
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1138
|
+
request_headers = {}
|
|
1139
|
+
|
|
1140
|
+
# Set Headers
|
|
1141
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1142
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1143
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions'
|
|
1144
|
+
options = {
|
|
1145
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1146
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
1147
|
+
query_params: {'api-version' => @client.api_version},
|
|
1148
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1149
|
+
}
|
|
1150
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
1151
|
+
promise = request.run_promise do |req|
|
|
1152
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1153
|
+
end
|
|
1154
|
+
|
|
1155
|
+
promise = promise.then do |http_response|
|
|
1156
|
+
status_code = http_response.status
|
|
1157
|
+
response_content = http_response.body
|
|
1158
|
+
unless status_code == 200
|
|
1159
|
+
error_model = JSON.load(response_content)
|
|
1160
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1161
|
+
end
|
|
1162
|
+
|
|
1163
|
+
# Create Result
|
|
1164
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1165
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1166
|
+
# Deserialize Response
|
|
1167
|
+
if status_code == 200
|
|
1168
|
+
begin
|
|
1169
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1170
|
+
unless parsed_response.nil?
|
|
1171
|
+
parsed_response = MetricDefinitionCollection.deserialize_object(parsed_response)
|
|
1172
|
+
end
|
|
1173
|
+
result.body = parsed_response
|
|
1174
|
+
rescue Exception => e
|
|
1175
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1176
|
+
end
|
|
1177
|
+
end
|
|
1178
|
+
|
|
1179
|
+
result
|
|
1180
|
+
end
|
|
1181
|
+
|
|
1182
|
+
promise.execute
|
|
1183
|
+
end
|
|
1184
|
+
|
|
1185
|
+
#
|
|
1186
|
+
# Get metric definitions for a worker pool of a hostingEnvironment (App
|
|
1187
|
+
# Service Environment).
|
|
1188
|
+
#
|
|
1189
|
+
# @param resource_group_name [String] Name of resource group
|
|
1190
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
1191
|
+
# @param worker_pool_name [String] Name of worker pool
|
|
1192
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1193
|
+
# applied to HTTP request.
|
|
1194
|
+
#
|
|
1195
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1196
|
+
# response.
|
|
1197
|
+
#
|
|
1198
|
+
def get_hosting_environment_web_worker_metric_definitions(resource_group_name, name, worker_pool_name, custom_headers = nil)
|
|
1199
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1200
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1201
|
+
fail ArgumentError, 'worker_pool_name is nil' if worker_pool_name.nil?
|
|
1202
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1203
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1204
|
+
request_headers = {}
|
|
1205
|
+
|
|
1206
|
+
# Set Headers
|
|
1207
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1208
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1209
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions'
|
|
1210
|
+
options = {
|
|
1211
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1212
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'workerPoolName' => worker_pool_name,'subscriptionId' => @client.subscription_id},
|
|
1213
|
+
query_params: {'api-version' => @client.api_version},
|
|
1214
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1215
|
+
}
|
|
1216
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
1217
|
+
promise = request.run_promise do |req|
|
|
1218
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1219
|
+
end
|
|
1220
|
+
|
|
1221
|
+
promise = promise.then do |http_response|
|
|
1222
|
+
status_code = http_response.status
|
|
1223
|
+
response_content = http_response.body
|
|
1224
|
+
unless status_code == 200
|
|
1225
|
+
error_model = JSON.load(response_content)
|
|
1226
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1227
|
+
end
|
|
1228
|
+
|
|
1229
|
+
# Create Result
|
|
1230
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1231
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1232
|
+
# Deserialize Response
|
|
1233
|
+
if status_code == 200
|
|
1234
|
+
begin
|
|
1235
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1236
|
+
unless parsed_response.nil?
|
|
1237
|
+
parsed_response = MetricDefinitionCollection.deserialize_object(parsed_response)
|
|
1238
|
+
end
|
|
1239
|
+
result.body = parsed_response
|
|
1240
|
+
rescue Exception => e
|
|
1241
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1242
|
+
end
|
|
1243
|
+
end
|
|
1244
|
+
|
|
1245
|
+
result
|
|
1246
|
+
end
|
|
1247
|
+
|
|
1248
|
+
promise.execute
|
|
1249
|
+
end
|
|
1250
|
+
|
|
1251
|
+
#
|
|
1252
|
+
# Get usages for a multiRole pool of a hostingEnvironment (App Service
|
|
1253
|
+
# Environment).
|
|
1254
|
+
#
|
|
1255
|
+
# @param resource_group_name [String] Name of resource group
|
|
1256
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
1257
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1258
|
+
# applied to HTTP request.
|
|
1259
|
+
#
|
|
1260
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1261
|
+
# response.
|
|
1262
|
+
#
|
|
1263
|
+
def get_hosting_environment_multi_role_usages(resource_group_name, name, custom_headers = nil)
|
|
1264
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1265
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1266
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1267
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1268
|
+
request_headers = {}
|
|
1269
|
+
|
|
1270
|
+
# Set Headers
|
|
1271
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1272
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1273
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages'
|
|
1274
|
+
options = {
|
|
1275
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1276
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
1277
|
+
query_params: {'api-version' => @client.api_version},
|
|
1278
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1279
|
+
}
|
|
1280
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
1281
|
+
promise = request.run_promise do |req|
|
|
1282
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1283
|
+
end
|
|
1284
|
+
|
|
1285
|
+
promise = promise.then do |http_response|
|
|
1286
|
+
status_code = http_response.status
|
|
1287
|
+
response_content = http_response.body
|
|
1288
|
+
unless status_code == 200
|
|
1289
|
+
error_model = JSON.load(response_content)
|
|
1290
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1291
|
+
end
|
|
1292
|
+
|
|
1293
|
+
# Create Result
|
|
1294
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1295
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1296
|
+
# Deserialize Response
|
|
1297
|
+
if status_code == 200
|
|
1298
|
+
begin
|
|
1299
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1300
|
+
unless parsed_response.nil?
|
|
1301
|
+
parsed_response = UsageCollection.deserialize_object(parsed_response)
|
|
1302
|
+
end
|
|
1303
|
+
result.body = parsed_response
|
|
1304
|
+
rescue Exception => e
|
|
1305
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1306
|
+
end
|
|
1307
|
+
end
|
|
1308
|
+
|
|
1309
|
+
result
|
|
1310
|
+
end
|
|
1311
|
+
|
|
1312
|
+
promise.execute
|
|
1313
|
+
end
|
|
1314
|
+
|
|
1315
|
+
#
|
|
1316
|
+
# Get usages for a worker pool of a hostingEnvironment (App Service
|
|
1317
|
+
# Environment).
|
|
1318
|
+
#
|
|
1319
|
+
# @param resource_group_name [String] Name of resource group
|
|
1320
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
1321
|
+
# @param worker_pool_name [String] Name of worker pool
|
|
1322
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1323
|
+
# applied to HTTP request.
|
|
1324
|
+
#
|
|
1325
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1326
|
+
# response.
|
|
1327
|
+
#
|
|
1328
|
+
def get_hosting_environment_web_worker_usages(resource_group_name, name, worker_pool_name, custom_headers = nil)
|
|
1329
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1330
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1331
|
+
fail ArgumentError, 'worker_pool_name is nil' if worker_pool_name.nil?
|
|
1332
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1333
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1334
|
+
request_headers = {}
|
|
1335
|
+
|
|
1336
|
+
# Set Headers
|
|
1337
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1338
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1339
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages'
|
|
1340
|
+
options = {
|
|
1341
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1342
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'workerPoolName' => worker_pool_name,'subscriptionId' => @client.subscription_id},
|
|
1343
|
+
query_params: {'api-version' => @client.api_version},
|
|
1344
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1345
|
+
}
|
|
1346
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
1347
|
+
promise = request.run_promise do |req|
|
|
1348
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1349
|
+
end
|
|
1350
|
+
|
|
1351
|
+
promise = promise.then do |http_response|
|
|
1352
|
+
status_code = http_response.status
|
|
1353
|
+
response_content = http_response.body
|
|
1354
|
+
unless status_code == 200
|
|
1355
|
+
error_model = JSON.load(response_content)
|
|
1356
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1357
|
+
end
|
|
1358
|
+
|
|
1359
|
+
# Create Result
|
|
1360
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1361
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1362
|
+
# Deserialize Response
|
|
1363
|
+
if status_code == 200
|
|
1364
|
+
begin
|
|
1365
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1366
|
+
unless parsed_response.nil?
|
|
1367
|
+
parsed_response = UsageCollection.deserialize_object(parsed_response)
|
|
1368
|
+
end
|
|
1369
|
+
result.body = parsed_response
|
|
1370
|
+
rescue Exception => e
|
|
1371
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1372
|
+
end
|
|
1373
|
+
end
|
|
1374
|
+
|
|
1375
|
+
result
|
|
1376
|
+
end
|
|
1377
|
+
|
|
1378
|
+
promise.execute
|
|
1379
|
+
end
|
|
1380
|
+
|
|
1381
|
+
#
|
|
1382
|
+
# Get all sites on the hostingEnvironment (App Service Environment).
|
|
1383
|
+
#
|
|
1384
|
+
# @param resource_group_name [String] Name of resource group
|
|
1385
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
1386
|
+
# @param properties_to_include [String] Comma separated list of site
|
|
1387
|
+
# properties to include
|
|
1388
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1389
|
+
# applied to HTTP request.
|
|
1390
|
+
#
|
|
1391
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1392
|
+
# response.
|
|
1393
|
+
#
|
|
1394
|
+
def get_hosting_environment_sites(resource_group_name, name, properties_to_include = nil, custom_headers = nil)
|
|
1395
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1396
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1397
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1398
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1399
|
+
request_headers = {}
|
|
1400
|
+
|
|
1401
|
+
# Set Headers
|
|
1402
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1403
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1404
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites'
|
|
1405
|
+
options = {
|
|
1406
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1407
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
1408
|
+
query_params: {'propertiesToInclude' => properties_to_include,'api-version' => @client.api_version},
|
|
1409
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1410
|
+
}
|
|
1411
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
1412
|
+
promise = request.run_promise do |req|
|
|
1413
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1414
|
+
end
|
|
1415
|
+
|
|
1416
|
+
promise = promise.then do |http_response|
|
|
1417
|
+
status_code = http_response.status
|
|
1418
|
+
response_content = http_response.body
|
|
1419
|
+
unless status_code == 200
|
|
1420
|
+
error_model = JSON.load(response_content)
|
|
1421
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1422
|
+
end
|
|
1423
|
+
|
|
1424
|
+
# Create Result
|
|
1425
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1426
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1427
|
+
# Deserialize Response
|
|
1428
|
+
if status_code == 200
|
|
1429
|
+
begin
|
|
1430
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1431
|
+
unless parsed_response.nil?
|
|
1432
|
+
parsed_response = SiteCollection.deserialize_object(parsed_response)
|
|
1433
|
+
end
|
|
1434
|
+
result.body = parsed_response
|
|
1435
|
+
rescue Exception => e
|
|
1436
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1437
|
+
end
|
|
1438
|
+
end
|
|
1439
|
+
|
|
1440
|
+
result
|
|
1441
|
+
end
|
|
1442
|
+
|
|
1443
|
+
promise.execute
|
|
1444
|
+
end
|
|
1445
|
+
|
|
1446
|
+
#
|
|
1447
|
+
# Get all serverfarms (App Service Plans) on the hostingEnvironment (App
|
|
1448
|
+
# Service Environment).
|
|
1449
|
+
#
|
|
1450
|
+
# @param resource_group_name [String] Name of resource group
|
|
1451
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
1452
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1453
|
+
# applied to HTTP request.
|
|
1454
|
+
#
|
|
1455
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1456
|
+
# response.
|
|
1457
|
+
#
|
|
1458
|
+
def get_hosting_environment_server_farms(resource_group_name, name, custom_headers = nil)
|
|
1459
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1460
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1461
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1462
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1463
|
+
request_headers = {}
|
|
1464
|
+
|
|
1465
|
+
# Set Headers
|
|
1466
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1467
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1468
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms'
|
|
1469
|
+
options = {
|
|
1470
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1471
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
1472
|
+
query_params: {'api-version' => @client.api_version},
|
|
1473
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1474
|
+
}
|
|
1475
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
1476
|
+
promise = request.run_promise do |req|
|
|
1477
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1478
|
+
end
|
|
1479
|
+
|
|
1480
|
+
promise = promise.then do |http_response|
|
|
1481
|
+
status_code = http_response.status
|
|
1482
|
+
response_content = http_response.body
|
|
1483
|
+
unless status_code == 200
|
|
1484
|
+
error_model = JSON.load(response_content)
|
|
1485
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1486
|
+
end
|
|
1487
|
+
|
|
1488
|
+
# Create Result
|
|
1489
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1490
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1491
|
+
# Deserialize Response
|
|
1492
|
+
if status_code == 200
|
|
1493
|
+
begin
|
|
1494
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1495
|
+
unless parsed_response.nil?
|
|
1496
|
+
parsed_response = ServerFarmCollection.deserialize_object(parsed_response)
|
|
1497
|
+
end
|
|
1498
|
+
result.body = parsed_response
|
|
1499
|
+
rescue Exception => e
|
|
1500
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1501
|
+
end
|
|
1502
|
+
end
|
|
1503
|
+
|
|
1504
|
+
result
|
|
1505
|
+
end
|
|
1506
|
+
|
|
1507
|
+
promise.execute
|
|
1508
|
+
end
|
|
1509
|
+
|
|
1510
|
+
#
|
|
1511
|
+
# Get all serverfarms (App Service Plans) on the hostingEnvironment (App
|
|
1512
|
+
# Service Environment).
|
|
1513
|
+
#
|
|
1514
|
+
# @param resource_group_name [String] Name of resource group
|
|
1515
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
1516
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1517
|
+
# applied to HTTP request.
|
|
1518
|
+
#
|
|
1519
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1520
|
+
# response.
|
|
1521
|
+
#
|
|
1522
|
+
def get_hosting_environment_web_hosting_plans(resource_group_name, name, custom_headers = nil)
|
|
1523
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1524
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1525
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1526
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1527
|
+
request_headers = {}
|
|
1528
|
+
|
|
1529
|
+
# Set Headers
|
|
1530
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1531
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1532
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/webhostingplans'
|
|
1533
|
+
options = {
|
|
1534
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1535
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
1536
|
+
query_params: {'api-version' => @client.api_version},
|
|
1537
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1538
|
+
}
|
|
1539
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
1540
|
+
promise = request.run_promise do |req|
|
|
1541
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1542
|
+
end
|
|
1543
|
+
|
|
1544
|
+
promise = promise.then do |http_response|
|
|
1545
|
+
status_code = http_response.status
|
|
1546
|
+
response_content = http_response.body
|
|
1547
|
+
unless status_code == 200
|
|
1548
|
+
error_model = JSON.load(response_content)
|
|
1549
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1550
|
+
end
|
|
1551
|
+
|
|
1552
|
+
# Create Result
|
|
1553
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1554
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1555
|
+
# Deserialize Response
|
|
1556
|
+
if status_code == 200
|
|
1557
|
+
begin
|
|
1558
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1559
|
+
unless parsed_response.nil?
|
|
1560
|
+
parsed_response = ServerFarmCollection.deserialize_object(parsed_response)
|
|
1561
|
+
end
|
|
1562
|
+
result.body = parsed_response
|
|
1563
|
+
rescue Exception => e
|
|
1564
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1565
|
+
end
|
|
1566
|
+
end
|
|
1567
|
+
|
|
1568
|
+
result
|
|
1569
|
+
end
|
|
1570
|
+
|
|
1571
|
+
promise.execute
|
|
1572
|
+
end
|
|
1573
|
+
|
|
1574
|
+
#
|
|
1575
|
+
# Get all multi role pools
|
|
1576
|
+
#
|
|
1577
|
+
# @param resource_group_name [String] Name of resource group
|
|
1578
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
1579
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1580
|
+
# applied to HTTP request.
|
|
1581
|
+
#
|
|
1582
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1583
|
+
# response.
|
|
1584
|
+
#
|
|
1585
|
+
def get_multi_role_pools(resource_group_name, name, custom_headers = nil)
|
|
1586
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1587
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1588
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1589
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1590
|
+
request_headers = {}
|
|
1591
|
+
|
|
1592
|
+
# Set Headers
|
|
1593
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1594
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1595
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools'
|
|
1596
|
+
options = {
|
|
1597
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1598
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
1599
|
+
query_params: {'api-version' => @client.api_version},
|
|
1600
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1601
|
+
}
|
|
1602
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
1603
|
+
promise = request.run_promise do |req|
|
|
1604
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1605
|
+
end
|
|
1606
|
+
|
|
1607
|
+
promise = promise.then do |http_response|
|
|
1608
|
+
status_code = http_response.status
|
|
1609
|
+
response_content = http_response.body
|
|
1610
|
+
unless status_code == 200
|
|
1611
|
+
error_model = JSON.load(response_content)
|
|
1612
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1613
|
+
end
|
|
1614
|
+
|
|
1615
|
+
# Create Result
|
|
1616
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1617
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1618
|
+
# Deserialize Response
|
|
1619
|
+
if status_code == 200
|
|
1620
|
+
begin
|
|
1621
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1622
|
+
unless parsed_response.nil?
|
|
1623
|
+
parsed_response = WorkerPoolCollection.deserialize_object(parsed_response)
|
|
1624
|
+
end
|
|
1625
|
+
result.body = parsed_response
|
|
1626
|
+
rescue Exception => e
|
|
1627
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1628
|
+
end
|
|
1629
|
+
end
|
|
1630
|
+
|
|
1631
|
+
result
|
|
1632
|
+
end
|
|
1633
|
+
|
|
1634
|
+
promise.execute
|
|
1635
|
+
end
|
|
1636
|
+
|
|
1637
|
+
#
|
|
1638
|
+
# Get properties of a multiRool pool.
|
|
1639
|
+
#
|
|
1640
|
+
# @param resource_group_name [String] Name of resource group
|
|
1641
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
1642
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1643
|
+
# applied to HTTP request.
|
|
1644
|
+
#
|
|
1645
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1646
|
+
# response.
|
|
1647
|
+
#
|
|
1648
|
+
def get_multi_role_pool(resource_group_name, name, custom_headers = nil)
|
|
1649
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1650
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1651
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1652
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1653
|
+
request_headers = {}
|
|
1654
|
+
|
|
1655
|
+
# Set Headers
|
|
1656
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1657
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1658
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'
|
|
1659
|
+
options = {
|
|
1660
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1661
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
1662
|
+
query_params: {'api-version' => @client.api_version},
|
|
1663
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1664
|
+
}
|
|
1665
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
1666
|
+
promise = request.run_promise do |req|
|
|
1667
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1668
|
+
end
|
|
1669
|
+
|
|
1670
|
+
promise = promise.then do |http_response|
|
|
1671
|
+
status_code = http_response.status
|
|
1672
|
+
response_content = http_response.body
|
|
1673
|
+
unless status_code == 200
|
|
1674
|
+
error_model = JSON.load(response_content)
|
|
1675
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1676
|
+
end
|
|
1677
|
+
|
|
1678
|
+
# Create Result
|
|
1679
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1680
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1681
|
+
# Deserialize Response
|
|
1682
|
+
if status_code == 200
|
|
1683
|
+
begin
|
|
1684
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1685
|
+
unless parsed_response.nil?
|
|
1686
|
+
parsed_response = WorkerPool.deserialize_object(parsed_response)
|
|
1687
|
+
end
|
|
1688
|
+
result.body = parsed_response
|
|
1689
|
+
rescue Exception => e
|
|
1690
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1691
|
+
end
|
|
1692
|
+
end
|
|
1693
|
+
|
|
1694
|
+
result
|
|
1695
|
+
end
|
|
1696
|
+
|
|
1697
|
+
promise.execute
|
|
1698
|
+
end
|
|
1699
|
+
|
|
1700
|
+
#
|
|
1701
|
+
# Create or update a multiRole pool.
|
|
1702
|
+
#
|
|
1703
|
+
# @param resource_group_name [String] Name of resource group
|
|
1704
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
1705
|
+
# @param multi_role_pool_envelope [WorkerPool] Properties of multiRole pool
|
|
1706
|
+
# @param @client.subscription_id [String] Subscription Id
|
|
1707
|
+
# @param @client.api_version [String] API Version
|
|
1708
|
+
# @param @client.accept_language [String] Gets or sets the preferred language
|
|
1709
|
+
# for the response.
|
|
1710
|
+
#
|
|
1711
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
|
1712
|
+
# response.
|
|
1713
|
+
#
|
|
1714
|
+
def create_or_update_multi_role_pool(resource_group_name, name, multi_role_pool_envelope, custom_headers = nil)
|
|
1715
|
+
# Send request
|
|
1716
|
+
promise = begin_create_or_update_multi_role_pool(resource_group_name, name, multi_role_pool_envelope, custom_headers)
|
|
1717
|
+
|
|
1718
|
+
promise = promise.then do |response|
|
|
1719
|
+
# Defining deserialization method.
|
|
1720
|
+
deserialize_method = lambda do |parsed_response|
|
|
1721
|
+
unless parsed_response.nil?
|
|
1722
|
+
parsed_response = WorkerPool.deserialize_object(parsed_response)
|
|
1723
|
+
end
|
|
1724
|
+
end
|
|
1725
|
+
|
|
1726
|
+
# Waiting for response.
|
|
1727
|
+
@client.get_put_operation_result(response, deserialize_method)
|
|
1728
|
+
end
|
|
1729
|
+
|
|
1730
|
+
promise
|
|
1731
|
+
end
|
|
1732
|
+
|
|
1733
|
+
#
|
|
1734
|
+
# Create or update a multiRole pool.
|
|
1735
|
+
#
|
|
1736
|
+
# @param resource_group_name [String] Name of resource group
|
|
1737
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
1738
|
+
# @param multi_role_pool_envelope [WorkerPool] Properties of multiRole pool
|
|
1739
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1740
|
+
# applied to HTTP request.
|
|
1741
|
+
#
|
|
1742
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1743
|
+
# response.
|
|
1744
|
+
#
|
|
1745
|
+
def begin_create_or_update_multi_role_pool(resource_group_name, name, multi_role_pool_envelope, custom_headers = nil)
|
|
1746
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1747
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1748
|
+
fail ArgumentError, 'multi_role_pool_envelope is nil' if multi_role_pool_envelope.nil?
|
|
1749
|
+
multi_role_pool_envelope.validate unless multi_role_pool_envelope.nil?
|
|
1750
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1751
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1752
|
+
request_headers = {}
|
|
1753
|
+
|
|
1754
|
+
# Set Headers
|
|
1755
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1756
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1757
|
+
|
|
1758
|
+
# Serialize Request
|
|
1759
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
1760
|
+
unless multi_role_pool_envelope.nil?
|
|
1761
|
+
multi_role_pool_envelope = WorkerPool.serialize_object(multi_role_pool_envelope)
|
|
1762
|
+
end
|
|
1763
|
+
request_content = JSON.generate(multi_role_pool_envelope, quirks_mode: true)
|
|
1764
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'
|
|
1765
|
+
options = {
|
|
1766
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1767
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
1768
|
+
query_params: {'api-version' => @client.api_version},
|
|
1769
|
+
body: request_content,
|
|
1770
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1771
|
+
}
|
|
1772
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :put, options)
|
|
1773
|
+
promise = request.run_promise do |req|
|
|
1774
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1775
|
+
end
|
|
1776
|
+
|
|
1777
|
+
promise = promise.then do |http_response|
|
|
1778
|
+
status_code = http_response.status
|
|
1779
|
+
response_content = http_response.body
|
|
1780
|
+
unless status_code == 200 || status_code == 202 || status_code == 400 || status_code == 404 || status_code == 409
|
|
1781
|
+
error_model = JSON.load(response_content)
|
|
1782
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1783
|
+
end
|
|
1784
|
+
|
|
1785
|
+
# Create Result
|
|
1786
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1787
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1788
|
+
# Deserialize Response
|
|
1789
|
+
if status_code == 200
|
|
1790
|
+
begin
|
|
1791
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1792
|
+
unless parsed_response.nil?
|
|
1793
|
+
parsed_response = WorkerPool.deserialize_object(parsed_response)
|
|
1794
|
+
end
|
|
1795
|
+
result.body = parsed_response
|
|
1796
|
+
rescue Exception => e
|
|
1797
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1798
|
+
end
|
|
1799
|
+
end
|
|
1800
|
+
# Deserialize Response
|
|
1801
|
+
if status_code == 202
|
|
1802
|
+
begin
|
|
1803
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1804
|
+
unless parsed_response.nil?
|
|
1805
|
+
parsed_response = WorkerPool.deserialize_object(parsed_response)
|
|
1806
|
+
end
|
|
1807
|
+
result.body = parsed_response
|
|
1808
|
+
rescue Exception => e
|
|
1809
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1810
|
+
end
|
|
1811
|
+
end
|
|
1812
|
+
|
|
1813
|
+
result
|
|
1814
|
+
end
|
|
1815
|
+
|
|
1816
|
+
promise.execute
|
|
1817
|
+
end
|
|
1818
|
+
|
|
1819
|
+
#
|
|
1820
|
+
# Get available skus for scaling a multiRole pool.
|
|
1821
|
+
#
|
|
1822
|
+
# @param resource_group_name [String] Name of resource group
|
|
1823
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
1824
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1825
|
+
# applied to HTTP request.
|
|
1826
|
+
#
|
|
1827
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1828
|
+
# response.
|
|
1829
|
+
#
|
|
1830
|
+
def get_multi_role_pool_skus(resource_group_name, name, custom_headers = nil)
|
|
1831
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1832
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1833
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1834
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1835
|
+
request_headers = {}
|
|
1836
|
+
|
|
1837
|
+
# Set Headers
|
|
1838
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1839
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1840
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus'
|
|
1841
|
+
options = {
|
|
1842
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1843
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
1844
|
+
query_params: {'api-version' => @client.api_version},
|
|
1845
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1846
|
+
}
|
|
1847
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
1848
|
+
promise = request.run_promise do |req|
|
|
1849
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1850
|
+
end
|
|
1851
|
+
|
|
1852
|
+
promise = promise.then do |http_response|
|
|
1853
|
+
status_code = http_response.status
|
|
1854
|
+
response_content = http_response.body
|
|
1855
|
+
unless status_code == 200
|
|
1856
|
+
error_model = JSON.load(response_content)
|
|
1857
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1858
|
+
end
|
|
1859
|
+
|
|
1860
|
+
# Create Result
|
|
1861
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1862
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1863
|
+
# Deserialize Response
|
|
1864
|
+
if status_code == 200
|
|
1865
|
+
begin
|
|
1866
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1867
|
+
unless parsed_response.nil?
|
|
1868
|
+
parsed_response = SkuInfoCollection.deserialize_object(parsed_response)
|
|
1869
|
+
end
|
|
1870
|
+
result.body = parsed_response
|
|
1871
|
+
rescue Exception => e
|
|
1872
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1873
|
+
end
|
|
1874
|
+
end
|
|
1875
|
+
|
|
1876
|
+
result
|
|
1877
|
+
end
|
|
1878
|
+
|
|
1879
|
+
promise.execute
|
|
1880
|
+
end
|
|
1881
|
+
|
|
1882
|
+
#
|
|
1883
|
+
# Get all worker pools
|
|
1884
|
+
#
|
|
1885
|
+
# @param resource_group_name [String] Name of resource group
|
|
1886
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
1887
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1888
|
+
# applied to HTTP request.
|
|
1889
|
+
#
|
|
1890
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1891
|
+
# response.
|
|
1892
|
+
#
|
|
1893
|
+
def get_worker_pools(resource_group_name, name, custom_headers = nil)
|
|
1894
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1895
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1896
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1897
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1898
|
+
request_headers = {}
|
|
1899
|
+
|
|
1900
|
+
# Set Headers
|
|
1901
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1902
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1903
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools'
|
|
1904
|
+
options = {
|
|
1905
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1906
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
1907
|
+
query_params: {'api-version' => @client.api_version},
|
|
1908
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1909
|
+
}
|
|
1910
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
1911
|
+
promise = request.run_promise do |req|
|
|
1912
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1913
|
+
end
|
|
1914
|
+
|
|
1915
|
+
promise = promise.then do |http_response|
|
|
1916
|
+
status_code = http_response.status
|
|
1917
|
+
response_content = http_response.body
|
|
1918
|
+
unless status_code == 200
|
|
1919
|
+
error_model = JSON.load(response_content)
|
|
1920
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1921
|
+
end
|
|
1922
|
+
|
|
1923
|
+
# Create Result
|
|
1924
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1925
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1926
|
+
# Deserialize Response
|
|
1927
|
+
if status_code == 200
|
|
1928
|
+
begin
|
|
1929
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1930
|
+
unless parsed_response.nil?
|
|
1931
|
+
parsed_response = WorkerPoolCollection.deserialize_object(parsed_response)
|
|
1932
|
+
end
|
|
1933
|
+
result.body = parsed_response
|
|
1934
|
+
rescue Exception => e
|
|
1935
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1936
|
+
end
|
|
1937
|
+
end
|
|
1938
|
+
|
|
1939
|
+
result
|
|
1940
|
+
end
|
|
1941
|
+
|
|
1942
|
+
promise.execute
|
|
1943
|
+
end
|
|
1944
|
+
|
|
1945
|
+
#
|
|
1946
|
+
# Get properties of a worker pool.
|
|
1947
|
+
#
|
|
1948
|
+
# @param resource_group_name [String] Name of resource group
|
|
1949
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
1950
|
+
# @param worker_pool_name [String] Name of worker pool
|
|
1951
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1952
|
+
# applied to HTTP request.
|
|
1953
|
+
#
|
|
1954
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1955
|
+
# response.
|
|
1956
|
+
#
|
|
1957
|
+
def get_worker_pool(resource_group_name, name, worker_pool_name, custom_headers = nil)
|
|
1958
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1959
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1960
|
+
fail ArgumentError, 'worker_pool_name is nil' if worker_pool_name.nil?
|
|
1961
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1962
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1963
|
+
request_headers = {}
|
|
1964
|
+
|
|
1965
|
+
# Set Headers
|
|
1966
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1967
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1968
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'
|
|
1969
|
+
options = {
|
|
1970
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1971
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'workerPoolName' => worker_pool_name,'subscriptionId' => @client.subscription_id},
|
|
1972
|
+
query_params: {'api-version' => @client.api_version},
|
|
1973
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1974
|
+
}
|
|
1975
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
1976
|
+
promise = request.run_promise do |req|
|
|
1977
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1978
|
+
end
|
|
1979
|
+
|
|
1980
|
+
promise = promise.then do |http_response|
|
|
1981
|
+
status_code = http_response.status
|
|
1982
|
+
response_content = http_response.body
|
|
1983
|
+
unless status_code == 200
|
|
1984
|
+
error_model = JSON.load(response_content)
|
|
1985
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1986
|
+
end
|
|
1987
|
+
|
|
1988
|
+
# Create Result
|
|
1989
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1990
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1991
|
+
# Deserialize Response
|
|
1992
|
+
if status_code == 200
|
|
1993
|
+
begin
|
|
1994
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1995
|
+
unless parsed_response.nil?
|
|
1996
|
+
parsed_response = WorkerPool.deserialize_object(parsed_response)
|
|
1997
|
+
end
|
|
1998
|
+
result.body = parsed_response
|
|
1999
|
+
rescue Exception => e
|
|
2000
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
2001
|
+
end
|
|
2002
|
+
end
|
|
2003
|
+
|
|
2004
|
+
result
|
|
2005
|
+
end
|
|
2006
|
+
|
|
2007
|
+
promise.execute
|
|
2008
|
+
end
|
|
2009
|
+
|
|
2010
|
+
#
|
|
2011
|
+
# Create or update a worker pool.
|
|
2012
|
+
#
|
|
2013
|
+
# @param resource_group_name [String] Name of resource group
|
|
2014
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
2015
|
+
# @param worker_pool_name [String] Name of worker pool
|
|
2016
|
+
# @param worker_pool_envelope [WorkerPool] Properties of worker pool
|
|
2017
|
+
# @param @client.subscription_id [String] Subscription Id
|
|
2018
|
+
# @param @client.api_version [String] API Version
|
|
2019
|
+
# @param @client.accept_language [String] Gets or sets the preferred language
|
|
2020
|
+
# for the response.
|
|
2021
|
+
#
|
|
2022
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
|
2023
|
+
# response.
|
|
2024
|
+
#
|
|
2025
|
+
def create_or_update_worker_pool(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers = nil)
|
|
2026
|
+
# Send request
|
|
2027
|
+
promise = begin_create_or_update_worker_pool(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers)
|
|
2028
|
+
|
|
2029
|
+
promise = promise.then do |response|
|
|
2030
|
+
# Defining deserialization method.
|
|
2031
|
+
deserialize_method = lambda do |parsed_response|
|
|
2032
|
+
unless parsed_response.nil?
|
|
2033
|
+
parsed_response = WorkerPool.deserialize_object(parsed_response)
|
|
2034
|
+
end
|
|
2035
|
+
end
|
|
2036
|
+
|
|
2037
|
+
# Waiting for response.
|
|
2038
|
+
@client.get_put_operation_result(response, deserialize_method)
|
|
2039
|
+
end
|
|
2040
|
+
|
|
2041
|
+
promise
|
|
2042
|
+
end
|
|
2043
|
+
|
|
2044
|
+
#
|
|
2045
|
+
# Create or update a worker pool.
|
|
2046
|
+
#
|
|
2047
|
+
# @param resource_group_name [String] Name of resource group
|
|
2048
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
2049
|
+
# @param worker_pool_name [String] Name of worker pool
|
|
2050
|
+
# @param worker_pool_envelope [WorkerPool] Properties of worker pool
|
|
2051
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
2052
|
+
# applied to HTTP request.
|
|
2053
|
+
#
|
|
2054
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
2055
|
+
# response.
|
|
2056
|
+
#
|
|
2057
|
+
def begin_create_or_update_worker_pool(resource_group_name, name, worker_pool_name, worker_pool_envelope, custom_headers = nil)
|
|
2058
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
2059
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
2060
|
+
fail ArgumentError, 'worker_pool_name is nil' if worker_pool_name.nil?
|
|
2061
|
+
fail ArgumentError, 'worker_pool_envelope is nil' if worker_pool_envelope.nil?
|
|
2062
|
+
worker_pool_envelope.validate unless worker_pool_envelope.nil?
|
|
2063
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
2064
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
2065
|
+
request_headers = {}
|
|
2066
|
+
|
|
2067
|
+
# Set Headers
|
|
2068
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
2069
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
2070
|
+
|
|
2071
|
+
# Serialize Request
|
|
2072
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
2073
|
+
unless worker_pool_envelope.nil?
|
|
2074
|
+
worker_pool_envelope = WorkerPool.serialize_object(worker_pool_envelope)
|
|
2075
|
+
end
|
|
2076
|
+
request_content = JSON.generate(worker_pool_envelope, quirks_mode: true)
|
|
2077
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'
|
|
2078
|
+
options = {
|
|
2079
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
2080
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'workerPoolName' => worker_pool_name,'subscriptionId' => @client.subscription_id},
|
|
2081
|
+
query_params: {'api-version' => @client.api_version},
|
|
2082
|
+
body: request_content,
|
|
2083
|
+
headers: request_headers.merge(custom_headers || {})
|
|
2084
|
+
}
|
|
2085
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :put, options)
|
|
2086
|
+
promise = request.run_promise do |req|
|
|
2087
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
2088
|
+
end
|
|
2089
|
+
|
|
2090
|
+
promise = promise.then do |http_response|
|
|
2091
|
+
status_code = http_response.status
|
|
2092
|
+
response_content = http_response.body
|
|
2093
|
+
unless status_code == 200 || status_code == 202 || status_code == 400 || status_code == 404 || status_code == 409
|
|
2094
|
+
error_model = JSON.load(response_content)
|
|
2095
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
2096
|
+
end
|
|
2097
|
+
|
|
2098
|
+
# Create Result
|
|
2099
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
2100
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
2101
|
+
# Deserialize Response
|
|
2102
|
+
if status_code == 200
|
|
2103
|
+
begin
|
|
2104
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
2105
|
+
unless parsed_response.nil?
|
|
2106
|
+
parsed_response = WorkerPool.deserialize_object(parsed_response)
|
|
2107
|
+
end
|
|
2108
|
+
result.body = parsed_response
|
|
2109
|
+
rescue Exception => e
|
|
2110
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
2111
|
+
end
|
|
2112
|
+
end
|
|
2113
|
+
# Deserialize Response
|
|
2114
|
+
if status_code == 202
|
|
2115
|
+
begin
|
|
2116
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
2117
|
+
unless parsed_response.nil?
|
|
2118
|
+
parsed_response = WorkerPool.deserialize_object(parsed_response)
|
|
2119
|
+
end
|
|
2120
|
+
result.body = parsed_response
|
|
2121
|
+
rescue Exception => e
|
|
2122
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
2123
|
+
end
|
|
2124
|
+
end
|
|
2125
|
+
|
|
2126
|
+
result
|
|
2127
|
+
end
|
|
2128
|
+
|
|
2129
|
+
promise.execute
|
|
2130
|
+
end
|
|
2131
|
+
|
|
2132
|
+
#
|
|
2133
|
+
# Get available skus for scaling a worker pool.
|
|
2134
|
+
#
|
|
2135
|
+
# @param resource_group_name [String] Name of resource group
|
|
2136
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
2137
|
+
# @param worker_pool_name [String] Name of worker pool
|
|
2138
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
2139
|
+
# applied to HTTP request.
|
|
2140
|
+
#
|
|
2141
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
2142
|
+
# response.
|
|
2143
|
+
#
|
|
2144
|
+
def get_worker_pool_skus(resource_group_name, name, worker_pool_name, custom_headers = nil)
|
|
2145
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
2146
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
2147
|
+
fail ArgumentError, 'worker_pool_name is nil' if worker_pool_name.nil?
|
|
2148
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
2149
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
2150
|
+
request_headers = {}
|
|
2151
|
+
|
|
2152
|
+
# Set Headers
|
|
2153
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
2154
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
2155
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus'
|
|
2156
|
+
options = {
|
|
2157
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
2158
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'workerPoolName' => worker_pool_name,'subscriptionId' => @client.subscription_id},
|
|
2159
|
+
query_params: {'api-version' => @client.api_version},
|
|
2160
|
+
headers: request_headers.merge(custom_headers || {})
|
|
2161
|
+
}
|
|
2162
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
2163
|
+
promise = request.run_promise do |req|
|
|
2164
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
2165
|
+
end
|
|
2166
|
+
|
|
2167
|
+
promise = promise.then do |http_response|
|
|
2168
|
+
status_code = http_response.status
|
|
2169
|
+
response_content = http_response.body
|
|
2170
|
+
unless status_code == 200
|
|
2171
|
+
error_model = JSON.load(response_content)
|
|
2172
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
2173
|
+
end
|
|
2174
|
+
|
|
2175
|
+
# Create Result
|
|
2176
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
2177
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
2178
|
+
# Deserialize Response
|
|
2179
|
+
if status_code == 200
|
|
2180
|
+
begin
|
|
2181
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
2182
|
+
unless parsed_response.nil?
|
|
2183
|
+
parsed_response = SkuInfoCollection.deserialize_object(parsed_response)
|
|
2184
|
+
end
|
|
2185
|
+
result.body = parsed_response
|
|
2186
|
+
rescue Exception => e
|
|
2187
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
2188
|
+
end
|
|
2189
|
+
end
|
|
2190
|
+
|
|
2191
|
+
result
|
|
2192
|
+
end
|
|
2193
|
+
|
|
2194
|
+
promise.execute
|
|
2195
|
+
end
|
|
2196
|
+
|
|
2197
|
+
#
|
|
2198
|
+
# Get metrics for a specific instance of a worker pool of a hostingEnvironment
|
|
2199
|
+
# (App Service Environment).
|
|
2200
|
+
#
|
|
2201
|
+
# @param resource_group_name [String] Name of resource group
|
|
2202
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
2203
|
+
# @param worker_pool_name [String] Name of worker pool
|
|
2204
|
+
# @param instance [String] Name of instance in the worker pool
|
|
2205
|
+
# @param details [Boolean] Include instance details
|
|
2206
|
+
# @param filter [String] Return only usages/metrics specified in the filter.
|
|
2207
|
+
# Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1'
|
|
2208
|
+
# or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and
|
|
2209
|
+
# endTime eq '2014-12-31T23:59:59Z' and timeGrain eq
|
|
2210
|
+
# duration'[Hour|Minute|Day]'.
|
|
2211
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
2212
|
+
# applied to HTTP request.
|
|
2213
|
+
#
|
|
2214
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
2215
|
+
# response.
|
|
2216
|
+
#
|
|
2217
|
+
def get_worker_pool_instance_metrics(resource_group_name, name, worker_pool_name, instance, details = nil, filter = nil, custom_headers = nil)
|
|
2218
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
2219
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
2220
|
+
fail ArgumentError, 'worker_pool_name is nil' if worker_pool_name.nil?
|
|
2221
|
+
fail ArgumentError, 'instance is nil' if instance.nil?
|
|
2222
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
2223
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
2224
|
+
request_headers = {}
|
|
2225
|
+
|
|
2226
|
+
# Set Headers
|
|
2227
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
2228
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
2229
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metrics'
|
|
2230
|
+
options = {
|
|
2231
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
2232
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'workerPoolName' => worker_pool_name,'instance' => instance,'subscriptionId' => @client.subscription_id},
|
|
2233
|
+
query_params: {'details' => details,'$filter' => filter,'api-version' => @client.api_version},
|
|
2234
|
+
headers: request_headers.merge(custom_headers || {})
|
|
2235
|
+
}
|
|
2236
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
2237
|
+
promise = request.run_promise do |req|
|
|
2238
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
2239
|
+
end
|
|
2240
|
+
|
|
2241
|
+
promise = promise.then do |http_response|
|
|
2242
|
+
status_code = http_response.status
|
|
2243
|
+
response_content = http_response.body
|
|
2244
|
+
unless status_code == 200
|
|
2245
|
+
error_model = JSON.load(response_content)
|
|
2246
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
2247
|
+
end
|
|
2248
|
+
|
|
2249
|
+
# Create Result
|
|
2250
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
2251
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
2252
|
+
|
|
2253
|
+
result
|
|
2254
|
+
end
|
|
2255
|
+
|
|
2256
|
+
promise.execute
|
|
2257
|
+
end
|
|
2258
|
+
|
|
2259
|
+
#
|
|
2260
|
+
# Get metric definitions for a specific instance of a worker pool of a
|
|
2261
|
+
# hostingEnvironment (App Service Environment).
|
|
2262
|
+
#
|
|
2263
|
+
# @param resource_group_name [String] Name of resource group
|
|
2264
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
2265
|
+
# @param worker_pool_name [String] Name of worker pool
|
|
2266
|
+
# @param instance [String] Name of instance in the worker pool
|
|
2267
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
2268
|
+
# applied to HTTP request.
|
|
2269
|
+
#
|
|
2270
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
2271
|
+
# response.
|
|
2272
|
+
#
|
|
2273
|
+
def get_worker_pool_instance_metric_definitions(resource_group_name, name, worker_pool_name, instance, custom_headers = nil)
|
|
2274
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
2275
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
2276
|
+
fail ArgumentError, 'worker_pool_name is nil' if worker_pool_name.nil?
|
|
2277
|
+
fail ArgumentError, 'instance is nil' if instance.nil?
|
|
2278
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
2279
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
2280
|
+
request_headers = {}
|
|
2281
|
+
|
|
2282
|
+
# Set Headers
|
|
2283
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
2284
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
2285
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions'
|
|
2286
|
+
options = {
|
|
2287
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
2288
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'workerPoolName' => worker_pool_name,'instance' => instance,'subscriptionId' => @client.subscription_id},
|
|
2289
|
+
query_params: {'api-version' => @client.api_version},
|
|
2290
|
+
headers: request_headers.merge(custom_headers || {})
|
|
2291
|
+
}
|
|
2292
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
2293
|
+
promise = request.run_promise do |req|
|
|
2294
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
2295
|
+
end
|
|
2296
|
+
|
|
2297
|
+
promise = promise.then do |http_response|
|
|
2298
|
+
status_code = http_response.status
|
|
2299
|
+
response_content = http_response.body
|
|
2300
|
+
unless status_code == 200
|
|
2301
|
+
error_model = JSON.load(response_content)
|
|
2302
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
2303
|
+
end
|
|
2304
|
+
|
|
2305
|
+
# Create Result
|
|
2306
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
2307
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
2308
|
+
|
|
2309
|
+
result
|
|
2310
|
+
end
|
|
2311
|
+
|
|
2312
|
+
promise.execute
|
|
2313
|
+
end
|
|
2314
|
+
|
|
2315
|
+
#
|
|
2316
|
+
# Get metrics for a specific instance of a multiRole pool of a
|
|
2317
|
+
# hostingEnvironment (App Service Environment).
|
|
2318
|
+
#
|
|
2319
|
+
# @param resource_group_name [String] Name of resource group
|
|
2320
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
2321
|
+
# @param instance [String] Name of instance in the multiRole pool
|
|
2322
|
+
# @param details [Boolean] Include instance details
|
|
2323
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
2324
|
+
# applied to HTTP request.
|
|
2325
|
+
#
|
|
2326
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
2327
|
+
# response.
|
|
2328
|
+
#
|
|
2329
|
+
def get_multi_role_pool_instance_metrics(resource_group_name, name, instance, details = nil, custom_headers = nil)
|
|
2330
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
2331
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
2332
|
+
fail ArgumentError, 'instance is nil' if instance.nil?
|
|
2333
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
2334
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
2335
|
+
request_headers = {}
|
|
2336
|
+
|
|
2337
|
+
# Set Headers
|
|
2338
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
2339
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
2340
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metrics'
|
|
2341
|
+
options = {
|
|
2342
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
2343
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'instance' => instance,'subscriptionId' => @client.subscription_id},
|
|
2344
|
+
query_params: {'details' => details,'api-version' => @client.api_version},
|
|
2345
|
+
headers: request_headers.merge(custom_headers || {})
|
|
2346
|
+
}
|
|
2347
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
2348
|
+
promise = request.run_promise do |req|
|
|
2349
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
2350
|
+
end
|
|
2351
|
+
|
|
2352
|
+
promise = promise.then do |http_response|
|
|
2353
|
+
status_code = http_response.status
|
|
2354
|
+
response_content = http_response.body
|
|
2355
|
+
unless status_code == 200
|
|
2356
|
+
error_model = JSON.load(response_content)
|
|
2357
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
2358
|
+
end
|
|
2359
|
+
|
|
2360
|
+
# Create Result
|
|
2361
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
2362
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
2363
|
+
|
|
2364
|
+
result
|
|
2365
|
+
end
|
|
2366
|
+
|
|
2367
|
+
promise.execute
|
|
2368
|
+
end
|
|
2369
|
+
|
|
2370
|
+
#
|
|
2371
|
+
# Get metric definitions for a specific instance of a multiRole pool of a
|
|
2372
|
+
# hostingEnvironment (App Service Environment).
|
|
2373
|
+
#
|
|
2374
|
+
# @param resource_group_name [String] Name of resource group
|
|
2375
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
2376
|
+
# @param instance [String] Name of instance in the multiRole pool>
|
|
2377
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
2378
|
+
# applied to HTTP request.
|
|
2379
|
+
#
|
|
2380
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
2381
|
+
# response.
|
|
2382
|
+
#
|
|
2383
|
+
def get_multi_role_pool_instance_metric_definitions(resource_group_name, name, instance, custom_headers = nil)
|
|
2384
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
2385
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
2386
|
+
fail ArgumentError, 'instance is nil' if instance.nil?
|
|
2387
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
2388
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
2389
|
+
request_headers = {}
|
|
2390
|
+
|
|
2391
|
+
# Set Headers
|
|
2392
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
2393
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
2394
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions'
|
|
2395
|
+
options = {
|
|
2396
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
2397
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'instance' => instance,'subscriptionId' => @client.subscription_id},
|
|
2398
|
+
query_params: {'api-version' => @client.api_version},
|
|
2399
|
+
headers: request_headers.merge(custom_headers || {})
|
|
2400
|
+
}
|
|
2401
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
2402
|
+
promise = request.run_promise do |req|
|
|
2403
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
2404
|
+
end
|
|
2405
|
+
|
|
2406
|
+
promise = promise.then do |http_response|
|
|
2407
|
+
status_code = http_response.status
|
|
2408
|
+
response_content = http_response.body
|
|
2409
|
+
unless status_code == 200
|
|
2410
|
+
error_model = JSON.load(response_content)
|
|
2411
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
2412
|
+
end
|
|
2413
|
+
|
|
2414
|
+
# Create Result
|
|
2415
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
2416
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
2417
|
+
|
|
2418
|
+
result
|
|
2419
|
+
end
|
|
2420
|
+
|
|
2421
|
+
promise.execute
|
|
2422
|
+
end
|
|
2423
|
+
|
|
2424
|
+
#
|
|
2425
|
+
# Suspends the hostingEnvironment.
|
|
2426
|
+
#
|
|
2427
|
+
# @param resource_group_name [String] Name of resource group
|
|
2428
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
2429
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
|
2430
|
+
# response.
|
|
2431
|
+
#
|
|
2432
|
+
def suspend_hosting_environment(resource_group_name, name, custom_headers = nil)
|
|
2433
|
+
# Send request
|
|
2434
|
+
promise = begin_suspend_hosting_environment(resource_group_name, name, custom_headers)
|
|
2435
|
+
|
|
2436
|
+
promise = promise.then do |response|
|
|
2437
|
+
# Defining deserialization method.
|
|
2438
|
+
deserialize_method = lambda do |parsed_response|
|
|
2439
|
+
unless parsed_response.nil?
|
|
2440
|
+
parsed_response = SiteCollection.deserialize_object(parsed_response)
|
|
2441
|
+
end
|
|
2442
|
+
end
|
|
2443
|
+
|
|
2444
|
+
# Waiting for response.
|
|
2445
|
+
@client.get_post_or_delete_operation_result(response, deserialize_method)
|
|
2446
|
+
end
|
|
2447
|
+
|
|
2448
|
+
promise
|
|
2449
|
+
end
|
|
2450
|
+
|
|
2451
|
+
#
|
|
2452
|
+
# Suspends the hostingEnvironment.
|
|
2453
|
+
#
|
|
2454
|
+
# @param resource_group_name [String] Name of resource group
|
|
2455
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
2456
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
2457
|
+
# applied to HTTP request.
|
|
2458
|
+
#
|
|
2459
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
2460
|
+
# response.
|
|
2461
|
+
#
|
|
2462
|
+
def begin_suspend_hosting_environment(resource_group_name, name, custom_headers = nil)
|
|
2463
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
2464
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
2465
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
2466
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
2467
|
+
request_headers = {}
|
|
2468
|
+
|
|
2469
|
+
# Set Headers
|
|
2470
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
2471
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
2472
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend'
|
|
2473
|
+
options = {
|
|
2474
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
2475
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
2476
|
+
query_params: {'api-version' => @client.api_version},
|
|
2477
|
+
headers: request_headers.merge(custom_headers || {})
|
|
2478
|
+
}
|
|
2479
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
|
|
2480
|
+
promise = request.run_promise do |req|
|
|
2481
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
2482
|
+
end
|
|
2483
|
+
|
|
2484
|
+
promise = promise.then do |http_response|
|
|
2485
|
+
status_code = http_response.status
|
|
2486
|
+
response_content = http_response.body
|
|
2487
|
+
unless status_code == 200 || status_code == 202
|
|
2488
|
+
error_model = JSON.load(response_content)
|
|
2489
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
2490
|
+
end
|
|
2491
|
+
|
|
2492
|
+
# Create Result
|
|
2493
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
2494
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
2495
|
+
# Deserialize Response
|
|
2496
|
+
if status_code == 200
|
|
2497
|
+
begin
|
|
2498
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
2499
|
+
unless parsed_response.nil?
|
|
2500
|
+
parsed_response = SiteCollection.deserialize_object(parsed_response)
|
|
2501
|
+
end
|
|
2502
|
+
result.body = parsed_response
|
|
2503
|
+
rescue Exception => e
|
|
2504
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
2505
|
+
end
|
|
2506
|
+
end
|
|
2507
|
+
# Deserialize Response
|
|
2508
|
+
if status_code == 202
|
|
2509
|
+
begin
|
|
2510
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
2511
|
+
unless parsed_response.nil?
|
|
2512
|
+
parsed_response = SiteCollection.deserialize_object(parsed_response)
|
|
2513
|
+
end
|
|
2514
|
+
result.body = parsed_response
|
|
2515
|
+
rescue Exception => e
|
|
2516
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
2517
|
+
end
|
|
2518
|
+
end
|
|
2519
|
+
|
|
2520
|
+
result
|
|
2521
|
+
end
|
|
2522
|
+
|
|
2523
|
+
promise.execute
|
|
2524
|
+
end
|
|
2525
|
+
|
|
2526
|
+
#
|
|
2527
|
+
# Resumes the hostingEnvironment.
|
|
2528
|
+
#
|
|
2529
|
+
# @param resource_group_name [String] Name of resource group
|
|
2530
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
2531
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
|
2532
|
+
# response.
|
|
2533
|
+
#
|
|
2534
|
+
def resume_hosting_environment(resource_group_name, name, custom_headers = nil)
|
|
2535
|
+
# Send request
|
|
2536
|
+
promise = begin_resume_hosting_environment(resource_group_name, name, custom_headers)
|
|
2537
|
+
|
|
2538
|
+
promise = promise.then do |response|
|
|
2539
|
+
# Defining deserialization method.
|
|
2540
|
+
deserialize_method = lambda do |parsed_response|
|
|
2541
|
+
unless parsed_response.nil?
|
|
2542
|
+
parsed_response = SiteCollection.deserialize_object(parsed_response)
|
|
2543
|
+
end
|
|
2544
|
+
end
|
|
2545
|
+
|
|
2546
|
+
# Waiting for response.
|
|
2547
|
+
@client.get_post_or_delete_operation_result(response, deserialize_method)
|
|
2548
|
+
end
|
|
2549
|
+
|
|
2550
|
+
promise
|
|
2551
|
+
end
|
|
2552
|
+
|
|
2553
|
+
#
|
|
2554
|
+
# Resumes the hostingEnvironment.
|
|
2555
|
+
#
|
|
2556
|
+
# @param resource_group_name [String] Name of resource group
|
|
2557
|
+
# @param name [String] Name of hostingEnvironment (App Service Environment)
|
|
2558
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
2559
|
+
# applied to HTTP request.
|
|
2560
|
+
#
|
|
2561
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
2562
|
+
# response.
|
|
2563
|
+
#
|
|
2564
|
+
def begin_resume_hosting_environment(resource_group_name, name, custom_headers = nil)
|
|
2565
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
2566
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
2567
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
2568
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
2569
|
+
request_headers = {}
|
|
2570
|
+
|
|
2571
|
+
# Set Headers
|
|
2572
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
2573
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
2574
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume'
|
|
2575
|
+
options = {
|
|
2576
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
2577
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
2578
|
+
query_params: {'api-version' => @client.api_version},
|
|
2579
|
+
headers: request_headers.merge(custom_headers || {})
|
|
2580
|
+
}
|
|
2581
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
|
|
2582
|
+
promise = request.run_promise do |req|
|
|
2583
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
2584
|
+
end
|
|
2585
|
+
|
|
2586
|
+
promise = promise.then do |http_response|
|
|
2587
|
+
status_code = http_response.status
|
|
2588
|
+
response_content = http_response.body
|
|
2589
|
+
unless status_code == 200 || status_code == 202
|
|
2590
|
+
error_model = JSON.load(response_content)
|
|
2591
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
2592
|
+
end
|
|
2593
|
+
|
|
2594
|
+
# Create Result
|
|
2595
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
2596
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
2597
|
+
# Deserialize Response
|
|
2598
|
+
if status_code == 200
|
|
2599
|
+
begin
|
|
2600
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
2601
|
+
unless parsed_response.nil?
|
|
2602
|
+
parsed_response = SiteCollection.deserialize_object(parsed_response)
|
|
2603
|
+
end
|
|
2604
|
+
result.body = parsed_response
|
|
2605
|
+
rescue Exception => e
|
|
2606
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
2607
|
+
end
|
|
2608
|
+
end
|
|
2609
|
+
# Deserialize Response
|
|
2610
|
+
if status_code == 202
|
|
2611
|
+
begin
|
|
2612
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
2613
|
+
unless parsed_response.nil?
|
|
2614
|
+
parsed_response = SiteCollection.deserialize_object(parsed_response)
|
|
2615
|
+
end
|
|
2616
|
+
result.body = parsed_response
|
|
2617
|
+
rescue Exception => e
|
|
2618
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
2619
|
+
end
|
|
2620
|
+
end
|
|
2621
|
+
|
|
2622
|
+
result
|
|
2623
|
+
end
|
|
2624
|
+
|
|
2625
|
+
promise.execute
|
|
2626
|
+
end
|
|
2627
|
+
|
|
2628
|
+
end
|
|
2629
|
+
end
|