azure_mgmt_devtestlabs 0.10.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/lib/generated/azure_mgmt_devtestlabs.rb +149 -55
  3. data/lib/generated/azure_mgmt_devtestlabs/arm_templates.rb +363 -0
  4. data/lib/generated/azure_mgmt_devtestlabs/{artifact_source_operations.rb → artifact_sources.rb} +85 -69
  5. data/lib/generated/azure_mgmt_devtestlabs/{artifact_operations.rb → artifacts.rb} +59 -43
  6. data/lib/generated/azure_mgmt_devtestlabs/costs.rb +244 -0
  7. data/lib/generated/azure_mgmt_devtestlabs/{custom_image_operations.rb → custom_images.rb} +81 -68
  8. data/lib/generated/azure_mgmt_devtestlabs/dev_test_labs_client.rb +73 -37
  9. data/lib/generated/azure_mgmt_devtestlabs/disks.rb +975 -0
  10. data/lib/generated/azure_mgmt_devtestlabs/environments.rb +672 -0
  11. data/lib/generated/azure_mgmt_devtestlabs/{formula_operations.rb → formulas.rb} +82 -64
  12. data/lib/generated/azure_mgmt_devtestlabs/{gallery_image_operations.rb → gallery_images.rb} +33 -26
  13. data/lib/generated/azure_mgmt_devtestlabs/global_schedules.rb +1121 -0
  14. data/lib/generated/azure_mgmt_devtestlabs/{lab_operations.rb → labs.rb} +439 -141
  15. data/lib/generated/azure_mgmt_devtestlabs/models/applicable_schedule.rb +105 -0
  16. data/lib/generated/azure_mgmt_devtestlabs/models/applicable_schedule_fragment.rb +105 -0
  17. data/lib/generated/azure_mgmt_devtestlabs/models/apply_artifacts_request.rb +2 -1
  18. data/lib/generated/azure_mgmt_devtestlabs/models/arm_template.rb +167 -0
  19. data/lib/generated/azure_mgmt_devtestlabs/models/arm_template_info.rb +2 -1
  20. data/lib/generated/azure_mgmt_devtestlabs/models/arm_template_parameter_properties.rb +55 -0
  21. data/lib/generated/azure_mgmt_devtestlabs/models/artifact.rb +70 -53
  22. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties.rb +2 -1
  23. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties_fragment.rb +68 -0
  24. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_install_properties.rb +43 -1
  25. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_install_properties_fragment.rb +105 -0
  26. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties.rb +2 -1
  27. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties_fragment.rb +55 -0
  28. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_source.rb +75 -62
  29. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_source_fragment.rb +185 -0
  30. data/lib/generated/azure_mgmt_devtestlabs/models/attach_disk_properties.rb +46 -0
  31. data/lib/generated/azure_mgmt_devtestlabs/models/attach_new_data_disk_options.rb +66 -0
  32. data/lib/generated/azure_mgmt_devtestlabs/models/bulk_creation_parameters.rb +45 -0
  33. data/lib/generated/azure_mgmt_devtestlabs/models/compute_data_disk.rb +76 -0
  34. data/lib/generated/azure_mgmt_devtestlabs/models/compute_data_disk_fragment.rb +76 -0
  35. data/lib/generated/azure_mgmt_devtestlabs/models/compute_vm_instance_view_status.rb +65 -0
  36. data/lib/generated/azure_mgmt_devtestlabs/models/compute_vm_instance_view_status_fragment.rb +65 -0
  37. data/lib/generated/azure_mgmt_devtestlabs/models/compute_vm_properties.rb +131 -0
  38. data/lib/generated/azure_mgmt_devtestlabs/models/compute_vm_properties_fragment.rb +131 -0
  39. data/lib/generated/azure_mgmt_devtestlabs/models/cost_threshold_properties.rb +92 -0
  40. data/lib/generated/azure_mgmt_devtestlabs/models/cost_threshold_status.rb +16 -0
  41. data/lib/generated/azure_mgmt_devtestlabs/models/{lab_cost_type.rb → cost_type.rb} +3 -3
  42. data/lib/generated/azure_mgmt_devtestlabs/models/custom_image.rb +58 -57
  43. data/lib/generated/azure_mgmt_devtestlabs/models/custom_image_os_type.rb +1 -1
  44. data/lib/generated/azure_mgmt_devtestlabs/models/custom_image_properties_custom.rb +5 -4
  45. data/lib/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_vm.rb +2 -1
  46. data/lib/generated/azure_mgmt_devtestlabs/models/data_disk_properties.rb +70 -0
  47. data/lib/generated/azure_mgmt_devtestlabs/models/day_details.rb +3 -2
  48. data/lib/generated/azure_mgmt_devtestlabs/models/{subscription_notification_properties.rb → day_details_fragment.rb} +11 -11
  49. data/lib/generated/azure_mgmt_devtestlabs/models/detach_data_disk_properties.rb +46 -0
  50. data/lib/generated/azure_mgmt_devtestlabs/models/detach_disk_properties.rb +46 -0
  51. data/lib/generated/azure_mgmt_devtestlabs/models/disk.rb +186 -0
  52. data/lib/generated/azure_mgmt_devtestlabs/models/dtl_environment.rb +146 -0
  53. data/lib/generated/azure_mgmt_devtestlabs/models/enable_status.rb +1 -1
  54. data/lib/generated/azure_mgmt_devtestlabs/models/environment_deployment_properties.rb +64 -0
  55. data/lib/generated/azure_mgmt_devtestlabs/models/evaluate_policies_properties.rb +2 -1
  56. data/lib/generated/azure_mgmt_devtestlabs/models/evaluate_policies_request.rb +2 -1
  57. data/lib/generated/azure_mgmt_devtestlabs/models/evaluate_policies_response.rb +2 -1
  58. data/lib/generated/azure_mgmt_devtestlabs/models/event.rb +47 -0
  59. data/lib/generated/azure_mgmt_devtestlabs/models/event_fragment.rb +47 -0
  60. data/lib/generated/azure_mgmt_devtestlabs/models/export_resource_usage_parameters.rb +58 -0
  61. data/lib/generated/azure_mgmt_devtestlabs/models/external_subnet.rb +55 -0
  62. data/lib/generated/azure_mgmt_devtestlabs/models/external_subnet_fragment.rb +55 -0
  63. data/lib/generated/azure_mgmt_devtestlabs/models/file_upload_options.rb +16 -0
  64. data/lib/generated/azure_mgmt_devtestlabs/models/formula.rb +53 -61
  65. data/lib/generated/azure_mgmt_devtestlabs/models/formula_properties_from_vm.rb +2 -1
  66. data/lib/generated/azure_mgmt_devtestlabs/models/gallery_image.rb +44 -54
  67. data/lib/generated/azure_mgmt_devtestlabs/models/gallery_image_reference.rb +2 -1
  68. data/lib/generated/azure_mgmt_devtestlabs/models/gallery_image_reference_fragment.rb +85 -0
  69. data/lib/generated/azure_mgmt_devtestlabs/models/generate_arm_template_request.rb +14 -1
  70. data/lib/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_parameter.rb +2 -1
  71. data/lib/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_response.rb +2 -1
  72. data/lib/generated/azure_mgmt_devtestlabs/models/host_caching_options.rb +17 -0
  73. data/lib/generated/azure_mgmt_devtestlabs/models/hour_details.rb +2 -1
  74. data/lib/generated/azure_mgmt_devtestlabs/models/hour_details_fragment.rb +45 -0
  75. data/lib/generated/azure_mgmt_devtestlabs/models/identity_properties.rb +75 -0
  76. data/lib/generated/azure_mgmt_devtestlabs/models/inbound_nat_rule.rb +70 -0
  77. data/lib/generated/azure_mgmt_devtestlabs/models/inbound_nat_rule_fragment.rb +70 -0
  78. data/lib/generated/azure_mgmt_devtestlabs/models/lab.rb +85 -54
  79. data/lib/generated/azure_mgmt_devtestlabs/models/lab_cost.rb +204 -0
  80. data/lib/generated/azure_mgmt_devtestlabs/models/{cost_per_day_properties.rb → lab_cost_details_properties.rb} +7 -6
  81. data/lib/generated/azure_mgmt_devtestlabs/models/lab_cost_summary_properties.rb +45 -0
  82. data/lib/generated/azure_mgmt_devtestlabs/models/lab_fragment.rb +127 -0
  83. data/lib/generated/azure_mgmt_devtestlabs/models/{resource_cost_properties.rb → lab_resource_cost_properties.rb} +49 -28
  84. data/lib/generated/azure_mgmt_devtestlabs/models/lab_vhd.rb +3 -2
  85. data/lib/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine.rb +141 -42
  86. data/lib/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_creation_parameter.rb +412 -0
  87. data/lib/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine_fragment.rb +410 -0
  88. data/lib/generated/azure_mgmt_devtestlabs/models/linux_os_info.rb +5 -3
  89. data/lib/generated/azure_mgmt_devtestlabs/models/linux_os_state.rb +1 -1
  90. data/lib/generated/azure_mgmt_devtestlabs/models/network_interface_properties.rb +130 -0
  91. data/lib/generated/azure_mgmt_devtestlabs/models/network_interface_properties_fragment.rb +130 -0
  92. data/lib/generated/azure_mgmt_devtestlabs/models/notification_channel.rb +150 -0
  93. data/lib/generated/azure_mgmt_devtestlabs/models/notification_channel_event_type.rb +16 -0
  94. data/lib/generated/azure_mgmt_devtestlabs/models/{cost.rb → notification_channel_fragment.rb} +64 -64
  95. data/lib/generated/azure_mgmt_devtestlabs/models/notification_settings.rb +69 -0
  96. data/lib/generated/azure_mgmt_devtestlabs/models/notification_settings_fragment.rb +69 -0
  97. data/lib/generated/azure_mgmt_devtestlabs/models/notification_status.rb +16 -0
  98. data/lib/generated/azure_mgmt_devtestlabs/models/notify_parameters.rb +56 -0
  99. data/lib/generated/azure_mgmt_devtestlabs/models/parameter_info.rb +5 -5
  100. data/lib/generated/azure_mgmt_devtestlabs/models/parameters_value_file_info.rb +55 -0
  101. data/lib/generated/azure_mgmt_devtestlabs/models/percentage_cost_threshold_properties.rb +45 -0
  102. data/lib/generated/azure_mgmt_devtestlabs/models/policy.rb +62 -58
  103. data/lib/generated/azure_mgmt_devtestlabs/models/policy_evaluator_type.rb +1 -1
  104. data/lib/generated/azure_mgmt_devtestlabs/models/policy_fact_name.rb +4 -1
  105. data/lib/generated/azure_mgmt_devtestlabs/models/policy_fragment.rb +168 -0
  106. data/lib/generated/azure_mgmt_devtestlabs/models/policy_set_result.rb +2 -1
  107. data/lib/generated/azure_mgmt_devtestlabs/models/policy_status.rb +1 -1
  108. data/lib/generated/azure_mgmt_devtestlabs/models/policy_violation.rb +2 -1
  109. data/lib/generated/azure_mgmt_devtestlabs/models/port.rb +56 -0
  110. data/lib/generated/azure_mgmt_devtestlabs/models/port_fragment.rb +56 -0
  111. data/lib/generated/azure_mgmt_devtestlabs/models/premium_data_disk.rb +16 -0
  112. data/lib/generated/azure_mgmt_devtestlabs/models/reporting_cycle_type.rb +16 -0
  113. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_arm_template.rb +94 -0
  114. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_artifact.rb +2 -1
  115. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_artifact_source.rb +2 -1
  116. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_custom_image.rb +2 -1
  117. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_disk.rb +94 -0
  118. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_dtl_environment.rb +95 -0
  119. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_formula.rb +2 -1
  120. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_gallery_image.rb +2 -1
  121. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab.rb +2 -1
  122. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab_vhd.rb +2 -1
  123. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab_virtual_machine.rb +2 -1
  124. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_notification_channel.rb +96 -0
  125. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_policy.rb +2 -1
  126. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_schedule.rb +2 -1
  127. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_secret.rb +94 -0
  128. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_service_runner.rb +94 -0
  129. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_user.rb +94 -0
  130. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_virtual_network.rb +2 -1
  131. data/lib/generated/azure_mgmt_devtestlabs/models/retarget_schedule_properties.rb +57 -0
  132. data/lib/generated/azure_mgmt_devtestlabs/models/schedule.rb +82 -57
  133. data/lib/generated/azure_mgmt_devtestlabs/models/schedule_fragment.rb +189 -0
  134. data/lib/generated/azure_mgmt_devtestlabs/models/secret.rb +110 -0
  135. data/lib/generated/azure_mgmt_devtestlabs/models/service_runner.rb +91 -0
  136. data/lib/generated/azure_mgmt_devtestlabs/models/shared_public_ip_address_configuration.rb +54 -0
  137. data/lib/generated/azure_mgmt_devtestlabs/models/shared_public_ip_address_configuration_fragment.rb +55 -0
  138. data/lib/generated/azure_mgmt_devtestlabs/models/shutdown_notification_content.rb +147 -0
  139. data/lib/generated/azure_mgmt_devtestlabs/models/source_control_type.rb +1 -1
  140. data/lib/generated/azure_mgmt_devtestlabs/models/{lab_storage_type.rb → storage_type.rb} +3 -3
  141. data/lib/generated/azure_mgmt_devtestlabs/models/subnet.rb +8 -7
  142. data/lib/generated/azure_mgmt_devtestlabs/models/subnet_fragment.rb +67 -0
  143. data/lib/generated/azure_mgmt_devtestlabs/models/subnet_override.rb +29 -6
  144. data/lib/generated/azure_mgmt_devtestlabs/models/subnet_override_fragment.rb +101 -0
  145. data/lib/generated/azure_mgmt_devtestlabs/models/subnet_shared_public_ip_address_configuration.rb +54 -0
  146. data/lib/generated/azure_mgmt_devtestlabs/models/subnet_shared_public_ip_address_configuration_fragment.rb +55 -0
  147. data/lib/generated/azure_mgmt_devtestlabs/models/target_cost_properties.rb +105 -0
  148. data/lib/generated/azure_mgmt_devtestlabs/models/target_cost_status.rb +16 -0
  149. data/lib/generated/azure_mgmt_devtestlabs/models/transport_protocol.rb +16 -0
  150. data/lib/generated/azure_mgmt_devtestlabs/models/usage_permission_type.rb +1 -1
  151. data/lib/generated/azure_mgmt_devtestlabs/models/user.rb +133 -0
  152. data/lib/generated/azure_mgmt_devtestlabs/models/user_fragment.rb +122 -0
  153. data/lib/generated/azure_mgmt_devtestlabs/models/user_identity.rb +91 -0
  154. data/lib/generated/azure_mgmt_devtestlabs/models/user_identity_fragment.rb +91 -0
  155. data/lib/generated/azure_mgmt_devtestlabs/models/user_secret_store.rb +55 -0
  156. data/lib/generated/azure_mgmt_devtestlabs/models/user_secret_store_fragment.rb +55 -0
  157. data/lib/generated/azure_mgmt_devtestlabs/models/virtual_machine_creation_source.rb +16 -0
  158. data/lib/generated/azure_mgmt_devtestlabs/models/virtual_network.rb +77 -59
  159. data/lib/generated/azure_mgmt_devtestlabs/models/virtual_network_fragment.rb +177 -0
  160. data/lib/generated/azure_mgmt_devtestlabs/models/week_details.rb +5 -3
  161. data/lib/generated/azure_mgmt_devtestlabs/models/week_details_fragment.rb +63 -0
  162. data/lib/generated/azure_mgmt_devtestlabs/models/windows_os_info.rb +4 -2
  163. data/lib/generated/azure_mgmt_devtestlabs/models/windows_os_state.rb +1 -1
  164. data/lib/generated/azure_mgmt_devtestlabs/module_definition.rb +1 -1
  165. data/lib/generated/azure_mgmt_devtestlabs/notification_channels.rb +764 -0
  166. data/lib/generated/azure_mgmt_devtestlabs/{policy_operations.rb → policies.rb} +82 -69
  167. data/lib/generated/azure_mgmt_devtestlabs/{policy_set.rb → policy_sets.rb} +18 -16
  168. data/lib/generated/azure_mgmt_devtestlabs/{virtual_machine.rb → schedules.rb} +282 -417
  169. data/lib/generated/azure_mgmt_devtestlabs/secrets.rb +573 -0
  170. data/lib/generated/azure_mgmt_devtestlabs/service_runners.rb +545 -0
  171. data/lib/generated/azure_mgmt_devtestlabs/users.rb +704 -0
  172. data/lib/generated/azure_mgmt_devtestlabs/version.rb +2 -2
  173. data/lib/generated/azure_mgmt_devtestlabs/{schedule_operations.rb → virtual_machine_schedules.rb} +132 -92
  174. data/lib/generated/azure_mgmt_devtestlabs/virtual_machines.rb +1669 -0
  175. data/lib/generated/azure_mgmt_devtestlabs/{virtual_network_operations.rb → virtual_networks.rb} +94 -81
  176. metadata +118 -24
  177. data/lib/generated/azure_mgmt_devtestlabs/cost_operations.rb +0 -121
  178. data/lib/generated/azure_mgmt_devtestlabs/models/subscription_notification.rb +0 -68
  179. data/lib/generated/azure_mgmt_devtestlabs/models/subscription_notification_state.rb +0 -20
