azure_mgmt_web 0.16.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (418) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2015-04-01/generated/azure_mgmt_web.rb +41 -39
  3. data/lib/2015-04-01/generated/azure_mgmt_web/domain_registration_provider.rb +1 -1
  4. data/lib/2015-04-01/generated/azure_mgmt_web/domains.rb +1 -1
  5. data/lib/2015-04-01/generated/azure_mgmt_web/models/managed_service_identity.rb +3 -2
  6. data/lib/2015-04-01/generated/azure_mgmt_web/models/managed_service_identity_type.rb +15 -0
  7. data/lib/2015-04-01/generated/azure_mgmt_web/models/site_config.rb +26 -0
  8. data/lib/2015-04-01/generated/azure_mgmt_web/models/supported_tls_versions.rb +17 -0
  9. data/lib/2015-04-01/generated/azure_mgmt_web/top_level_domains.rb +1 -1
  10. data/lib/2015-04-01/generated/azure_mgmt_web/web_site_management_client.rb +11 -10
  11. data/lib/2015-08-01/generated/azure_mgmt_web.rb +2 -0
  12. data/lib/2015-08-01/generated/azure_mgmt_web/app_service_certificate_orders.rb +1 -1
  13. data/lib/2015-08-01/generated/azure_mgmt_web/certificate_registration_provider.rb +1 -1
  14. data/lib/2015-08-01/generated/azure_mgmt_web/models/managed_service_identity.rb +3 -2
  15. data/lib/2015-08-01/generated/azure_mgmt_web/models/managed_service_identity_type.rb +15 -0
  16. data/lib/2015-08-01/generated/azure_mgmt_web/models/site_config.rb +26 -0
  17. data/lib/2015-08-01/generated/azure_mgmt_web/models/supported_tls_versions.rb +17 -0
  18. data/lib/2015-08-01/generated/azure_mgmt_web/web_site_management_client.rb +7 -6
  19. data/lib/2016-03-01/generated/azure_mgmt_web.rb +76 -52
  20. data/lib/2016-03-01/generated/azure_mgmt_web/billing_meters.rb +235 -0
  21. data/lib/2016-03-01/generated/azure_mgmt_web/certificates.rb +1 -1
  22. data/lib/2016-03-01/generated/azure_mgmt_web/deleted_web_apps.rb +1 -1
  23. data/lib/2016-03-01/generated/azure_mgmt_web/diagnostics.rb +1143 -111
  24. data/lib/2016-03-01/generated/azure_mgmt_web/models/application_stack.rb +109 -0
  25. data/lib/2016-03-01/generated/azure_mgmt_web/models/application_stack_collection.rb +99 -0
  26. data/lib/2016-03-01/generated/azure_mgmt_web/models/billing_meter.rb +126 -0
  27. data/lib/2016-03-01/generated/azure_mgmt_web/models/billing_meter_collection.rb +99 -0
  28. data/lib/2016-03-01/generated/azure_mgmt_web/models/data_table_response_column.rb +68 -0
  29. data/lib/2016-03-01/generated/azure_mgmt_web/models/data_table_response_object.rb +94 -0
  30. data/lib/2016-03-01/generated/azure_mgmt_web/models/default_error_response.rb +48 -0
  31. data/lib/2016-03-01/generated/azure_mgmt_web/models/default_error_response_error.rb +104 -0
  32. data/lib/2016-03-01/generated/azure_mgmt_web/models/default_error_response_error_details_item.rb +72 -0
  33. data/lib/2016-03-01/generated/azure_mgmt_web/models/detector_info.rb +83 -0
  34. data/lib/2016-03-01/generated/azure_mgmt_web/models/detector_response.rb +102 -0
  35. data/lib/2016-03-01/generated/azure_mgmt_web/models/detector_response_collection.rb +99 -0
  36. data/lib/2016-03-01/generated/azure_mgmt_web/models/diagnostic_data.rb +60 -0
  37. data/lib/2016-03-01/generated/azure_mgmt_web/models/managed_service_identity.rb +3 -2
  38. data/lib/2016-03-01/generated/azure_mgmt_web/models/managed_service_identity_type.rb +15 -0
  39. data/lib/2016-03-01/generated/azure_mgmt_web/models/recommendation.rb +57 -22
  40. data/lib/2016-03-01/generated/azure_mgmt_web/models/recommendation_collection.rb +99 -0
  41. data/lib/2016-03-01/generated/azure_mgmt_web/models/recommendation_rule.rb +49 -14
  42. data/lib/2016-03-01/generated/azure_mgmt_web/models/rendering.rb +71 -0
  43. data/lib/2016-03-01/generated/azure_mgmt_web/models/rendering_type.rb +18 -0
  44. data/lib/2016-03-01/generated/azure_mgmt_web/models/resource_health_metadata.rb +93 -0
  45. data/lib/2016-03-01/generated/azure_mgmt_web/models/resource_health_metadata_collection.rb +99 -0
  46. data/lib/2016-03-01/generated/azure_mgmt_web/models/site_config.rb +26 -0
  47. data/lib/2016-03-01/generated/azure_mgmt_web/models/stack_major_version.rb +90 -0
  48. data/lib/2016-03-01/generated/azure_mgmt_web/models/stack_minor_version.rb +69 -0
  49. data/lib/2016-03-01/generated/azure_mgmt_web/models/supported_tls_versions.rb +17 -0
  50. data/lib/2016-03-01/generated/azure_mgmt_web/provider.rb +277 -17
  51. data/lib/2016-03-01/generated/azure_mgmt_web/recommendations.rb +582 -67
  52. data/lib/2016-03-01/generated/azure_mgmt_web/resource_health_metadata_operations.rb +1161 -0
  53. data/lib/2016-03-01/generated/azure_mgmt_web/web_site_management_client.rb +16 -6
  54. data/lib/2016-08-01/generated/azure_mgmt_web.rb +2 -0
  55. data/lib/2016-08-01/generated/azure_mgmt_web/models/managed_service_identity.rb +3 -2
  56. data/lib/2016-08-01/generated/azure_mgmt_web/models/managed_service_identity_type.rb +15 -0
  57. data/lib/2016-08-01/generated/azure_mgmt_web/models/site_config.rb +26 -0
  58. data/lib/2016-08-01/generated/azure_mgmt_web/models/site_config_resource.rb +26 -0
  59. data/lib/2016-08-01/generated/azure_mgmt_web/models/supported_tls_versions.rb +17 -0
  60. data/lib/2016-08-01/generated/azure_mgmt_web/web_apps.rb +87 -102
  61. data/lib/2016-08-01/generated/azure_mgmt_web/web_site_management_client.rb +7 -6
  62. data/lib/2016-09-01/generated/azure_mgmt_web.rb +2 -0
  63. data/lib/2016-09-01/generated/azure_mgmt_web/app_service_environments.rb +3 -3
  64. data/lib/2016-09-01/generated/azure_mgmt_web/app_service_plans.rb +1 -1
  65. data/lib/2016-09-01/generated/azure_mgmt_web/models/managed_service_identity.rb +3 -2
  66. data/lib/2016-09-01/generated/azure_mgmt_web/models/managed_service_identity_type.rb +15 -0
  67. data/lib/2016-09-01/generated/azure_mgmt_web/models/site_config.rb +26 -0
  68. data/lib/2016-09-01/generated/azure_mgmt_web/models/supported_tls_versions.rb +17 -0
  69. data/lib/2016-09-01/generated/azure_mgmt_web/web_site_management_client.rb +7 -6
  70. data/lib/2018-02-01/generated/azure_mgmt_web.rb +369 -0
  71. data/lib/2018-02-01/generated/azure_mgmt_web/app_service_certificate_orders.rb +2651 -0
  72. data/lib/2018-02-01/generated/azure_mgmt_web/app_service_environments.rb +8089 -0
  73. data/lib/2018-02-01/generated/azure_mgmt_web/app_service_plans.rb +4314 -0
  74. data/lib/2018-02-01/generated/azure_mgmt_web/certificate_registration_provider.rb +243 -0
  75. data/lib/2018-02-01/generated/azure_mgmt_web/certificates.rb +882 -0
  76. data/lib/2018-02-01/generated/azure_mgmt_web/deleted_web_apps.rb +231 -0
  77. data/lib/2018-02-01/generated/azure_mgmt_web/diagnostics.rb +3845 -0
  78. data/lib/2018-02-01/generated/azure_mgmt_web/domain_registration_provider.rb +243 -0
  79. data/lib/2018-02-01/generated/azure_mgmt_web/domains.rb +2145 -0
  80. data/lib/2018-02-01/generated/azure_mgmt_web/models/abnormal_time_period.rb +98 -0
  81. data/lib/2018-02-01/generated/azure_mgmt_web/models/access_control_entry_action.rb +16 -0
  82. data/lib/2018-02-01/generated/azure_mgmt_web/models/address.rb +101 -0
  83. data/lib/2018-02-01/generated/azure_mgmt_web/models/address_response.rb +97 -0
  84. data/lib/2018-02-01/generated/azure_mgmt_web/models/analysis_data.rb +118 -0
  85. data/lib/2018-02-01/generated/azure_mgmt_web/models/analysis_definition.rb +82 -0
  86. data/lib/2018-02-01/generated/azure_mgmt_web/models/api_definition_info.rb +46 -0
  87. data/lib/2018-02-01/generated/azure_mgmt_web/models/app_service_certificate.rb +76 -0
  88. data/lib/2018-02-01/generated/azure_mgmt_web/models/app_service_certificate_collection.rb +99 -0
  89. data/lib/2018-02-01/generated/azure_mgmt_web/models/app_service_certificate_order.rb +359 -0
  90. data/lib/2018-02-01/generated/azure_mgmt_web/models/app_service_certificate_order_collection.rb +99 -0
  91. data/lib/2018-02-01/generated/azure_mgmt_web/models/app_service_certificate_order_patch_resource.rb +335 -0
  92. data/lib/2018-02-01/generated/azure_mgmt_web/models/app_service_certificate_patch_resource.rb +112 -0
  93. data/lib/2018-02-01/generated/azure_mgmt_web/models/app_service_certificate_resource.rb +136 -0
  94. data/lib/2018-02-01/generated/azure_mgmt_web/models/app_service_environment.rb +570 -0
  95. data/lib/2018-02-01/generated/azure_mgmt_web/models/app_service_environment_collection.rb +99 -0
  96. data/lib/2018-02-01/generated/azure_mgmt_web/models/app_service_environment_patch_resource.rb +605 -0
  97. data/lib/2018-02-01/generated/azure_mgmt_web/models/app_service_environment_resource.rb +629 -0
  98. data/lib/2018-02-01/generated/azure_mgmt_web/models/app_service_plan.rb +329 -0
  99. data/lib/2018-02-01/generated/azure_mgmt_web/models/app_service_plan_collection.rb +99 -0
  100. data/lib/2018-02-01/generated/azure_mgmt_web/models/app_service_plan_patch_resource.rb +293 -0
  101. data/lib/2018-02-01/generated/azure_mgmt_web/models/app_service_plan_restrictions.rb +20 -0
  102. data/lib/2018-02-01/generated/azure_mgmt_web/models/application_logs_config.rb +74 -0
  103. data/lib/2018-02-01/generated/azure_mgmt_web/models/application_stack.rb +109 -0
  104. data/lib/2018-02-01/generated/azure_mgmt_web/models/application_stack_collection.rb +99 -0
  105. data/lib/2018-02-01/generated/azure_mgmt_web/models/auto_heal_action_type.rb +17 -0
  106. data/lib/2018-02-01/generated/azure_mgmt_web/models/auto_heal_actions.rb +72 -0
  107. data/lib/2018-02-01/generated/azure_mgmt_web/models/auto_heal_custom_action.rb +58 -0
  108. data/lib/2018-02-01/generated/azure_mgmt_web/models/auto_heal_rules.rb +61 -0
  109. data/lib/2018-02-01/generated/azure_mgmt_web/models/auto_heal_triggers.rb +91 -0
  110. data/lib/2018-02-01/generated/azure_mgmt_web/models/azure_blob_storage_application_logs_config.rb +73 -0
  111. data/lib/2018-02-01/generated/azure_mgmt_web/models/azure_blob_storage_http_logs_config.rb +72 -0
  112. data/lib/2018-02-01/generated/azure_mgmt_web/models/azure_resource_type.rb +16 -0
  113. data/lib/2018-02-01/generated/azure_mgmt_web/models/azure_table_storage_application_logs_config.rb +60 -0
  114. data/lib/2018-02-01/generated/azure_mgmt_web/models/backup_item.rb +257 -0
  115. data/lib/2018-02-01/generated/azure_mgmt_web/models/backup_item_collection.rb +99 -0
  116. data/lib/2018-02-01/generated/azure_mgmt_web/models/backup_item_status.rb +24 -0
  117. data/lib/2018-02-01/generated/azure_mgmt_web/models/backup_request.rb +128 -0
  118. data/lib/2018-02-01/generated/azure_mgmt_web/models/backup_restore_operation_type.rb +19 -0
  119. data/lib/2018-02-01/generated/azure_mgmt_web/models/backup_schedule.rb +116 -0
  120. data/lib/2018-02-01/generated/azure_mgmt_web/models/billing_meter.rb +137 -0
  121. data/lib/2018-02-01/generated/azure_mgmt_web/models/billing_meter_collection.rb +99 -0
  122. data/lib/2018-02-01/generated/azure_mgmt_web/models/built_in_authentication_provider.rb +19 -0
  123. data/lib/2018-02-01/generated/azure_mgmt_web/models/capability.rb +68 -0
  124. data/lib/2018-02-01/generated/azure_mgmt_web/models/certificate.rb +335 -0
  125. data/lib/2018-02-01/generated/azure_mgmt_web/models/certificate_collection.rb +99 -0
  126. data/lib/2018-02-01/generated/azure_mgmt_web/models/certificate_details.rb +143 -0
  127. data/lib/2018-02-01/generated/azure_mgmt_web/models/certificate_email.rb +92 -0
  128. data/lib/2018-02-01/generated/azure_mgmt_web/models/certificate_order_action.rb +101 -0
  129. data/lib/2018-02-01/generated/azure_mgmt_web/models/certificate_order_action_type.rb +28 -0
  130. data/lib/2018-02-01/generated/azure_mgmt_web/models/certificate_order_status.rb +24 -0
  131. data/lib/2018-02-01/generated/azure_mgmt_web/models/certificate_patch_resource.rb +311 -0
  132. data/lib/2018-02-01/generated/azure_mgmt_web/models/certificate_product_type.rb +16 -0
  133. data/lib/2018-02-01/generated/azure_mgmt_web/models/channels.rb +19 -0
  134. data/lib/2018-02-01/generated/azure_mgmt_web/models/check_name_resource_types.rb +22 -0
  135. data/lib/2018-02-01/generated/azure_mgmt_web/models/clone_ability_result.rb +17 -0
  136. data/lib/2018-02-01/generated/azure_mgmt_web/models/cloning_info.rb +170 -0
  137. data/lib/2018-02-01/generated/azure_mgmt_web/models/compute_mode_options.rb +17 -0
  138. data/lib/2018-02-01/generated/azure_mgmt_web/models/conn_string_info.rb +71 -0
  139. data/lib/2018-02-01/generated/azure_mgmt_web/models/conn_string_value_type_pair.rb +60 -0
  140. data/lib/2018-02-01/generated/azure_mgmt_web/models/connection_string_dictionary.rb +90 -0
  141. data/lib/2018-02-01/generated/azure_mgmt_web/models/connection_string_type.rb +25 -0
  142. data/lib/2018-02-01/generated/azure_mgmt_web/models/contact.rb +138 -0
  143. data/lib/2018-02-01/generated/azure_mgmt_web/models/continuous_web_job.rb +192 -0
  144. data/lib/2018-02-01/generated/azure_mgmt_web/models/continuous_web_job_collection.rb +99 -0
  145. data/lib/2018-02-01/generated/azure_mgmt_web/models/continuous_web_job_status.rb +19 -0
  146. data/lib/2018-02-01/generated/azure_mgmt_web/models/cors_settings.rb +56 -0
  147. data/lib/2018-02-01/generated/azure_mgmt_web/models/csm_move_resource_envelope.rb +71 -0
  148. data/lib/2018-02-01/generated/azure_mgmt_web/models/csm_operation_collection.rb +99 -0
  149. data/lib/2018-02-01/generated/azure_mgmt_web/models/csm_operation_description.rb +82 -0
  150. data/lib/2018-02-01/generated/azure_mgmt_web/models/csm_operation_description_properties.rb +47 -0
  151. data/lib/2018-02-01/generated/azure_mgmt_web/models/csm_operation_display.rb +79 -0
  152. data/lib/2018-02-01/generated/azure_mgmt_web/models/csm_publishing_profile_options.rb +49 -0
  153. data/lib/2018-02-01/generated/azure_mgmt_web/models/csm_slot_entity.rb +58 -0
  154. data/lib/2018-02-01/generated/azure_mgmt_web/models/csm_usage_quota.rb +91 -0
  155. data/lib/2018-02-01/generated/azure_mgmt_web/models/csm_usage_quota_collection.rb +99 -0
  156. data/lib/2018-02-01/generated/azure_mgmt_web/models/custom_host_name_dns_record_type.rb +16 -0
  157. data/lib/2018-02-01/generated/azure_mgmt_web/models/custom_hostname_analysis_result.rb +249 -0
  158. data/lib/2018-02-01/generated/azure_mgmt_web/models/data_source.rb +74 -0
  159. data/lib/2018-02-01/generated/azure_mgmt_web/models/data_table_response_column.rb +68 -0
  160. data/lib/2018-02-01/generated/azure_mgmt_web/models/data_table_response_object.rb +94 -0
  161. data/lib/2018-02-01/generated/azure_mgmt_web/models/database_backup_setting.rb +84 -0
  162. data/lib/2018-02-01/generated/azure_mgmt_web/models/database_type.rb +18 -0
  163. data/lib/2018-02-01/generated/azure_mgmt_web/models/default_error_response.rb +48 -0
  164. data/lib/2018-02-01/generated/azure_mgmt_web/models/default_error_response_error.rb +104 -0
  165. data/lib/2018-02-01/generated/azure_mgmt_web/models/default_error_response_error_details_item.rb +72 -0
  166. data/lib/2018-02-01/generated/azure_mgmt_web/models/deleted_app_restore_request.rb +107 -0
  167. data/lib/2018-02-01/generated/azure_mgmt_web/models/deleted_site.rb +107 -0
  168. data/lib/2018-02-01/generated/azure_mgmt_web/models/deleted_web_app_collection.rb +99 -0
  169. data/lib/2018-02-01/generated/azure_mgmt_web/models/deployment.rb +170 -0
  170. data/lib/2018-02-01/generated/azure_mgmt_web/models/deployment_collection.rb +99 -0
  171. data/lib/2018-02-01/generated/azure_mgmt_web/models/deployment_locations.rb +98 -0
  172. data/lib/2018-02-01/generated/azure_mgmt_web/models/detector_abnormal_time_period.rb +153 -0
  173. data/lib/2018-02-01/generated/azure_mgmt_web/models/detector_definition.rb +118 -0
  174. data/lib/2018-02-01/generated/azure_mgmt_web/models/detector_info.rb +83 -0
  175. data/lib/2018-02-01/generated/azure_mgmt_web/models/detector_response.rb +102 -0
  176. data/lib/2018-02-01/generated/azure_mgmt_web/models/detector_response_collection.rb +99 -0
  177. data/lib/2018-02-01/generated/azure_mgmt_web/models/diagnostic_analysis.rb +153 -0
  178. data/lib/2018-02-01/generated/azure_mgmt_web/models/diagnostic_analysis_collection.rb +99 -0
  179. data/lib/2018-02-01/generated/azure_mgmt_web/models/diagnostic_category.rb +82 -0
  180. data/lib/2018-02-01/generated/azure_mgmt_web/models/diagnostic_category_collection.rb +99 -0
  181. data/lib/2018-02-01/generated/azure_mgmt_web/models/diagnostic_data.rb +60 -0
  182. data/lib/2018-02-01/generated/azure_mgmt_web/models/diagnostic_detector_collection.rb +99 -0
  183. data/lib/2018-02-01/generated/azure_mgmt_web/models/diagnostic_detector_response.rb +197 -0
  184. data/lib/2018-02-01/generated/azure_mgmt_web/models/diagnostic_metric_sample.rb +109 -0
  185. data/lib/2018-02-01/generated/azure_mgmt_web/models/diagnostic_metric_set.rb +113 -0
  186. data/lib/2018-02-01/generated/azure_mgmt_web/models/dimension.rb +81 -0
  187. data/lib/2018-02-01/generated/azure_mgmt_web/models/dns_type.rb +16 -0
  188. data/lib/2018-02-01/generated/azure_mgmt_web/models/dns_verification_test_result.rb +17 -0
  189. data/lib/2018-02-01/generated/azure_mgmt_web/models/domain.rb +372 -0
  190. data/lib/2018-02-01/generated/azure_mgmt_web/models/domain_availablility_check_result.rb +73 -0
  191. data/lib/2018-02-01/generated/azure_mgmt_web/models/domain_collection.rb +99 -0
  192. data/lib/2018-02-01/generated/azure_mgmt_web/models/domain_control_center_sso_request.rb +72 -0
  193. data/lib/2018-02-01/generated/azure_mgmt_web/models/domain_ownership_identifier.rb +81 -0
  194. data/lib/2018-02-01/generated/azure_mgmt_web/models/domain_ownership_identifier_collection.rb +99 -0
  195. data/lib/2018-02-01/generated/azure_mgmt_web/models/domain_patch_resource.rb +348 -0
  196. data/lib/2018-02-01/generated/azure_mgmt_web/models/domain_purchase_consent.rb +79 -0
  197. data/lib/2018-02-01/generated/azure_mgmt_web/models/domain_recommendation_search_parameters.rb +58 -0
  198. data/lib/2018-02-01/generated/azure_mgmt_web/models/domain_status.rb +35 -0
  199. data/lib/2018-02-01/generated/azure_mgmt_web/models/domain_type.rb +16 -0
  200. data/lib/2018-02-01/generated/azure_mgmt_web/models/enabled_config.rb +47 -0
  201. data/lib/2018-02-01/generated/azure_mgmt_web/models/error_entity.rb +118 -0
  202. data/lib/2018-02-01/generated/azure_mgmt_web/models/experiments.rb +55 -0
  203. data/lib/2018-02-01/generated/azure_mgmt_web/models/file_system_application_logs_config.rb +49 -0
  204. data/lib/2018-02-01/generated/azure_mgmt_web/models/file_system_http_logs_config.rb +78 -0
  205. data/lib/2018-02-01/generated/azure_mgmt_web/models/frequency_unit.rb +16 -0
  206. data/lib/2018-02-01/generated/azure_mgmt_web/models/ftps_state.rb +17 -0
  207. data/lib/2018-02-01/generated/azure_mgmt_web/models/function_envelope.rb +177 -0
  208. data/lib/2018-02-01/generated/azure_mgmt_web/models/function_envelope_collection.rb +99 -0
  209. data/lib/2018-02-01/generated/azure_mgmt_web/models/function_secrets.rb +92 -0
  210. data/lib/2018-02-01/generated/azure_mgmt_web/models/geo_region.rb +94 -0
  211. data/lib/2018-02-01/generated/azure_mgmt_web/models/geo_region_collection.rb +99 -0
  212. data/lib/2018-02-01/generated/azure_mgmt_web/models/global_csm_sku_description.rb +131 -0
  213. data/lib/2018-02-01/generated/azure_mgmt_web/models/handler_mapping.rb +73 -0
  214. data/lib/2018-02-01/generated/azure_mgmt_web/models/host_name.rb +119 -0
  215. data/lib/2018-02-01/generated/azure_mgmt_web/models/host_name_binding.rb +179 -0
  216. data/lib/2018-02-01/generated/azure_mgmt_web/models/host_name_binding_collection.rb +99 -0
  217. data/lib/2018-02-01/generated/azure_mgmt_web/models/host_name_ssl_state.rb +106 -0
  218. data/lib/2018-02-01/generated/azure_mgmt_web/models/host_name_type.rb +16 -0
  219. data/lib/2018-02-01/generated/azure_mgmt_web/models/host_type.rb +16 -0
  220. data/lib/2018-02-01/generated/azure_mgmt_web/models/hosting_environment_deployment_info.rb +57 -0
  221. data/lib/2018-02-01/generated/azure_mgmt_web/models/hosting_environment_diagnostics.rb +57 -0
  222. data/lib/2018-02-01/generated/azure_mgmt_web/models/hosting_environment_profile.rb +70 -0
  223. data/lib/2018-02-01/generated/azure_mgmt_web/models/hosting_environment_status.rb +18 -0
  224. data/lib/2018-02-01/generated/azure_mgmt_web/models/http_logs_config.rb +61 -0
  225. data/lib/2018-02-01/generated/azure_mgmt_web/models/hybrid_connection.rb +163 -0
  226. data/lib/2018-02-01/generated/azure_mgmt_web/models/hybrid_connection_collection.rb +99 -0
  227. data/lib/2018-02-01/generated/azure_mgmt_web/models/hybrid_connection_key.rb +95 -0
  228. data/lib/2018-02-01/generated/azure_mgmt_web/models/hybrid_connection_limits.rb +95 -0
  229. data/lib/2018-02-01/generated/azure_mgmt_web/models/identifier.rb +81 -0
  230. data/lib/2018-02-01/generated/azure_mgmt_web/models/identifier_collection.rb +99 -0
  231. data/lib/2018-02-01/generated/azure_mgmt_web/models/in_availability_reason_type.rb +16 -0
  232. data/lib/2018-02-01/generated/azure_mgmt_web/models/internal_load_balancing_mode.rb +17 -0
  233. data/lib/2018-02-01/generated/azure_mgmt_web/models/ip_filter_tag.rb +16 -0
  234. data/lib/2018-02-01/generated/azure_mgmt_web/models/ip_security_restriction.rb +120 -0
  235. data/lib/2018-02-01/generated/azure_mgmt_web/models/issue_type.rb +22 -0
  236. data/lib/2018-02-01/generated/azure_mgmt_web/models/key_vault_secret_status.rb +25 -0
  237. data/lib/2018-02-01/generated/azure_mgmt_web/models/localizable_string.rb +57 -0
  238. data/lib/2018-02-01/generated/azure_mgmt_web/models/log_level.rb +19 -0
  239. data/lib/2018-02-01/generated/azure_mgmt_web/models/log_specification.rb +68 -0
  240. data/lib/2018-02-01/generated/azure_mgmt_web/models/managed_pipeline_mode.rb +16 -0
  241. data/lib/2018-02-01/generated/azure_mgmt_web/models/managed_service_identity.rb +91 -0
  242. data/lib/2018-02-01/generated/azure_mgmt_web/models/managed_service_identity_type.rb +16 -0
  243. data/lib/2018-02-01/generated/azure_mgmt_web/models/metric_availabilily.rb +57 -0
  244. data/lib/2018-02-01/generated/azure_mgmt_web/models/metric_availability.rb +57 -0
  245. data/lib/2018-02-01/generated/azure_mgmt_web/models/metric_definition.rb +128 -0
  246. data/lib/2018-02-01/generated/azure_mgmt_web/models/metric_specification.rb +218 -0
  247. data/lib/2018-02-01/generated/azure_mgmt_web/models/migrate_my_sql_request.rb +94 -0
  248. data/lib/2018-02-01/generated/azure_mgmt_web/models/migrate_my_sql_status.rb +108 -0
  249. data/lib/2018-02-01/generated/azure_mgmt_web/models/msdeploy.rb +165 -0
  250. data/lib/2018-02-01/generated/azure_mgmt_web/models/msdeploy_log.rb +91 -0
  251. data/lib/2018-02-01/generated/azure_mgmt_web/models/msdeploy_log_entry.rb +73 -0
  252. data/lib/2018-02-01/generated/azure_mgmt_web/models/msdeploy_log_entry_type.rb +17 -0
  253. data/lib/2018-02-01/generated/azure_mgmt_web/models/msdeploy_provisioning_state.rb +19 -0
  254. data/lib/2018-02-01/generated/azure_mgmt_web/models/msdeploy_status.rb +132 -0
  255. data/lib/2018-02-01/generated/azure_mgmt_web/models/my_sql_migration_type.rb +16 -0
  256. data/lib/2018-02-01/generated/azure_mgmt_web/models/name_identifier.rb +46 -0
  257. data/lib/2018-02-01/generated/azure_mgmt_web/models/name_identifier_collection.rb +99 -0
  258. data/lib/2018-02-01/generated/azure_mgmt_web/models/name_value_pair.rb +57 -0
  259. data/lib/2018-02-01/generated/azure_mgmt_web/models/network_access_control_entry.rb +81 -0
  260. data/lib/2018-02-01/generated/azure_mgmt_web/models/network_features.rb +140 -0
  261. data/lib/2018-02-01/generated/azure_mgmt_web/models/notification_level.rb +18 -0
  262. data/lib/2018-02-01/generated/azure_mgmt_web/models/operation.rb +135 -0
  263. data/lib/2018-02-01/generated/azure_mgmt_web/models/operation_status.rb +19 -0
  264. data/lib/2018-02-01/generated/azure_mgmt_web/models/perf_mon_counter_collection.rb +99 -0
  265. data/lib/2018-02-01/generated/azure_mgmt_web/models/perf_mon_response.rb +69 -0
  266. data/lib/2018-02-01/generated/azure_mgmt_web/models/perf_mon_sample.rb +68 -0
  267. data/lib/2018-02-01/generated/azure_mgmt_web/models/perf_mon_set.rb +100 -0
  268. data/lib/2018-02-01/generated/azure_mgmt_web/models/premier_add_on.rb +149 -0
  269. data/lib/2018-02-01/generated/azure_mgmt_web/models/premier_add_on_offer.rb +184 -0
  270. data/lib/2018-02-01/generated/azure_mgmt_web/models/premier_add_on_offer_collection.rb +99 -0
  271. data/lib/2018-02-01/generated/azure_mgmt_web/models/premier_add_on_patch_resource.rb +125 -0
  272. data/lib/2018-02-01/generated/azure_mgmt_web/models/private_access.rb +102 -0
  273. data/lib/2018-02-01/generated/azure_mgmt_web/models/private_access_subnet.rb +58 -0
  274. data/lib/2018-02-01/generated/azure_mgmt_web/models/private_access_virtual_network.rb +91 -0
  275. data/lib/2018-02-01/generated/azure_mgmt_web/models/process_info.rb +509 -0
  276. data/lib/2018-02-01/generated/azure_mgmt_web/models/process_info_collection.rb +99 -0
  277. data/lib/2018-02-01/generated/azure_mgmt_web/models/process_module_info.rb +192 -0
  278. data/lib/2018-02-01/generated/azure_mgmt_web/models/process_module_info_collection.rb +99 -0
  279. data/lib/2018-02-01/generated/azure_mgmt_web/models/process_thread_info.rb +214 -0
  280. data/lib/2018-02-01/generated/azure_mgmt_web/models/process_thread_info_collection.rb +99 -0
  281. data/lib/2018-02-01/generated/azure_mgmt_web/models/provisioning_state.rb +19 -0
  282. data/lib/2018-02-01/generated/azure_mgmt_web/models/proxy_only_resource.rb +83 -0
  283. data/lib/2018-02-01/generated/azure_mgmt_web/models/public_certificate.rb +106 -0
  284. data/lib/2018-02-01/generated/azure_mgmt_web/models/public_certificate_collection.rb +99 -0
  285. data/lib/2018-02-01/generated/azure_mgmt_web/models/public_certificate_location.rb +17 -0
  286. data/lib/2018-02-01/generated/azure_mgmt_web/models/publishing_profile_format.rb +17 -0
  287. data/lib/2018-02-01/generated/azure_mgmt_web/models/push_settings.rb +123 -0
  288. data/lib/2018-02-01/generated/azure_mgmt_web/models/ramp_up_rule.rb +141 -0
  289. data/lib/2018-02-01/generated/azure_mgmt_web/models/recommendation.rb +360 -0
  290. data/lib/2018-02-01/generated/azure_mgmt_web/models/recommendation_collection.rb +99 -0
  291. data/lib/2018-02-01/generated/azure_mgmt_web/models/recommendation_rule.rb +237 -0
  292. data/lib/2018-02-01/generated/azure_mgmt_web/models/reissue_certificate_order_request.rb +116 -0
  293. data/lib/2018-02-01/generated/azure_mgmt_web/models/relay_service_connection_entity.rb +147 -0
  294. data/lib/2018-02-01/generated/azure_mgmt_web/models/rendering.rb +71 -0
  295. data/lib/2018-02-01/generated/azure_mgmt_web/models/rendering_type.rb +18 -0
  296. data/lib/2018-02-01/generated/azure_mgmt_web/models/renew_certificate_order_request.rb +104 -0
  297. data/lib/2018-02-01/generated/azure_mgmt_web/models/requests_based_trigger.rb +57 -0
  298. data/lib/2018-02-01/generated/azure_mgmt_web/models/resource.rb +112 -0
  299. data/lib/2018-02-01/generated/azure_mgmt_web/models/resource_collection.rb +98 -0
  300. data/lib/2018-02-01/generated/azure_mgmt_web/models/resource_metric.rb +163 -0
  301. data/lib/2018-02-01/generated/azure_mgmt_web/models/resource_metric_availability.rb +59 -0
  302. data/lib/2018-02-01/generated/azure_mgmt_web/models/resource_metric_collection.rb +99 -0
  303. data/lib/2018-02-01/generated/azure_mgmt_web/models/resource_metric_definition.rb +148 -0
  304. data/lib/2018-02-01/generated/azure_mgmt_web/models/resource_metric_definition_collection.rb +99 -0
  305. data/lib/2018-02-01/generated/azure_mgmt_web/models/resource_metric_name.rb +59 -0
  306. data/lib/2018-02-01/generated/azure_mgmt_web/models/resource_metric_property.rb +57 -0
  307. data/lib/2018-02-01/generated/azure_mgmt_web/models/resource_metric_value.rb +129 -0
  308. data/lib/2018-02-01/generated/azure_mgmt_web/models/resource_name_availability.rb +78 -0
  309. data/lib/2018-02-01/generated/azure_mgmt_web/models/resource_name_availability_request.rb +71 -0
  310. data/lib/2018-02-01/generated/azure_mgmt_web/models/resource_scope_type.rb +17 -0
  311. data/lib/2018-02-01/generated/azure_mgmt_web/models/response_meta_data.rb +48 -0
  312. data/lib/2018-02-01/generated/azure_mgmt_web/models/restore_request.rb +217 -0
  313. data/lib/2018-02-01/generated/azure_mgmt_web/models/route_type.rb +17 -0
  314. data/lib/2018-02-01/generated/azure_mgmt_web/models/scm_type.rb +27 -0
  315. data/lib/2018-02-01/generated/azure_mgmt_web/models/service_specification.rb +76 -0
  316. data/lib/2018-02-01/generated/azure_mgmt_web/models/site.rb +554 -0
  317. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_auth_settings.rb +477 -0
  318. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_availability_state.rb +17 -0
  319. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_cloneability.rb +113 -0
  320. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_cloneability_criterion.rb +57 -0
  321. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_config.rb +676 -0
  322. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_config_resource.rb +711 -0
  323. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_config_resource_collection.rb +99 -0
  324. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_configuration_snapshot_info.rb +94 -0
  325. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_configuration_snapshot_info_collection.rb +101 -0
  326. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_extension_info.rb +301 -0
  327. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_extension_info_collection.rb +99 -0
  328. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_extension_type.rb +16 -0
  329. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_instance.rb +82 -0
  330. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_limits.rb +68 -0
  331. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_load_balancing.rb +19 -0
  332. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_logs_config.rb +118 -0
  333. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_machine_key.rb +79 -0
  334. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_patch_resource.rb +518 -0
  335. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_php_error_log_flag.rb +114 -0
  336. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_seal.rb +46 -0
  337. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_seal_request.rb +58 -0
  338. data/lib/2018-02-01/generated/azure_mgmt_web/models/site_source_control.rb +129 -0
  339. data/lib/2018-02-01/generated/azure_mgmt_web/models/sku_capacity.rb +83 -0
  340. data/lib/2018-02-01/generated/azure_mgmt_web/models/sku_description.rb +142 -0
  341. data/lib/2018-02-01/generated/azure_mgmt_web/models/sku_info.rb +70 -0
  342. data/lib/2018-02-01/generated/azure_mgmt_web/models/sku_info_collection.rb +99 -0
  343. data/lib/2018-02-01/generated/azure_mgmt_web/models/sku_infos.rb +67 -0
  344. data/lib/2018-02-01/generated/azure_mgmt_web/models/sku_name.rb +22 -0
  345. data/lib/2018-02-01/generated/azure_mgmt_web/models/slot_config_names_resource.rb +108 -0
  346. data/lib/2018-02-01/generated/azure_mgmt_web/models/slot_difference.rb +157 -0
  347. data/lib/2018-02-01/generated/azure_mgmt_web/models/slot_difference_collection.rb +99 -0
  348. data/lib/2018-02-01/generated/azure_mgmt_web/models/slot_swap_status.rb +71 -0
  349. data/lib/2018-02-01/generated/azure_mgmt_web/models/slow_requests_based_trigger.rb +68 -0
  350. data/lib/2018-02-01/generated/azure_mgmt_web/models/snapshot.rb +82 -0
  351. data/lib/2018-02-01/generated/azure_mgmt_web/models/snapshot_collection.rb +100 -0
  352. data/lib/2018-02-01/generated/azure_mgmt_web/models/snapshot_recovery_source.rb +62 -0
  353. data/lib/2018-02-01/generated/azure_mgmt_web/models/snapshot_restore_request.rb +133 -0
  354. data/lib/2018-02-01/generated/azure_mgmt_web/models/solution.rb +148 -0
  355. data/lib/2018-02-01/generated/azure_mgmt_web/models/solution_type.rb +17 -0
  356. data/lib/2018-02-01/generated/azure_mgmt_web/models/source_control.rb +114 -0
  357. data/lib/2018-02-01/generated/azure_mgmt_web/models/source_control_collection.rb +99 -0
  358. data/lib/2018-02-01/generated/azure_mgmt_web/models/ssl_state.rb +17 -0
  359. data/lib/2018-02-01/generated/azure_mgmt_web/models/stack_major_version.rb +90 -0
  360. data/lib/2018-02-01/generated/azure_mgmt_web/models/stack_minor_version.rb +69 -0
  361. data/lib/2018-02-01/generated/azure_mgmt_web/models/stamp_capacity.rb +167 -0
  362. data/lib/2018-02-01/generated/azure_mgmt_web/models/stamp_capacity_collection.rb +99 -0
  363. data/lib/2018-02-01/generated/azure_mgmt_web/models/status_codes_based_trigger.rb +90 -0
  364. data/lib/2018-02-01/generated/azure_mgmt_web/models/status_options.rb +17 -0
  365. data/lib/2018-02-01/generated/azure_mgmt_web/models/storage_migration_options.rb +119 -0
  366. data/lib/2018-02-01/generated/azure_mgmt_web/models/storage_migration_response.rb +83 -0
  367. data/lib/2018-02-01/generated/azure_mgmt_web/models/string_dictionary.rb +89 -0
  368. data/lib/2018-02-01/generated/azure_mgmt_web/models/supported_tls_versions.rb +17 -0
  369. data/lib/2018-02-01/generated/azure_mgmt_web/models/swift_virtual_network.rb +96 -0
  370. data/lib/2018-02-01/generated/azure_mgmt_web/models/tld_legal_agreement.rb +79 -0
  371. data/lib/2018-02-01/generated/azure_mgmt_web/models/tld_legal_agreement_collection.rb +99 -0
  372. data/lib/2018-02-01/generated/azure_mgmt_web/models/top_level_domain.rb +82 -0
  373. data/lib/2018-02-01/generated/azure_mgmt_web/models/top_level_domain_agreement_option.rb +61 -0
  374. data/lib/2018-02-01/generated/azure_mgmt_web/models/top_level_domain_collection.rb +99 -0
  375. data/lib/2018-02-01/generated/azure_mgmt_web/models/triggered_job_history.rb +91 -0
  376. data/lib/2018-02-01/generated/azure_mgmt_web/models/triggered_job_history_collection.rb +99 -0
  377. data/lib/2018-02-01/generated/azure_mgmt_web/models/triggered_job_run.rb +193 -0
  378. data/lib/2018-02-01/generated/azure_mgmt_web/models/triggered_web_job.rb +191 -0
  379. data/lib/2018-02-01/generated/azure_mgmt_web/models/triggered_web_job_collection.rb +99 -0
  380. data/lib/2018-02-01/generated/azure_mgmt_web/models/triggered_web_job_status.rb +17 -0
  381. data/lib/2018-02-01/generated/azure_mgmt_web/models/unauthenticated_client_action.rb +16 -0
  382. data/lib/2018-02-01/generated/azure_mgmt_web/models/usage.rb +168 -0
  383. data/lib/2018-02-01/generated/azure_mgmt_web/models/usage_collection.rb +99 -0
  384. data/lib/2018-02-01/generated/azure_mgmt_web/models/usage_state.rb +16 -0
  385. data/lib/2018-02-01/generated/azure_mgmt_web/models/user.rb +125 -0
  386. data/lib/2018-02-01/generated/azure_mgmt_web/models/validate_request.rb +155 -0
  387. data/lib/2018-02-01/generated/azure_mgmt_web/models/validate_resource_types.rb +16 -0
  388. data/lib/2018-02-01/generated/azure_mgmt_web/models/validate_response.rb +59 -0
  389. data/lib/2018-02-01/generated/azure_mgmt_web/models/validate_response_error.rb +57 -0
  390. data/lib/2018-02-01/generated/azure_mgmt_web/models/virtual_application.rb +90 -0
  391. data/lib/2018-02-01/generated/azure_mgmt_web/models/virtual_directory.rb +57 -0
  392. data/lib/2018-02-01/generated/azure_mgmt_web/models/virtual_ipmapping.rb +79 -0
  393. data/lib/2018-02-01/generated/azure_mgmt_web/models/virtual_network_profile.rb +81 -0
  394. data/lib/2018-02-01/generated/azure_mgmt_web/models/vnet_gateway.rb +93 -0
  395. data/lib/2018-02-01/generated/azure_mgmt_web/models/vnet_info.rb +153 -0
  396. data/lib/2018-02-01/generated/azure_mgmt_web/models/vnet_parameters.rb +103 -0
  397. data/lib/2018-02-01/generated/azure_mgmt_web/models/vnet_route.rb +115 -0
  398. data/lib/2018-02-01/generated/azure_mgmt_web/models/vnet_validation_failure_details.rb +102 -0
  399. data/lib/2018-02-01/generated/azure_mgmt_web/models/vnet_validation_test_failure.rb +93 -0
  400. data/lib/2018-02-01/generated/azure_mgmt_web/models/web_app_collection.rb +99 -0
  401. data/lib/2018-02-01/generated/azure_mgmt_web/models/web_app_instance_collection.rb +99 -0
  402. data/lib/2018-02-01/generated/azure_mgmt_web/models/web_job.rb +157 -0
  403. data/lib/2018-02-01/generated/azure_mgmt_web/models/web_job_collection.rb +99 -0
  404. data/lib/2018-02-01/generated/azure_mgmt_web/models/web_job_type.rb +16 -0
  405. data/lib/2018-02-01/generated/azure_mgmt_web/models/worker_pool.rb +102 -0
  406. data/lib/2018-02-01/generated/azure_mgmt_web/models/worker_pool_collection.rb +99 -0
  407. data/lib/2018-02-01/generated/azure_mgmt_web/models/worker_pool_resource.rb +149 -0
  408. data/lib/2018-02-01/generated/azure_mgmt_web/models/worker_size_options.rb +21 -0
  409. data/lib/2018-02-01/generated/azure_mgmt_web/module_definition.rb +9 -0
  410. data/lib/2018-02-01/generated/azure_mgmt_web/provider.rb +661 -0
  411. data/lib/2018-02-01/generated/azure_mgmt_web/recommendations.rb +1331 -0
  412. data/lib/2018-02-01/generated/azure_mgmt_web/top_level_domains.rb +566 -0
  413. data/lib/2018-02-01/generated/azure_mgmt_web/web_apps.rb +45908 -0
  414. data/lib/2018-02-01/generated/azure_mgmt_web/web_site_management_client.rb +2701 -0
  415. data/lib/azure_mgmt_web.rb +3 -2
  416. data/lib/profiles/latest/modules/web_profile_module.rb +1045 -969
  417. data/lib/version.rb +1 -1
  418. metadata +382 -5
