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,320 @@
|
|
|
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 Recommendations
|
|
18
|
+
include Azure::ARM::Web::Models
|
|
19
|
+
include MsRestAzure
|
|
20
|
+
|
|
21
|
+
#
|
|
22
|
+
# Creates and initializes a new instance of the Recommendations 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
|
+
# Gets a list of recommendations associated with the specified subscription.
|
|
34
|
+
#
|
|
35
|
+
# @param featured [Boolean] If set, this API returns only the most critical
|
|
36
|
+
# recommendation among the others. Otherwise this API returns all
|
|
37
|
+
# recommendations available
|
|
38
|
+
# @param filter [String] Return only channels specified in the filter. Filter
|
|
39
|
+
# is specified by using OData syntax. Example: $filter=channels eq 'Api' or
|
|
40
|
+
# channel eq 'Notification'
|
|
41
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
42
|
+
# applied to HTTP request.
|
|
43
|
+
#
|
|
44
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
45
|
+
# response.
|
|
46
|
+
#
|
|
47
|
+
def get_recommendation_by_subscription(featured = nil, filter = nil, custom_headers = nil)
|
|
48
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
49
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
50
|
+
request_headers = {}
|
|
51
|
+
|
|
52
|
+
# Set Headers
|
|
53
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
54
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
55
|
+
path_template = '/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations'
|
|
56
|
+
options = {
|
|
57
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
58
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
|
59
|
+
query_params: {'featured' => featured,'$filter' => filter,'api-version' => @client.api_version},
|
|
60
|
+
headers: request_headers.merge(custom_headers || {})
|
|
61
|
+
}
|
|
62
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
63
|
+
promise = request.run_promise do |req|
|
|
64
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
promise = promise.then do |http_response|
|
|
68
|
+
status_code = http_response.status
|
|
69
|
+
response_content = http_response.body
|
|
70
|
+
unless status_code == 200
|
|
71
|
+
error_model = JSON.load(response_content)
|
|
72
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# Create Result
|
|
76
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
77
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
78
|
+
# Deserialize Response
|
|
79
|
+
if status_code == 200
|
|
80
|
+
begin
|
|
81
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
82
|
+
unless parsed_response.nil?
|
|
83
|
+
deserialized_array = []
|
|
84
|
+
parsed_response.each do |element|
|
|
85
|
+
unless element.nil?
|
|
86
|
+
element = Recommendation.deserialize_object(element)
|
|
87
|
+
end
|
|
88
|
+
deserialized_array.push(element)
|
|
89
|
+
end
|
|
90
|
+
parsed_response = deserialized_array
|
|
91
|
+
end
|
|
92
|
+
result.body = parsed_response
|
|
93
|
+
rescue Exception => e
|
|
94
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
result
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
promise.execute
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
#
|
|
105
|
+
# Gets the detailed properties of the recommendation object for the specified
|
|
106
|
+
# web site.
|
|
107
|
+
#
|
|
108
|
+
# @param resource_group_name [String] Resource group name
|
|
109
|
+
# @param site_name [String] Site name
|
|
110
|
+
# @param name [String] Recommendation rule name
|
|
111
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
112
|
+
# applied to HTTP request.
|
|
113
|
+
#
|
|
114
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
115
|
+
# response.
|
|
116
|
+
#
|
|
117
|
+
def get_rule_details_by_site_name(resource_group_name, site_name, name, custom_headers = nil)
|
|
118
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
119
|
+
fail ArgumentError, 'site_name is nil' if site_name.nil?
|
|
120
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
121
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
122
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
123
|
+
request_headers = {}
|
|
124
|
+
|
|
125
|
+
# Set Headers
|
|
126
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
127
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
128
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}'
|
|
129
|
+
options = {
|
|
130
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
131
|
+
path_params: {'resourceGroupName' => resource_group_name,'siteName' => site_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
132
|
+
query_params: {'api-version' => @client.api_version},
|
|
133
|
+
headers: request_headers.merge(custom_headers || {})
|
|
134
|
+
}
|
|
135
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
136
|
+
promise = request.run_promise do |req|
|
|
137
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
promise = promise.then do |http_response|
|
|
141
|
+
status_code = http_response.status
|
|
142
|
+
response_content = http_response.body
|
|
143
|
+
unless status_code == 200
|
|
144
|
+
error_model = JSON.load(response_content)
|
|
145
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Create Result
|
|
149
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
150
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
151
|
+
# Deserialize Response
|
|
152
|
+
if status_code == 200
|
|
153
|
+
begin
|
|
154
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
155
|
+
unless parsed_response.nil?
|
|
156
|
+
parsed_response = RecommendationRule.deserialize_object(parsed_response)
|
|
157
|
+
end
|
|
158
|
+
result.body = parsed_response
|
|
159
|
+
rescue Exception => e
|
|
160
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
161
|
+
end
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
result
|
|
165
|
+
end
|
|
166
|
+
|
|
167
|
+
promise.execute
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
#
|
|
171
|
+
# Gets a list of recommendations associated with the specified web site.
|
|
172
|
+
#
|
|
173
|
+
# @param resource_group_name [String] Resource group name
|
|
174
|
+
# @param site_name [String] Site name
|
|
175
|
+
# @param featured [Boolean] If set, this API returns only the most critical
|
|
176
|
+
# recommendation among the others. Otherwise this API returns all
|
|
177
|
+
# recommendations available
|
|
178
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
179
|
+
# applied to HTTP request.
|
|
180
|
+
#
|
|
181
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
182
|
+
# response.
|
|
183
|
+
#
|
|
184
|
+
def get_recommended_rules_for_site(resource_group_name, site_name, featured = nil, custom_headers = nil)
|
|
185
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
186
|
+
fail ArgumentError, 'site_name is nil' if site_name.nil?
|
|
187
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
188
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
189
|
+
request_headers = {}
|
|
190
|
+
|
|
191
|
+
# Set Headers
|
|
192
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
193
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
194
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations'
|
|
195
|
+
options = {
|
|
196
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
197
|
+
path_params: {'resourceGroupName' => resource_group_name,'siteName' => site_name,'subscriptionId' => @client.subscription_id},
|
|
198
|
+
query_params: {'featured' => featured,'api-version' => @client.api_version},
|
|
199
|
+
headers: request_headers.merge(custom_headers || {})
|
|
200
|
+
}
|
|
201
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
202
|
+
promise = request.run_promise do |req|
|
|
203
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
promise = promise.then do |http_response|
|
|
207
|
+
status_code = http_response.status
|
|
208
|
+
response_content = http_response.body
|
|
209
|
+
unless status_code == 200
|
|
210
|
+
error_model = JSON.load(response_content)
|
|
211
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
# Create Result
|
|
215
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
216
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
217
|
+
# Deserialize Response
|
|
218
|
+
if status_code == 200
|
|
219
|
+
begin
|
|
220
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
221
|
+
unless parsed_response.nil?
|
|
222
|
+
deserialized_array = []
|
|
223
|
+
parsed_response.each do |element|
|
|
224
|
+
unless element.nil?
|
|
225
|
+
element = Recommendation.deserialize_object(element)
|
|
226
|
+
end
|
|
227
|
+
deserialized_array.push(element)
|
|
228
|
+
end
|
|
229
|
+
parsed_response = deserialized_array
|
|
230
|
+
end
|
|
231
|
+
result.body = parsed_response
|
|
232
|
+
rescue Exception => e
|
|
233
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
234
|
+
end
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
result
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
promise.execute
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
#
|
|
244
|
+
# Gets the list of past recommendations optionally specified by the time range.
|
|
245
|
+
#
|
|
246
|
+
# @param resource_group_name [String] Resource group name
|
|
247
|
+
# @param site_name [String] Site name
|
|
248
|
+
# @param start_time [String] The start time of a time range to query, e.g.
|
|
249
|
+
# $filter=startTime eq '2015-01-01T00:00:00Z' and endTime eq
|
|
250
|
+
# '2015-01-02T00:00:00Z'
|
|
251
|
+
# @param end_time [String] The end time of a time range to query, e.g.
|
|
252
|
+
# $filter=startTime eq '2015-01-01T00:00:00Z' and endTime eq
|
|
253
|
+
# '2015-01-02T00:00:00Z'
|
|
254
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
255
|
+
# applied to HTTP request.
|
|
256
|
+
#
|
|
257
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
258
|
+
# response.
|
|
259
|
+
#
|
|
260
|
+
def get_recommendation_history_for_site(resource_group_name, site_name, start_time = nil, end_time = nil, custom_headers = nil)
|
|
261
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
262
|
+
fail ArgumentError, 'site_name is nil' if site_name.nil?
|
|
263
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
264
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
265
|
+
request_headers = {}
|
|
266
|
+
|
|
267
|
+
# Set Headers
|
|
268
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
269
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
270
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendationHistory'
|
|
271
|
+
options = {
|
|
272
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
273
|
+
path_params: {'resourceGroupName' => resource_group_name,'siteName' => site_name,'subscriptionId' => @client.subscription_id},
|
|
274
|
+
query_params: {'startTime' => start_time,'endTime' => end_time,'api-version' => @client.api_version},
|
|
275
|
+
headers: request_headers.merge(custom_headers || {})
|
|
276
|
+
}
|
|
277
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
278
|
+
promise = request.run_promise do |req|
|
|
279
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
promise = promise.then do |http_response|
|
|
283
|
+
status_code = http_response.status
|
|
284
|
+
response_content = http_response.body
|
|
285
|
+
unless status_code == 200
|
|
286
|
+
error_model = JSON.load(response_content)
|
|
287
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
288
|
+
end
|
|
289
|
+
|
|
290
|
+
# Create Result
|
|
291
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
292
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
293
|
+
# Deserialize Response
|
|
294
|
+
if status_code == 200
|
|
295
|
+
begin
|
|
296
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
297
|
+
unless parsed_response.nil?
|
|
298
|
+
deserialized_array = []
|
|
299
|
+
parsed_response.each do |element|
|
|
300
|
+
unless element.nil?
|
|
301
|
+
element = Recommendation.deserialize_object(element)
|
|
302
|
+
end
|
|
303
|
+
deserialized_array.push(element)
|
|
304
|
+
end
|
|
305
|
+
parsed_response = deserialized_array
|
|
306
|
+
end
|
|
307
|
+
result.body = parsed_response
|
|
308
|
+
rescue Exception => e
|
|
309
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
310
|
+
end
|
|
311
|
+
end
|
|
312
|
+
|
|
313
|
+
result
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
promise.execute
|
|
317
|
+
end
|
|
318
|
+
|
|
319
|
+
end
|
|
320
|
+
end
|
|
@@ -0,0 +1,1409 @@
|
|
|
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 ServerFarms
|
|
18
|
+
include Azure::ARM::Web::Models
|
|
19
|
+
include MsRestAzure
|
|
20
|
+
|
|
21
|
+
#
|
|
22
|
+
# Creates and initializes a new instance of the ServerFarms 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
|
+
# Gets collection of App Service Plans in a resource group for a given
|
|
34
|
+
# subscription.
|
|
35
|
+
#
|
|
36
|
+
# @param resource_group_name [String] Name of resource group
|
|
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_server_farms(resource_group_name, custom_headers = nil)
|
|
44
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.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
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms'
|
|
53
|
+
options = {
|
|
54
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
55
|
+
path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
|
|
56
|
+
query_params: {'api-version' => @client.api_version},
|
|
57
|
+
headers: request_headers.merge(custom_headers || {})
|
|
58
|
+
}
|
|
59
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
60
|
+
promise = request.run_promise do |req|
|
|
61
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
promise = promise.then do |http_response|
|
|
65
|
+
status_code = http_response.status
|
|
66
|
+
response_content = http_response.body
|
|
67
|
+
unless status_code == 200
|
|
68
|
+
error_model = JSON.load(response_content)
|
|
69
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Create Result
|
|
73
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
74
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
75
|
+
# Deserialize Response
|
|
76
|
+
if status_code == 200
|
|
77
|
+
begin
|
|
78
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
79
|
+
unless parsed_response.nil?
|
|
80
|
+
parsed_response = ServerFarmCollection.deserialize_object(parsed_response)
|
|
81
|
+
end
|
|
82
|
+
result.body = parsed_response
|
|
83
|
+
rescue Exception => e
|
|
84
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
result
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
promise.execute
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
#
|
|
95
|
+
# Gets specified App Service Plan in a resource group
|
|
96
|
+
#
|
|
97
|
+
# @param resource_group_name [String] Name of resource group
|
|
98
|
+
# @param name [String] Name of App Service Plan
|
|
99
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
100
|
+
# applied to HTTP request.
|
|
101
|
+
#
|
|
102
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
103
|
+
# response.
|
|
104
|
+
#
|
|
105
|
+
def get_server_farm(resource_group_name, name, custom_headers = nil)
|
|
106
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
107
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
108
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
109
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
110
|
+
request_headers = {}
|
|
111
|
+
|
|
112
|
+
# Set Headers
|
|
113
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
114
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
115
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'
|
|
116
|
+
options = {
|
|
117
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
118
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
119
|
+
query_params: {'api-version' => @client.api_version},
|
|
120
|
+
headers: request_headers.merge(custom_headers || {})
|
|
121
|
+
}
|
|
122
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
123
|
+
promise = request.run_promise do |req|
|
|
124
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
promise = promise.then do |http_response|
|
|
128
|
+
status_code = http_response.status
|
|
129
|
+
response_content = http_response.body
|
|
130
|
+
unless status_code == 200
|
|
131
|
+
error_model = JSON.load(response_content)
|
|
132
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Create Result
|
|
136
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
137
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
138
|
+
# Deserialize Response
|
|
139
|
+
if status_code == 200
|
|
140
|
+
begin
|
|
141
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
142
|
+
unless parsed_response.nil?
|
|
143
|
+
parsed_response = ServerFarmWithRichSku.deserialize_object(parsed_response)
|
|
144
|
+
end
|
|
145
|
+
result.body = parsed_response
|
|
146
|
+
rescue Exception => e
|
|
147
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
|
|
151
|
+
result
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
promise.execute
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
#
|
|
158
|
+
# Creates or updates an App Service Plan
|
|
159
|
+
#
|
|
160
|
+
# @param resource_group_name [String] Name of resource group
|
|
161
|
+
# @param name [String] Name of App Service Plan
|
|
162
|
+
# @param server_farm_envelope [ServerFarmWithRichSku] Details of App Service
|
|
163
|
+
# Plan
|
|
164
|
+
# @param allow_pending_state [Boolean] OBSOLETE: If true, allow pending state
|
|
165
|
+
# for App Service Plan
|
|
166
|
+
# @param @client.subscription_id [String] Subscription Id
|
|
167
|
+
# @param @client.api_version [String] API Version
|
|
168
|
+
# @param @client.accept_language [String] Gets or sets the preferred language
|
|
169
|
+
# for the response.
|
|
170
|
+
#
|
|
171
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
|
172
|
+
# response.
|
|
173
|
+
#
|
|
174
|
+
def create_or_update_server_farm(resource_group_name, name, server_farm_envelope, allow_pending_state = nil, custom_headers = nil)
|
|
175
|
+
# Send request
|
|
176
|
+
promise = begin_create_or_update_server_farm(resource_group_name, name, server_farm_envelope, allow_pending_state, custom_headers)
|
|
177
|
+
|
|
178
|
+
promise = promise.then do |response|
|
|
179
|
+
# Defining deserialization method.
|
|
180
|
+
deserialize_method = lambda do |parsed_response|
|
|
181
|
+
unless parsed_response.nil?
|
|
182
|
+
parsed_response = ServerFarmWithRichSku.deserialize_object(parsed_response)
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
# Waiting for response.
|
|
187
|
+
@client.get_put_operation_result(response, deserialize_method)
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
promise
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
#
|
|
194
|
+
# Creates or updates an App Service Plan
|
|
195
|
+
#
|
|
196
|
+
# @param resource_group_name [String] Name of resource group
|
|
197
|
+
# @param name [String] Name of App Service Plan
|
|
198
|
+
# @param server_farm_envelope [ServerFarmWithRichSku] Details of App Service
|
|
199
|
+
# Plan
|
|
200
|
+
# @param allow_pending_state [Boolean] OBSOLETE: If true, allow pending state
|
|
201
|
+
# for App Service Plan
|
|
202
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
203
|
+
# applied to HTTP request.
|
|
204
|
+
#
|
|
205
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
206
|
+
# response.
|
|
207
|
+
#
|
|
208
|
+
def begin_create_or_update_server_farm(resource_group_name, name, server_farm_envelope, allow_pending_state = nil, custom_headers = nil)
|
|
209
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
210
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
211
|
+
fail ArgumentError, 'server_farm_envelope is nil' if server_farm_envelope.nil?
|
|
212
|
+
server_farm_envelope.validate unless server_farm_envelope.nil?
|
|
213
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
214
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
215
|
+
request_headers = {}
|
|
216
|
+
|
|
217
|
+
# Set Headers
|
|
218
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
219
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
220
|
+
|
|
221
|
+
# Serialize Request
|
|
222
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
223
|
+
unless server_farm_envelope.nil?
|
|
224
|
+
server_farm_envelope = ServerFarmWithRichSku.serialize_object(server_farm_envelope)
|
|
225
|
+
end
|
|
226
|
+
request_content = JSON.generate(server_farm_envelope, quirks_mode: true)
|
|
227
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'
|
|
228
|
+
options = {
|
|
229
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
230
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
231
|
+
query_params: {'allowPendingState' => allow_pending_state,'api-version' => @client.api_version},
|
|
232
|
+
body: request_content,
|
|
233
|
+
headers: request_headers.merge(custom_headers || {})
|
|
234
|
+
}
|
|
235
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :put, options)
|
|
236
|
+
promise = request.run_promise do |req|
|
|
237
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
promise = promise.then do |http_response|
|
|
241
|
+
status_code = http_response.status
|
|
242
|
+
response_content = http_response.body
|
|
243
|
+
unless status_code == 200 || status_code == 202
|
|
244
|
+
error_model = JSON.load(response_content)
|
|
245
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
246
|
+
end
|
|
247
|
+
|
|
248
|
+
# Create Result
|
|
249
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
250
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
251
|
+
# Deserialize Response
|
|
252
|
+
if status_code == 200
|
|
253
|
+
begin
|
|
254
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
255
|
+
unless parsed_response.nil?
|
|
256
|
+
parsed_response = ServerFarmWithRichSku.deserialize_object(parsed_response)
|
|
257
|
+
end
|
|
258
|
+
result.body = parsed_response
|
|
259
|
+
rescue Exception => e
|
|
260
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
261
|
+
end
|
|
262
|
+
end
|
|
263
|
+
# Deserialize Response
|
|
264
|
+
if status_code == 202
|
|
265
|
+
begin
|
|
266
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
267
|
+
unless parsed_response.nil?
|
|
268
|
+
parsed_response = ServerFarmWithRichSku.deserialize_object(parsed_response)
|
|
269
|
+
end
|
|
270
|
+
result.body = parsed_response
|
|
271
|
+
rescue Exception => e
|
|
272
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
273
|
+
end
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
result
|
|
277
|
+
end
|
|
278
|
+
|
|
279
|
+
promise.execute
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
#
|
|
283
|
+
# Deletes a App Service Plan
|
|
284
|
+
#
|
|
285
|
+
# @param resource_group_name [String] Name of resource group
|
|
286
|
+
# @param name [String] Name of App Service Plan
|
|
287
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
288
|
+
# applied to HTTP request.
|
|
289
|
+
#
|
|
290
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
291
|
+
# response.
|
|
292
|
+
#
|
|
293
|
+
def delete_server_farm(resource_group_name, name, custom_headers = nil)
|
|
294
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
295
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
296
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
297
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
298
|
+
request_headers = {}
|
|
299
|
+
|
|
300
|
+
# Set Headers
|
|
301
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
302
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
303
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'
|
|
304
|
+
options = {
|
|
305
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
306
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
307
|
+
query_params: {'api-version' => @client.api_version},
|
|
308
|
+
headers: request_headers.merge(custom_headers || {})
|
|
309
|
+
}
|
|
310
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :delete, options)
|
|
311
|
+
promise = request.run_promise do |req|
|
|
312
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
313
|
+
end
|
|
314
|
+
|
|
315
|
+
promise = promise.then do |http_response|
|
|
316
|
+
status_code = http_response.status
|
|
317
|
+
response_content = http_response.body
|
|
318
|
+
unless status_code == 200
|
|
319
|
+
error_model = JSON.load(response_content)
|
|
320
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
321
|
+
end
|
|
322
|
+
|
|
323
|
+
# Create Result
|
|
324
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
325
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
326
|
+
|
|
327
|
+
result
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
promise.execute
|
|
331
|
+
end
|
|
332
|
+
|
|
333
|
+
#
|
|
334
|
+
# Queries for App Serice Plan metrics
|
|
335
|
+
#
|
|
336
|
+
# @param resource_group_name [String] Name of resource group
|
|
337
|
+
# @param name [String] Name of App Service Plan
|
|
338
|
+
# @param details [Boolean] If true, metrics are broken down per App Service
|
|
339
|
+
# Plan instance
|
|
340
|
+
# @param filter [String] Return only usages/metrics specified in the filter.
|
|
341
|
+
# Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1'
|
|
342
|
+
# or name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and
|
|
343
|
+
# endTime eq '2014-12-31T23:59:59Z' and timeGrain eq
|
|
344
|
+
# duration'[Hour|Minute|Day]'.
|
|
345
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
346
|
+
# applied to HTTP request.
|
|
347
|
+
#
|
|
348
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
349
|
+
# response.
|
|
350
|
+
#
|
|
351
|
+
def get_server_farm_metrics(resource_group_name, name, details = nil, filter = nil, custom_headers = nil)
|
|
352
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
353
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
354
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
355
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
356
|
+
request_headers = {}
|
|
357
|
+
|
|
358
|
+
# Set Headers
|
|
359
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
360
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
361
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metrics'
|
|
362
|
+
options = {
|
|
363
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
364
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
365
|
+
query_params: {'details' => details,'$filter' => filter,'api-version' => @client.api_version},
|
|
366
|
+
headers: request_headers.merge(custom_headers || {})
|
|
367
|
+
}
|
|
368
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
369
|
+
promise = request.run_promise do |req|
|
|
370
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
371
|
+
end
|
|
372
|
+
|
|
373
|
+
promise = promise.then do |http_response|
|
|
374
|
+
status_code = http_response.status
|
|
375
|
+
response_content = http_response.body
|
|
376
|
+
unless status_code == 200
|
|
377
|
+
error_model = JSON.load(response_content)
|
|
378
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
379
|
+
end
|
|
380
|
+
|
|
381
|
+
# Create Result
|
|
382
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
383
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
384
|
+
# Deserialize Response
|
|
385
|
+
if status_code == 200
|
|
386
|
+
begin
|
|
387
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
388
|
+
unless parsed_response.nil?
|
|
389
|
+
parsed_response = ResourceMetricCollection.deserialize_object(parsed_response)
|
|
390
|
+
end
|
|
391
|
+
result.body = parsed_response
|
|
392
|
+
rescue Exception => e
|
|
393
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
394
|
+
end
|
|
395
|
+
end
|
|
396
|
+
|
|
397
|
+
result
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
promise.execute
|
|
401
|
+
end
|
|
402
|
+
|
|
403
|
+
#
|
|
404
|
+
# List of metrics that can be queried for an App Service Plan
|
|
405
|
+
#
|
|
406
|
+
# @param resource_group_name [String] Name of resource group
|
|
407
|
+
# @param name [String] Name of App Service Plan
|
|
408
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
409
|
+
# applied to HTTP request.
|
|
410
|
+
#
|
|
411
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
412
|
+
# response.
|
|
413
|
+
#
|
|
414
|
+
def get_server_farm_metric_defintions(resource_group_name, name, custom_headers = nil)
|
|
415
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
416
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
417
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
418
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
419
|
+
request_headers = {}
|
|
420
|
+
|
|
421
|
+
# Set Headers
|
|
422
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
423
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
424
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metricdefinitions'
|
|
425
|
+
options = {
|
|
426
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
427
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
428
|
+
query_params: {'api-version' => @client.api_version},
|
|
429
|
+
headers: request_headers.merge(custom_headers || {})
|
|
430
|
+
}
|
|
431
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
432
|
+
promise = request.run_promise do |req|
|
|
433
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
434
|
+
end
|
|
435
|
+
|
|
436
|
+
promise = promise.then do |http_response|
|
|
437
|
+
status_code = http_response.status
|
|
438
|
+
response_content = http_response.body
|
|
439
|
+
unless status_code == 200
|
|
440
|
+
error_model = JSON.load(response_content)
|
|
441
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
442
|
+
end
|
|
443
|
+
|
|
444
|
+
# Create Result
|
|
445
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
446
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
447
|
+
# Deserialize Response
|
|
448
|
+
if status_code == 200
|
|
449
|
+
begin
|
|
450
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
451
|
+
unless parsed_response.nil?
|
|
452
|
+
parsed_response = MetricDefinitionCollection.deserialize_object(parsed_response)
|
|
453
|
+
end
|
|
454
|
+
result.body = parsed_response
|
|
455
|
+
rescue Exception => e
|
|
456
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
457
|
+
end
|
|
458
|
+
end
|
|
459
|
+
|
|
460
|
+
result
|
|
461
|
+
end
|
|
462
|
+
|
|
463
|
+
promise.execute
|
|
464
|
+
end
|
|
465
|
+
|
|
466
|
+
#
|
|
467
|
+
# Gets list of vnets associated with App Service Plan
|
|
468
|
+
#
|
|
469
|
+
# @param resource_group_name [String] Name of resource group
|
|
470
|
+
# @param name [String] Name of App Service Plan
|
|
471
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
472
|
+
# applied to HTTP request.
|
|
473
|
+
#
|
|
474
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
475
|
+
# response.
|
|
476
|
+
#
|
|
477
|
+
def get_vnets_for_server_farm(resource_group_name, name, custom_headers = nil)
|
|
478
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
479
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
480
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
481
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
482
|
+
request_headers = {}
|
|
483
|
+
|
|
484
|
+
# Set Headers
|
|
485
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
486
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
487
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections'
|
|
488
|
+
options = {
|
|
489
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
490
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
491
|
+
query_params: {'api-version' => @client.api_version},
|
|
492
|
+
headers: request_headers.merge(custom_headers || {})
|
|
493
|
+
}
|
|
494
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
495
|
+
promise = request.run_promise do |req|
|
|
496
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
497
|
+
end
|
|
498
|
+
|
|
499
|
+
promise = promise.then do |http_response|
|
|
500
|
+
status_code = http_response.status
|
|
501
|
+
response_content = http_response.body
|
|
502
|
+
unless status_code == 200
|
|
503
|
+
error_model = JSON.load(response_content)
|
|
504
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
505
|
+
end
|
|
506
|
+
|
|
507
|
+
# Create Result
|
|
508
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
509
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
510
|
+
# Deserialize Response
|
|
511
|
+
if status_code == 200
|
|
512
|
+
begin
|
|
513
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
514
|
+
unless parsed_response.nil?
|
|
515
|
+
deserialized_array = []
|
|
516
|
+
parsed_response.each do |element|
|
|
517
|
+
unless element.nil?
|
|
518
|
+
element = VnetInfo.deserialize_object(element)
|
|
519
|
+
end
|
|
520
|
+
deserialized_array.push(element)
|
|
521
|
+
end
|
|
522
|
+
parsed_response = deserialized_array
|
|
523
|
+
end
|
|
524
|
+
result.body = parsed_response
|
|
525
|
+
rescue Exception => e
|
|
526
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
527
|
+
end
|
|
528
|
+
end
|
|
529
|
+
|
|
530
|
+
result
|
|
531
|
+
end
|
|
532
|
+
|
|
533
|
+
promise.execute
|
|
534
|
+
end
|
|
535
|
+
|
|
536
|
+
#
|
|
537
|
+
# Gets a vnet associated with an App Service Plan
|
|
538
|
+
#
|
|
539
|
+
# @param resource_group_name [String] Name of resource group
|
|
540
|
+
# @param name [String] Name of App Service Plan
|
|
541
|
+
# @param vnet_name [String] Name of virtual network
|
|
542
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
543
|
+
# applied to HTTP request.
|
|
544
|
+
#
|
|
545
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
546
|
+
# response.
|
|
547
|
+
#
|
|
548
|
+
def get_vnet_from_server_farm(resource_group_name, name, vnet_name, custom_headers = nil)
|
|
549
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
550
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
551
|
+
fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
|
|
552
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
553
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
554
|
+
request_headers = {}
|
|
555
|
+
|
|
556
|
+
# Set Headers
|
|
557
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
558
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
559
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}'
|
|
560
|
+
options = {
|
|
561
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
562
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'subscriptionId' => @client.subscription_id},
|
|
563
|
+
query_params: {'api-version' => @client.api_version},
|
|
564
|
+
headers: request_headers.merge(custom_headers || {})
|
|
565
|
+
}
|
|
566
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
567
|
+
promise = request.run_promise do |req|
|
|
568
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
569
|
+
end
|
|
570
|
+
|
|
571
|
+
promise = promise.then do |http_response|
|
|
572
|
+
status_code = http_response.status
|
|
573
|
+
response_content = http_response.body
|
|
574
|
+
unless status_code == 200 || status_code == 404
|
|
575
|
+
error_model = JSON.load(response_content)
|
|
576
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
577
|
+
end
|
|
578
|
+
|
|
579
|
+
# Create Result
|
|
580
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
581
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
582
|
+
# Deserialize Response
|
|
583
|
+
if status_code == 200
|
|
584
|
+
begin
|
|
585
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
586
|
+
unless parsed_response.nil?
|
|
587
|
+
parsed_response = VnetInfo.deserialize_object(parsed_response)
|
|
588
|
+
end
|
|
589
|
+
result.body = parsed_response
|
|
590
|
+
rescue Exception => e
|
|
591
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
592
|
+
end
|
|
593
|
+
end
|
|
594
|
+
|
|
595
|
+
result
|
|
596
|
+
end
|
|
597
|
+
|
|
598
|
+
promise.execute
|
|
599
|
+
end
|
|
600
|
+
|
|
601
|
+
#
|
|
602
|
+
# Gets a list of all routes associated with a vnet, in an app service plan
|
|
603
|
+
#
|
|
604
|
+
# @param resource_group_name [String] Name of resource group
|
|
605
|
+
# @param name [String] Name of App Service Plan
|
|
606
|
+
# @param vnet_name [String] Name of virtual network
|
|
607
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
608
|
+
# applied to HTTP request.
|
|
609
|
+
#
|
|
610
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
611
|
+
# response.
|
|
612
|
+
#
|
|
613
|
+
def get_routes_for_vnet(resource_group_name, name, vnet_name, custom_headers = nil)
|
|
614
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
615
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
616
|
+
fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
|
|
617
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
618
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
619
|
+
request_headers = {}
|
|
620
|
+
|
|
621
|
+
# Set Headers
|
|
622
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
623
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
624
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes'
|
|
625
|
+
options = {
|
|
626
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
627
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'subscriptionId' => @client.subscription_id},
|
|
628
|
+
query_params: {'api-version' => @client.api_version},
|
|
629
|
+
headers: request_headers.merge(custom_headers || {})
|
|
630
|
+
}
|
|
631
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
632
|
+
promise = request.run_promise do |req|
|
|
633
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
634
|
+
end
|
|
635
|
+
|
|
636
|
+
promise = promise.then do |http_response|
|
|
637
|
+
status_code = http_response.status
|
|
638
|
+
response_content = http_response.body
|
|
639
|
+
unless status_code == 200
|
|
640
|
+
error_model = JSON.load(response_content)
|
|
641
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
642
|
+
end
|
|
643
|
+
|
|
644
|
+
# Create Result
|
|
645
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
646
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
647
|
+
# Deserialize Response
|
|
648
|
+
if status_code == 200
|
|
649
|
+
begin
|
|
650
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
651
|
+
unless parsed_response.nil?
|
|
652
|
+
deserialized_array = []
|
|
653
|
+
parsed_response.each do |element|
|
|
654
|
+
unless element.nil?
|
|
655
|
+
element = VnetRoute.deserialize_object(element)
|
|
656
|
+
end
|
|
657
|
+
deserialized_array.push(element)
|
|
658
|
+
end
|
|
659
|
+
parsed_response = deserialized_array
|
|
660
|
+
end
|
|
661
|
+
result.body = parsed_response
|
|
662
|
+
rescue Exception => e
|
|
663
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
664
|
+
end
|
|
665
|
+
end
|
|
666
|
+
|
|
667
|
+
result
|
|
668
|
+
end
|
|
669
|
+
|
|
670
|
+
promise.execute
|
|
671
|
+
end
|
|
672
|
+
|
|
673
|
+
#
|
|
674
|
+
# Gets a specific route associated with a vnet, in an app service plan
|
|
675
|
+
#
|
|
676
|
+
# @param resource_group_name [String] Name of resource group
|
|
677
|
+
# @param name [String] Name of App Service Plan
|
|
678
|
+
# @param vnet_name [String] Name of virtual network
|
|
679
|
+
# @param route_name [String] Name of the virtual network route
|
|
680
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
681
|
+
# applied to HTTP request.
|
|
682
|
+
#
|
|
683
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
684
|
+
# response.
|
|
685
|
+
#
|
|
686
|
+
def get_route_for_vnet(resource_group_name, name, vnet_name, route_name, custom_headers = nil)
|
|
687
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
688
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
689
|
+
fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
|
|
690
|
+
fail ArgumentError, 'route_name is nil' if route_name.nil?
|
|
691
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
692
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
693
|
+
request_headers = {}
|
|
694
|
+
|
|
695
|
+
# Set Headers
|
|
696
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
697
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
698
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'
|
|
699
|
+
options = {
|
|
700
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
701
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'routeName' => route_name,'subscriptionId' => @client.subscription_id},
|
|
702
|
+
query_params: {'api-version' => @client.api_version},
|
|
703
|
+
headers: request_headers.merge(custom_headers || {})
|
|
704
|
+
}
|
|
705
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
706
|
+
promise = request.run_promise do |req|
|
|
707
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
708
|
+
end
|
|
709
|
+
|
|
710
|
+
promise = promise.then do |http_response|
|
|
711
|
+
status_code = http_response.status
|
|
712
|
+
response_content = http_response.body
|
|
713
|
+
unless status_code == 200 || status_code == 404
|
|
714
|
+
error_model = JSON.load(response_content)
|
|
715
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
716
|
+
end
|
|
717
|
+
|
|
718
|
+
# Create Result
|
|
719
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
720
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
721
|
+
# Deserialize Response
|
|
722
|
+
if status_code == 200
|
|
723
|
+
begin
|
|
724
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
725
|
+
unless parsed_response.nil?
|
|
726
|
+
deserialized_array = []
|
|
727
|
+
parsed_response.each do |element|
|
|
728
|
+
unless element.nil?
|
|
729
|
+
element = VnetRoute.deserialize_object(element)
|
|
730
|
+
end
|
|
731
|
+
deserialized_array.push(element)
|
|
732
|
+
end
|
|
733
|
+
parsed_response = deserialized_array
|
|
734
|
+
end
|
|
735
|
+
result.body = parsed_response
|
|
736
|
+
rescue Exception => e
|
|
737
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
738
|
+
end
|
|
739
|
+
end
|
|
740
|
+
|
|
741
|
+
result
|
|
742
|
+
end
|
|
743
|
+
|
|
744
|
+
promise.execute
|
|
745
|
+
end
|
|
746
|
+
|
|
747
|
+
#
|
|
748
|
+
# Creates a new route or updates an existing route for a vnet in an app
|
|
749
|
+
# service plan.
|
|
750
|
+
#
|
|
751
|
+
# @param resource_group_name [String] Name of resource group
|
|
752
|
+
# @param name [String] Name of App Service Plan
|
|
753
|
+
# @param vnet_name [String] Name of virtual network
|
|
754
|
+
# @param route_name [String] Name of the virtual network route
|
|
755
|
+
# @param route [VnetRoute] The route object
|
|
756
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
757
|
+
# applied to HTTP request.
|
|
758
|
+
#
|
|
759
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
760
|
+
# response.
|
|
761
|
+
#
|
|
762
|
+
def create_or_update_vnet_route(resource_group_name, name, vnet_name, route_name, route, custom_headers = nil)
|
|
763
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
764
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
765
|
+
fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
|
|
766
|
+
fail ArgumentError, 'route_name is nil' if route_name.nil?
|
|
767
|
+
fail ArgumentError, 'route is nil' if route.nil?
|
|
768
|
+
route.validate unless route.nil?
|
|
769
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
770
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
771
|
+
request_headers = {}
|
|
772
|
+
|
|
773
|
+
# Set Headers
|
|
774
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
775
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
776
|
+
|
|
777
|
+
# Serialize Request
|
|
778
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
779
|
+
unless route.nil?
|
|
780
|
+
route = VnetRoute.serialize_object(route)
|
|
781
|
+
end
|
|
782
|
+
request_content = JSON.generate(route, quirks_mode: true)
|
|
783
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'
|
|
784
|
+
options = {
|
|
785
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
786
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'routeName' => route_name,'subscriptionId' => @client.subscription_id},
|
|
787
|
+
query_params: {'api-version' => @client.api_version},
|
|
788
|
+
body: request_content,
|
|
789
|
+
headers: request_headers.merge(custom_headers || {})
|
|
790
|
+
}
|
|
791
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :put, options)
|
|
792
|
+
promise = request.run_promise do |req|
|
|
793
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
794
|
+
end
|
|
795
|
+
|
|
796
|
+
promise = promise.then do |http_response|
|
|
797
|
+
status_code = http_response.status
|
|
798
|
+
response_content = http_response.body
|
|
799
|
+
unless status_code == 200 || status_code == 400 || status_code == 404
|
|
800
|
+
error_model = JSON.load(response_content)
|
|
801
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
802
|
+
end
|
|
803
|
+
|
|
804
|
+
# Create Result
|
|
805
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
806
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
807
|
+
# Deserialize Response
|
|
808
|
+
if status_code == 200
|
|
809
|
+
begin
|
|
810
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
811
|
+
unless parsed_response.nil?
|
|
812
|
+
parsed_response = VnetRoute.deserialize_object(parsed_response)
|
|
813
|
+
end
|
|
814
|
+
result.body = parsed_response
|
|
815
|
+
rescue Exception => e
|
|
816
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
817
|
+
end
|
|
818
|
+
end
|
|
819
|
+
|
|
820
|
+
result
|
|
821
|
+
end
|
|
822
|
+
|
|
823
|
+
promise.execute
|
|
824
|
+
end
|
|
825
|
+
|
|
826
|
+
#
|
|
827
|
+
# Deletes an existing route for a vnet in an app service plan.
|
|
828
|
+
#
|
|
829
|
+
# @param resource_group_name [String] Name of resource group
|
|
830
|
+
# @param name [String] Name of App Service Plan
|
|
831
|
+
# @param vnet_name [String] Name of virtual network
|
|
832
|
+
# @param route_name [String] Name of the virtual network route
|
|
833
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
834
|
+
# applied to HTTP request.
|
|
835
|
+
#
|
|
836
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
837
|
+
# response.
|
|
838
|
+
#
|
|
839
|
+
def delete_vnet_route(resource_group_name, name, vnet_name, route_name, custom_headers = nil)
|
|
840
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
841
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
842
|
+
fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
|
|
843
|
+
fail ArgumentError, 'route_name is nil' if route_name.nil?
|
|
844
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
845
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
846
|
+
request_headers = {}
|
|
847
|
+
|
|
848
|
+
# Set Headers
|
|
849
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
850
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
851
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'
|
|
852
|
+
options = {
|
|
853
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
854
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'routeName' => route_name,'subscriptionId' => @client.subscription_id},
|
|
855
|
+
query_params: {'api-version' => @client.api_version},
|
|
856
|
+
headers: request_headers.merge(custom_headers || {})
|
|
857
|
+
}
|
|
858
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :delete, options)
|
|
859
|
+
promise = request.run_promise do |req|
|
|
860
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
861
|
+
end
|
|
862
|
+
|
|
863
|
+
promise = promise.then do |http_response|
|
|
864
|
+
status_code = http_response.status
|
|
865
|
+
response_content = http_response.body
|
|
866
|
+
unless status_code == 200 || status_code == 404
|
|
867
|
+
error_model = JSON.load(response_content)
|
|
868
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
869
|
+
end
|
|
870
|
+
|
|
871
|
+
# Create Result
|
|
872
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
873
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
874
|
+
|
|
875
|
+
result
|
|
876
|
+
end
|
|
877
|
+
|
|
878
|
+
promise.execute
|
|
879
|
+
end
|
|
880
|
+
|
|
881
|
+
#
|
|
882
|
+
# Creates a new route or updates an existing route for a vnet in an app
|
|
883
|
+
# service plan.
|
|
884
|
+
#
|
|
885
|
+
# @param resource_group_name [String] Name of resource group
|
|
886
|
+
# @param name [String] Name of App Service Plan
|
|
887
|
+
# @param vnet_name [String] Name of virtual network
|
|
888
|
+
# @param route_name [String] Name of the virtual network route
|
|
889
|
+
# @param route [VnetRoute] The route object
|
|
890
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
891
|
+
# applied to HTTP request.
|
|
892
|
+
#
|
|
893
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
894
|
+
# response.
|
|
895
|
+
#
|
|
896
|
+
def update_vnet_route(resource_group_name, name, vnet_name, route_name, route, custom_headers = nil)
|
|
897
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
898
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
899
|
+
fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
|
|
900
|
+
fail ArgumentError, 'route_name is nil' if route_name.nil?
|
|
901
|
+
fail ArgumentError, 'route is nil' if route.nil?
|
|
902
|
+
route.validate unless route.nil?
|
|
903
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
904
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
905
|
+
request_headers = {}
|
|
906
|
+
|
|
907
|
+
# Set Headers
|
|
908
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
909
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
910
|
+
|
|
911
|
+
# Serialize Request
|
|
912
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
913
|
+
unless route.nil?
|
|
914
|
+
route = VnetRoute.serialize_object(route)
|
|
915
|
+
end
|
|
916
|
+
request_content = JSON.generate(route, quirks_mode: true)
|
|
917
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'
|
|
918
|
+
options = {
|
|
919
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
920
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'routeName' => route_name,'subscriptionId' => @client.subscription_id},
|
|
921
|
+
query_params: {'api-version' => @client.api_version},
|
|
922
|
+
body: request_content,
|
|
923
|
+
headers: request_headers.merge(custom_headers || {})
|
|
924
|
+
}
|
|
925
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :patch, options)
|
|
926
|
+
promise = request.run_promise do |req|
|
|
927
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
928
|
+
end
|
|
929
|
+
|
|
930
|
+
promise = promise.then do |http_response|
|
|
931
|
+
status_code = http_response.status
|
|
932
|
+
response_content = http_response.body
|
|
933
|
+
unless status_code == 200 || status_code == 400 || status_code == 404
|
|
934
|
+
error_model = JSON.load(response_content)
|
|
935
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
936
|
+
end
|
|
937
|
+
|
|
938
|
+
# Create Result
|
|
939
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
940
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
941
|
+
# Deserialize Response
|
|
942
|
+
if status_code == 200
|
|
943
|
+
begin
|
|
944
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
945
|
+
unless parsed_response.nil?
|
|
946
|
+
parsed_response = VnetRoute.deserialize_object(parsed_response)
|
|
947
|
+
end
|
|
948
|
+
result.body = parsed_response
|
|
949
|
+
rescue Exception => e
|
|
950
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
951
|
+
end
|
|
952
|
+
end
|
|
953
|
+
|
|
954
|
+
result
|
|
955
|
+
end
|
|
956
|
+
|
|
957
|
+
promise.execute
|
|
958
|
+
end
|
|
959
|
+
|
|
960
|
+
#
|
|
961
|
+
# Gets the vnet gateway.
|
|
962
|
+
#
|
|
963
|
+
# @param resource_group_name [String] Name of resource group
|
|
964
|
+
# @param name [String] Name of the App Service Plan
|
|
965
|
+
# @param vnet_name [String] Name of the virtual network
|
|
966
|
+
# @param gateway_name [String] Name of the gateway. Only the 'primary' gateway
|
|
967
|
+
# is supported.
|
|
968
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
969
|
+
# applied to HTTP request.
|
|
970
|
+
#
|
|
971
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
972
|
+
# response.
|
|
973
|
+
#
|
|
974
|
+
def get_server_farm_vnet_gateway(resource_group_name, name, vnet_name, gateway_name, custom_headers = nil)
|
|
975
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
976
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
977
|
+
fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
|
|
978
|
+
fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?
|
|
979
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
980
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
981
|
+
request_headers = {}
|
|
982
|
+
|
|
983
|
+
# Set Headers
|
|
984
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
985
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
986
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'
|
|
987
|
+
options = {
|
|
988
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
989
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'gatewayName' => gateway_name,'subscriptionId' => @client.subscription_id},
|
|
990
|
+
query_params: {'api-version' => @client.api_version},
|
|
991
|
+
headers: request_headers.merge(custom_headers || {})
|
|
992
|
+
}
|
|
993
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
994
|
+
promise = request.run_promise do |req|
|
|
995
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
996
|
+
end
|
|
997
|
+
|
|
998
|
+
promise = promise.then do |http_response|
|
|
999
|
+
status_code = http_response.status
|
|
1000
|
+
response_content = http_response.body
|
|
1001
|
+
unless status_code == 200
|
|
1002
|
+
error_model = JSON.load(response_content)
|
|
1003
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1004
|
+
end
|
|
1005
|
+
|
|
1006
|
+
# Create Result
|
|
1007
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1008
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1009
|
+
# Deserialize Response
|
|
1010
|
+
if status_code == 200
|
|
1011
|
+
begin
|
|
1012
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1013
|
+
unless parsed_response.nil?
|
|
1014
|
+
parsed_response = VnetGateway.deserialize_object(parsed_response)
|
|
1015
|
+
end
|
|
1016
|
+
result.body = parsed_response
|
|
1017
|
+
rescue Exception => e
|
|
1018
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1019
|
+
end
|
|
1020
|
+
end
|
|
1021
|
+
|
|
1022
|
+
result
|
|
1023
|
+
end
|
|
1024
|
+
|
|
1025
|
+
promise.execute
|
|
1026
|
+
end
|
|
1027
|
+
|
|
1028
|
+
#
|
|
1029
|
+
# Updates the vnet gateway
|
|
1030
|
+
#
|
|
1031
|
+
# @param resource_group_name [String] The resource group
|
|
1032
|
+
# @param name [String] The name of the App Service Plan
|
|
1033
|
+
# @param vnet_name [String] The name of the virtual network
|
|
1034
|
+
# @param gateway_name [String] The name of the gateway. Only 'primary' is
|
|
1035
|
+
# supported.
|
|
1036
|
+
# @param connection_envelope [VnetGateway] The gateway entity.
|
|
1037
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1038
|
+
# applied to HTTP request.
|
|
1039
|
+
#
|
|
1040
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1041
|
+
# response.
|
|
1042
|
+
#
|
|
1043
|
+
def update_server_farm_vnet_gateway(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers = nil)
|
|
1044
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1045
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1046
|
+
fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
|
|
1047
|
+
fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?
|
|
1048
|
+
fail ArgumentError, 'connection_envelope is nil' if connection_envelope.nil?
|
|
1049
|
+
connection_envelope.validate unless connection_envelope.nil?
|
|
1050
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1051
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1052
|
+
request_headers = {}
|
|
1053
|
+
|
|
1054
|
+
# Set Headers
|
|
1055
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1056
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1057
|
+
|
|
1058
|
+
# Serialize Request
|
|
1059
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
|
1060
|
+
unless connection_envelope.nil?
|
|
1061
|
+
connection_envelope = VnetGateway.serialize_object(connection_envelope)
|
|
1062
|
+
end
|
|
1063
|
+
request_content = JSON.generate(connection_envelope, quirks_mode: true)
|
|
1064
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'
|
|
1065
|
+
options = {
|
|
1066
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1067
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'gatewayName' => gateway_name,'subscriptionId' => @client.subscription_id},
|
|
1068
|
+
query_params: {'api-version' => @client.api_version},
|
|
1069
|
+
body: request_content,
|
|
1070
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1071
|
+
}
|
|
1072
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :put, options)
|
|
1073
|
+
promise = request.run_promise do |req|
|
|
1074
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1075
|
+
end
|
|
1076
|
+
|
|
1077
|
+
promise = promise.then do |http_response|
|
|
1078
|
+
status_code = http_response.status
|
|
1079
|
+
response_content = http_response.body
|
|
1080
|
+
unless status_code == 200
|
|
1081
|
+
error_model = JSON.load(response_content)
|
|
1082
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1083
|
+
end
|
|
1084
|
+
|
|
1085
|
+
# Create Result
|
|
1086
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1087
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1088
|
+
# Deserialize Response
|
|
1089
|
+
if status_code == 200
|
|
1090
|
+
begin
|
|
1091
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1092
|
+
unless parsed_response.nil?
|
|
1093
|
+
parsed_response = VnetGateway.deserialize_object(parsed_response)
|
|
1094
|
+
end
|
|
1095
|
+
result.body = parsed_response
|
|
1096
|
+
rescue Exception => e
|
|
1097
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1098
|
+
end
|
|
1099
|
+
end
|
|
1100
|
+
|
|
1101
|
+
result
|
|
1102
|
+
end
|
|
1103
|
+
|
|
1104
|
+
promise.execute
|
|
1105
|
+
end
|
|
1106
|
+
|
|
1107
|
+
#
|
|
1108
|
+
# Gets list of Apps associated with an App Service Plan
|
|
1109
|
+
#
|
|
1110
|
+
# @param resource_group_name [String] Name of resource group
|
|
1111
|
+
# @param name [String] Name of App Service Plan
|
|
1112
|
+
# @param skip_token [String] Skip to of web apps in a list. If specified, the
|
|
1113
|
+
# resulting list will contain web apps starting from (including) the
|
|
1114
|
+
# skipToken. Else, the resulting list contains web apps from the start of the
|
|
1115
|
+
# list
|
|
1116
|
+
# @param filter [String] Supported filter: $filter=state eq running. Returns
|
|
1117
|
+
# only web apps that are currently running
|
|
1118
|
+
# @param top [String] List page size. If specified, results are paged.
|
|
1119
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1120
|
+
# applied to HTTP request.
|
|
1121
|
+
#
|
|
1122
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1123
|
+
# response.
|
|
1124
|
+
#
|
|
1125
|
+
def get_server_farm_sites(resource_group_name, name, skip_token = nil, filter = nil, top = nil, custom_headers = nil)
|
|
1126
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1127
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1128
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1129
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1130
|
+
request_headers = {}
|
|
1131
|
+
|
|
1132
|
+
# Set Headers
|
|
1133
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1134
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1135
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites'
|
|
1136
|
+
options = {
|
|
1137
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1138
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
1139
|
+
query_params: {'$skipToken' => skip_token,'$filter' => filter,'$top' => top,'api-version' => @client.api_version},
|
|
1140
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1141
|
+
}
|
|
1142
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
1143
|
+
promise = request.run_promise do |req|
|
|
1144
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1145
|
+
end
|
|
1146
|
+
|
|
1147
|
+
promise = promise.then do |http_response|
|
|
1148
|
+
status_code = http_response.status
|
|
1149
|
+
response_content = http_response.body
|
|
1150
|
+
unless status_code == 200
|
|
1151
|
+
error_model = JSON.load(response_content)
|
|
1152
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1153
|
+
end
|
|
1154
|
+
|
|
1155
|
+
# Create Result
|
|
1156
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1157
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1158
|
+
# Deserialize Response
|
|
1159
|
+
if status_code == 200
|
|
1160
|
+
begin
|
|
1161
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1162
|
+
unless parsed_response.nil?
|
|
1163
|
+
parsed_response = SiteCollection.deserialize_object(parsed_response)
|
|
1164
|
+
end
|
|
1165
|
+
result.body = parsed_response
|
|
1166
|
+
rescue Exception => e
|
|
1167
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1168
|
+
end
|
|
1169
|
+
end
|
|
1170
|
+
|
|
1171
|
+
result
|
|
1172
|
+
end
|
|
1173
|
+
|
|
1174
|
+
promise.execute
|
|
1175
|
+
end
|
|
1176
|
+
|
|
1177
|
+
#
|
|
1178
|
+
# Submit a reboot request for a worker machine in the specified server farm
|
|
1179
|
+
#
|
|
1180
|
+
# @param resource_group_name [String] Name of resource group
|
|
1181
|
+
# @param name [String] Name of server farm
|
|
1182
|
+
# @param worker_name [String] Name of worker machine, typically IP address
|
|
1183
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1184
|
+
# applied to HTTP request.
|
|
1185
|
+
#
|
|
1186
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1187
|
+
# response.
|
|
1188
|
+
#
|
|
1189
|
+
def reboot_worker_for_server_farm(resource_group_name, name, worker_name, custom_headers = nil)
|
|
1190
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1191
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1192
|
+
fail ArgumentError, 'worker_name is nil' if worker_name.nil?
|
|
1193
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1194
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1195
|
+
request_headers = {}
|
|
1196
|
+
|
|
1197
|
+
# Set Headers
|
|
1198
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1199
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1200
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}'
|
|
1201
|
+
options = {
|
|
1202
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1203
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'workerName' => worker_name,'subscriptionId' => @client.subscription_id},
|
|
1204
|
+
query_params: {'api-version' => @client.api_version},
|
|
1205
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1206
|
+
}
|
|
1207
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
|
|
1208
|
+
promise = request.run_promise do |req|
|
|
1209
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1210
|
+
end
|
|
1211
|
+
|
|
1212
|
+
promise = promise.then do |http_response|
|
|
1213
|
+
status_code = http_response.status
|
|
1214
|
+
response_content = http_response.body
|
|
1215
|
+
unless status_code == 200
|
|
1216
|
+
error_model = JSON.load(response_content)
|
|
1217
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1218
|
+
end
|
|
1219
|
+
|
|
1220
|
+
# Create Result
|
|
1221
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1222
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1223
|
+
|
|
1224
|
+
result
|
|
1225
|
+
end
|
|
1226
|
+
|
|
1227
|
+
promise.execute
|
|
1228
|
+
end
|
|
1229
|
+
|
|
1230
|
+
#
|
|
1231
|
+
# Restarts web apps in a specified App Service Plan
|
|
1232
|
+
#
|
|
1233
|
+
# @param resource_group_name [String] Name of resource group
|
|
1234
|
+
# @param name [String] Name of App Service Plan
|
|
1235
|
+
# @param soft_restart [Boolean] Soft restart applies the configuration
|
|
1236
|
+
# settings and restarts the apps if necessary. Hard restart always restarts
|
|
1237
|
+
# and reprovisions the apps
|
|
1238
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1239
|
+
# applied to HTTP request.
|
|
1240
|
+
#
|
|
1241
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1242
|
+
# response.
|
|
1243
|
+
#
|
|
1244
|
+
def restart_sites_for_server_farm(resource_group_name, name, soft_restart = nil, custom_headers = nil)
|
|
1245
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1246
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1247
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1248
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1249
|
+
request_headers = {}
|
|
1250
|
+
|
|
1251
|
+
# Set Headers
|
|
1252
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1253
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1254
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites'
|
|
1255
|
+
options = {
|
|
1256
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1257
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
|
|
1258
|
+
query_params: {'softRestart' => soft_restart,'api-version' => @client.api_version},
|
|
1259
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1260
|
+
}
|
|
1261
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :post, options)
|
|
1262
|
+
promise = request.run_promise do |req|
|
|
1263
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1264
|
+
end
|
|
1265
|
+
|
|
1266
|
+
promise = promise.then do |http_response|
|
|
1267
|
+
status_code = http_response.status
|
|
1268
|
+
response_content = http_response.body
|
|
1269
|
+
unless status_code == 200
|
|
1270
|
+
error_model = JSON.load(response_content)
|
|
1271
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1272
|
+
end
|
|
1273
|
+
|
|
1274
|
+
# Create Result
|
|
1275
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1276
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1277
|
+
|
|
1278
|
+
result
|
|
1279
|
+
end
|
|
1280
|
+
|
|
1281
|
+
promise.execute
|
|
1282
|
+
end
|
|
1283
|
+
|
|
1284
|
+
#
|
|
1285
|
+
# Gets a server farm operation
|
|
1286
|
+
#
|
|
1287
|
+
# @param resource_group_name [String] Name of resource group
|
|
1288
|
+
# @param name [String] Name of server farm
|
|
1289
|
+
# @param operation_id [String] Id of Server farm operation">
|
|
1290
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1291
|
+
# applied to HTTP request.
|
|
1292
|
+
#
|
|
1293
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1294
|
+
# response.
|
|
1295
|
+
#
|
|
1296
|
+
def get_server_farm_operation(resource_group_name, name, operation_id, custom_headers = nil)
|
|
1297
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
|
1298
|
+
fail ArgumentError, 'name is nil' if name.nil?
|
|
1299
|
+
fail ArgumentError, 'operation_id is nil' if operation_id.nil?
|
|
1300
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
|
1301
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
|
1302
|
+
request_headers = {}
|
|
1303
|
+
|
|
1304
|
+
# Set Headers
|
|
1305
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1306
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1307
|
+
path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/operationresults/{operationId}'
|
|
1308
|
+
options = {
|
|
1309
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1310
|
+
path_params: {'resourceGroupName' => resource_group_name,'name' => name,'operationId' => operation_id,'subscriptionId' => @client.subscription_id},
|
|
1311
|
+
query_params: {'api-version' => @client.api_version},
|
|
1312
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1313
|
+
}
|
|
1314
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
1315
|
+
promise = request.run_promise do |req|
|
|
1316
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1317
|
+
end
|
|
1318
|
+
|
|
1319
|
+
promise = promise.then do |http_response|
|
|
1320
|
+
status_code = http_response.status
|
|
1321
|
+
response_content = http_response.body
|
|
1322
|
+
unless status_code == 200
|
|
1323
|
+
error_model = JSON.load(response_content)
|
|
1324
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1325
|
+
end
|
|
1326
|
+
|
|
1327
|
+
# Create Result
|
|
1328
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1329
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1330
|
+
# Deserialize Response
|
|
1331
|
+
if status_code == 200
|
|
1332
|
+
begin
|
|
1333
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1334
|
+
unless parsed_response.nil?
|
|
1335
|
+
parsed_response = ServerFarmWithRichSku.deserialize_object(parsed_response)
|
|
1336
|
+
end
|
|
1337
|
+
result.body = parsed_response
|
|
1338
|
+
rescue Exception => e
|
|
1339
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1340
|
+
end
|
|
1341
|
+
end
|
|
1342
|
+
|
|
1343
|
+
result
|
|
1344
|
+
end
|
|
1345
|
+
|
|
1346
|
+
promise.execute
|
|
1347
|
+
end
|
|
1348
|
+
|
|
1349
|
+
#
|
|
1350
|
+
# Gets list of Apps associated with an App Service Plan
|
|
1351
|
+
#
|
|
1352
|
+
# @param next_page_link [String] The NextLink from the previous successful
|
|
1353
|
+
# call to List operation.
|
|
1354
|
+
# @param [Hash{String => String}] The hash of custom headers need to be
|
|
1355
|
+
# applied to HTTP request.
|
|
1356
|
+
#
|
|
1357
|
+
# @return [Concurrent::Promise] Promise object which allows to get HTTP
|
|
1358
|
+
# response.
|
|
1359
|
+
#
|
|
1360
|
+
def get_server_farm_sites_next(next_page_link, custom_headers = nil)
|
|
1361
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
|
1362
|
+
request_headers = {}
|
|
1363
|
+
|
|
1364
|
+
# Set Headers
|
|
1365
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
|
1366
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
|
1367
|
+
path_template = '{nextLink}'
|
|
1368
|
+
options = {
|
|
1369
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
|
1370
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
|
1371
|
+
headers: request_headers.merge(custom_headers || {})
|
|
1372
|
+
}
|
|
1373
|
+
request = MsRest::HttpOperationRequest.new(@base_url || @client.base_url, path_template, :get, options)
|
|
1374
|
+
promise = request.run_promise do |req|
|
|
1375
|
+
@client.credentials.sign_request(req) unless @client.credentials.nil?
|
|
1376
|
+
end
|
|
1377
|
+
|
|
1378
|
+
promise = promise.then do |http_response|
|
|
1379
|
+
status_code = http_response.status
|
|
1380
|
+
response_content = http_response.body
|
|
1381
|
+
unless status_code == 200
|
|
1382
|
+
error_model = JSON.load(response_content)
|
|
1383
|
+
fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
|
|
1384
|
+
end
|
|
1385
|
+
|
|
1386
|
+
# Create Result
|
|
1387
|
+
result = MsRestAzure::AzureOperationResponse.new(request, http_response)
|
|
1388
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
|
1389
|
+
# Deserialize Response
|
|
1390
|
+
if status_code == 200
|
|
1391
|
+
begin
|
|
1392
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
|
1393
|
+
unless parsed_response.nil?
|
|
1394
|
+
parsed_response = SiteCollection.deserialize_object(parsed_response)
|
|
1395
|
+
end
|
|
1396
|
+
result.body = parsed_response
|
|
1397
|
+
rescue Exception => e
|
|
1398
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
|
1399
|
+
end
|
|
1400
|
+
end
|
|
1401
|
+
|
|
1402
|
+
result
|
|
1403
|
+
end
|
|
1404
|
+
|
|
1405
|
+
promise.execute
|
|
1406
|
+
end
|
|
1407
|
+
|
|
1408
|
+
end
|
|
1409
|
+
end
|