@@ -0,0 +1,545 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 1.2.2.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ module Azure::ARM::DevTestLabs
7
+ #
8
+ # The DevTest Labs Client.
9
+ #
10
+ class ServiceRunners
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ServiceRunners class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [DevTestLabsClient] reference to the DevTestLabsClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # List service runners in a given lab.
26
+ #
27
+ # @param resource_group_name [String] The name of the resource group.
28
+ # @param lab_name [String] The name of the lab.
29
+ # @param filter [String] The filter to apply to the operation.
30
+ # @param top [Integer] The maximum number of resources to return from the
31
+ # operation.
32
+ # @param orderby [String] The ordering expression for the results, using OData
33
+ # notation.
34
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
35
+ # will be added to the HTTP request.
36
+ #
37
+ # @return [Array<ServiceRunner>] operation results.
38
+ #
39
+ def list(resource_group_name, lab_name, filter = nil, top = nil, orderby = nil, custom_headers = nil)
40
+ first_page = list_as_lazy(resource_group_name, lab_name, filter, top, orderby, custom_headers)
41
+ first_page.get_all_items
42
+ end
43
+
44
+ #
45
+ # List service runners in a given lab.
46
+ #
47
+ # @param resource_group_name [String] The name of the resource group.
48
+ # @param lab_name [String] The name of the lab.
49
+ # @param filter [String] The filter to apply to the operation.
50
+ # @param top [Integer] The maximum number of resources to return from the
51
+ # operation.
52
+ # @param orderby [String] The ordering expression for the results, using OData
53
+ # notation.
54
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
55
+ # will be added to the HTTP request.
56
+ #
57
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
58
+ #
59
+ def list_with_http_info(resource_group_name, lab_name, filter = nil, top = nil, orderby = nil, custom_headers = nil)
60
+ list_async(resource_group_name, lab_name, filter, top, orderby, custom_headers).value!
61
+ end
62
+
63
+ #
64
+ # List service runners in a given lab.
65
+ #
66
+ # @param resource_group_name [String] The name of the resource group.
67
+ # @param lab_name [String] The name of the lab.
68
+ # @param filter [String] The filter to apply to the operation.
69
+ # @param top [Integer] The maximum number of resources to return from the
70
+ # operation.
71
+ # @param orderby [String] The ordering expression for the results, using OData
72
+ # notation.
73
+ # @param [Hash{String => String}] A hash of custom headers that will be added
74
+ # to the HTTP request.
75
+ #
76
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
77
+ #
78
+ def list_async(resource_group_name, lab_name, filter = nil, top = nil, orderby = nil, custom_headers = nil)
79
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
80
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
81
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
82
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
83
+
84
+
85
+ request_headers = {}
86
+
87
+ # Set Headers
88
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
89
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
90
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/servicerunners'
91
+
92
+ request_url = @base_url || @client.base_url
93
+
94
+ options = {
95
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
96
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name},
97
+ query_params: {'$filter' => filter,'$top' => top,'$orderby' => orderby,'api-version' => @client.api_version},
98
+ headers: request_headers.merge(custom_headers || {}),
99
+ base_url: request_url
100
+ }
101
+ promise = @client.make_request_async(:get, path_template, options)
102
+
103
+ promise = promise.then do |result|
104
+ http_response = result.response
105
+ status_code = http_response.status
106
+ response_content = http_response.body
107
+ unless status_code == 200
108
+ error_model = JSON.load(response_content)
109
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
110
+ end
111
+
112
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
113
+ # Deserialize Response
114
+ if status_code == 200
115
+ begin
116
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
117
+ result_mapper = Azure::ARM::DevTestLabs::Models::ResponseWithContinuationServiceRunner.mapper()
118
+ result.body = @client.deserialize(result_mapper, parsed_response)
119
+ rescue Exception => e
120
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
121
+ end
122
+ end
123
+
124
+ result
125
+ end
126
+
127
+ promise.execute
128
+ end
129
+
130
+ #
131
+ # Get service runner.
132
+ #
133
+ # @param resource_group_name [String] The name of the resource group.
134
+ # @param lab_name [String] The name of the lab.
135
+ # @param name [String] The name of the service runner.
136
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
137
+ # will be added to the HTTP request.
138
+ #
139
+ # @return [ServiceRunner] operation results.
140
+ #
141
+ def get(resource_group_name, lab_name, name, custom_headers = nil)
142
+ response = get_async(resource_group_name, lab_name, name, custom_headers).value!
143
+ response.body unless response.nil?
144
+ end
145
+
146
+ #
147
+ # Get service runner.
148
+ #
149
+ # @param resource_group_name [String] The name of the resource group.
150
+ # @param lab_name [String] The name of the lab.
151
+ # @param name [String] The name of the service runner.
152
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
153
+ # will be added to the HTTP request.
154
+ #
155
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
156
+ #
157
+ def get_with_http_info(resource_group_name, lab_name, name, custom_headers = nil)
158
+ get_async(resource_group_name, lab_name, name, custom_headers).value!
159
+ end
160
+
161
+ #
162
+ # Get service runner.
163
+ #
164
+ # @param resource_group_name [String] The name of the resource group.
165
+ # @param lab_name [String] The name of the lab.
166
+ # @param name [String] The name of the service runner.
167
+ # @param [Hash{String => String}] A hash of custom headers that will be added
168
+ # to the HTTP request.
169
+ #
170
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
171
+ #
172
+ def get_async(resource_group_name, lab_name, name, custom_headers = nil)
173
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
174
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
175
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
176
+ fail ArgumentError, 'name is nil' if name.nil?
177
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
178
+
179
+
180
+ request_headers = {}
181
+
182
+ # Set Headers
183
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
184
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
185
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/servicerunners/{name}'
186
+
187
+ request_url = @base_url || @client.base_url
188
+
189
+ options = {
190
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
191
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
192
+ query_params: {'api-version' => @client.api_version},
193
+ headers: request_headers.merge(custom_headers || {}),
194
+ base_url: request_url
195
+ }
196
+ promise = @client.make_request_async(:get, path_template, options)
197
+
198
+ promise = promise.then do |result|
199
+ http_response = result.response
200
+ status_code = http_response.status
201
+ response_content = http_response.body
202
+ unless status_code == 200
203
+ error_model = JSON.load(response_content)
204
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
205
+ end
206
+
207
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
208
+ # Deserialize Response
209
+ if status_code == 200
210
+ begin
211
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
212
+ result_mapper = Azure::ARM::DevTestLabs::Models::ServiceRunner.mapper()
213
+ result.body = @client.deserialize(result_mapper, parsed_response)
214
+ rescue Exception => e
215
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
216
+ end
217
+ end
218
+
219
+ result
220
+ end
221
+
222
+ promise.execute
223
+ end
224
+
225
+ #
226
+ # Create or replace an existing Service runner.
227
+ #
228
+ # @param resource_group_name [String] The name of the resource group.
229
+ # @param lab_name [String] The name of the lab.
230
+ # @param name [String] The name of the service runner.
231
+ # @param service_runner [ServiceRunner] A container for a managed identity to
232
+ # execute DevTest lab services.
233
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
234
+ # will be added to the HTTP request.
235
+ #
236
+ # @return [ServiceRunner] operation results.
237
+ #
238
+ def create_or_update(resource_group_name, lab_name, name, service_runner, custom_headers = nil)
239
+ response = create_or_update_async(resource_group_name, lab_name, name, service_runner, custom_headers).value!
240
+ response.body unless response.nil?
241
+ end
242
+
243
+ #
244
+ # Create or replace an existing Service runner.
245
+ #
246
+ # @param resource_group_name [String] The name of the resource group.
247
+ # @param lab_name [String] The name of the lab.
248
+ # @param name [String] The name of the service runner.
249
+ # @param service_runner [ServiceRunner] A container for a managed identity to
250
+ # execute DevTest lab services.
251
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
252
+ # will be added to the HTTP request.
253
+ #
254
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
255
+ #
256
+ def create_or_update_with_http_info(resource_group_name, lab_name, name, service_runner, custom_headers = nil)
257
+ create_or_update_async(resource_group_name, lab_name, name, service_runner, custom_headers).value!
258
+ end
259
+
260
+ #
261
+ # Create or replace an existing Service runner.
262
+ #
263
+ # @param resource_group_name [String] The name of the resource group.
264
+ # @param lab_name [String] The name of the lab.
265
+ # @param name [String] The name of the service runner.
266
+ # @param service_runner [ServiceRunner] A container for a managed identity to
267
+ # execute DevTest lab services.
268
+ # @param [Hash{String => String}] A hash of custom headers that will be added
269
+ # to the HTTP request.
270
+ #
271
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
272
+ #
273
+ def create_or_update_async(resource_group_name, lab_name, name, service_runner, custom_headers = nil)
274
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
275
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
276
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
277
+ fail ArgumentError, 'name is nil' if name.nil?
278
+ fail ArgumentError, 'service_runner is nil' if service_runner.nil?
279
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
280
+
281
+
282
+ request_headers = {}
283
+
284
+ # Set Headers
285
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
286
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
287
+
288
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
289
+
290
+ # Serialize Request
291
+ request_mapper = Azure::ARM::DevTestLabs::Models::ServiceRunner.mapper()
292
+ request_content = @client.serialize(request_mapper, service_runner)
293
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
294
+
295
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/servicerunners/{name}'
296
+
297
+ request_url = @base_url || @client.base_url
298
+
299
+ options = {
300
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
301
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
302
+ query_params: {'api-version' => @client.api_version},
303
+ body: request_content,
304
+ headers: request_headers.merge(custom_headers || {}),
305
+ base_url: request_url
306
+ }
307
+ promise = @client.make_request_async(:put, path_template, options)
308
+
309
+ promise = promise.then do |result|
310
+ http_response = result.response
311
+ status_code = http_response.status
312
+ response_content = http_response.body
313
+ unless status_code == 200 || status_code == 201
314
+ error_model = JSON.load(response_content)
315
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
316
+ end
317
+
318
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
319
+ # Deserialize Response
320
+ if status_code == 200
321
+ begin
322
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
323
+ result_mapper = Azure::ARM::DevTestLabs::Models::ServiceRunner.mapper()
324
+ result.body = @client.deserialize(result_mapper, parsed_response)
325
+ rescue Exception => e
326
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
327
+ end
328
+ end
329
+ # Deserialize Response
330
+ if status_code == 201
331
+ begin
332
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
333
+ result_mapper = Azure::ARM::DevTestLabs::Models::ServiceRunner.mapper()
334
+ result.body = @client.deserialize(result_mapper, parsed_response)
335
+ rescue Exception => e
336
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
337
+ end
338
+ end
339
+
340
+ result
341
+ end
342
+
343
+ promise.execute
344
+ end
345
+
346
+ #
347
+ # Delete service runner.
348
+ #
349
+ # @param resource_group_name [String] The name of the resource group.
350
+ # @param lab_name [String] The name of the lab.
351
+ # @param name [String] The name of the service runner.
352
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
353
+ # will be added to the HTTP request.
354
+ #
355
+ #
356
+ def delete(resource_group_name, lab_name, name, custom_headers = nil)
357
+ response = delete_async(resource_group_name, lab_name, name, custom_headers).value!
358
+ nil
359
+ end
360
+
361
+ #
362
+ # Delete service runner.
363
+ #
364
+ # @param resource_group_name [String] The name of the resource group.
365
+ # @param lab_name [String] The name of the lab.
366
+ # @param name [String] The name of the service runner.
367
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
368
+ # will be added to the HTTP request.
369
+ #
370
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
371
+ #
372
+ def delete_with_http_info(resource_group_name, lab_name, name, custom_headers = nil)
373
+ delete_async(resource_group_name, lab_name, name, custom_headers).value!
374
+ end
375
+
376
+ #
377
+ # Delete service runner.
378
+ #
379
+ # @param resource_group_name [String] The name of the resource group.
380
+ # @param lab_name [String] The name of the lab.
381
+ # @param name [String] The name of the service runner.
382
+ # @param [Hash{String => String}] A hash of custom headers that will be added
383
+ # to the HTTP request.
384
+ #
385
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
386
+ #
387
+ def delete_async(resource_group_name, lab_name, name, custom_headers = nil)
388
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
389
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
390
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
391
+ fail ArgumentError, 'name is nil' if name.nil?
392
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
393
+
394
+
395
+ request_headers = {}
396
+
397
+ # Set Headers
398
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
399
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
400
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/servicerunners/{name}'
401
+
402
+ request_url = @base_url || @client.base_url
403
+
404
+ options = {
405
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
406
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'name' => name},
407
+ query_params: {'api-version' => @client.api_version},
408
+ headers: request_headers.merge(custom_headers || {}),
409
+ base_url: request_url
410
+ }
411
+ promise = @client.make_request_async(:delete, path_template, options)
412
+
413
+ promise = promise.then do |result|
414
+ http_response = result.response
415
+ status_code = http_response.status
416
+ response_content = http_response.body
417
+ unless status_code == 200 || status_code == 204
418
+ error_model = JSON.load(response_content)
419
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
420
+ end
421
+
422
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
423
+
424
+ result
425
+ end
426
+
427
+ promise.execute
428
+ end
429
+
430
+ #
431
+ # List service runners in a given lab.
432
+ #
433
+ # @param next_page_link [String] The NextLink from the previous successful call
434
+ # to List operation.
435
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
436
+ # will be added to the HTTP request.
437
+ #
438
+ # @return [ResponseWithContinuationServiceRunner] operation results.
439
+ #
440
+ def list_next(next_page_link, custom_headers = nil)
441
+ response = list_next_async(next_page_link, custom_headers).value!
442
+ response.body unless response.nil?
443
+ end
444
+
445
+ #
446
+ # List service runners in a given lab.
447
+ #
448
+ # @param next_page_link [String] The NextLink from the previous successful call
449
+ # to List operation.
450
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
451
+ # will be added to the HTTP request.
452
+ #
453
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
454
+ #
455
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
456
+ list_next_async(next_page_link, custom_headers).value!
457
+ end
458
+
459
+ #
460
+ # List service runners in a given lab.
461
+ #
462
+ # @param next_page_link [String] The NextLink from the previous successful call
463
+ # to List operation.
464
+ # @param [Hash{String => String}] A hash of custom headers that will be added
465
+ # to the HTTP request.
466
+ #
467
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
468
+ #
469
+ def list_next_async(next_page_link, custom_headers = nil)
470
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
471
+
472
+
473
+ request_headers = {}
474
+
475
+ # Set Headers
476
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
477
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
478
+ path_template = '{nextLink}'
479
+
480
+ request_url = @base_url || @client.base_url
481
+
482
+ options = {
483
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
484
+ skip_encoding_path_params: {'nextLink' => next_page_link},
485
+ headers: request_headers.merge(custom_headers || {}),
486
+ base_url: request_url
487
+ }
488
+ promise = @client.make_request_async(:get, path_template, options)
489
+
490
+ promise = promise.then do |result|
491
+ http_response = result.response
492
+ status_code = http_response.status
493
+ response_content = http_response.body
494
+ unless status_code == 200
495
+ error_model = JSON.load(response_content)
496
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
497
+ end
498
+
499
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
500
+ # Deserialize Response
501
+ if status_code == 200
502
+ begin
503
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
504
+ result_mapper = Azure::ARM::DevTestLabs::Models::ResponseWithContinuationServiceRunner.mapper()
505
+ result.body = @client.deserialize(result_mapper, parsed_response)
506
+ rescue Exception => e
507
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
508
+ end
509
+ end
510
+
511
+ result
512
+ end
513
+
514
+ promise.execute
515
+ end
516
+
517
+ #
518
+ # List service runners in a given lab.
519
+ #
520
+ # @param resource_group_name [String] The name of the resource group.
521
+ # @param lab_name [String] The name of the lab.
522
+ # @param filter [String] The filter to apply to the operation.
523
+ # @param top [Integer] The maximum number of resources to return from the
524
+ # operation.
525
+ # @param orderby [String] The ordering expression for the results, using OData
526
+ # notation.
527
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
528
+ # will be added to the HTTP request.
529
+ #
530
+ # @return [ResponseWithContinuationServiceRunner] which provide lazy access to
531
+ # pages of the response.
532
+ #
533
+ def list_as_lazy(resource_group_name, lab_name, filter = nil, top = nil, orderby = nil, custom_headers = nil)
534
+ response = list_async(resource_group_name, lab_name, filter, top, orderby, custom_headers).value!
535
+ unless response.nil?
536
+ page = response.body
537
+ page.next_method = Proc.new do |next_page_link|
538
+ list_next_async(next_page_link, custom_headers)
539
+ end
540
+ page
541
+ end
542
+ end
543
+
544
+ end
545
+ end