@@ -0,0 +1,4314 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator.
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::Web::Mgmt::V2018_02_01
7
+ #
8
+ # WebSite Management Client
9
+ #
10
+ class AppServicePlans
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the AppServicePlans class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [WebSiteManagementClient] reference to the WebSiteManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Get all App Service plans for a subcription.
26
+ #
27
+ # Get all App Service plans for a subcription.
28
+ #
29
+ # @param detailed [Boolean] Specify <code>true</code> to return all App Service
30
+ # plan properties. The default is <code>false</code>, which returns a subset of
31
+ # the properties.
32
+ # Retrieval of all properties may increase the API latency.
33
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
+ # will be added to the HTTP request.
35
+ #
36
+ # @return [Array<AppServicePlan>] operation results.
37
+ #
38
+ def list(detailed:nil, custom_headers:nil)
39
+ first_page = list_as_lazy(detailed:detailed, custom_headers:custom_headers)
40
+ first_page.get_all_items
41
+ end
42
+
43
+ #
44
+ # Get all App Service plans for a subcription.
45
+ #
46
+ # Get all App Service plans for a subcription.
47
+ #
48
+ # @param detailed [Boolean] Specify <code>true</code> to return all App Service
49
+ # plan properties. The default is <code>false</code>, which returns a subset of
50
+ # the properties.
51
+ # Retrieval of all properties may increase the API latency.
52
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
53
+ # will be added to the HTTP request.
54
+ #
55
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
56
+ #
57
+ def list_with_http_info(detailed:nil, custom_headers:nil)
58
+ list_async(detailed:detailed, custom_headers:custom_headers).value!
59
+ end
60
+
61
+ #
62
+ # Get all App Service plans for a subcription.
63
+ #
64
+ # Get all App Service plans for a subcription.
65
+ #
66
+ # @param detailed [Boolean] Specify <code>true</code> to return all App Service
67
+ # plan properties. The default is <code>false</code>, which returns a subset of
68
+ # the properties.
69
+ # Retrieval of all properties may increase the API latency.
70
+ # @param [Hash{String => String}] A hash of custom headers that will be added
71
+ # to the HTTP request.
72
+ #
73
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
74
+ #
75
+ def list_async(detailed:nil, custom_headers:nil)
76
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
77
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
78
+
79
+
80
+ request_headers = {}
81
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
82
+
83
+ # Set Headers
84
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
85
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
86
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.Web/serverfarms'
87
+
88
+ request_url = @base_url || @client.base_url
89
+
90
+ options = {
91
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
92
+ path_params: {'subscriptionId' => @client.subscription_id},
93
+ query_params: {'detailed' => detailed,'api-version' => @client.api_version},
94
+ headers: request_headers.merge(custom_headers || {}),
95
+ base_url: request_url
96
+ }
97
+ promise = @client.make_request_async(:get, path_template, options)
98
+
99
+ promise = promise.then do |result|
100
+ http_response = result.response
101
+ status_code = http_response.status
102
+ response_content = http_response.body
103
+ unless status_code == 200
104
+ error_model = JSON.load(response_content)
105
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
106
+ end
107
+
108
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
109
+ # Deserialize Response
110
+ if status_code == 200
111
+ begin
112
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
113
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlanCollection.mapper()
114
+ result.body = @client.deserialize(result_mapper, parsed_response)
115
+ rescue Exception => e
116
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
117
+ end
118
+ end
119
+
120
+ result
121
+ end
122
+
123
+ promise.execute
124
+ end
125
+
126
+ #
127
+ # Get all App Service plans in a resource group.
128
+ #
129
+ # Get all App Service plans in a resource group.
130
+ #
131
+ # @param resource_group_name [String] Name of the resource group to which the
132
+ # resource belongs.
133
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
134
+ # will be added to the HTTP request.
135
+ #
136
+ # @return [Array<AppServicePlan>] operation results.
137
+ #
138
+ def list_by_resource_group(resource_group_name, custom_headers:nil)
139
+ first_page = list_by_resource_group_as_lazy(resource_group_name, custom_headers:custom_headers)
140
+ first_page.get_all_items
141
+ end
142
+
143
+ #
144
+ # Get all App Service plans in a resource group.
145
+ #
146
+ # Get all App Service plans in a resource group.
147
+ #
148
+ # @param resource_group_name [String] Name of the resource group to which the
149
+ # resource belongs.
150
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
151
+ # will be added to the HTTP request.
152
+ #
153
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
154
+ #
155
+ def list_by_resource_group_with_http_info(resource_group_name, custom_headers:nil)
156
+ list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
157
+ end
158
+
159
+ #
160
+ # Get all App Service plans in a resource group.
161
+ #
162
+ # Get all App Service plans in a resource group.
163
+ #
164
+ # @param resource_group_name [String] Name of the resource group to which the
165
+ # resource belongs.
166
+ # @param [Hash{String => String}] A hash of custom headers that will be added
167
+ # to the HTTP request.
168
+ #
169
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
170
+ #
171
+ def list_by_resource_group_async(resource_group_name, custom_headers:nil)
172
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
173
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
174
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
175
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
176
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
177
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
178
+
179
+
180
+ request_headers = {}
181
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
182
+
183
+ # Set Headers
184
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
185
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
186
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms'
187
+
188
+ request_url = @base_url || @client.base_url
189
+
190
+ options = {
191
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
192
+ path_params: {'resourceGroupName' => resource_group_name,'subscriptionId' => @client.subscription_id},
193
+ query_params: {'api-version' => @client.api_version},
194
+ headers: request_headers.merge(custom_headers || {}),
195
+ base_url: request_url
196
+ }
197
+ promise = @client.make_request_async(:get, path_template, options)
198
+
199
+ promise = promise.then do |result|
200
+ http_response = result.response
201
+ status_code = http_response.status
202
+ response_content = http_response.body
203
+ unless status_code == 200
204
+ error_model = JSON.load(response_content)
205
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
206
+ end
207
+
208
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
209
+ # Deserialize Response
210
+ if status_code == 200
211
+ begin
212
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
213
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlanCollection.mapper()
214
+ result.body = @client.deserialize(result_mapper, parsed_response)
215
+ rescue Exception => e
216
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
217
+ end
218
+ end
219
+
220
+ result
221
+ end
222
+
223
+ promise.execute
224
+ end
225
+
226
+ #
227
+ # Get an App Service plan.
228
+ #
229
+ # Get an App Service plan.
230
+ #
231
+ # @param resource_group_name [String] Name of the resource group to which the
232
+ # resource belongs.
233
+ # @param name [String] Name of the App Service plan.
234
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
235
+ # will be added to the HTTP request.
236
+ #
237
+ # @return [AppServicePlan] operation results.
238
+ #
239
+ def get(resource_group_name, name, custom_headers:nil)
240
+ response = get_async(resource_group_name, name, custom_headers:custom_headers).value!
241
+ response.body unless response.nil?
242
+ end
243
+
244
+ #
245
+ # Get an App Service plan.
246
+ #
247
+ # Get an App Service plan.
248
+ #
249
+ # @param resource_group_name [String] Name of the resource group to which the
250
+ # resource belongs.
251
+ # @param name [String] Name of the App Service plan.
252
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
253
+ # will be added to the HTTP request.
254
+ #
255
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
256
+ #
257
+ def get_with_http_info(resource_group_name, name, custom_headers:nil)
258
+ get_async(resource_group_name, name, custom_headers:custom_headers).value!
259
+ end
260
+
261
+ #
262
+ # Get an App Service plan.
263
+ #
264
+ # Get an App Service plan.
265
+ #
266
+ # @param resource_group_name [String] Name of the resource group to which the
267
+ # resource belongs.
268
+ # @param name [String] Name of the App Service plan.
269
+ # @param [Hash{String => String}] A hash of custom headers that will be added
270
+ # to the HTTP request.
271
+ #
272
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
273
+ #
274
+ def get_async(resource_group_name, name, custom_headers:nil)
275
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
276
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
277
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
278
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
279
+ fail ArgumentError, 'name is nil' if name.nil?
280
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
281
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
282
+
283
+
284
+ request_headers = {}
285
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
286
+
287
+ # Set Headers
288
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
289
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
290
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'
291
+
292
+ request_url = @base_url || @client.base_url
293
+
294
+ options = {
295
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
296
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
297
+ query_params: {'api-version' => @client.api_version},
298
+ headers: request_headers.merge(custom_headers || {}),
299
+ base_url: request_url
300
+ }
301
+ promise = @client.make_request_async(:get, path_template, options)
302
+
303
+ promise = promise.then do |result|
304
+ http_response = result.response
305
+ status_code = http_response.status
306
+ response_content = http_response.body
307
+ unless status_code == 200 || status_code == 404
308
+ error_model = JSON.load(response_content)
309
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
310
+ end
311
+
312
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
313
+ # Deserialize Response
314
+ if status_code == 200
315
+ begin
316
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
317
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlan.mapper()
318
+ result.body = @client.deserialize(result_mapper, parsed_response)
319
+ rescue Exception => e
320
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
321
+ end
322
+ end
323
+
324
+ result
325
+ end
326
+
327
+ promise.execute
328
+ end
329
+
330
+ #
331
+ # Creates or updates an App Service Plan.
332
+ #
333
+ # Creates or updates an App Service Plan.
334
+ #
335
+ # @param resource_group_name [String] Name of the resource group to which the
336
+ # resource belongs.
337
+ # @param name [String] Name of the App Service plan.
338
+ # @param app_service_plan [AppServicePlan] Details of the App Service plan.
339
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
340
+ # will be added to the HTTP request.
341
+ #
342
+ # @return [AppServicePlan] operation results.
343
+ #
344
+ def create_or_update(resource_group_name, name, app_service_plan, custom_headers:nil)
345
+ response = create_or_update_async(resource_group_name, name, app_service_plan, custom_headers:custom_headers).value!
346
+ response.body unless response.nil?
347
+ end
348
+
349
+ #
350
+ # @param resource_group_name [String] Name of the resource group to which the
351
+ # resource belongs.
352
+ # @param name [String] Name of the App Service plan.
353
+ # @param app_service_plan [AppServicePlan] Details of the App Service plan.
354
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
355
+ # will be added to the HTTP request.
356
+ #
357
+ # @return [Concurrent::Promise] promise which provides async access to http
358
+ # response.
359
+ #
360
+ def create_or_update_async(resource_group_name, name, app_service_plan, custom_headers:nil)
361
+ # Send request
362
+ promise = begin_create_or_update_async(resource_group_name, name, app_service_plan, custom_headers:custom_headers)
363
+
364
+ promise = promise.then do |response|
365
+ # Defining deserialization method.
366
+ deserialize_method = lambda do |parsed_response|
367
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlan.mapper()
368
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
369
+ end
370
+
371
+ # Waiting for response.
372
+ @client.get_long_running_operation_result(response, deserialize_method)
373
+ end
374
+
375
+ promise
376
+ end
377
+
378
+ #
379
+ # Delete an App Service plan.
380
+ #
381
+ # Delete an App Service plan.
382
+ #
383
+ # @param resource_group_name [String] Name of the resource group to which the
384
+ # resource belongs.
385
+ # @param name [String] Name of the App Service plan.
386
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
387
+ # will be added to the HTTP request.
388
+ #
389
+ #
390
+ def delete(resource_group_name, name, custom_headers:nil)
391
+ response = delete_async(resource_group_name, name, custom_headers:custom_headers).value!
392
+ nil
393
+ end
394
+
395
+ #
396
+ # Delete an App Service plan.
397
+ #
398
+ # Delete an App Service plan.
399
+ #
400
+ # @param resource_group_name [String] Name of the resource group to which the
401
+ # resource belongs.
402
+ # @param name [String] Name of the App Service plan.
403
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
404
+ # will be added to the HTTP request.
405
+ #
406
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
407
+ #
408
+ def delete_with_http_info(resource_group_name, name, custom_headers:nil)
409
+ delete_async(resource_group_name, name, custom_headers:custom_headers).value!
410
+ end
411
+
412
+ #
413
+ # Delete an App Service plan.
414
+ #
415
+ # Delete an App Service plan.
416
+ #
417
+ # @param resource_group_name [String] Name of the resource group to which the
418
+ # resource belongs.
419
+ # @param name [String] Name of the App Service plan.
420
+ # @param [Hash{String => String}] A hash of custom headers that will be added
421
+ # to the HTTP request.
422
+ #
423
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
424
+ #
425
+ def delete_async(resource_group_name, name, custom_headers:nil)
426
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
427
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
428
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
429
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
430
+ fail ArgumentError, 'name is nil' if name.nil?
431
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
432
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
433
+
434
+
435
+ request_headers = {}
436
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
437
+
438
+ # Set Headers
439
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
440
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
441
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'
442
+
443
+ request_url = @base_url || @client.base_url
444
+
445
+ options = {
446
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
447
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
448
+ query_params: {'api-version' => @client.api_version},
449
+ headers: request_headers.merge(custom_headers || {}),
450
+ base_url: request_url
451
+ }
452
+ promise = @client.make_request_async(:delete, path_template, options)
453
+
454
+ promise = promise.then do |result|
455
+ http_response = result.response
456
+ status_code = http_response.status
457
+ response_content = http_response.body
458
+ unless status_code == 200 || status_code == 204
459
+ error_model = JSON.load(response_content)
460
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
461
+ end
462
+
463
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
464
+
465
+ result
466
+ end
467
+
468
+ promise.execute
469
+ end
470
+
471
+ #
472
+ # Creates or updates an App Service Plan.
473
+ #
474
+ # Creates or updates an App Service Plan.
475
+ #
476
+ # @param resource_group_name [String] Name of the resource group to which the
477
+ # resource belongs.
478
+ # @param name [String] Name of the App Service plan.
479
+ # @param app_service_plan [AppServicePlanPatchResource] Details of the App
480
+ # Service plan.
481
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
482
+ # will be added to the HTTP request.
483
+ #
484
+ # @return [AppServicePlan] operation results.
485
+ #
486
+ def update(resource_group_name, name, app_service_plan, custom_headers:nil)
487
+ response = update_async(resource_group_name, name, app_service_plan, custom_headers:custom_headers).value!
488
+ response.body unless response.nil?
489
+ end
490
+
491
+ #
492
+ # Creates or updates an App Service Plan.
493
+ #
494
+ # Creates or updates an App Service Plan.
495
+ #
496
+ # @param resource_group_name [String] Name of the resource group to which the
497
+ # resource belongs.
498
+ # @param name [String] Name of the App Service plan.
499
+ # @param app_service_plan [AppServicePlanPatchResource] Details of the App
500
+ # Service plan.
501
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
502
+ # will be added to the HTTP request.
503
+ #
504
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
505
+ #
506
+ def update_with_http_info(resource_group_name, name, app_service_plan, custom_headers:nil)
507
+ update_async(resource_group_name, name, app_service_plan, custom_headers:custom_headers).value!
508
+ end
509
+
510
+ #
511
+ # Creates or updates an App Service Plan.
512
+ #
513
+ # Creates or updates an App Service Plan.
514
+ #
515
+ # @param resource_group_name [String] Name of the resource group to which the
516
+ # resource belongs.
517
+ # @param name [String] Name of the App Service plan.
518
+ # @param app_service_plan [AppServicePlanPatchResource] Details of the App
519
+ # Service plan.
520
+ # @param [Hash{String => String}] A hash of custom headers that will be added
521
+ # to the HTTP request.
522
+ #
523
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
524
+ #
525
+ def update_async(resource_group_name, name, app_service_plan, custom_headers:nil)
526
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
527
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
528
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
529
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
530
+ fail ArgumentError, 'name is nil' if name.nil?
531
+ fail ArgumentError, 'app_service_plan is nil' if app_service_plan.nil?
532
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
533
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
534
+
535
+
536
+ request_headers = {}
537
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
538
+
539
+ # Set Headers
540
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
541
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
542
+
543
+ # Serialize Request
544
+ request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlanPatchResource.mapper()
545
+ request_content = @client.serialize(request_mapper, app_service_plan)
546
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
547
+
548
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'
549
+
550
+ request_url = @base_url || @client.base_url
551
+
552
+ options = {
553
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
554
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
555
+ query_params: {'api-version' => @client.api_version},
556
+ body: request_content,
557
+ headers: request_headers.merge(custom_headers || {}),
558
+ base_url: request_url
559
+ }
560
+ promise = @client.make_request_async(:patch, path_template, options)
561
+
562
+ promise = promise.then do |result|
563
+ http_response = result.response
564
+ status_code = http_response.status
565
+ response_content = http_response.body
566
+ unless status_code == 200 || status_code == 202
567
+ error_model = JSON.load(response_content)
568
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
569
+ end
570
+
571
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
572
+ # Deserialize Response
573
+ if status_code == 200
574
+ begin
575
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
576
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlan.mapper()
577
+ result.body = @client.deserialize(result_mapper, parsed_response)
578
+ rescue Exception => e
579
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
580
+ end
581
+ end
582
+ # Deserialize Response
583
+ if status_code == 202
584
+ begin
585
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
586
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlan.mapper()
587
+ result.body = @client.deserialize(result_mapper, parsed_response)
588
+ rescue Exception => e
589
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
590
+ end
591
+ end
592
+
593
+ result
594
+ end
595
+
596
+ promise.execute
597
+ end
598
+
599
+ #
600
+ # List all capabilities of an App Service plan.
601
+ #
602
+ # List all capabilities of an App Service plan.
603
+ #
604
+ # @param resource_group_name [String] Name of the resource group to which the
605
+ # resource belongs.
606
+ # @param name [String] Name of the App Service plan.
607
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
608
+ # will be added to the HTTP request.
609
+ #
610
+ # @return [Array] operation results.
611
+ #
612
+ def list_capabilities(resource_group_name, name, custom_headers:nil)
613
+ response = list_capabilities_async(resource_group_name, name, custom_headers:custom_headers).value!
614
+ response.body unless response.nil?
615
+ end
616
+
617
+ #
618
+ # List all capabilities of an App Service plan.
619
+ #
620
+ # List all capabilities of an App Service plan.
621
+ #
622
+ # @param resource_group_name [String] Name of the resource group to which the
623
+ # resource belongs.
624
+ # @param name [String] Name of the App Service plan.
625
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
626
+ # will be added to the HTTP request.
627
+ #
628
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
629
+ #
630
+ def list_capabilities_with_http_info(resource_group_name, name, custom_headers:nil)
631
+ list_capabilities_async(resource_group_name, name, custom_headers:custom_headers).value!
632
+ end
633
+
634
+ #
635
+ # List all capabilities of an App Service plan.
636
+ #
637
+ # List all capabilities of an App Service plan.
638
+ #
639
+ # @param resource_group_name [String] Name of the resource group to which the
640
+ # resource belongs.
641
+ # @param name [String] Name of the App Service plan.
642
+ # @param [Hash{String => String}] A hash of custom headers that will be added
643
+ # to the HTTP request.
644
+ #
645
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
646
+ #
647
+ def list_capabilities_async(resource_group_name, name, custom_headers:nil)
648
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
649
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
650
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
651
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
652
+ fail ArgumentError, 'name is nil' if name.nil?
653
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
654
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
655
+
656
+
657
+ request_headers = {}
658
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
659
+
660
+ # Set Headers
661
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
662
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
663
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/capabilities'
664
+
665
+ request_url = @base_url || @client.base_url
666
+
667
+ options = {
668
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
669
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
670
+ query_params: {'api-version' => @client.api_version},
671
+ headers: request_headers.merge(custom_headers || {}),
672
+ base_url: request_url
673
+ }
674
+ promise = @client.make_request_async(:get, path_template, options)
675
+
676
+ promise = promise.then do |result|
677
+ http_response = result.response
678
+ status_code = http_response.status
679
+ response_content = http_response.body
680
+ unless status_code == 200
681
+ error_model = JSON.load(response_content)
682
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
683
+ end
684
+
685
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
686
+ # Deserialize Response
687
+ if status_code == 200
688
+ begin
689
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
690
+ result_mapper = {
691
+ client_side_validation: true,
692
+ required: false,
693
+ serialized_name: 'parsed_response',
694
+ type: {
695
+ name: 'Sequence',
696
+ element: {
697
+ client_side_validation: true,
698
+ required: false,
699
+ serialized_name: 'CapabilityElementType',
700
+ type: {
701
+ name: 'Composite',
702
+ class_name: 'Capability'
703
+ }
704
+ }
705
+ }
706
+ }
707
+ result.body = @client.deserialize(result_mapper, parsed_response)
708
+ rescue Exception => e
709
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
710
+ end
711
+ end
712
+
713
+ result
714
+ end
715
+
716
+ promise.execute
717
+ end
718
+
719
+ #
720
+ # Retrieve a Hybrid Connection in use in an App Service plan.
721
+ #
722
+ # Retrieve a Hybrid Connection in use in an App Service plan.
723
+ #
724
+ # @param resource_group_name [String] Name of the resource group to which the
725
+ # resource belongs.
726
+ # @param name [String] Name of the App Service plan.
727
+ # @param namespace_name [String] Name of the Service Bus namespace.
728
+ # @param relay_name [String] Name of the Service Bus relay.
729
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
730
+ # will be added to the HTTP request.
731
+ #
732
+ # @return [HybridConnection] operation results.
733
+ #
734
+ def get_hybrid_connection(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
735
+ response = get_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
736
+ response.body unless response.nil?
737
+ end
738
+
739
+ #
740
+ # Retrieve a Hybrid Connection in use in an App Service plan.
741
+ #
742
+ # Retrieve a Hybrid Connection in use in an App Service plan.
743
+ #
744
+ # @param resource_group_name [String] Name of the resource group to which the
745
+ # resource belongs.
746
+ # @param name [String] Name of the App Service plan.
747
+ # @param namespace_name [String] Name of the Service Bus namespace.
748
+ # @param relay_name [String] Name of the Service Bus relay.
749
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
750
+ # will be added to the HTTP request.
751
+ #
752
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
753
+ #
754
+ def get_hybrid_connection_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
755
+ get_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
756
+ end
757
+
758
+ #
759
+ # Retrieve a Hybrid Connection in use in an App Service plan.
760
+ #
761
+ # Retrieve a Hybrid Connection in use in an App Service plan.
762
+ #
763
+ # @param resource_group_name [String] Name of the resource group to which the
764
+ # resource belongs.
765
+ # @param name [String] Name of the App Service plan.
766
+ # @param namespace_name [String] Name of the Service Bus namespace.
767
+ # @param relay_name [String] Name of the Service Bus relay.
768
+ # @param [Hash{String => String}] A hash of custom headers that will be added
769
+ # to the HTTP request.
770
+ #
771
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
772
+ #
773
+ def get_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
774
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
775
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
776
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
777
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
778
+ fail ArgumentError, 'name is nil' if name.nil?
779
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
780
+ fail ArgumentError, 'relay_name is nil' if relay_name.nil?
781
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
782
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
783
+
784
+
785
+ request_headers = {}
786
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
787
+
788
+ # Set Headers
789
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
790
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
791
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'
792
+
793
+ request_url = @base_url || @client.base_url
794
+
795
+ options = {
796
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
797
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'namespaceName' => namespace_name,'relayName' => relay_name,'subscriptionId' => @client.subscription_id},
798
+ query_params: {'api-version' => @client.api_version},
799
+ headers: request_headers.merge(custom_headers || {}),
800
+ base_url: request_url
801
+ }
802
+ promise = @client.make_request_async(:get, path_template, options)
803
+
804
+ promise = promise.then do |result|
805
+ http_response = result.response
806
+ status_code = http_response.status
807
+ response_content = http_response.body
808
+ unless status_code == 200
809
+ error_model = JSON.load(response_content)
810
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
811
+ end
812
+
813
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
814
+ # Deserialize Response
815
+ if status_code == 200
816
+ begin
817
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
818
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::HybridConnection.mapper()
819
+ result.body = @client.deserialize(result_mapper, parsed_response)
820
+ rescue Exception => e
821
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
822
+ end
823
+ end
824
+
825
+ result
826
+ end
827
+
828
+ promise.execute
829
+ end
830
+
831
+ #
832
+ # Delete a Hybrid Connection in use in an App Service plan.
833
+ #
834
+ # Delete a Hybrid Connection in use in an App Service plan.
835
+ #
836
+ # @param resource_group_name [String] Name of the resource group to which the
837
+ # resource belongs.
838
+ # @param name [String] Name of the App Service plan.
839
+ # @param namespace_name [String] Name of the Service Bus namespace.
840
+ # @param relay_name [String] Name of the Service Bus relay.
841
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
842
+ # will be added to the HTTP request.
843
+ #
844
+ #
845
+ def delete_hybrid_connection(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
846
+ response = delete_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
847
+ nil
848
+ end
849
+
850
+ #
851
+ # Delete a Hybrid Connection in use in an App Service plan.
852
+ #
853
+ # Delete a Hybrid Connection in use in an App Service plan.
854
+ #
855
+ # @param resource_group_name [String] Name of the resource group to which the
856
+ # resource belongs.
857
+ # @param name [String] Name of the App Service plan.
858
+ # @param namespace_name [String] Name of the Service Bus namespace.
859
+ # @param relay_name [String] Name of the Service Bus relay.
860
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
861
+ # will be added to the HTTP request.
862
+ #
863
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
864
+ #
865
+ def delete_hybrid_connection_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
866
+ delete_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
867
+ end
868
+
869
+ #
870
+ # Delete a Hybrid Connection in use in an App Service plan.
871
+ #
872
+ # Delete a Hybrid Connection in use in an App Service plan.
873
+ #
874
+ # @param resource_group_name [String] Name of the resource group to which the
875
+ # resource belongs.
876
+ # @param name [String] Name of the App Service plan.
877
+ # @param namespace_name [String] Name of the Service Bus namespace.
878
+ # @param relay_name [String] Name of the Service Bus relay.
879
+ # @param [Hash{String => String}] A hash of custom headers that will be added
880
+ # to the HTTP request.
881
+ #
882
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
883
+ #
884
+ def delete_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
885
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
886
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
887
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
888
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
889
+ fail ArgumentError, 'name is nil' if name.nil?
890
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
891
+ fail ArgumentError, 'relay_name is nil' if relay_name.nil?
892
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
893
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
894
+
895
+
896
+ request_headers = {}
897
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
898
+
899
+ # Set Headers
900
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
901
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
902
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'
903
+
904
+ request_url = @base_url || @client.base_url
905
+
906
+ options = {
907
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
908
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'namespaceName' => namespace_name,'relayName' => relay_name,'subscriptionId' => @client.subscription_id},
909
+ query_params: {'api-version' => @client.api_version},
910
+ headers: request_headers.merge(custom_headers || {}),
911
+ base_url: request_url
912
+ }
913
+ promise = @client.make_request_async(:delete, path_template, options)
914
+
915
+ promise = promise.then do |result|
916
+ http_response = result.response
917
+ status_code = http_response.status
918
+ response_content = http_response.body
919
+ unless status_code == 200 || status_code == 204
920
+ error_model = JSON.load(response_content)
921
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
922
+ end
923
+
924
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
925
+
926
+ result
927
+ end
928
+
929
+ promise.execute
930
+ end
931
+
932
+ #
933
+ # Get the send key name and value of a Hybrid Connection.
934
+ #
935
+ # Get the send key name and value of a Hybrid Connection.
936
+ #
937
+ # @param resource_group_name [String] Name of the resource group to which the
938
+ # resource belongs.
939
+ # @param name [String] Name of the App Service plan.
940
+ # @param namespace_name [String] The name of the Service Bus namespace.
941
+ # @param relay_name [String] The name of the Service Bus relay.
942
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
943
+ # will be added to the HTTP request.
944
+ #
945
+ # @return [HybridConnectionKey] operation results.
946
+ #
947
+ def list_hybrid_connection_keys(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
948
+ response = list_hybrid_connection_keys_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
949
+ response.body unless response.nil?
950
+ end
951
+
952
+ #
953
+ # Get the send key name and value of a Hybrid Connection.
954
+ #
955
+ # Get the send key name and value of a Hybrid Connection.
956
+ #
957
+ # @param resource_group_name [String] Name of the resource group to which the
958
+ # resource belongs.
959
+ # @param name [String] Name of the App Service plan.
960
+ # @param namespace_name [String] The name of the Service Bus namespace.
961
+ # @param relay_name [String] The name of the Service Bus relay.
962
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
963
+ # will be added to the HTTP request.
964
+ #
965
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
966
+ #
967
+ def list_hybrid_connection_keys_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
968
+ list_hybrid_connection_keys_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
969
+ end
970
+
971
+ #
972
+ # Get the send key name and value of a Hybrid Connection.
973
+ #
974
+ # Get the send key name and value of a Hybrid Connection.
975
+ #
976
+ # @param resource_group_name [String] Name of the resource group to which the
977
+ # resource belongs.
978
+ # @param name [String] Name of the App Service plan.
979
+ # @param namespace_name [String] The name of the Service Bus namespace.
980
+ # @param relay_name [String] The name of the Service Bus relay.
981
+ # @param [Hash{String => String}] A hash of custom headers that will be added
982
+ # to the HTTP request.
983
+ #
984
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
985
+ #
986
+ def list_hybrid_connection_keys_async(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
987
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
988
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
989
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
990
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
991
+ fail ArgumentError, 'name is nil' if name.nil?
992
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
993
+ fail ArgumentError, 'relay_name is nil' if relay_name.nil?
994
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
995
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
996
+
997
+
998
+ request_headers = {}
999
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1000
+
1001
+ # Set Headers
1002
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1003
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1004
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'
1005
+
1006
+ request_url = @base_url || @client.base_url
1007
+
1008
+ options = {
1009
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1010
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'namespaceName' => namespace_name,'relayName' => relay_name,'subscriptionId' => @client.subscription_id},
1011
+ query_params: {'api-version' => @client.api_version},
1012
+ headers: request_headers.merge(custom_headers || {}),
1013
+ base_url: request_url
1014
+ }
1015
+ promise = @client.make_request_async(:post, path_template, options)
1016
+
1017
+ promise = promise.then do |result|
1018
+ http_response = result.response
1019
+ status_code = http_response.status
1020
+ response_content = http_response.body
1021
+ unless status_code == 200
1022
+ error_model = JSON.load(response_content)
1023
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1024
+ end
1025
+
1026
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1027
+ # Deserialize Response
1028
+ if status_code == 200
1029
+ begin
1030
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1031
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::HybridConnectionKey.mapper()
1032
+ result.body = @client.deserialize(result_mapper, parsed_response)
1033
+ rescue Exception => e
1034
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1035
+ end
1036
+ end
1037
+
1038
+ result
1039
+ end
1040
+
1041
+ promise.execute
1042
+ end
1043
+
1044
+ #
1045
+ # Get all apps that use a Hybrid Connection in an App Service Plan.
1046
+ #
1047
+ # Get all apps that use a Hybrid Connection in an App Service Plan.
1048
+ #
1049
+ # @param resource_group_name [String] Name of the resource group to which the
1050
+ # resource belongs.
1051
+ # @param name [String] Name of the App Service plan.
1052
+ # @param namespace_name [String] Name of the Hybrid Connection namespace.
1053
+ # @param relay_name [String] Name of the Hybrid Connection relay.
1054
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1055
+ # will be added to the HTTP request.
1056
+ #
1057
+ # @return [Array<String>] operation results.
1058
+ #
1059
+ def list_web_apps_by_hybrid_connection(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
1060
+ first_page = list_web_apps_by_hybrid_connection_as_lazy(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers)
1061
+ first_page.get_all_items
1062
+ end
1063
+
1064
+ #
1065
+ # Get all apps that use a Hybrid Connection in an App Service Plan.
1066
+ #
1067
+ # Get all apps that use a Hybrid Connection in an App Service Plan.
1068
+ #
1069
+ # @param resource_group_name [String] Name of the resource group to which the
1070
+ # resource belongs.
1071
+ # @param name [String] Name of the App Service plan.
1072
+ # @param namespace_name [String] Name of the Hybrid Connection namespace.
1073
+ # @param relay_name [String] Name of the Hybrid Connection relay.
1074
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1075
+ # will be added to the HTTP request.
1076
+ #
1077
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1078
+ #
1079
+ def list_web_apps_by_hybrid_connection_with_http_info(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
1080
+ list_web_apps_by_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
1081
+ end
1082
+
1083
+ #
1084
+ # Get all apps that use a Hybrid Connection in an App Service Plan.
1085
+ #
1086
+ # Get all apps that use a Hybrid Connection in an App Service Plan.
1087
+ #
1088
+ # @param resource_group_name [String] Name of the resource group to which the
1089
+ # resource belongs.
1090
+ # @param name [String] Name of the App Service plan.
1091
+ # @param namespace_name [String] Name of the Hybrid Connection namespace.
1092
+ # @param relay_name [String] Name of the Hybrid Connection relay.
1093
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1094
+ # to the HTTP request.
1095
+ #
1096
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1097
+ #
1098
+ def list_web_apps_by_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
1099
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1100
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1101
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1102
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
1103
+ fail ArgumentError, 'name is nil' if name.nil?
1104
+ fail ArgumentError, 'namespace_name is nil' if namespace_name.nil?
1105
+ fail ArgumentError, 'relay_name is nil' if relay_name.nil?
1106
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1107
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1108
+
1109
+
1110
+ request_headers = {}
1111
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1112
+
1113
+ # Set Headers
1114
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1115
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1116
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/sites'
1117
+
1118
+ request_url = @base_url || @client.base_url
1119
+
1120
+ options = {
1121
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1122
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'namespaceName' => namespace_name,'relayName' => relay_name,'subscriptionId' => @client.subscription_id},
1123
+ query_params: {'api-version' => @client.api_version},
1124
+ headers: request_headers.merge(custom_headers || {}),
1125
+ base_url: request_url
1126
+ }
1127
+ promise = @client.make_request_async(:get, path_template, options)
1128
+
1129
+ promise = promise.then do |result|
1130
+ http_response = result.response
1131
+ status_code = http_response.status
1132
+ response_content = http_response.body
1133
+ unless status_code == 200
1134
+ error_model = JSON.load(response_content)
1135
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1136
+ end
1137
+
1138
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1139
+ # Deserialize Response
1140
+ if status_code == 200
1141
+ begin
1142
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1143
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::ResourceCollection.mapper()
1144
+ result.body = @client.deserialize(result_mapper, parsed_response)
1145
+ rescue Exception => e
1146
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1147
+ end
1148
+ end
1149
+
1150
+ result
1151
+ end
1152
+
1153
+ promise.execute
1154
+ end
1155
+
1156
+ #
1157
+ # Get the maximum number of Hybrid Connections allowed in an App Service plan.
1158
+ #
1159
+ # Get the maximum number of Hybrid Connections allowed in an App Service plan.
1160
+ #
1161
+ # @param resource_group_name [String] Name of the resource group to which the
1162
+ # resource belongs.
1163
+ # @param name [String] Name of the App Service plan.
1164
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1165
+ # will be added to the HTTP request.
1166
+ #
1167
+ # @return [HybridConnectionLimits] operation results.
1168
+ #
1169
+ def get_hybrid_connection_plan_limit(resource_group_name, name, custom_headers:nil)
1170
+ response = get_hybrid_connection_plan_limit_async(resource_group_name, name, custom_headers:custom_headers).value!
1171
+ response.body unless response.nil?
1172
+ end
1173
+
1174
+ #
1175
+ # Get the maximum number of Hybrid Connections allowed in an App Service plan.
1176
+ #
1177
+ # Get the maximum number of Hybrid Connections allowed in an App Service plan.
1178
+ #
1179
+ # @param resource_group_name [String] Name of the resource group to which the
1180
+ # resource belongs.
1181
+ # @param name [String] Name of the App Service plan.
1182
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1183
+ # will be added to the HTTP request.
1184
+ #
1185
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1186
+ #
1187
+ def get_hybrid_connection_plan_limit_with_http_info(resource_group_name, name, custom_headers:nil)
1188
+ get_hybrid_connection_plan_limit_async(resource_group_name, name, custom_headers:custom_headers).value!
1189
+ end
1190
+
1191
+ #
1192
+ # Get the maximum number of Hybrid Connections allowed in an App Service plan.
1193
+ #
1194
+ # Get the maximum number of Hybrid Connections allowed in an App Service plan.
1195
+ #
1196
+ # @param resource_group_name [String] Name of the resource group to which the
1197
+ # resource belongs.
1198
+ # @param name [String] Name of the App Service plan.
1199
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1200
+ # to the HTTP request.
1201
+ #
1202
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1203
+ #
1204
+ def get_hybrid_connection_plan_limit_async(resource_group_name, name, custom_headers:nil)
1205
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1206
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1207
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1208
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
1209
+ fail ArgumentError, 'name is nil' if name.nil?
1210
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1211
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1212
+
1213
+
1214
+ request_headers = {}
1215
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1216
+
1217
+ # Set Headers
1218
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1219
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1220
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionPlanLimits/limit'
1221
+
1222
+ request_url = @base_url || @client.base_url
1223
+
1224
+ options = {
1225
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1226
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
1227
+ query_params: {'api-version' => @client.api_version},
1228
+ headers: request_headers.merge(custom_headers || {}),
1229
+ base_url: request_url
1230
+ }
1231
+ promise = @client.make_request_async(:get, path_template, options)
1232
+
1233
+ promise = promise.then do |result|
1234
+ http_response = result.response
1235
+ status_code = http_response.status
1236
+ response_content = http_response.body
1237
+ unless status_code == 200
1238
+ error_model = JSON.load(response_content)
1239
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1240
+ end
1241
+
1242
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1243
+ # Deserialize Response
1244
+ if status_code == 200
1245
+ begin
1246
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1247
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::HybridConnectionLimits.mapper()
1248
+ result.body = @client.deserialize(result_mapper, parsed_response)
1249
+ rescue Exception => e
1250
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1251
+ end
1252
+ end
1253
+
1254
+ result
1255
+ end
1256
+
1257
+ promise.execute
1258
+ end
1259
+
1260
+ #
1261
+ # Retrieve all Hybrid Connections in use in an App Service plan.
1262
+ #
1263
+ # Retrieve all Hybrid Connections in use in an App Service plan.
1264
+ #
1265
+ # @param resource_group_name [String] Name of the resource group to which the
1266
+ # resource belongs.
1267
+ # @param name [String] Name of the App Service plan.
1268
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1269
+ # will be added to the HTTP request.
1270
+ #
1271
+ # @return [Array<HybridConnection>] operation results.
1272
+ #
1273
+ def list_hybrid_connections(resource_group_name, name, custom_headers:nil)
1274
+ first_page = list_hybrid_connections_as_lazy(resource_group_name, name, custom_headers:custom_headers)
1275
+ first_page.get_all_items
1276
+ end
1277
+
1278
+ #
1279
+ # Retrieve all Hybrid Connections in use in an App Service plan.
1280
+ #
1281
+ # Retrieve all Hybrid Connections in use in an App Service plan.
1282
+ #
1283
+ # @param resource_group_name [String] Name of the resource group to which the
1284
+ # resource belongs.
1285
+ # @param name [String] Name of the App Service plan.
1286
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1287
+ # will be added to the HTTP request.
1288
+ #
1289
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1290
+ #
1291
+ def list_hybrid_connections_with_http_info(resource_group_name, name, custom_headers:nil)
1292
+ list_hybrid_connections_async(resource_group_name, name, custom_headers:custom_headers).value!
1293
+ end
1294
+
1295
+ #
1296
+ # Retrieve all Hybrid Connections in use in an App Service plan.
1297
+ #
1298
+ # Retrieve all Hybrid Connections in use in an App Service plan.
1299
+ #
1300
+ # @param resource_group_name [String] Name of the resource group to which the
1301
+ # resource belongs.
1302
+ # @param name [String] Name of the App Service plan.
1303
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1304
+ # to the HTTP request.
1305
+ #
1306
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1307
+ #
1308
+ def list_hybrid_connections_async(resource_group_name, name, custom_headers:nil)
1309
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1310
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1311
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1312
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
1313
+ fail ArgumentError, 'name is nil' if name.nil?
1314
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1315
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1316
+
1317
+
1318
+ request_headers = {}
1319
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1320
+
1321
+ # Set Headers
1322
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1323
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1324
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionRelays'
1325
+
1326
+ request_url = @base_url || @client.base_url
1327
+
1328
+ options = {
1329
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1330
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
1331
+ query_params: {'api-version' => @client.api_version},
1332
+ headers: request_headers.merge(custom_headers || {}),
1333
+ base_url: request_url
1334
+ }
1335
+ promise = @client.make_request_async(:get, path_template, options)
1336
+
1337
+ promise = promise.then do |result|
1338
+ http_response = result.response
1339
+ status_code = http_response.status
1340
+ response_content = http_response.body
1341
+ unless status_code == 200
1342
+ error_model = JSON.load(response_content)
1343
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1344
+ end
1345
+
1346
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1347
+ # Deserialize Response
1348
+ if status_code == 200
1349
+ begin
1350
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1351
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::HybridConnectionCollection.mapper()
1352
+ result.body = @client.deserialize(result_mapper, parsed_response)
1353
+ rescue Exception => e
1354
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1355
+ end
1356
+ end
1357
+
1358
+ result
1359
+ end
1360
+
1361
+ promise.execute
1362
+ end
1363
+
1364
+ #
1365
+ # Get metrics that can be queried for an App Service plan, and their
1366
+ # definitions.
1367
+ #
1368
+ # Get metrics that can be queried for an App Service plan, and their
1369
+ # definitions.
1370
+ #
1371
+ # @param resource_group_name [String] Name of the resource group to which the
1372
+ # resource belongs.
1373
+ # @param name [String] Name of the App Service plan.
1374
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1375
+ # will be added to the HTTP request.
1376
+ #
1377
+ # @return [Array<ResourceMetricDefinition>] operation results.
1378
+ #
1379
+ def list_metric_defintions(resource_group_name, name, custom_headers:nil)
1380
+ first_page = list_metric_defintions_as_lazy(resource_group_name, name, custom_headers:custom_headers)
1381
+ first_page.get_all_items
1382
+ end
1383
+
1384
+ #
1385
+ # Get metrics that can be queried for an App Service plan, and their
1386
+ # definitions.
1387
+ #
1388
+ # Get metrics that can be queried for an App Service plan, and their
1389
+ # definitions.
1390
+ #
1391
+ # @param resource_group_name [String] Name of the resource group to which the
1392
+ # resource belongs.
1393
+ # @param name [String] Name of the App Service plan.
1394
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1395
+ # will be added to the HTTP request.
1396
+ #
1397
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1398
+ #
1399
+ def list_metric_defintions_with_http_info(resource_group_name, name, custom_headers:nil)
1400
+ list_metric_defintions_async(resource_group_name, name, custom_headers:custom_headers).value!
1401
+ end
1402
+
1403
+ #
1404
+ # Get metrics that can be queried for an App Service plan, and their
1405
+ # definitions.
1406
+ #
1407
+ # Get metrics that can be queried for an App Service plan, and their
1408
+ # definitions.
1409
+ #
1410
+ # @param resource_group_name [String] Name of the resource group to which the
1411
+ # resource belongs.
1412
+ # @param name [String] Name of the App Service plan.
1413
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1414
+ # to the HTTP request.
1415
+ #
1416
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1417
+ #
1418
+ def list_metric_defintions_async(resource_group_name, name, custom_headers:nil)
1419
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1420
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1421
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1422
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
1423
+ fail ArgumentError, 'name is nil' if name.nil?
1424
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1425
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1426
+
1427
+
1428
+ request_headers = {}
1429
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1430
+
1431
+ # Set Headers
1432
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1433
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1434
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metricdefinitions'
1435
+
1436
+ request_url = @base_url || @client.base_url
1437
+
1438
+ options = {
1439
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1440
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
1441
+ query_params: {'api-version' => @client.api_version},
1442
+ headers: request_headers.merge(custom_headers || {}),
1443
+ base_url: request_url
1444
+ }
1445
+ promise = @client.make_request_async(:get, path_template, options)
1446
+
1447
+ promise = promise.then do |result|
1448
+ http_response = result.response
1449
+ status_code = http_response.status
1450
+ response_content = http_response.body
1451
+ unless status_code == 200
1452
+ error_model = JSON.load(response_content)
1453
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1454
+ end
1455
+
1456
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1457
+ # Deserialize Response
1458
+ if status_code == 200
1459
+ begin
1460
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1461
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::ResourceMetricDefinitionCollection.mapper()
1462
+ result.body = @client.deserialize(result_mapper, parsed_response)
1463
+ rescue Exception => e
1464
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1465
+ end
1466
+ end
1467
+
1468
+ result
1469
+ end
1470
+
1471
+ promise.execute
1472
+ end
1473
+
1474
+ #
1475
+ # Get metrics for an App Serice plan.
1476
+ #
1477
+ # Get metrics for an App Serice plan.
1478
+ #
1479
+ # @param resource_group_name [String] Name of the resource group to which the
1480
+ # resource belongs.
1481
+ # @param name [String] Name of the App Service plan.
1482
+ # @param details [Boolean] Specify <code>true</code> to include instance
1483
+ # details. The default is <code>false</code>.
1484
+ # @param filter [String] Return only usages/metrics specified in the filter.
1485
+ # Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or
1486
+ # name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime
1487
+ # eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'.
1488
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1489
+ # will be added to the HTTP request.
1490
+ #
1491
+ # @return [Array<ResourceMetric>] operation results.
1492
+ #
1493
+ def list_metrics(resource_group_name, name, details:nil, filter:nil, custom_headers:nil)
1494
+ first_page = list_metrics_as_lazy(resource_group_name, name, details:details, filter:filter, custom_headers:custom_headers)
1495
+ first_page.get_all_items
1496
+ end
1497
+
1498
+ #
1499
+ # Get metrics for an App Serice plan.
1500
+ #
1501
+ # Get metrics for an App Serice plan.
1502
+ #
1503
+ # @param resource_group_name [String] Name of the resource group to which the
1504
+ # resource belongs.
1505
+ # @param name [String] Name of the App Service plan.
1506
+ # @param details [Boolean] Specify <code>true</code> to include instance
1507
+ # details. The default is <code>false</code>.
1508
+ # @param filter [String] Return only usages/metrics specified in the filter.
1509
+ # Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or
1510
+ # name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime
1511
+ # eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'.
1512
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1513
+ # will be added to the HTTP request.
1514
+ #
1515
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1516
+ #
1517
+ def list_metrics_with_http_info(resource_group_name, name, details:nil, filter:nil, custom_headers:nil)
1518
+ list_metrics_async(resource_group_name, name, details:details, filter:filter, custom_headers:custom_headers).value!
1519
+ end
1520
+
1521
+ #
1522
+ # Get metrics for an App Serice plan.
1523
+ #
1524
+ # Get metrics for an App Serice plan.
1525
+ #
1526
+ # @param resource_group_name [String] Name of the resource group to which the
1527
+ # resource belongs.
1528
+ # @param name [String] Name of the App Service plan.
1529
+ # @param details [Boolean] Specify <code>true</code> to include instance
1530
+ # details. The default is <code>false</code>.
1531
+ # @param filter [String] Return only usages/metrics specified in the filter.
1532
+ # Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or
1533
+ # name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime
1534
+ # eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'.
1535
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1536
+ # to the HTTP request.
1537
+ #
1538
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1539
+ #
1540
+ def list_metrics_async(resource_group_name, name, details:nil, filter:nil, custom_headers:nil)
1541
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1542
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1543
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1544
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
1545
+ fail ArgumentError, 'name is nil' if name.nil?
1546
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1547
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1548
+
1549
+
1550
+ request_headers = {}
1551
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1552
+
1553
+ # Set Headers
1554
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1555
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1556
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metrics'
1557
+
1558
+ request_url = @base_url || @client.base_url
1559
+
1560
+ options = {
1561
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1562
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
1563
+ query_params: {'details' => details,'api-version' => @client.api_version},
1564
+ skip_encoding_query_params: {'$filter' => filter},
1565
+ headers: request_headers.merge(custom_headers || {}),
1566
+ base_url: request_url
1567
+ }
1568
+ promise = @client.make_request_async(:get, path_template, options)
1569
+
1570
+ promise = promise.then do |result|
1571
+ http_response = result.response
1572
+ status_code = http_response.status
1573
+ response_content = http_response.body
1574
+ unless status_code == 200
1575
+ error_model = JSON.load(response_content)
1576
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1577
+ end
1578
+
1579
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1580
+ # Deserialize Response
1581
+ if status_code == 200
1582
+ begin
1583
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1584
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::ResourceMetricCollection.mapper()
1585
+ result.body = @client.deserialize(result_mapper, parsed_response)
1586
+ rescue Exception => e
1587
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1588
+ end
1589
+ end
1590
+
1591
+ result
1592
+ end
1593
+
1594
+ promise.execute
1595
+ end
1596
+
1597
+ #
1598
+ # Restart all apps in an App Service plan.
1599
+ #
1600
+ # Restart all apps in an App Service plan.
1601
+ #
1602
+ # @param resource_group_name [String] Name of the resource group to which the
1603
+ # resource belongs.
1604
+ # @param name [String] Name of the App Service plan.
1605
+ # @param soft_restart [Boolean] Specify <code>true</code> to performa a soft
1606
+ # restart, applies the configuration settings and restarts the apps if
1607
+ # necessary. The default is <code>false</code>, which always restarts and
1608
+ # reprovisions the apps
1609
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1610
+ # will be added to the HTTP request.
1611
+ #
1612
+ #
1613
+ def restart_web_apps(resource_group_name, name, soft_restart:nil, custom_headers:nil)
1614
+ response = restart_web_apps_async(resource_group_name, name, soft_restart:soft_restart, custom_headers:custom_headers).value!
1615
+ nil
1616
+ end
1617
+
1618
+ #
1619
+ # Restart all apps in an App Service plan.
1620
+ #
1621
+ # Restart all apps in an App Service plan.
1622
+ #
1623
+ # @param resource_group_name [String] Name of the resource group to which the
1624
+ # resource belongs.
1625
+ # @param name [String] Name of the App Service plan.
1626
+ # @param soft_restart [Boolean] Specify <code>true</code> to performa a soft
1627
+ # restart, applies the configuration settings and restarts the apps if
1628
+ # necessary. The default is <code>false</code>, which always restarts and
1629
+ # reprovisions the apps
1630
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1631
+ # will be added to the HTTP request.
1632
+ #
1633
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1634
+ #
1635
+ def restart_web_apps_with_http_info(resource_group_name, name, soft_restart:nil, custom_headers:nil)
1636
+ restart_web_apps_async(resource_group_name, name, soft_restart:soft_restart, custom_headers:custom_headers).value!
1637
+ end
1638
+
1639
+ #
1640
+ # Restart all apps in an App Service plan.
1641
+ #
1642
+ # Restart all apps in an App Service plan.
1643
+ #
1644
+ # @param resource_group_name [String] Name of the resource group to which the
1645
+ # resource belongs.
1646
+ # @param name [String] Name of the App Service plan.
1647
+ # @param soft_restart [Boolean] Specify <code>true</code> to performa a soft
1648
+ # restart, applies the configuration settings and restarts the apps if
1649
+ # necessary. The default is <code>false</code>, which always restarts and
1650
+ # reprovisions the apps
1651
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1652
+ # to the HTTP request.
1653
+ #
1654
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1655
+ #
1656
+ def restart_web_apps_async(resource_group_name, name, soft_restart:nil, custom_headers:nil)
1657
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1658
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1659
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1660
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
1661
+ fail ArgumentError, 'name is nil' if name.nil?
1662
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1663
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1664
+
1665
+
1666
+ request_headers = {}
1667
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1668
+
1669
+ # Set Headers
1670
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1671
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1672
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites'
1673
+
1674
+ request_url = @base_url || @client.base_url
1675
+
1676
+ options = {
1677
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1678
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
1679
+ query_params: {'softRestart' => soft_restart,'api-version' => @client.api_version},
1680
+ headers: request_headers.merge(custom_headers || {}),
1681
+ base_url: request_url
1682
+ }
1683
+ promise = @client.make_request_async(:post, path_template, options)
1684
+
1685
+ promise = promise.then do |result|
1686
+ http_response = result.response
1687
+ status_code = http_response.status
1688
+ response_content = http_response.body
1689
+ unless status_code == 204
1690
+ error_model = JSON.load(response_content)
1691
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
1692
+ end
1693
+
1694
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1695
+
1696
+ result
1697
+ end
1698
+
1699
+ promise.execute
1700
+ end
1701
+
1702
+ #
1703
+ # Get all apps associated with an App Service plan.
1704
+ #
1705
+ # Get all apps associated with an App Service plan.
1706
+ #
1707
+ # @param resource_group_name [String] Name of the resource group to which the
1708
+ # resource belongs.
1709
+ # @param name [String] Name of the App Service plan.
1710
+ # @param skip_token [String] Skip to a web app in the list of webapps
1711
+ # associated with app service plan. If specified, the resulting list will
1712
+ # contain web apps starting from (including) the skipToken. Otherwise, the
1713
+ # resulting list contains web apps from the start of the list
1714
+ # @param filter [String] Supported filter: $filter=state eq running. Returns
1715
+ # only web apps that are currently running
1716
+ # @param top [String] List page size. If specified, results are paged.
1717
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1718
+ # will be added to the HTTP request.
1719
+ #
1720
+ # @return [Array<Site>] operation results.
1721
+ #
1722
+ def list_web_apps(resource_group_name, name, skip_token:nil, filter:nil, top:nil, custom_headers:nil)
1723
+ first_page = list_web_apps_as_lazy(resource_group_name, name, skip_token:skip_token, filter:filter, top:top, custom_headers:custom_headers)
1724
+ first_page.get_all_items
1725
+ end
1726
+
1727
+ #
1728
+ # Get all apps associated with an App Service plan.
1729
+ #
1730
+ # Get all apps associated with an App Service plan.
1731
+ #
1732
+ # @param resource_group_name [String] Name of the resource group to which the
1733
+ # resource belongs.
1734
+ # @param name [String] Name of the App Service plan.
1735
+ # @param skip_token [String] Skip to a web app in the list of webapps
1736
+ # associated with app service plan. If specified, the resulting list will
1737
+ # contain web apps starting from (including) the skipToken. Otherwise, the
1738
+ # resulting list contains web apps from the start of the list
1739
+ # @param filter [String] Supported filter: $filter=state eq running. Returns
1740
+ # only web apps that are currently running
1741
+ # @param top [String] List page size. If specified, results are paged.
1742
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1743
+ # will be added to the HTTP request.
1744
+ #
1745
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1746
+ #
1747
+ def list_web_apps_with_http_info(resource_group_name, name, skip_token:nil, filter:nil, top:nil, custom_headers:nil)
1748
+ list_web_apps_async(resource_group_name, name, skip_token:skip_token, filter:filter, top:top, custom_headers:custom_headers).value!
1749
+ end
1750
+
1751
+ #
1752
+ # Get all apps associated with an App Service plan.
1753
+ #
1754
+ # Get all apps associated with an App Service plan.
1755
+ #
1756
+ # @param resource_group_name [String] Name of the resource group to which the
1757
+ # resource belongs.
1758
+ # @param name [String] Name of the App Service plan.
1759
+ # @param skip_token [String] Skip to a web app in the list of webapps
1760
+ # associated with app service plan. If specified, the resulting list will
1761
+ # contain web apps starting from (including) the skipToken. Otherwise, the
1762
+ # resulting list contains web apps from the start of the list
1763
+ # @param filter [String] Supported filter: $filter=state eq running. Returns
1764
+ # only web apps that are currently running
1765
+ # @param top [String] List page size. If specified, results are paged.
1766
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1767
+ # to the HTTP request.
1768
+ #
1769
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1770
+ #
1771
+ def list_web_apps_async(resource_group_name, name, skip_token:nil, filter:nil, top:nil, custom_headers:nil)
1772
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1773
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1774
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1775
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
1776
+ fail ArgumentError, 'name is nil' if name.nil?
1777
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1778
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1779
+
1780
+
1781
+ request_headers = {}
1782
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1783
+
1784
+ # Set Headers
1785
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1786
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1787
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites'
1788
+
1789
+ request_url = @base_url || @client.base_url
1790
+
1791
+ options = {
1792
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1793
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
1794
+ query_params: {'$skipToken' => skip_token,'$top' => top,'api-version' => @client.api_version},
1795
+ skip_encoding_query_params: {'$filter' => filter},
1796
+ headers: request_headers.merge(custom_headers || {}),
1797
+ base_url: request_url
1798
+ }
1799
+ promise = @client.make_request_async(:get, path_template, options)
1800
+
1801
+ promise = promise.then do |result|
1802
+ http_response = result.response
1803
+ status_code = http_response.status
1804
+ response_content = http_response.body
1805
+ unless status_code == 200
1806
+ error_model = JSON.load(response_content)
1807
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1808
+ end
1809
+
1810
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1811
+ # Deserialize Response
1812
+ if status_code == 200
1813
+ begin
1814
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
1815
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.mapper()
1816
+ result.body = @client.deserialize(result_mapper, parsed_response)
1817
+ rescue Exception => e
1818
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
1819
+ end
1820
+ end
1821
+
1822
+ result
1823
+ end
1824
+
1825
+ promise.execute
1826
+ end
1827
+
1828
+ #
1829
+ # Gets all selectable sku's for a given App Service Plan
1830
+ #
1831
+ # Gets all selectable sku's for a given App Service Plan
1832
+ #
1833
+ # @param resource_group_name [String] Name of the resource group to which the
1834
+ # resource belongs.
1835
+ # @param name [String] Name of App Service Plan
1836
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1837
+ # will be added to the HTTP request.
1838
+ #
1839
+ # @return [Object] operation results.
1840
+ #
1841
+ def get_server_farm_skus(resource_group_name, name, custom_headers:nil)
1842
+ response = get_server_farm_skus_async(resource_group_name, name, custom_headers:custom_headers).value!
1843
+ response.body unless response.nil?
1844
+ end
1845
+
1846
+ #
1847
+ # Gets all selectable sku's for a given App Service Plan
1848
+ #
1849
+ # Gets all selectable sku's for a given App Service Plan
1850
+ #
1851
+ # @param resource_group_name [String] Name of the resource group to which the
1852
+ # resource belongs.
1853
+ # @param name [String] Name of App Service Plan
1854
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1855
+ # will be added to the HTTP request.
1856
+ #
1857
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1858
+ #
1859
+ def get_server_farm_skus_with_http_info(resource_group_name, name, custom_headers:nil)
1860
+ get_server_farm_skus_async(resource_group_name, name, custom_headers:custom_headers).value!
1861
+ end
1862
+
1863
+ #
1864
+ # Gets all selectable sku's for a given App Service Plan
1865
+ #
1866
+ # Gets all selectable sku's for a given App Service Plan
1867
+ #
1868
+ # @param resource_group_name [String] Name of the resource group to which the
1869
+ # resource belongs.
1870
+ # @param name [String] Name of App Service Plan
1871
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1872
+ # to the HTTP request.
1873
+ #
1874
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1875
+ #
1876
+ def get_server_farm_skus_async(resource_group_name, name, custom_headers:nil)
1877
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1878
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1879
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1880
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
1881
+ fail ArgumentError, 'name is nil' if name.nil?
1882
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1883
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1884
+
1885
+
1886
+ request_headers = {}
1887
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1888
+
1889
+ # Set Headers
1890
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1891
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1892
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/skus'
1893
+
1894
+ request_url = @base_url || @client.base_url
1895
+
1896
+ options = {
1897
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1898
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
1899
+ query_params: {'api-version' => @client.api_version},
1900
+ headers: request_headers.merge(custom_headers || {}),
1901
+ base_url: request_url
1902
+ }
1903
+ promise = @client.make_request_async(:get, path_template, options)
1904
+
1905
+ promise = promise.then do |result|
1906
+ http_response = result.response
1907
+ status_code = http_response.status
1908
+ response_content = http_response.body
1909
+ unless status_code == 200
1910
+ error_model = JSON.load(response_content)
1911
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
1912
+ end
1913
+
1914
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1915
+
1916
+ result
1917
+ end
1918
+
1919
+ promise.execute
1920
+ end
1921
+
1922
+ #
1923
+ # Gets server farm usage information
1924
+ #
1925
+ # Gets server farm usage information
1926
+ #
1927
+ # @param resource_group_name [String] Name of the resource group to which the
1928
+ # resource belongs.
1929
+ # @param name [String] Name of App Service Plan
1930
+ # @param filter [String] Return only usages/metrics specified in the filter.
1931
+ # Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or
1932
+ # name.value eq 'Metric2').
1933
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1934
+ # will be added to the HTTP request.
1935
+ #
1936
+ # @return [Array<CsmUsageQuota>] operation results.
1937
+ #
1938
+ def list_usages(resource_group_name, name, filter:nil, custom_headers:nil)
1939
+ first_page = list_usages_as_lazy(resource_group_name, name, filter:filter, custom_headers:custom_headers)
1940
+ first_page.get_all_items
1941
+ end
1942
+
1943
+ #
1944
+ # Gets server farm usage information
1945
+ #
1946
+ # Gets server farm usage information
1947
+ #
1948
+ # @param resource_group_name [String] Name of the resource group to which the
1949
+ # resource belongs.
1950
+ # @param name [String] Name of App Service Plan
1951
+ # @param filter [String] Return only usages/metrics specified in the filter.
1952
+ # Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or
1953
+ # name.value eq 'Metric2').
1954
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
1955
+ # will be added to the HTTP request.
1956
+ #
1957
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1958
+ #
1959
+ def list_usages_with_http_info(resource_group_name, name, filter:nil, custom_headers:nil)
1960
+ list_usages_async(resource_group_name, name, filter:filter, custom_headers:custom_headers).value!
1961
+ end
1962
+
1963
+ #
1964
+ # Gets server farm usage information
1965
+ #
1966
+ # Gets server farm usage information
1967
+ #
1968
+ # @param resource_group_name [String] Name of the resource group to which the
1969
+ # resource belongs.
1970
+ # @param name [String] Name of App Service Plan
1971
+ # @param filter [String] Return only usages/metrics specified in the filter.
1972
+ # Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or
1973
+ # name.value eq 'Metric2').
1974
+ # @param [Hash{String => String}] A hash of custom headers that will be added
1975
+ # to the HTTP request.
1976
+ #
1977
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1978
+ #
1979
+ def list_usages_async(resource_group_name, name, filter:nil, custom_headers:nil)
1980
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
1981
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
1982
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
1983
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
1984
+ fail ArgumentError, 'name is nil' if name.nil?
1985
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
1986
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
1987
+
1988
+
1989
+ request_headers = {}
1990
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
1991
+
1992
+ # Set Headers
1993
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
1994
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
1995
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/usages'
1996
+
1997
+ request_url = @base_url || @client.base_url
1998
+
1999
+ options = {
2000
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2001
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
2002
+ query_params: {'api-version' => @client.api_version},
2003
+ skip_encoding_query_params: {'$filter' => filter},
2004
+ headers: request_headers.merge(custom_headers || {}),
2005
+ base_url: request_url
2006
+ }
2007
+ promise = @client.make_request_async(:get, path_template, options)
2008
+
2009
+ promise = promise.then do |result|
2010
+ http_response = result.response
2011
+ status_code = http_response.status
2012
+ response_content = http_response.body
2013
+ unless status_code == 200
2014
+ error_model = JSON.load(response_content)
2015
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2016
+ end
2017
+
2018
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2019
+ # Deserialize Response
2020
+ if status_code == 200
2021
+ begin
2022
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2023
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::CsmUsageQuotaCollection.mapper()
2024
+ result.body = @client.deserialize(result_mapper, parsed_response)
2025
+ rescue Exception => e
2026
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2027
+ end
2028
+ end
2029
+
2030
+ result
2031
+ end
2032
+
2033
+ promise.execute
2034
+ end
2035
+
2036
+ #
2037
+ # Get all Virtual Networks associated with an App Service plan.
2038
+ #
2039
+ # Get all Virtual Networks associated with an App Service plan.
2040
+ #
2041
+ # @param resource_group_name [String] Name of the resource group to which the
2042
+ # resource belongs.
2043
+ # @param name [String] Name of the App Service plan.
2044
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2045
+ # will be added to the HTTP request.
2046
+ #
2047
+ # @return [Array] operation results.
2048
+ #
2049
+ def list_vnets(resource_group_name, name, custom_headers:nil)
2050
+ response = list_vnets_async(resource_group_name, name, custom_headers:custom_headers).value!
2051
+ response.body unless response.nil?
2052
+ end
2053
+
2054
+ #
2055
+ # Get all Virtual Networks associated with an App Service plan.
2056
+ #
2057
+ # Get all Virtual Networks associated with an App Service plan.
2058
+ #
2059
+ # @param resource_group_name [String] Name of the resource group to which the
2060
+ # resource belongs.
2061
+ # @param name [String] Name of the App Service plan.
2062
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2063
+ # will be added to the HTTP request.
2064
+ #
2065
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2066
+ #
2067
+ def list_vnets_with_http_info(resource_group_name, name, custom_headers:nil)
2068
+ list_vnets_async(resource_group_name, name, custom_headers:custom_headers).value!
2069
+ end
2070
+
2071
+ #
2072
+ # Get all Virtual Networks associated with an App Service plan.
2073
+ #
2074
+ # Get all Virtual Networks associated with an App Service plan.
2075
+ #
2076
+ # @param resource_group_name [String] Name of the resource group to which the
2077
+ # resource belongs.
2078
+ # @param name [String] Name of the App Service plan.
2079
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2080
+ # to the HTTP request.
2081
+ #
2082
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2083
+ #
2084
+ def list_vnets_async(resource_group_name, name, custom_headers:nil)
2085
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2086
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
2087
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
2088
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
2089
+ fail ArgumentError, 'name is nil' if name.nil?
2090
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2091
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2092
+
2093
+
2094
+ request_headers = {}
2095
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2096
+
2097
+ # Set Headers
2098
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2099
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2100
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections'
2101
+
2102
+ request_url = @base_url || @client.base_url
2103
+
2104
+ options = {
2105
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2106
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
2107
+ query_params: {'api-version' => @client.api_version},
2108
+ headers: request_headers.merge(custom_headers || {}),
2109
+ base_url: request_url
2110
+ }
2111
+ promise = @client.make_request_async(:get, path_template, options)
2112
+
2113
+ promise = promise.then do |result|
2114
+ http_response = result.response
2115
+ status_code = http_response.status
2116
+ response_content = http_response.body
2117
+ unless status_code == 200
2118
+ error_model = JSON.load(response_content)
2119
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2120
+ end
2121
+
2122
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2123
+ # Deserialize Response
2124
+ if status_code == 200
2125
+ begin
2126
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2127
+ result_mapper = {
2128
+ client_side_validation: true,
2129
+ required: false,
2130
+ serialized_name: 'parsed_response',
2131
+ type: {
2132
+ name: 'Sequence',
2133
+ element: {
2134
+ client_side_validation: true,
2135
+ required: false,
2136
+ serialized_name: 'VnetInfoElementType',
2137
+ type: {
2138
+ name: 'Composite',
2139
+ class_name: 'VnetInfo'
2140
+ }
2141
+ }
2142
+ }
2143
+ }
2144
+ result.body = @client.deserialize(result_mapper, parsed_response)
2145
+ rescue Exception => e
2146
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2147
+ end
2148
+ end
2149
+
2150
+ result
2151
+ end
2152
+
2153
+ promise.execute
2154
+ end
2155
+
2156
+ #
2157
+ # Get a Virtual Network associated with an App Service plan.
2158
+ #
2159
+ # Get a Virtual Network associated with an App Service plan.
2160
+ #
2161
+ # @param resource_group_name [String] Name of the resource group to which the
2162
+ # resource belongs.
2163
+ # @param name [String] Name of the App Service plan.
2164
+ # @param vnet_name [String] Name of the Virtual Network.
2165
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2166
+ # will be added to the HTTP request.
2167
+ #
2168
+ # @return [VnetInfo] operation results.
2169
+ #
2170
+ def get_vnet_from_server_farm(resource_group_name, name, vnet_name, custom_headers:nil)
2171
+ response = get_vnet_from_server_farm_async(resource_group_name, name, vnet_name, custom_headers:custom_headers).value!
2172
+ response.body unless response.nil?
2173
+ end
2174
+
2175
+ #
2176
+ # Get a Virtual Network associated with an App Service plan.
2177
+ #
2178
+ # Get a Virtual Network associated with an App Service plan.
2179
+ #
2180
+ # @param resource_group_name [String] Name of the resource group to which the
2181
+ # resource belongs.
2182
+ # @param name [String] Name of the App Service plan.
2183
+ # @param vnet_name [String] Name of the Virtual Network.
2184
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2185
+ # will be added to the HTTP request.
2186
+ #
2187
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2188
+ #
2189
+ def get_vnet_from_server_farm_with_http_info(resource_group_name, name, vnet_name, custom_headers:nil)
2190
+ get_vnet_from_server_farm_async(resource_group_name, name, vnet_name, custom_headers:custom_headers).value!
2191
+ end
2192
+
2193
+ #
2194
+ # Get a Virtual Network associated with an App Service plan.
2195
+ #
2196
+ # Get a Virtual Network associated with an App Service plan.
2197
+ #
2198
+ # @param resource_group_name [String] Name of the resource group to which the
2199
+ # resource belongs.
2200
+ # @param name [String] Name of the App Service plan.
2201
+ # @param vnet_name [String] Name of the Virtual Network.
2202
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2203
+ # to the HTTP request.
2204
+ #
2205
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2206
+ #
2207
+ def get_vnet_from_server_farm_async(resource_group_name, name, vnet_name, custom_headers:nil)
2208
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2209
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
2210
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
2211
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
2212
+ fail ArgumentError, 'name is nil' if name.nil?
2213
+ fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
2214
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2215
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2216
+
2217
+
2218
+ request_headers = {}
2219
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2220
+
2221
+ # Set Headers
2222
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2223
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2224
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}'
2225
+
2226
+ request_url = @base_url || @client.base_url
2227
+
2228
+ options = {
2229
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2230
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'subscriptionId' => @client.subscription_id},
2231
+ query_params: {'api-version' => @client.api_version},
2232
+ headers: request_headers.merge(custom_headers || {}),
2233
+ base_url: request_url
2234
+ }
2235
+ promise = @client.make_request_async(:get, path_template, options)
2236
+
2237
+ promise = promise.then do |result|
2238
+ http_response = result.response
2239
+ status_code = http_response.status
2240
+ response_content = http_response.body
2241
+ unless status_code == 200 || status_code == 404
2242
+ error_model = JSON.load(response_content)
2243
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2244
+ end
2245
+
2246
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2247
+ # Deserialize Response
2248
+ if status_code == 200
2249
+ begin
2250
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2251
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::VnetInfo.mapper()
2252
+ result.body = @client.deserialize(result_mapper, parsed_response)
2253
+ rescue Exception => e
2254
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2255
+ end
2256
+ end
2257
+
2258
+ result
2259
+ end
2260
+
2261
+ promise.execute
2262
+ end
2263
+
2264
+ #
2265
+ # Get a Virtual Network gateway.
2266
+ #
2267
+ # Get a Virtual Network gateway.
2268
+ #
2269
+ # @param resource_group_name [String] Name of the resource group to which the
2270
+ # resource belongs.
2271
+ # @param name [String] Name of the App Service plan.
2272
+ # @param vnet_name [String] Name of the Virtual Network.
2273
+ # @param gateway_name [String] Name of the gateway. Only the 'primary' gateway
2274
+ # is supported.
2275
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2276
+ # will be added to the HTTP request.
2277
+ #
2278
+ # @return [VnetGateway] operation results.
2279
+ #
2280
+ def get_vnet_gateway(resource_group_name, name, vnet_name, gateway_name, custom_headers:nil)
2281
+ response = get_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, custom_headers:custom_headers).value!
2282
+ response.body unless response.nil?
2283
+ end
2284
+
2285
+ #
2286
+ # Get a Virtual Network gateway.
2287
+ #
2288
+ # Get a Virtual Network gateway.
2289
+ #
2290
+ # @param resource_group_name [String] Name of the resource group to which the
2291
+ # resource belongs.
2292
+ # @param name [String] Name of the App Service plan.
2293
+ # @param vnet_name [String] Name of the Virtual Network.
2294
+ # @param gateway_name [String] Name of the gateway. Only the 'primary' gateway
2295
+ # is supported.
2296
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2297
+ # will be added to the HTTP request.
2298
+ #
2299
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2300
+ #
2301
+ def get_vnet_gateway_with_http_info(resource_group_name, name, vnet_name, gateway_name, custom_headers:nil)
2302
+ get_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, custom_headers:custom_headers).value!
2303
+ end
2304
+
2305
+ #
2306
+ # Get a Virtual Network gateway.
2307
+ #
2308
+ # Get a Virtual Network gateway.
2309
+ #
2310
+ # @param resource_group_name [String] Name of the resource group to which the
2311
+ # resource belongs.
2312
+ # @param name [String] Name of the App Service plan.
2313
+ # @param vnet_name [String] Name of the Virtual Network.
2314
+ # @param gateway_name [String] Name of the gateway. Only the 'primary' gateway
2315
+ # is supported.
2316
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2317
+ # to the HTTP request.
2318
+ #
2319
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2320
+ #
2321
+ def get_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, custom_headers:nil)
2322
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2323
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
2324
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
2325
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
2326
+ fail ArgumentError, 'name is nil' if name.nil?
2327
+ fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
2328
+ fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?
2329
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2330
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2331
+
2332
+
2333
+ request_headers = {}
2334
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2335
+
2336
+ # Set Headers
2337
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2338
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2339
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'
2340
+
2341
+ request_url = @base_url || @client.base_url
2342
+
2343
+ options = {
2344
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2345
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'gatewayName' => gateway_name,'subscriptionId' => @client.subscription_id},
2346
+ query_params: {'api-version' => @client.api_version},
2347
+ headers: request_headers.merge(custom_headers || {}),
2348
+ base_url: request_url
2349
+ }
2350
+ promise = @client.make_request_async(:get, path_template, options)
2351
+
2352
+ promise = promise.then do |result|
2353
+ http_response = result.response
2354
+ status_code = http_response.status
2355
+ response_content = http_response.body
2356
+ unless status_code == 200
2357
+ error_model = JSON.load(response_content)
2358
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2359
+ end
2360
+
2361
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2362
+ # Deserialize Response
2363
+ if status_code == 200
2364
+ begin
2365
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2366
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::VnetGateway.mapper()
2367
+ result.body = @client.deserialize(result_mapper, parsed_response)
2368
+ rescue Exception => e
2369
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2370
+ end
2371
+ end
2372
+
2373
+ result
2374
+ end
2375
+
2376
+ promise.execute
2377
+ end
2378
+
2379
+ #
2380
+ # Update a Virtual Network gateway.
2381
+ #
2382
+ # Update a Virtual Network gateway.
2383
+ #
2384
+ # @param resource_group_name [String] Name of the resource group to which the
2385
+ # resource belongs.
2386
+ # @param name [String] Name of the App Service plan.
2387
+ # @param vnet_name [String] Name of the Virtual Network.
2388
+ # @param gateway_name [String] Name of the gateway. Only the 'primary' gateway
2389
+ # is supported.
2390
+ # @param connection_envelope [VnetGateway] Definition of the gateway.
2391
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2392
+ # will be added to the HTTP request.
2393
+ #
2394
+ # @return [VnetGateway] operation results.
2395
+ #
2396
+ def update_vnet_gateway(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers:nil)
2397
+ response = update_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers:custom_headers).value!
2398
+ response.body unless response.nil?
2399
+ end
2400
+
2401
+ #
2402
+ # Update a Virtual Network gateway.
2403
+ #
2404
+ # Update a Virtual Network gateway.
2405
+ #
2406
+ # @param resource_group_name [String] Name of the resource group to which the
2407
+ # resource belongs.
2408
+ # @param name [String] Name of the App Service plan.
2409
+ # @param vnet_name [String] Name of the Virtual Network.
2410
+ # @param gateway_name [String] Name of the gateway. Only the 'primary' gateway
2411
+ # is supported.
2412
+ # @param connection_envelope [VnetGateway] Definition of the gateway.
2413
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2414
+ # will be added to the HTTP request.
2415
+ #
2416
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2417
+ #
2418
+ def update_vnet_gateway_with_http_info(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers:nil)
2419
+ update_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers:custom_headers).value!
2420
+ end
2421
+
2422
+ #
2423
+ # Update a Virtual Network gateway.
2424
+ #
2425
+ # Update a Virtual Network gateway.
2426
+ #
2427
+ # @param resource_group_name [String] Name of the resource group to which the
2428
+ # resource belongs.
2429
+ # @param name [String] Name of the App Service plan.
2430
+ # @param vnet_name [String] Name of the Virtual Network.
2431
+ # @param gateway_name [String] Name of the gateway. Only the 'primary' gateway
2432
+ # is supported.
2433
+ # @param connection_envelope [VnetGateway] Definition of the gateway.
2434
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2435
+ # to the HTTP request.
2436
+ #
2437
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2438
+ #
2439
+ def update_vnet_gateway_async(resource_group_name, name, vnet_name, gateway_name, connection_envelope, custom_headers:nil)
2440
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2441
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
2442
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
2443
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
2444
+ fail ArgumentError, 'name is nil' if name.nil?
2445
+ fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
2446
+ fail ArgumentError, 'gateway_name is nil' if gateway_name.nil?
2447
+ fail ArgumentError, 'connection_envelope is nil' if connection_envelope.nil?
2448
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2449
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2450
+
2451
+
2452
+ request_headers = {}
2453
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2454
+
2455
+ # Set Headers
2456
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2457
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2458
+
2459
+ # Serialize Request
2460
+ request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::VnetGateway.mapper()
2461
+ request_content = @client.serialize(request_mapper, connection_envelope)
2462
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2463
+
2464
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'
2465
+
2466
+ request_url = @base_url || @client.base_url
2467
+
2468
+ options = {
2469
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2470
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'gatewayName' => gateway_name,'subscriptionId' => @client.subscription_id},
2471
+ query_params: {'api-version' => @client.api_version},
2472
+ body: request_content,
2473
+ headers: request_headers.merge(custom_headers || {}),
2474
+ base_url: request_url
2475
+ }
2476
+ promise = @client.make_request_async(:put, path_template, options)
2477
+
2478
+ promise = promise.then do |result|
2479
+ http_response = result.response
2480
+ status_code = http_response.status
2481
+ response_content = http_response.body
2482
+ unless status_code == 200
2483
+ error_model = JSON.load(response_content)
2484
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2485
+ end
2486
+
2487
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2488
+ # Deserialize Response
2489
+ if status_code == 200
2490
+ begin
2491
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2492
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::VnetGateway.mapper()
2493
+ result.body = @client.deserialize(result_mapper, parsed_response)
2494
+ rescue Exception => e
2495
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2496
+ end
2497
+ end
2498
+
2499
+ result
2500
+ end
2501
+
2502
+ promise.execute
2503
+ end
2504
+
2505
+ #
2506
+ # Get all routes that are associated with a Virtual Network in an App Service
2507
+ # plan.
2508
+ #
2509
+ # Get all routes that are associated with a Virtual Network in an App Service
2510
+ # plan.
2511
+ #
2512
+ # @param resource_group_name [String] Name of the resource group to which the
2513
+ # resource belongs.
2514
+ # @param name [String] Name of the App Service plan.
2515
+ # @param vnet_name [String] Name of the Virtual Network.
2516
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2517
+ # will be added to the HTTP request.
2518
+ #
2519
+ # @return [Array] operation results.
2520
+ #
2521
+ def list_routes_for_vnet(resource_group_name, name, vnet_name, custom_headers:nil)
2522
+ response = list_routes_for_vnet_async(resource_group_name, name, vnet_name, custom_headers:custom_headers).value!
2523
+ response.body unless response.nil?
2524
+ end
2525
+
2526
+ #
2527
+ # Get all routes that are associated with a Virtual Network in an App Service
2528
+ # plan.
2529
+ #
2530
+ # Get all routes that are associated with a Virtual Network in an App Service
2531
+ # plan.
2532
+ #
2533
+ # @param resource_group_name [String] Name of the resource group to which the
2534
+ # resource belongs.
2535
+ # @param name [String] Name of the App Service plan.
2536
+ # @param vnet_name [String] Name of the Virtual Network.
2537
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2538
+ # will be added to the HTTP request.
2539
+ #
2540
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2541
+ #
2542
+ def list_routes_for_vnet_with_http_info(resource_group_name, name, vnet_name, custom_headers:nil)
2543
+ list_routes_for_vnet_async(resource_group_name, name, vnet_name, custom_headers:custom_headers).value!
2544
+ end
2545
+
2546
+ #
2547
+ # Get all routes that are associated with a Virtual Network in an App Service
2548
+ # plan.
2549
+ #
2550
+ # Get all routes that are associated with a Virtual Network in an App Service
2551
+ # plan.
2552
+ #
2553
+ # @param resource_group_name [String] Name of the resource group to which the
2554
+ # resource belongs.
2555
+ # @param name [String] Name of the App Service plan.
2556
+ # @param vnet_name [String] Name of the Virtual Network.
2557
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2558
+ # to the HTTP request.
2559
+ #
2560
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2561
+ #
2562
+ def list_routes_for_vnet_async(resource_group_name, name, vnet_name, custom_headers:nil)
2563
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2564
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
2565
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
2566
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
2567
+ fail ArgumentError, 'name is nil' if name.nil?
2568
+ fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
2569
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2570
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2571
+
2572
+
2573
+ request_headers = {}
2574
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2575
+
2576
+ # Set Headers
2577
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2578
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2579
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes'
2580
+
2581
+ request_url = @base_url || @client.base_url
2582
+
2583
+ options = {
2584
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2585
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'subscriptionId' => @client.subscription_id},
2586
+ query_params: {'api-version' => @client.api_version},
2587
+ headers: request_headers.merge(custom_headers || {}),
2588
+ base_url: request_url
2589
+ }
2590
+ promise = @client.make_request_async(:get, path_template, options)
2591
+
2592
+ promise = promise.then do |result|
2593
+ http_response = result.response
2594
+ status_code = http_response.status
2595
+ response_content = http_response.body
2596
+ unless status_code == 200
2597
+ error_model = JSON.load(response_content)
2598
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
2599
+ end
2600
+
2601
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2602
+ # Deserialize Response
2603
+ if status_code == 200
2604
+ begin
2605
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2606
+ result_mapper = {
2607
+ client_side_validation: true,
2608
+ required: false,
2609
+ serialized_name: 'parsed_response',
2610
+ type: {
2611
+ name: 'Sequence',
2612
+ element: {
2613
+ client_side_validation: true,
2614
+ required: false,
2615
+ serialized_name: 'VnetRouteElementType',
2616
+ type: {
2617
+ name: 'Composite',
2618
+ class_name: 'VnetRoute'
2619
+ }
2620
+ }
2621
+ }
2622
+ }
2623
+ result.body = @client.deserialize(result_mapper, parsed_response)
2624
+ rescue Exception => e
2625
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2626
+ end
2627
+ end
2628
+
2629
+ result
2630
+ end
2631
+
2632
+ promise.execute
2633
+ end
2634
+
2635
+ #
2636
+ # Get a Virtual Network route in an App Service plan.
2637
+ #
2638
+ # Get a Virtual Network route in an App Service plan.
2639
+ #
2640
+ # @param resource_group_name [String] Name of the resource group to which the
2641
+ # resource belongs.
2642
+ # @param name [String] Name of the App Service plan.
2643
+ # @param vnet_name [String] Name of the Virtual Network.
2644
+ # @param route_name [String] Name of the Virtual Network route.
2645
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2646
+ # will be added to the HTTP request.
2647
+ #
2648
+ # @return [Array] operation results.
2649
+ #
2650
+ def get_route_for_vnet(resource_group_name, name, vnet_name, route_name, custom_headers:nil)
2651
+ response = get_route_for_vnet_async(resource_group_name, name, vnet_name, route_name, custom_headers:custom_headers).value!
2652
+ response.body unless response.nil?
2653
+ end
2654
+
2655
+ #
2656
+ # Get a Virtual Network route in an App Service plan.
2657
+ #
2658
+ # Get a Virtual Network route in an App Service plan.
2659
+ #
2660
+ # @param resource_group_name [String] Name of the resource group to which the
2661
+ # resource belongs.
2662
+ # @param name [String] Name of the App Service plan.
2663
+ # @param vnet_name [String] Name of the Virtual Network.
2664
+ # @param route_name [String] Name of the Virtual Network route.
2665
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2666
+ # will be added to the HTTP request.
2667
+ #
2668
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2669
+ #
2670
+ def get_route_for_vnet_with_http_info(resource_group_name, name, vnet_name, route_name, custom_headers:nil)
2671
+ get_route_for_vnet_async(resource_group_name, name, vnet_name, route_name, custom_headers:custom_headers).value!
2672
+ end
2673
+
2674
+ #
2675
+ # Get a Virtual Network route in an App Service plan.
2676
+ #
2677
+ # Get a Virtual Network route in an App Service plan.
2678
+ #
2679
+ # @param resource_group_name [String] Name of the resource group to which the
2680
+ # resource belongs.
2681
+ # @param name [String] Name of the App Service plan.
2682
+ # @param vnet_name [String] Name of the Virtual Network.
2683
+ # @param route_name [String] Name of the Virtual Network route.
2684
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2685
+ # to the HTTP request.
2686
+ #
2687
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2688
+ #
2689
+ def get_route_for_vnet_async(resource_group_name, name, vnet_name, route_name, custom_headers:nil)
2690
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2691
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
2692
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
2693
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
2694
+ fail ArgumentError, 'name is nil' if name.nil?
2695
+ fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
2696
+ fail ArgumentError, 'route_name is nil' if route_name.nil?
2697
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2698
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2699
+
2700
+
2701
+ request_headers = {}
2702
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2703
+
2704
+ # Set Headers
2705
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2706
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2707
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'
2708
+
2709
+ request_url = @base_url || @client.base_url
2710
+
2711
+ options = {
2712
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2713
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'routeName' => route_name,'subscriptionId' => @client.subscription_id},
2714
+ query_params: {'api-version' => @client.api_version},
2715
+ headers: request_headers.merge(custom_headers || {}),
2716
+ base_url: request_url
2717
+ }
2718
+ promise = @client.make_request_async(:get, path_template, options)
2719
+
2720
+ promise = promise.then do |result|
2721
+ http_response = result.response
2722
+ status_code = http_response.status
2723
+ response_content = http_response.body
2724
+ unless status_code == 200 || status_code == 404
2725
+ error_model = JSON.load(response_content)
2726
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2727
+ end
2728
+
2729
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2730
+ # Deserialize Response
2731
+ if status_code == 200
2732
+ begin
2733
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2734
+ result_mapper = {
2735
+ client_side_validation: true,
2736
+ required: false,
2737
+ serialized_name: 'parsed_response',
2738
+ type: {
2739
+ name: 'Sequence',
2740
+ element: {
2741
+ client_side_validation: true,
2742
+ required: false,
2743
+ serialized_name: 'VnetRouteElementType',
2744
+ type: {
2745
+ name: 'Composite',
2746
+ class_name: 'VnetRoute'
2747
+ }
2748
+ }
2749
+ }
2750
+ }
2751
+ result.body = @client.deserialize(result_mapper, parsed_response)
2752
+ rescue Exception => e
2753
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2754
+ end
2755
+ end
2756
+
2757
+ result
2758
+ end
2759
+
2760
+ promise.execute
2761
+ end
2762
+
2763
+ #
2764
+ # Create or update a Virtual Network route in an App Service plan.
2765
+ #
2766
+ # Create or update a Virtual Network route in an App Service plan.
2767
+ #
2768
+ # @param resource_group_name [String] Name of the resource group to which the
2769
+ # resource belongs.
2770
+ # @param name [String] Name of the App Service plan.
2771
+ # @param vnet_name [String] Name of the Virtual Network.
2772
+ # @param route_name [String] Name of the Virtual Network route.
2773
+ # @param route [VnetRoute] Definition of the Virtual Network route.
2774
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2775
+ # will be added to the HTTP request.
2776
+ #
2777
+ # @return [VnetRoute] operation results.
2778
+ #
2779
+ def create_or_update_vnet_route(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil)
2780
+ response = create_or_update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:custom_headers).value!
2781
+ response.body unless response.nil?
2782
+ end
2783
+
2784
+ #
2785
+ # Create or update a Virtual Network route in an App Service plan.
2786
+ #
2787
+ # Create or update a Virtual Network route in an App Service plan.
2788
+ #
2789
+ # @param resource_group_name [String] Name of the resource group to which the
2790
+ # resource belongs.
2791
+ # @param name [String] Name of the App Service plan.
2792
+ # @param vnet_name [String] Name of the Virtual Network.
2793
+ # @param route_name [String] Name of the Virtual Network route.
2794
+ # @param route [VnetRoute] Definition of the Virtual Network route.
2795
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2796
+ # will be added to the HTTP request.
2797
+ #
2798
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2799
+ #
2800
+ def create_or_update_vnet_route_with_http_info(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil)
2801
+ create_or_update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:custom_headers).value!
2802
+ end
2803
+
2804
+ #
2805
+ # Create or update a Virtual Network route in an App Service plan.
2806
+ #
2807
+ # Create or update a Virtual Network route in an App Service plan.
2808
+ #
2809
+ # @param resource_group_name [String] Name of the resource group to which the
2810
+ # resource belongs.
2811
+ # @param name [String] Name of the App Service plan.
2812
+ # @param vnet_name [String] Name of the Virtual Network.
2813
+ # @param route_name [String] Name of the Virtual Network route.
2814
+ # @param route [VnetRoute] Definition of the Virtual Network route.
2815
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2816
+ # to the HTTP request.
2817
+ #
2818
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2819
+ #
2820
+ def create_or_update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil)
2821
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2822
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
2823
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
2824
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
2825
+ fail ArgumentError, 'name is nil' if name.nil?
2826
+ fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
2827
+ fail ArgumentError, 'route_name is nil' if route_name.nil?
2828
+ fail ArgumentError, 'route is nil' if route.nil?
2829
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2830
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2831
+
2832
+
2833
+ request_headers = {}
2834
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2835
+
2836
+ # Set Headers
2837
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2838
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2839
+
2840
+ # Serialize Request
2841
+ request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::VnetRoute.mapper()
2842
+ request_content = @client.serialize(request_mapper, route)
2843
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
2844
+
2845
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'
2846
+
2847
+ request_url = @base_url || @client.base_url
2848
+
2849
+ options = {
2850
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2851
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'routeName' => route_name,'subscriptionId' => @client.subscription_id},
2852
+ query_params: {'api-version' => @client.api_version},
2853
+ body: request_content,
2854
+ headers: request_headers.merge(custom_headers || {}),
2855
+ base_url: request_url
2856
+ }
2857
+ promise = @client.make_request_async(:put, path_template, options)
2858
+
2859
+ promise = promise.then do |result|
2860
+ http_response = result.response
2861
+ status_code = http_response.status
2862
+ response_content = http_response.body
2863
+ unless status_code == 200 || status_code == 400 || status_code == 404
2864
+ error_model = JSON.load(response_content)
2865
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2866
+ end
2867
+
2868
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2869
+ # Deserialize Response
2870
+ if status_code == 200
2871
+ begin
2872
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
2873
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::VnetRoute.mapper()
2874
+ result.body = @client.deserialize(result_mapper, parsed_response)
2875
+ rescue Exception => e
2876
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
2877
+ end
2878
+ end
2879
+
2880
+ result
2881
+ end
2882
+
2883
+ promise.execute
2884
+ end
2885
+
2886
+ #
2887
+ # Delete a Virtual Network route in an App Service plan.
2888
+ #
2889
+ # Delete a Virtual Network route in an App Service plan.
2890
+ #
2891
+ # @param resource_group_name [String] Name of the resource group to which the
2892
+ # resource belongs.
2893
+ # @param name [String] Name of the App Service plan.
2894
+ # @param vnet_name [String] Name of the Virtual Network.
2895
+ # @param route_name [String] Name of the Virtual Network route.
2896
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2897
+ # will be added to the HTTP request.
2898
+ #
2899
+ #
2900
+ def delete_vnet_route(resource_group_name, name, vnet_name, route_name, custom_headers:nil)
2901
+ response = delete_vnet_route_async(resource_group_name, name, vnet_name, route_name, custom_headers:custom_headers).value!
2902
+ nil
2903
+ end
2904
+
2905
+ #
2906
+ # Delete a Virtual Network route in an App Service plan.
2907
+ #
2908
+ # Delete a Virtual Network route in an App Service plan.
2909
+ #
2910
+ # @param resource_group_name [String] Name of the resource group to which the
2911
+ # resource belongs.
2912
+ # @param name [String] Name of the App Service plan.
2913
+ # @param vnet_name [String] Name of the Virtual Network.
2914
+ # @param route_name [String] Name of the Virtual Network route.
2915
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2916
+ # will be added to the HTTP request.
2917
+ #
2918
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
2919
+ #
2920
+ def delete_vnet_route_with_http_info(resource_group_name, name, vnet_name, route_name, custom_headers:nil)
2921
+ delete_vnet_route_async(resource_group_name, name, vnet_name, route_name, custom_headers:custom_headers).value!
2922
+ end
2923
+
2924
+ #
2925
+ # Delete a Virtual Network route in an App Service plan.
2926
+ #
2927
+ # Delete a Virtual Network route in an App Service plan.
2928
+ #
2929
+ # @param resource_group_name [String] Name of the resource group to which the
2930
+ # resource belongs.
2931
+ # @param name [String] Name of the App Service plan.
2932
+ # @param vnet_name [String] Name of the Virtual Network.
2933
+ # @param route_name [String] Name of the Virtual Network route.
2934
+ # @param [Hash{String => String}] A hash of custom headers that will be added
2935
+ # to the HTTP request.
2936
+ #
2937
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
2938
+ #
2939
+ def delete_vnet_route_async(resource_group_name, name, vnet_name, route_name, custom_headers:nil)
2940
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
2941
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
2942
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
2943
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
2944
+ fail ArgumentError, 'name is nil' if name.nil?
2945
+ fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
2946
+ fail ArgumentError, 'route_name is nil' if route_name.nil?
2947
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
2948
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
2949
+
2950
+
2951
+ request_headers = {}
2952
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
2953
+
2954
+ # Set Headers
2955
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
2956
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
2957
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'
2958
+
2959
+ request_url = @base_url || @client.base_url
2960
+
2961
+ options = {
2962
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
2963
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'routeName' => route_name,'subscriptionId' => @client.subscription_id},
2964
+ query_params: {'api-version' => @client.api_version},
2965
+ headers: request_headers.merge(custom_headers || {}),
2966
+ base_url: request_url
2967
+ }
2968
+ promise = @client.make_request_async(:delete, path_template, options)
2969
+
2970
+ promise = promise.then do |result|
2971
+ http_response = result.response
2972
+ status_code = http_response.status
2973
+ response_content = http_response.body
2974
+ unless status_code == 200 || status_code == 404
2975
+ error_model = JSON.load(response_content)
2976
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
2977
+ end
2978
+
2979
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
2980
+
2981
+ result
2982
+ end
2983
+
2984
+ promise.execute
2985
+ end
2986
+
2987
+ #
2988
+ # Create or update a Virtual Network route in an App Service plan.
2989
+ #
2990
+ # Create or update a Virtual Network route in an App Service plan.
2991
+ #
2992
+ # @param resource_group_name [String] Name of the resource group to which the
2993
+ # resource belongs.
2994
+ # @param name [String] Name of the App Service plan.
2995
+ # @param vnet_name [String] Name of the Virtual Network.
2996
+ # @param route_name [String] Name of the Virtual Network route.
2997
+ # @param route [VnetRoute] Definition of the Virtual Network route.
2998
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
2999
+ # will be added to the HTTP request.
3000
+ #
3001
+ # @return [VnetRoute] operation results.
3002
+ #
3003
+ def update_vnet_route(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil)
3004
+ response = update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:custom_headers).value!
3005
+ response.body unless response.nil?
3006
+ end
3007
+
3008
+ #
3009
+ # Create or update a Virtual Network route in an App Service plan.
3010
+ #
3011
+ # Create or update a Virtual Network route in an App Service plan.
3012
+ #
3013
+ # @param resource_group_name [String] Name of the resource group to which the
3014
+ # resource belongs.
3015
+ # @param name [String] Name of the App Service plan.
3016
+ # @param vnet_name [String] Name of the Virtual Network.
3017
+ # @param route_name [String] Name of the Virtual Network route.
3018
+ # @param route [VnetRoute] Definition of the Virtual Network route.
3019
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3020
+ # will be added to the HTTP request.
3021
+ #
3022
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3023
+ #
3024
+ def update_vnet_route_with_http_info(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil)
3025
+ update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:custom_headers).value!
3026
+ end
3027
+
3028
+ #
3029
+ # Create or update a Virtual Network route in an App Service plan.
3030
+ #
3031
+ # Create or update a Virtual Network route in an App Service plan.
3032
+ #
3033
+ # @param resource_group_name [String] Name of the resource group to which the
3034
+ # resource belongs.
3035
+ # @param name [String] Name of the App Service plan.
3036
+ # @param vnet_name [String] Name of the Virtual Network.
3037
+ # @param route_name [String] Name of the Virtual Network route.
3038
+ # @param route [VnetRoute] Definition of the Virtual Network route.
3039
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3040
+ # to the HTTP request.
3041
+ #
3042
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3043
+ #
3044
+ def update_vnet_route_async(resource_group_name, name, vnet_name, route_name, route, custom_headers:nil)
3045
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
3046
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
3047
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
3048
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
3049
+ fail ArgumentError, 'name is nil' if name.nil?
3050
+ fail ArgumentError, 'vnet_name is nil' if vnet_name.nil?
3051
+ fail ArgumentError, 'route_name is nil' if route_name.nil?
3052
+ fail ArgumentError, 'route is nil' if route.nil?
3053
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
3054
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
3055
+
3056
+
3057
+ request_headers = {}
3058
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3059
+
3060
+ # Set Headers
3061
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3062
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3063
+
3064
+ # Serialize Request
3065
+ request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::VnetRoute.mapper()
3066
+ request_content = @client.serialize(request_mapper, route)
3067
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
3068
+
3069
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'
3070
+
3071
+ request_url = @base_url || @client.base_url
3072
+
3073
+ options = {
3074
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3075
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'vnetName' => vnet_name,'routeName' => route_name,'subscriptionId' => @client.subscription_id},
3076
+ query_params: {'api-version' => @client.api_version},
3077
+ body: request_content,
3078
+ headers: request_headers.merge(custom_headers || {}),
3079
+ base_url: request_url
3080
+ }
3081
+ promise = @client.make_request_async(:patch, path_template, options)
3082
+
3083
+ promise = promise.then do |result|
3084
+ http_response = result.response
3085
+ status_code = http_response.status
3086
+ response_content = http_response.body
3087
+ unless status_code == 200 || status_code == 400 || status_code == 404
3088
+ error_model = JSON.load(response_content)
3089
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
3090
+ end
3091
+
3092
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3093
+ # Deserialize Response
3094
+ if status_code == 200
3095
+ begin
3096
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3097
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::VnetRoute.mapper()
3098
+ result.body = @client.deserialize(result_mapper, parsed_response)
3099
+ rescue Exception => e
3100
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3101
+ end
3102
+ end
3103
+
3104
+ result
3105
+ end
3106
+
3107
+ promise.execute
3108
+ end
3109
+
3110
+ #
3111
+ # Reboot a worker machine in an App Service plan.
3112
+ #
3113
+ # Reboot a worker machine in an App Service plan.
3114
+ #
3115
+ # @param resource_group_name [String] Name of the resource group to which the
3116
+ # resource belongs.
3117
+ # @param name [String] Name of the App Service plan.
3118
+ # @param worker_name [String] Name of worker machine, which typically starts
3119
+ # with RD.
3120
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3121
+ # will be added to the HTTP request.
3122
+ #
3123
+ #
3124
+ def reboot_worker(resource_group_name, name, worker_name, custom_headers:nil)
3125
+ response = reboot_worker_async(resource_group_name, name, worker_name, custom_headers:custom_headers).value!
3126
+ nil
3127
+ end
3128
+
3129
+ #
3130
+ # Reboot a worker machine in an App Service plan.
3131
+ #
3132
+ # Reboot a worker machine in an App Service plan.
3133
+ #
3134
+ # @param resource_group_name [String] Name of the resource group to which the
3135
+ # resource belongs.
3136
+ # @param name [String] Name of the App Service plan.
3137
+ # @param worker_name [String] Name of worker machine, which typically starts
3138
+ # with RD.
3139
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3140
+ # will be added to the HTTP request.
3141
+ #
3142
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3143
+ #
3144
+ def reboot_worker_with_http_info(resource_group_name, name, worker_name, custom_headers:nil)
3145
+ reboot_worker_async(resource_group_name, name, worker_name, custom_headers:custom_headers).value!
3146
+ end
3147
+
3148
+ #
3149
+ # Reboot a worker machine in an App Service plan.
3150
+ #
3151
+ # Reboot a worker machine in an App Service plan.
3152
+ #
3153
+ # @param resource_group_name [String] Name of the resource group to which the
3154
+ # resource belongs.
3155
+ # @param name [String] Name of the App Service plan.
3156
+ # @param worker_name [String] Name of worker machine, which typically starts
3157
+ # with RD.
3158
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3159
+ # to the HTTP request.
3160
+ #
3161
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3162
+ #
3163
+ def reboot_worker_async(resource_group_name, name, worker_name, custom_headers:nil)
3164
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
3165
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
3166
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
3167
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
3168
+ fail ArgumentError, 'name is nil' if name.nil?
3169
+ fail ArgumentError, 'worker_name is nil' if worker_name.nil?
3170
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
3171
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
3172
+
3173
+
3174
+ request_headers = {}
3175
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3176
+
3177
+ # Set Headers
3178
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3179
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3180
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}/reboot'
3181
+
3182
+ request_url = @base_url || @client.base_url
3183
+
3184
+ options = {
3185
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3186
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'workerName' => worker_name,'subscriptionId' => @client.subscription_id},
3187
+ query_params: {'api-version' => @client.api_version},
3188
+ headers: request_headers.merge(custom_headers || {}),
3189
+ base_url: request_url
3190
+ }
3191
+ promise = @client.make_request_async(:post, path_template, options)
3192
+
3193
+ promise = promise.then do |result|
3194
+ http_response = result.response
3195
+ status_code = http_response.status
3196
+ response_content = http_response.body
3197
+ unless status_code == 204
3198
+ error_model = JSON.load(response_content)
3199
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
3200
+ end
3201
+
3202
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3203
+
3204
+ result
3205
+ end
3206
+
3207
+ promise.execute
3208
+ end
3209
+
3210
+ #
3211
+ # Creates or updates an App Service Plan.
3212
+ #
3213
+ # Creates or updates an App Service Plan.
3214
+ #
3215
+ # @param resource_group_name [String] Name of the resource group to which the
3216
+ # resource belongs.
3217
+ # @param name [String] Name of the App Service plan.
3218
+ # @param app_service_plan [AppServicePlan] Details of the App Service plan.
3219
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3220
+ # will be added to the HTTP request.
3221
+ #
3222
+ # @return [AppServicePlan] operation results.
3223
+ #
3224
+ def begin_create_or_update(resource_group_name, name, app_service_plan, custom_headers:nil)
3225
+ response = begin_create_or_update_async(resource_group_name, name, app_service_plan, custom_headers:custom_headers).value!
3226
+ response.body unless response.nil?
3227
+ end
3228
+
3229
+ #
3230
+ # Creates or updates an App Service Plan.
3231
+ #
3232
+ # Creates or updates an App Service Plan.
3233
+ #
3234
+ # @param resource_group_name [String] Name of the resource group to which the
3235
+ # resource belongs.
3236
+ # @param name [String] Name of the App Service plan.
3237
+ # @param app_service_plan [AppServicePlan] Details of the App Service plan.
3238
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3239
+ # will be added to the HTTP request.
3240
+ #
3241
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3242
+ #
3243
+ def begin_create_or_update_with_http_info(resource_group_name, name, app_service_plan, custom_headers:nil)
3244
+ begin_create_or_update_async(resource_group_name, name, app_service_plan, custom_headers:custom_headers).value!
3245
+ end
3246
+
3247
+ #
3248
+ # Creates or updates an App Service Plan.
3249
+ #
3250
+ # Creates or updates an App Service Plan.
3251
+ #
3252
+ # @param resource_group_name [String] Name of the resource group to which the
3253
+ # resource belongs.
3254
+ # @param name [String] Name of the App Service plan.
3255
+ # @param app_service_plan [AppServicePlan] Details of the App Service plan.
3256
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3257
+ # to the HTTP request.
3258
+ #
3259
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3260
+ #
3261
+ def begin_create_or_update_async(resource_group_name, name, app_service_plan, custom_headers:nil)
3262
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
3263
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MaxLength': '90'" if !resource_group_name.nil? && resource_group_name.length > 90
3264
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'MinLength': '1'" if !resource_group_name.nil? && resource_group_name.length < 1
3265
+ fail ArgumentError, "'resource_group_name' should satisfy the constraint - 'Pattern': '^[-\w\._\(\)]+[^\.]$'" if !resource_group_name.nil? && resource_group_name.match(Regexp.new('^^[-\w\._\(\)]+[^\.]$$')).nil?
3266
+ fail ArgumentError, 'name is nil' if name.nil?
3267
+ fail ArgumentError, 'app_service_plan is nil' if app_service_plan.nil?
3268
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
3269
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
3270
+
3271
+
3272
+ request_headers = {}
3273
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3274
+
3275
+ # Set Headers
3276
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3277
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3278
+
3279
+ # Serialize Request
3280
+ request_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlan.mapper()
3281
+ request_content = @client.serialize(request_mapper, app_service_plan)
3282
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
3283
+
3284
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'
3285
+
3286
+ request_url = @base_url || @client.base_url
3287
+
3288
+ options = {
3289
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3290
+ path_params: {'resourceGroupName' => resource_group_name,'name' => name,'subscriptionId' => @client.subscription_id},
3291
+ query_params: {'api-version' => @client.api_version},
3292
+ body: request_content,
3293
+ headers: request_headers.merge(custom_headers || {}),
3294
+ base_url: request_url
3295
+ }
3296
+ promise = @client.make_request_async(:put, path_template, options)
3297
+
3298
+ promise = promise.then do |result|
3299
+ http_response = result.response
3300
+ status_code = http_response.status
3301
+ response_content = http_response.body
3302
+ unless status_code == 200 || status_code == 202
3303
+ error_model = JSON.load(response_content)
3304
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
3305
+ end
3306
+
3307
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3308
+ # Deserialize Response
3309
+ if status_code == 200
3310
+ begin
3311
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3312
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlan.mapper()
3313
+ result.body = @client.deserialize(result_mapper, parsed_response)
3314
+ rescue Exception => e
3315
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3316
+ end
3317
+ end
3318
+ # Deserialize Response
3319
+ if status_code == 202
3320
+ begin
3321
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3322
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlan.mapper()
3323
+ result.body = @client.deserialize(result_mapper, parsed_response)
3324
+ rescue Exception => e
3325
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3326
+ end
3327
+ end
3328
+
3329
+ result
3330
+ end
3331
+
3332
+ promise.execute
3333
+ end
3334
+
3335
+ #
3336
+ # Get all App Service plans for a subcription.
3337
+ #
3338
+ # Get all App Service plans for a subcription.
3339
+ #
3340
+ # @param next_page_link [String] The NextLink from the previous successful call
3341
+ # to List operation.
3342
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3343
+ # will be added to the HTTP request.
3344
+ #
3345
+ # @return [AppServicePlanCollection] operation results.
3346
+ #
3347
+ def list_next(next_page_link, custom_headers:nil)
3348
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
3349
+ response.body unless response.nil?
3350
+ end
3351
+
3352
+ #
3353
+ # Get all App Service plans for a subcription.
3354
+ #
3355
+ # Get all App Service plans for a subcription.
3356
+ #
3357
+ # @param next_page_link [String] The NextLink from the previous successful call
3358
+ # to List operation.
3359
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3360
+ # will be added to the HTTP request.
3361
+ #
3362
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3363
+ #
3364
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
3365
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
3366
+ end
3367
+
3368
+ #
3369
+ # Get all App Service plans for a subcription.
3370
+ #
3371
+ # Get all App Service plans for a subcription.
3372
+ #
3373
+ # @param next_page_link [String] The NextLink from the previous successful call
3374
+ # to List operation.
3375
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3376
+ # to the HTTP request.
3377
+ #
3378
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3379
+ #
3380
+ def list_next_async(next_page_link, custom_headers:nil)
3381
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3382
+
3383
+
3384
+ request_headers = {}
3385
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3386
+
3387
+ # Set Headers
3388
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3389
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3390
+ path_template = '{nextLink}'
3391
+
3392
+ request_url = @base_url || @client.base_url
3393
+
3394
+ options = {
3395
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3396
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3397
+ headers: request_headers.merge(custom_headers || {}),
3398
+ base_url: request_url
3399
+ }
3400
+ promise = @client.make_request_async(:get, path_template, options)
3401
+
3402
+ promise = promise.then do |result|
3403
+ http_response = result.response
3404
+ status_code = http_response.status
3405
+ response_content = http_response.body
3406
+ unless status_code == 200
3407
+ error_model = JSON.load(response_content)
3408
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
3409
+ end
3410
+
3411
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3412
+ # Deserialize Response
3413
+ if status_code == 200
3414
+ begin
3415
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3416
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlanCollection.mapper()
3417
+ result.body = @client.deserialize(result_mapper, parsed_response)
3418
+ rescue Exception => e
3419
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3420
+ end
3421
+ end
3422
+
3423
+ result
3424
+ end
3425
+
3426
+ promise.execute
3427
+ end
3428
+
3429
+ #
3430
+ # Get all App Service plans in a resource group.
3431
+ #
3432
+ # Get all App Service plans in a resource group.
3433
+ #
3434
+ # @param next_page_link [String] The NextLink from the previous successful call
3435
+ # to List operation.
3436
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3437
+ # will be added to the HTTP request.
3438
+ #
3439
+ # @return [AppServicePlanCollection] operation results.
3440
+ #
3441
+ def list_by_resource_group_next(next_page_link, custom_headers:nil)
3442
+ response = list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
3443
+ response.body unless response.nil?
3444
+ end
3445
+
3446
+ #
3447
+ # Get all App Service plans in a resource group.
3448
+ #
3449
+ # Get all App Service plans in a resource group.
3450
+ #
3451
+ # @param next_page_link [String] The NextLink from the previous successful call
3452
+ # to List operation.
3453
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3454
+ # will be added to the HTTP request.
3455
+ #
3456
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3457
+ #
3458
+ def list_by_resource_group_next_with_http_info(next_page_link, custom_headers:nil)
3459
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers).value!
3460
+ end
3461
+
3462
+ #
3463
+ # Get all App Service plans in a resource group.
3464
+ #
3465
+ # Get all App Service plans in a resource group.
3466
+ #
3467
+ # @param next_page_link [String] The NextLink from the previous successful call
3468
+ # to List operation.
3469
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3470
+ # to the HTTP request.
3471
+ #
3472
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3473
+ #
3474
+ def list_by_resource_group_next_async(next_page_link, custom_headers:nil)
3475
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3476
+
3477
+
3478
+ request_headers = {}
3479
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3480
+
3481
+ # Set Headers
3482
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3483
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3484
+ path_template = '{nextLink}'
3485
+
3486
+ request_url = @base_url || @client.base_url
3487
+
3488
+ options = {
3489
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3490
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3491
+ headers: request_headers.merge(custom_headers || {}),
3492
+ base_url: request_url
3493
+ }
3494
+ promise = @client.make_request_async(:get, path_template, options)
3495
+
3496
+ promise = promise.then do |result|
3497
+ http_response = result.response
3498
+ status_code = http_response.status
3499
+ response_content = http_response.body
3500
+ unless status_code == 200
3501
+ error_model = JSON.load(response_content)
3502
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
3503
+ end
3504
+
3505
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3506
+ # Deserialize Response
3507
+ if status_code == 200
3508
+ begin
3509
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3510
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::AppServicePlanCollection.mapper()
3511
+ result.body = @client.deserialize(result_mapper, parsed_response)
3512
+ rescue Exception => e
3513
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3514
+ end
3515
+ end
3516
+
3517
+ result
3518
+ end
3519
+
3520
+ promise.execute
3521
+ end
3522
+
3523
+ #
3524
+ # Get all apps that use a Hybrid Connection in an App Service Plan.
3525
+ #
3526
+ # Get all apps that use a Hybrid Connection in an App Service Plan.
3527
+ #
3528
+ # @param next_page_link [String] The NextLink from the previous successful call
3529
+ # to List operation.
3530
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3531
+ # will be added to the HTTP request.
3532
+ #
3533
+ # @return [ResourceCollection] operation results.
3534
+ #
3535
+ def list_web_apps_by_hybrid_connection_next(next_page_link, custom_headers:nil)
3536
+ response = list_web_apps_by_hybrid_connection_next_async(next_page_link, custom_headers:custom_headers).value!
3537
+ response.body unless response.nil?
3538
+ end
3539
+
3540
+ #
3541
+ # Get all apps that use a Hybrid Connection in an App Service Plan.
3542
+ #
3543
+ # Get all apps that use a Hybrid Connection in an App Service Plan.
3544
+ #
3545
+ # @param next_page_link [String] The NextLink from the previous successful call
3546
+ # to List operation.
3547
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3548
+ # will be added to the HTTP request.
3549
+ #
3550
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3551
+ #
3552
+ def list_web_apps_by_hybrid_connection_next_with_http_info(next_page_link, custom_headers:nil)
3553
+ list_web_apps_by_hybrid_connection_next_async(next_page_link, custom_headers:custom_headers).value!
3554
+ end
3555
+
3556
+ #
3557
+ # Get all apps that use a Hybrid Connection in an App Service Plan.
3558
+ #
3559
+ # Get all apps that use a Hybrid Connection in an App Service Plan.
3560
+ #
3561
+ # @param next_page_link [String] The NextLink from the previous successful call
3562
+ # to List operation.
3563
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3564
+ # to the HTTP request.
3565
+ #
3566
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3567
+ #
3568
+ def list_web_apps_by_hybrid_connection_next_async(next_page_link, custom_headers:nil)
3569
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3570
+
3571
+
3572
+ request_headers = {}
3573
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3574
+
3575
+ # Set Headers
3576
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3577
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3578
+ path_template = '{nextLink}'
3579
+
3580
+ request_url = @base_url || @client.base_url
3581
+
3582
+ options = {
3583
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3584
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3585
+ headers: request_headers.merge(custom_headers || {}),
3586
+ base_url: request_url
3587
+ }
3588
+ promise = @client.make_request_async(:get, path_template, options)
3589
+
3590
+ promise = promise.then do |result|
3591
+ http_response = result.response
3592
+ status_code = http_response.status
3593
+ response_content = http_response.body
3594
+ unless status_code == 200
3595
+ error_model = JSON.load(response_content)
3596
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
3597
+ end
3598
+
3599
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3600
+ # Deserialize Response
3601
+ if status_code == 200
3602
+ begin
3603
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3604
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::ResourceCollection.mapper()
3605
+ result.body = @client.deserialize(result_mapper, parsed_response)
3606
+ rescue Exception => e
3607
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3608
+ end
3609
+ end
3610
+
3611
+ result
3612
+ end
3613
+
3614
+ promise.execute
3615
+ end
3616
+
3617
+ #
3618
+ # Retrieve all Hybrid Connections in use in an App Service plan.
3619
+ #
3620
+ # Retrieve all Hybrid Connections in use in an App Service plan.
3621
+ #
3622
+ # @param next_page_link [String] The NextLink from the previous successful call
3623
+ # to List operation.
3624
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3625
+ # will be added to the HTTP request.
3626
+ #
3627
+ # @return [HybridConnectionCollection] operation results.
3628
+ #
3629
+ def list_hybrid_connections_next(next_page_link, custom_headers:nil)
3630
+ response = list_hybrid_connections_next_async(next_page_link, custom_headers:custom_headers).value!
3631
+ response.body unless response.nil?
3632
+ end
3633
+
3634
+ #
3635
+ # Retrieve all Hybrid Connections in use in an App Service plan.
3636
+ #
3637
+ # Retrieve all Hybrid Connections in use in an App Service plan.
3638
+ #
3639
+ # @param next_page_link [String] The NextLink from the previous successful call
3640
+ # to List operation.
3641
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3642
+ # will be added to the HTTP request.
3643
+ #
3644
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3645
+ #
3646
+ def list_hybrid_connections_next_with_http_info(next_page_link, custom_headers:nil)
3647
+ list_hybrid_connections_next_async(next_page_link, custom_headers:custom_headers).value!
3648
+ end
3649
+
3650
+ #
3651
+ # Retrieve all Hybrid Connections in use in an App Service plan.
3652
+ #
3653
+ # Retrieve all Hybrid Connections in use in an App Service plan.
3654
+ #
3655
+ # @param next_page_link [String] The NextLink from the previous successful call
3656
+ # to List operation.
3657
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3658
+ # to the HTTP request.
3659
+ #
3660
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3661
+ #
3662
+ def list_hybrid_connections_next_async(next_page_link, custom_headers:nil)
3663
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3664
+
3665
+
3666
+ request_headers = {}
3667
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3668
+
3669
+ # Set Headers
3670
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3671
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3672
+ path_template = '{nextLink}'
3673
+
3674
+ request_url = @base_url || @client.base_url
3675
+
3676
+ options = {
3677
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3678
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3679
+ headers: request_headers.merge(custom_headers || {}),
3680
+ base_url: request_url
3681
+ }
3682
+ promise = @client.make_request_async(:get, path_template, options)
3683
+
3684
+ promise = promise.then do |result|
3685
+ http_response = result.response
3686
+ status_code = http_response.status
3687
+ response_content = http_response.body
3688
+ unless status_code == 200
3689
+ error_model = JSON.load(response_content)
3690
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
3691
+ end
3692
+
3693
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3694
+ # Deserialize Response
3695
+ if status_code == 200
3696
+ begin
3697
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3698
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::HybridConnectionCollection.mapper()
3699
+ result.body = @client.deserialize(result_mapper, parsed_response)
3700
+ rescue Exception => e
3701
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3702
+ end
3703
+ end
3704
+
3705
+ result
3706
+ end
3707
+
3708
+ promise.execute
3709
+ end
3710
+
3711
+ #
3712
+ # Get metrics that can be queried for an App Service plan, and their
3713
+ # definitions.
3714
+ #
3715
+ # Get metrics that can be queried for an App Service plan, and their
3716
+ # definitions.
3717
+ #
3718
+ # @param next_page_link [String] The NextLink from the previous successful call
3719
+ # to List operation.
3720
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3721
+ # will be added to the HTTP request.
3722
+ #
3723
+ # @return [ResourceMetricDefinitionCollection] operation results.
3724
+ #
3725
+ def list_metric_defintions_next(next_page_link, custom_headers:nil)
3726
+ response = list_metric_defintions_next_async(next_page_link, custom_headers:custom_headers).value!
3727
+ response.body unless response.nil?
3728
+ end
3729
+
3730
+ #
3731
+ # Get metrics that can be queried for an App Service plan, and their
3732
+ # definitions.
3733
+ #
3734
+ # Get metrics that can be queried for an App Service plan, and their
3735
+ # definitions.
3736
+ #
3737
+ # @param next_page_link [String] The NextLink from the previous successful call
3738
+ # to List operation.
3739
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3740
+ # will be added to the HTTP request.
3741
+ #
3742
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3743
+ #
3744
+ def list_metric_defintions_next_with_http_info(next_page_link, custom_headers:nil)
3745
+ list_metric_defintions_next_async(next_page_link, custom_headers:custom_headers).value!
3746
+ end
3747
+
3748
+ #
3749
+ # Get metrics that can be queried for an App Service plan, and their
3750
+ # definitions.
3751
+ #
3752
+ # Get metrics that can be queried for an App Service plan, and their
3753
+ # definitions.
3754
+ #
3755
+ # @param next_page_link [String] The NextLink from the previous successful call
3756
+ # to List operation.
3757
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3758
+ # to the HTTP request.
3759
+ #
3760
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3761
+ #
3762
+ def list_metric_defintions_next_async(next_page_link, custom_headers:nil)
3763
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3764
+
3765
+
3766
+ request_headers = {}
3767
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3768
+
3769
+ # Set Headers
3770
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3771
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3772
+ path_template = '{nextLink}'
3773
+
3774
+ request_url = @base_url || @client.base_url
3775
+
3776
+ options = {
3777
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3778
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3779
+ headers: request_headers.merge(custom_headers || {}),
3780
+ base_url: request_url
3781
+ }
3782
+ promise = @client.make_request_async(:get, path_template, options)
3783
+
3784
+ promise = promise.then do |result|
3785
+ http_response = result.response
3786
+ status_code = http_response.status
3787
+ response_content = http_response.body
3788
+ unless status_code == 200
3789
+ error_model = JSON.load(response_content)
3790
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
3791
+ end
3792
+
3793
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3794
+ # Deserialize Response
3795
+ if status_code == 200
3796
+ begin
3797
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3798
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::ResourceMetricDefinitionCollection.mapper()
3799
+ result.body = @client.deserialize(result_mapper, parsed_response)
3800
+ rescue Exception => e
3801
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3802
+ end
3803
+ end
3804
+
3805
+ result
3806
+ end
3807
+
3808
+ promise.execute
3809
+ end
3810
+
3811
+ #
3812
+ # Get metrics for an App Serice plan.
3813
+ #
3814
+ # Get metrics for an App Serice plan.
3815
+ #
3816
+ # @param next_page_link [String] The NextLink from the previous successful call
3817
+ # to List operation.
3818
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3819
+ # will be added to the HTTP request.
3820
+ #
3821
+ # @return [ResourceMetricCollection] operation results.
3822
+ #
3823
+ def list_metrics_next(next_page_link, custom_headers:nil)
3824
+ response = list_metrics_next_async(next_page_link, custom_headers:custom_headers).value!
3825
+ response.body unless response.nil?
3826
+ end
3827
+
3828
+ #
3829
+ # Get metrics for an App Serice plan.
3830
+ #
3831
+ # Get metrics for an App Serice plan.
3832
+ #
3833
+ # @param next_page_link [String] The NextLink from the previous successful call
3834
+ # to List operation.
3835
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3836
+ # will be added to the HTTP request.
3837
+ #
3838
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3839
+ #
3840
+ def list_metrics_next_with_http_info(next_page_link, custom_headers:nil)
3841
+ list_metrics_next_async(next_page_link, custom_headers:custom_headers).value!
3842
+ end
3843
+
3844
+ #
3845
+ # Get metrics for an App Serice plan.
3846
+ #
3847
+ # Get metrics for an App Serice plan.
3848
+ #
3849
+ # @param next_page_link [String] The NextLink from the previous successful call
3850
+ # to List operation.
3851
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3852
+ # to the HTTP request.
3853
+ #
3854
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3855
+ #
3856
+ def list_metrics_next_async(next_page_link, custom_headers:nil)
3857
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3858
+
3859
+
3860
+ request_headers = {}
3861
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3862
+
3863
+ # Set Headers
3864
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3865
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3866
+ path_template = '{nextLink}'
3867
+
3868
+ request_url = @base_url || @client.base_url
3869
+
3870
+ options = {
3871
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3872
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3873
+ headers: request_headers.merge(custom_headers || {}),
3874
+ base_url: request_url
3875
+ }
3876
+ promise = @client.make_request_async(:get, path_template, options)
3877
+
3878
+ promise = promise.then do |result|
3879
+ http_response = result.response
3880
+ status_code = http_response.status
3881
+ response_content = http_response.body
3882
+ unless status_code == 200
3883
+ error_model = JSON.load(response_content)
3884
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
3885
+ end
3886
+
3887
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3888
+ # Deserialize Response
3889
+ if status_code == 200
3890
+ begin
3891
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3892
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::ResourceMetricCollection.mapper()
3893
+ result.body = @client.deserialize(result_mapper, parsed_response)
3894
+ rescue Exception => e
3895
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3896
+ end
3897
+ end
3898
+
3899
+ result
3900
+ end
3901
+
3902
+ promise.execute
3903
+ end
3904
+
3905
+ #
3906
+ # Get all apps associated with an App Service plan.
3907
+ #
3908
+ # Get all apps associated with an App Service plan.
3909
+ #
3910
+ # @param next_page_link [String] The NextLink from the previous successful call
3911
+ # to List operation.
3912
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3913
+ # will be added to the HTTP request.
3914
+ #
3915
+ # @return [WebAppCollection] operation results.
3916
+ #
3917
+ def list_web_apps_next(next_page_link, custom_headers:nil)
3918
+ response = list_web_apps_next_async(next_page_link, custom_headers:custom_headers).value!
3919
+ response.body unless response.nil?
3920
+ end
3921
+
3922
+ #
3923
+ # Get all apps associated with an App Service plan.
3924
+ #
3925
+ # Get all apps associated with an App Service plan.
3926
+ #
3927
+ # @param next_page_link [String] The NextLink from the previous successful call
3928
+ # to List operation.
3929
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
3930
+ # will be added to the HTTP request.
3931
+ #
3932
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
3933
+ #
3934
+ def list_web_apps_next_with_http_info(next_page_link, custom_headers:nil)
3935
+ list_web_apps_next_async(next_page_link, custom_headers:custom_headers).value!
3936
+ end
3937
+
3938
+ #
3939
+ # Get all apps associated with an App Service plan.
3940
+ #
3941
+ # Get all apps associated with an App Service plan.
3942
+ #
3943
+ # @param next_page_link [String] The NextLink from the previous successful call
3944
+ # to List operation.
3945
+ # @param [Hash{String => String}] A hash of custom headers that will be added
3946
+ # to the HTTP request.
3947
+ #
3948
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
3949
+ #
3950
+ def list_web_apps_next_async(next_page_link, custom_headers:nil)
3951
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
3952
+
3953
+
3954
+ request_headers = {}
3955
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
3956
+
3957
+ # Set Headers
3958
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
3959
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
3960
+ path_template = '{nextLink}'
3961
+
3962
+ request_url = @base_url || @client.base_url
3963
+
3964
+ options = {
3965
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
3966
+ skip_encoding_path_params: {'nextLink' => next_page_link},
3967
+ headers: request_headers.merge(custom_headers || {}),
3968
+ base_url: request_url
3969
+ }
3970
+ promise = @client.make_request_async(:get, path_template, options)
3971
+
3972
+ promise = promise.then do |result|
3973
+ http_response = result.response
3974
+ status_code = http_response.status
3975
+ response_content = http_response.body
3976
+ unless status_code == 200
3977
+ error_model = JSON.load(response_content)
3978
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
3979
+ end
3980
+
3981
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
3982
+ # Deserialize Response
3983
+ if status_code == 200
3984
+ begin
3985
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
3986
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::WebAppCollection.mapper()
3987
+ result.body = @client.deserialize(result_mapper, parsed_response)
3988
+ rescue Exception => e
3989
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
3990
+ end
3991
+ end
3992
+
3993
+ result
3994
+ end
3995
+
3996
+ promise.execute
3997
+ end
3998
+
3999
+ #
4000
+ # Gets server farm usage information
4001
+ #
4002
+ # Gets server farm usage information
4003
+ #
4004
+ # @param next_page_link [String] The NextLink from the previous successful call
4005
+ # to List operation.
4006
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
4007
+ # will be added to the HTTP request.
4008
+ #
4009
+ # @return [CsmUsageQuotaCollection] operation results.
4010
+ #
4011
+ def list_usages_next(next_page_link, custom_headers:nil)
4012
+ response = list_usages_next_async(next_page_link, custom_headers:custom_headers).value!
4013
+ response.body unless response.nil?
4014
+ end
4015
+
4016
+ #
4017
+ # Gets server farm usage information
4018
+ #
4019
+ # Gets server farm usage information
4020
+ #
4021
+ # @param next_page_link [String] The NextLink from the previous successful call
4022
+ # to List operation.
4023
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
4024
+ # will be added to the HTTP request.
4025
+ #
4026
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
4027
+ #
4028
+ def list_usages_next_with_http_info(next_page_link, custom_headers:nil)
4029
+ list_usages_next_async(next_page_link, custom_headers:custom_headers).value!
4030
+ end
4031
+
4032
+ #
4033
+ # Gets server farm usage information
4034
+ #
4035
+ # Gets server farm usage information
4036
+ #
4037
+ # @param next_page_link [String] The NextLink from the previous successful call
4038
+ # to List operation.
4039
+ # @param [Hash{String => String}] A hash of custom headers that will be added
4040
+ # to the HTTP request.
4041
+ #
4042
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
4043
+ #
4044
+ def list_usages_next_async(next_page_link, custom_headers:nil)
4045
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
4046
+
4047
+
4048
+ request_headers = {}
4049
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
4050
+
4051
+ # Set Headers
4052
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
4053
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
4054
+ path_template = '{nextLink}'
4055
+
4056
+ request_url = @base_url || @client.base_url
4057
+
4058
+ options = {
4059
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
4060
+ skip_encoding_path_params: {'nextLink' => next_page_link},
4061
+ headers: request_headers.merge(custom_headers || {}),
4062
+ base_url: request_url
4063
+ }
4064
+ promise = @client.make_request_async(:get, path_template, options)
4065
+
4066
+ promise = promise.then do |result|
4067
+ http_response = result.response
4068
+ status_code = http_response.status
4069
+ response_content = http_response.body
4070
+ unless status_code == 200
4071
+ error_model = JSON.load(response_content)
4072
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
4073
+ end
4074
+
4075
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
4076
+ # Deserialize Response
4077
+ if status_code == 200
4078
+ begin
4079
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
4080
+ result_mapper = Azure::Web::Mgmt::V2018_02_01::Models::CsmUsageQuotaCollection.mapper()
4081
+ result.body = @client.deserialize(result_mapper, parsed_response)
4082
+ rescue Exception => e
4083
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
4084
+ end
4085
+ end
4086
+
4087
+ result
4088
+ end
4089
+
4090
+ promise.execute
4091
+ end
4092
+
4093
+ #
4094
+ # Get all App Service plans for a subcription.
4095
+ #
4096
+ # Get all App Service plans for a subcription.
4097
+ #
4098
+ # @param detailed [Boolean] Specify <code>true</code> to return all App Service
4099
+ # plan properties. The default is <code>false</code>, which returns a subset of
4100
+ # the properties.
4101
+ # Retrieval of all properties may increase the API latency.
4102
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
4103
+ # will be added to the HTTP request.
4104
+ #
4105
+ # @return [AppServicePlanCollection] which provide lazy access to pages of the
4106
+ # response.
4107
+ #
4108
+ def list_as_lazy(detailed:nil, custom_headers:nil)
4109
+ response = list_async(detailed:detailed, custom_headers:custom_headers).value!
4110
+ unless response.nil?
4111
+ page = response.body
4112
+ page.next_method = Proc.new do |next_page_link|
4113
+ list_next_async(next_page_link, custom_headers:custom_headers)
4114
+ end
4115
+ page
4116
+ end
4117
+ end
4118
+
4119
+ #
4120
+ # Get all App Service plans in a resource group.
4121
+ #
4122
+ # Get all App Service plans in a resource group.
4123
+ #
4124
+ # @param resource_group_name [String] Name of the resource group to which the
4125
+ # resource belongs.
4126
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
4127
+ # will be added to the HTTP request.
4128
+ #
4129
+ # @return [AppServicePlanCollection] which provide lazy access to pages of the
4130
+ # response.
4131
+ #
4132
+ def list_by_resource_group_as_lazy(resource_group_name, custom_headers:nil)
4133
+ response = list_by_resource_group_async(resource_group_name, custom_headers:custom_headers).value!
4134
+ unless response.nil?
4135
+ page = response.body
4136
+ page.next_method = Proc.new do |next_page_link|
4137
+ list_by_resource_group_next_async(next_page_link, custom_headers:custom_headers)
4138
+ end
4139
+ page
4140
+ end
4141
+ end
4142
+
4143
+ #
4144
+ # Get all apps that use a Hybrid Connection in an App Service Plan.
4145
+ #
4146
+ # Get all apps that use a Hybrid Connection in an App Service Plan.
4147
+ #
4148
+ # @param resource_group_name [String] Name of the resource group to which the
4149
+ # resource belongs.
4150
+ # @param name [String] Name of the App Service plan.
4151
+ # @param namespace_name [String] Name of the Hybrid Connection namespace.
4152
+ # @param relay_name [String] Name of the Hybrid Connection relay.
4153
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
4154
+ # will be added to the HTTP request.
4155
+ #
4156
+ # @return [ResourceCollection] which provide lazy access to pages of the
4157
+ # response.
4158
+ #
4159
+ def list_web_apps_by_hybrid_connection_as_lazy(resource_group_name, name, namespace_name, relay_name, custom_headers:nil)
4160
+ response = list_web_apps_by_hybrid_connection_async(resource_group_name, name, namespace_name, relay_name, custom_headers:custom_headers).value!
4161
+ unless response.nil?
4162
+ page = response.body
4163
+ page.next_method = Proc.new do |next_page_link|
4164
+ list_web_apps_by_hybrid_connection_next_async(next_page_link, custom_headers:custom_headers)
4165
+ end
4166
+ page
4167
+ end
4168
+ end
4169
+
4170
+ #
4171
+ # Retrieve all Hybrid Connections in use in an App Service plan.
4172
+ #
4173
+ # Retrieve all Hybrid Connections in use in an App Service plan.
4174
+ #
4175
+ # @param resource_group_name [String] Name of the resource group to which the
4176
+ # resource belongs.
4177
+ # @param name [String] Name of the App Service plan.
4178
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
4179
+ # will be added to the HTTP request.
4180
+ #
4181
+ # @return [HybridConnectionCollection] which provide lazy access to pages of
4182
+ # the response.
4183
+ #
4184
+ def list_hybrid_connections_as_lazy(resource_group_name, name, custom_headers:nil)
4185
+ response = list_hybrid_connections_async(resource_group_name, name, custom_headers:custom_headers).value!
4186
+ unless response.nil?
4187
+ page = response.body
4188
+ page.next_method = Proc.new do |next_page_link|
4189
+ list_hybrid_connections_next_async(next_page_link, custom_headers:custom_headers)
4190
+ end
4191
+ page
4192
+ end
4193
+ end
4194
+
4195
+ #
4196
+ # Get metrics that can be queried for an App Service plan, and their
4197
+ # definitions.
4198
+ #
4199
+ # Get metrics that can be queried for an App Service plan, and their
4200
+ # definitions.
4201
+ #
4202
+ # @param resource_group_name [String] Name of the resource group to which the
4203
+ # resource belongs.
4204
+ # @param name [String] Name of the App Service plan.
4205
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
4206
+ # will be added to the HTTP request.
4207
+ #
4208
+ # @return [ResourceMetricDefinitionCollection] which provide lazy access to
4209
+ # pages of the response.
4210
+ #
4211
+ def list_metric_defintions_as_lazy(resource_group_name, name, custom_headers:nil)
4212
+ response = list_metric_defintions_async(resource_group_name, name, custom_headers:custom_headers).value!
4213
+ unless response.nil?
4214
+ page = response.body
4215
+ page.next_method = Proc.new do |next_page_link|
4216
+ list_metric_defintions_next_async(next_page_link, custom_headers:custom_headers)
4217
+ end
4218
+ page
4219
+ end
4220
+ end
4221
+
4222
+ #
4223
+ # Get metrics for an App Serice plan.
4224
+ #
4225
+ # Get metrics for an App Serice plan.
4226
+ #
4227
+ # @param resource_group_name [String] Name of the resource group to which the
4228
+ # resource belongs.
4229
+ # @param name [String] Name of the App Service plan.
4230
+ # @param details [Boolean] Specify <code>true</code> to include instance
4231
+ # details. The default is <code>false</code>.
4232
+ # @param filter [String] Return only usages/metrics specified in the filter.
4233
+ # Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or
4234
+ # name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime
4235
+ # eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'.
4236
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
4237
+ # will be added to the HTTP request.
4238
+ #
4239
+ # @return [ResourceMetricCollection] which provide lazy access to pages of the
4240
+ # response.
4241
+ #
4242
+ def list_metrics_as_lazy(resource_group_name, name, details:nil, filter:nil, custom_headers:nil)
4243
+ response = list_metrics_async(resource_group_name, name, details:details, filter:filter, custom_headers:custom_headers).value!
4244
+ unless response.nil?
4245
+ page = response.body
4246
+ page.next_method = Proc.new do |next_page_link|
4247
+ list_metrics_next_async(next_page_link, custom_headers:custom_headers)
4248
+ end
4249
+ page
4250
+ end
4251
+ end
4252
+
4253
+ #
4254
+ # Get all apps associated with an App Service plan.
4255
+ #
4256
+ # Get all apps associated with an App Service plan.
4257
+ #
4258
+ # @param resource_group_name [String] Name of the resource group to which the
4259
+ # resource belongs.
4260
+ # @param name [String] Name of the App Service plan.
4261
+ # @param skip_token [String] Skip to a web app in the list of webapps
4262
+ # associated with app service plan. If specified, the resulting list will
4263
+ # contain web apps starting from (including) the skipToken. Otherwise, the
4264
+ # resulting list contains web apps from the start of the list
4265
+ # @param filter [String] Supported filter: $filter=state eq running. Returns
4266
+ # only web apps that are currently running
4267
+ # @param top [String] List page size. If specified, results are paged.
4268
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
4269
+ # will be added to the HTTP request.
4270
+ #
4271
+ # @return [WebAppCollection] which provide lazy access to pages of the
4272
+ # response.
4273
+ #
4274
+ def list_web_apps_as_lazy(resource_group_name, name, skip_token:nil, filter:nil, top:nil, custom_headers:nil)
4275
+ response = list_web_apps_async(resource_group_name, name, skip_token:skip_token, filter:filter, top:top, custom_headers:custom_headers).value!
4276
+ unless response.nil?
4277
+ page = response.body
4278
+ page.next_method = Proc.new do |next_page_link|
4279
+ list_web_apps_next_async(next_page_link, custom_headers:custom_headers)
4280
+ end
4281
+ page
4282
+ end
4283
+ end
4284
+
4285
+ #
4286
+ # Gets server farm usage information
4287
+ #
4288
+ # Gets server farm usage information
4289
+ #
4290
+ # @param resource_group_name [String] Name of the resource group to which the
4291
+ # resource belongs.
4292
+ # @param name [String] Name of App Service Plan
4293
+ # @param filter [String] Return only usages/metrics specified in the filter.
4294
+ # Filter conforms to odata syntax. Example: $filter=(name.value eq 'Metric1' or
4295
+ # name.value eq 'Metric2').
4296
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
4297
+ # will be added to the HTTP request.
4298
+ #
4299
+ # @return [CsmUsageQuotaCollection] which provide lazy access to pages of the
4300
+ # response.
4301
+ #
4302
+ def list_usages_as_lazy(resource_group_name, name, filter:nil, custom_headers:nil)
4303
+ response = list_usages_async(resource_group_name, name, filter:filter, custom_headers:custom_headers).value!
4304
+ unless response.nil?
4305
+ page = response.body
4306
+ page.next_method = Proc.new do |next_page_link|
4307
+ list_usages_next_async(next_page_link, custom_headers:custom_headers)
4308
+ end
4309
+ page
4310
+ end
4311
+ end
4312
+
4313
+ end
4314
+ end