azure_mgmt_devtestlabs 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/LICENSE.txt +21 -0
  4. data/Rakefile +5 -0
  5. data/azure_mgmt_devtestlabs.gemspec +34 -0
  6. data/lib/azure_mgmt_devtestlabs.rb +5 -0
  7. data/lib/generated/azure_mgmt_devtestlabs.rb +103 -0
  8. data/lib/generated/azure_mgmt_devtestlabs/artifact_operations.rb +477 -0
  9. data/lib/generated/azure_mgmt_devtestlabs/artifact_source_operations.rb +669 -0
  10. data/lib/generated/azure_mgmt_devtestlabs/cost_operations.rb +124 -0
  11. data/lib/generated/azure_mgmt_devtestlabs/custom_image_operations.rb +648 -0
  12. data/lib/generated/azure_mgmt_devtestlabs/dev_test_labs_client.rb +110 -0
  13. data/lib/generated/azure_mgmt_devtestlabs/formula_operations.rb +608 -0
  14. data/lib/generated/azure_mgmt_devtestlabs/gallery_image_operations.rb +252 -0
  15. data/lib/generated/azure_mgmt_devtestlabs/lab_operations.rb +1403 -0
  16. data/lib/generated/azure_mgmt_devtestlabs/models/apply_artifacts_request.rb +53 -0
  17. data/lib/generated/azure_mgmt_devtestlabs/models/arm_template_info.rb +54 -0
  18. data/lib/generated/azure_mgmt_devtestlabs/models/artifact.rb +151 -0
  19. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties.rb +66 -0
  20. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_install_properties.rb +63 -0
  21. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties.rb +54 -0
  22. data/lib/generated/azure_mgmt_devtestlabs/models/artifact_source.rb +183 -0
  23. data/lib/generated/azure_mgmt_devtestlabs/models/cost.rb +139 -0
  24. data/lib/generated/azure_mgmt_devtestlabs/models/cost_per_day_properties.rb +65 -0
  25. data/lib/generated/azure_mgmt_devtestlabs/models/custom_image.rb +164 -0
  26. data/lib/generated/azure_mgmt_devtestlabs/models/custom_image_os_type.rb +17 -0
  27. data/lib/generated/azure_mgmt_devtestlabs/models/custom_image_properties_custom.rb +65 -0
  28. data/lib/generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_vm.rb +66 -0
  29. data/lib/generated/azure_mgmt_devtestlabs/models/day_details.rb +44 -0
  30. data/lib/generated/azure_mgmt_devtestlabs/models/enable_status.rb +16 -0
  31. data/lib/generated/azure_mgmt_devtestlabs/models/evaluate_policies_properties.rb +64 -0
  32. data/lib/generated/azure_mgmt_devtestlabs/models/evaluate_policies_request.rb +52 -0
  33. data/lib/generated/azure_mgmt_devtestlabs/models/evaluate_policies_response.rb +52 -0
  34. data/lib/generated/azure_mgmt_devtestlabs/models/formula.rb +174 -0
  35. data/lib/generated/azure_mgmt_devtestlabs/models/formula_properties_from_vm.rb +45 -0
  36. data/lib/generated/azure_mgmt_devtestlabs/models/gallery_image.rb +153 -0
  37. data/lib/generated/azure_mgmt_devtestlabs/models/gallery_image_reference.rb +84 -0
  38. data/lib/generated/azure_mgmt_devtestlabs/models/generate_arm_template_request.rb +72 -0
  39. data/lib/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_parameter.rb +44 -0
  40. data/lib/generated/azure_mgmt_devtestlabs/models/generate_upload_uri_response.rb +44 -0
  41. data/lib/generated/azure_mgmt_devtestlabs/models/hour_details.rb +44 -0
  42. data/lib/generated/azure_mgmt_devtestlabs/models/lab.rb +162 -0
  43. data/lib/generated/azure_mgmt_devtestlabs/models/lab_cost_type.rb +17 -0
  44. data/lib/generated/azure_mgmt_devtestlabs/models/lab_storage_type.rb +16 -0
  45. data/lib/generated/azure_mgmt_devtestlabs/models/lab_vhd.rb +44 -0
  46. data/lib/generated/azure_mgmt_devtestlabs/models/lab_virtual_machine.rb +321 -0
  47. data/lib/generated/azure_mgmt_devtestlabs/models/linux_os_info.rb +46 -0
  48. data/lib/generated/azure_mgmt_devtestlabs/models/linux_os_state.rb +17 -0
  49. data/lib/generated/azure_mgmt_devtestlabs/models/parameter_info.rb +54 -0
  50. data/lib/generated/azure_mgmt_devtestlabs/models/policy.rb +175 -0
  51. data/lib/generated/azure_mgmt_devtestlabs/models/policy_evaluator_type.rb +16 -0
  52. data/lib/generated/azure_mgmt_devtestlabs/models/policy_fact_name.rb +19 -0
  53. data/lib/generated/azure_mgmt_devtestlabs/models/policy_set_result.rb +63 -0
  54. data/lib/generated/azure_mgmt_devtestlabs/models/policy_status.rb +16 -0
  55. data/lib/generated/azure_mgmt_devtestlabs/models/policy_violation.rb +54 -0
  56. data/lib/generated/azure_mgmt_devtestlabs/models/resource_cost_properties.rb +106 -0
  57. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_artifact.rb +93 -0
  58. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_artifact_source.rb +94 -0
  59. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_custom_image.rb +93 -0
  60. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_formula.rb +93 -0
  61. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_gallery_image.rb +93 -0
  62. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab.rb +93 -0
  63. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab_vhd.rb +93 -0
  64. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab_virtual_machine.rb +95 -0
  65. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_policy.rb +93 -0
  66. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_schedule.rb +93 -0
  67. data/lib/generated/azure_mgmt_devtestlabs/models/response_with_continuation_virtual_network.rb +94 -0
  68. data/lib/generated/azure_mgmt_devtestlabs/models/schedule.rb +175 -0
  69. data/lib/generated/azure_mgmt_devtestlabs/models/source_control_type.rb +16 -0
  70. data/lib/generated/azure_mgmt_devtestlabs/models/subnet.rb +65 -0
  71. data/lib/generated/azure_mgmt_devtestlabs/models/subnet_override.rb +78 -0
  72. data/lib/generated/azure_mgmt_devtestlabs/models/subscription_notification.rb +67 -0
  73. data/lib/generated/azure_mgmt_devtestlabs/models/subscription_notification_properties.rb +44 -0
  74. data/lib/generated/azure_mgmt_devtestlabs/models/subscription_notification_state.rb +20 -0
  75. data/lib/generated/azure_mgmt_devtestlabs/models/usage_permission_type.rb +17 -0
  76. data/lib/generated/azure_mgmt_devtestlabs/models/virtual_network.rb +169 -0
  77. data/lib/generated/azure_mgmt_devtestlabs/models/week_details.rb +61 -0
  78. data/lib/generated/azure_mgmt_devtestlabs/models/windows_os_info.rb +45 -0
  79. data/lib/generated/azure_mgmt_devtestlabs/models/windows_os_state.rb +17 -0
  80. data/lib/generated/azure_mgmt_devtestlabs/module_definition.rb +8 -0
  81. data/lib/generated/azure_mgmt_devtestlabs/policy_operations.rb +690 -0
  82. data/lib/generated/azure_mgmt_devtestlabs/policy_set.rb +137 -0
  83. data/lib/generated/azure_mgmt_devtestlabs/schedule_operations.rb +796 -0
  84. data/lib/generated/azure_mgmt_devtestlabs/version.rb +8 -0
  85. data/lib/generated/azure_mgmt_devtestlabs/virtual_machine.rb +1155 -0
  86. data/lib/generated/azure_mgmt_devtestlabs/virtual_network_operations.rb +759 -0
  87. metadata +199 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 57685bf23c6c76b797052bfbb41ea1012390462d
4
+ data.tar.gz: a395dbe5b5fe2341f4ba6fbd2a55a6aa9a4bc7bc
5
+ SHA512:
6
+ metadata.gz: 6ea7d973aeb228b336e2ad2b47b74874ef51b55449850594108ccb312fa5ebc789c9ff3e5b7d3db9012137476062b2dabee8239221db7357e424fdeb340d6468
7
+ data.tar.gz: 40fcc543c83915ca5a0c6b138e54f74ee42e1f2b83e942fc38e58bf4fca222a949289422f56d6f33406ed7e98b4d6773505e6b36cea1b78579a3cbde7787aefc
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --require spec_helper
2
+ --color
3
+ --format documentation
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Microsoft Corporation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,5 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+
5
+ require "bundler/gem_tasks"
@@ -0,0 +1,34 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+
5
+ lib = File.expand_path('../lib', __FILE__)
6
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
7
+
8
+ require 'generated/azure_mgmt_devtestlabs/module_definition'
9
+ require 'generated/azure_mgmt_devtestlabs/version'
10
+
11
+ Gem::Specification.new do |spec|
12
+ spec.name = 'azure_mgmt_devtestlabs'
13
+ spec.version = Azure::ARM::DevTestLabs::VERSION
14
+ spec.authors = 'Microsoft Corporation'
15
+ spec.email = 'azrubyteam@microsoft.com'
16
+ spec.description = 'Microsoft Azure Dev Test Lab Management Client Library for Ruby'
17
+ spec.summary = 'Official Ruby client library to consume Microsoft Azure Dev Test Labs Management services.'
18
+ spec.homepage = 'https://aka.ms/azure-sdk-for-ruby'
19
+ spec.license = 'MIT'
20
+
21
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
+ spec.bindir = 'bin'
23
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
+ spec.require_paths = ['lib']
25
+
26
+ spec.required_ruby_version = '>= 1.9.3'
27
+
28
+ spec.add_development_dependency 'bundler', '~> 1.9'
29
+ spec.add_development_dependency 'rake', '~> 10'
30
+ spec.add_development_dependency 'rspec', '~> 3'
31
+ spec.add_development_dependency 'dotenv', '~> 2'
32
+
33
+ spec.add_runtime_dependency 'ms_rest_azure', '~> 0.3.0'
34
+ end
@@ -0,0 +1,5 @@
1
+ # encoding: utf-8
2
+ # Copyright (c) Microsoft Corporation. All rights reserved.
3
+ # Licensed under the MIT License. See License.txt in the project root for license information.
4
+
5
+ require 'generated/azure_mgmt_devtestlabs'
@@ -0,0 +1,103 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.0
3
+ # Changes may cause incorrect behavior and will be lost if the code is
4
+ # regenerated.
5
+
6
+ require 'uri'
7
+ require 'cgi'
8
+ require 'date'
9
+ require 'json'
10
+ require 'base64'
11
+ require 'erb'
12
+ require 'securerandom'
13
+ require 'time'
14
+ require 'timeliness'
15
+ require 'faraday'
16
+ require 'faraday-cookie_jar'
17
+ require 'concurrent'
18
+ require 'ms_rest'
19
+ require 'generated/azure_mgmt_devtestlabs/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::ARM::DevTestLabs
23
+ autoload :LabOperations, 'generated/azure_mgmt_devtestlabs/lab_operations.rb'
24
+ autoload :ArtifactSourceOperations, 'generated/azure_mgmt_devtestlabs/artifact_source_operations.rb'
25
+ autoload :ArtifactOperations, 'generated/azure_mgmt_devtestlabs/artifact_operations.rb'
26
+ autoload :CostOperations, 'generated/azure_mgmt_devtestlabs/cost_operations.rb'
27
+ autoload :CustomImageOperations, 'generated/azure_mgmt_devtestlabs/custom_image_operations.rb'
28
+ autoload :FormulaOperations, 'generated/azure_mgmt_devtestlabs/formula_operations.rb'
29
+ autoload :GalleryImageOperations, 'generated/azure_mgmt_devtestlabs/gallery_image_operations.rb'
30
+ autoload :PolicySet, 'generated/azure_mgmt_devtestlabs/policy_set.rb'
31
+ autoload :PolicyOperations, 'generated/azure_mgmt_devtestlabs/policy_operations.rb'
32
+ autoload :ScheduleOperations, 'generated/azure_mgmt_devtestlabs/schedule_operations.rb'
33
+ autoload :VirtualMachine, 'generated/azure_mgmt_devtestlabs/virtual_machine.rb'
34
+ autoload :VirtualNetworkOperations, 'generated/azure_mgmt_devtestlabs/virtual_network_operations.rb'
35
+ autoload :DevTestLabsClient, 'generated/azure_mgmt_devtestlabs/dev_test_labs_client.rb'
36
+
37
+ module Models
38
+ autoload :ApplyArtifactsRequest, 'generated/azure_mgmt_devtestlabs/models/apply_artifacts_request.rb'
39
+ autoload :ArtifactInstallProperties, 'generated/azure_mgmt_devtestlabs/models/artifact_install_properties.rb'
40
+ autoload :ArtifactParameterProperties, 'generated/azure_mgmt_devtestlabs/models/artifact_parameter_properties.rb'
41
+ autoload :ArmTemplateInfo, 'generated/azure_mgmt_devtestlabs/models/arm_template_info.rb'
42
+ autoload :Artifact, 'generated/azure_mgmt_devtestlabs/models/artifact.rb'
43
+ autoload :ArtifactDeploymentStatusProperties, 'generated/azure_mgmt_devtestlabs/models/artifact_deployment_status_properties.rb'
44
+ autoload :ArtifactSource, 'generated/azure_mgmt_devtestlabs/models/artifact_source.rb'
45
+ autoload :Cost, 'generated/azure_mgmt_devtestlabs/models/cost.rb'
46
+ autoload :CostPerDayProperties, 'generated/azure_mgmt_devtestlabs/models/cost_per_day_properties.rb'
47
+ autoload :ResourceCostProperties, 'generated/azure_mgmt_devtestlabs/models/resource_cost_properties.rb'
48
+ autoload :CustomImage, 'generated/azure_mgmt_devtestlabs/models/custom_image.rb'
49
+ autoload :CustomImagePropertiesFromVm, 'generated/azure_mgmt_devtestlabs/models/custom_image_properties_from_vm.rb'
50
+ autoload :WindowsOsInfo, 'generated/azure_mgmt_devtestlabs/models/windows_os_info.rb'
51
+ autoload :LinuxOsInfo, 'generated/azure_mgmt_devtestlabs/models/linux_os_info.rb'
52
+ autoload :CustomImagePropertiesCustom, 'generated/azure_mgmt_devtestlabs/models/custom_image_properties_custom.rb'
53
+ autoload :DayDetails, 'generated/azure_mgmt_devtestlabs/models/day_details.rb'
54
+ autoload :EvaluatePoliciesProperties, 'generated/azure_mgmt_devtestlabs/models/evaluate_policies_properties.rb'
55
+ autoload :EvaluatePoliciesRequest, 'generated/azure_mgmt_devtestlabs/models/evaluate_policies_request.rb'
56
+ autoload :EvaluatePoliciesResponse, 'generated/azure_mgmt_devtestlabs/models/evaluate_policies_response.rb'
57
+ autoload :PolicySetResult, 'generated/azure_mgmt_devtestlabs/models/policy_set_result.rb'
58
+ autoload :PolicyViolation, 'generated/azure_mgmt_devtestlabs/models/policy_violation.rb'
59
+ autoload :Formula, 'generated/azure_mgmt_devtestlabs/models/formula.rb'
60
+ autoload :LabVirtualMachine, 'generated/azure_mgmt_devtestlabs/models/lab_virtual_machine.rb'
61
+ autoload :GalleryImageReference, 'generated/azure_mgmt_devtestlabs/models/gallery_image_reference.rb'
62
+ autoload :FormulaPropertiesFromVm, 'generated/azure_mgmt_devtestlabs/models/formula_properties_from_vm.rb'
63
+ autoload :GalleryImage, 'generated/azure_mgmt_devtestlabs/models/gallery_image.rb'
64
+ autoload :GenerateArmTemplateRequest, 'generated/azure_mgmt_devtestlabs/models/generate_arm_template_request.rb'
65
+ autoload :ParameterInfo, 'generated/azure_mgmt_devtestlabs/models/parameter_info.rb'
66
+ autoload :GenerateUploadUriParameter, 'generated/azure_mgmt_devtestlabs/models/generate_upload_uri_parameter.rb'
67
+ autoload :GenerateUploadUriResponse, 'generated/azure_mgmt_devtestlabs/models/generate_upload_uri_response.rb'
68
+ autoload :HourDetails, 'generated/azure_mgmt_devtestlabs/models/hour_details.rb'
69
+ autoload :Lab, 'generated/azure_mgmt_devtestlabs/models/lab.rb'
70
+ autoload :LabVhd, 'generated/azure_mgmt_devtestlabs/models/lab_vhd.rb'
71
+ autoload :Policy, 'generated/azure_mgmt_devtestlabs/models/policy.rb'
72
+ autoload :ResponseWithContinuationArtifact, 'generated/azure_mgmt_devtestlabs/models/response_with_continuation_artifact.rb'
73
+ autoload :ResponseWithContinuationArtifactSource, 'generated/azure_mgmt_devtestlabs/models/response_with_continuation_artifact_source.rb'
74
+ autoload :ResponseWithContinuationCustomImage, 'generated/azure_mgmt_devtestlabs/models/response_with_continuation_custom_image.rb'
75
+ autoload :ResponseWithContinuationFormula, 'generated/azure_mgmt_devtestlabs/models/response_with_continuation_formula.rb'
76
+ autoload :ResponseWithContinuationGalleryImage, 'generated/azure_mgmt_devtestlabs/models/response_with_continuation_gallery_image.rb'
77
+ autoload :ResponseWithContinuationLab, 'generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab.rb'
78
+ autoload :ResponseWithContinuationLabVhd, 'generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab_vhd.rb'
79
+ autoload :ResponseWithContinuationLabVirtualMachine, 'generated/azure_mgmt_devtestlabs/models/response_with_continuation_lab_virtual_machine.rb'
80
+ autoload :ResponseWithContinuationPolicy, 'generated/azure_mgmt_devtestlabs/models/response_with_continuation_policy.rb'
81
+ autoload :ResponseWithContinuationSchedule, 'generated/azure_mgmt_devtestlabs/models/response_with_continuation_schedule.rb'
82
+ autoload :Schedule, 'generated/azure_mgmt_devtestlabs/models/schedule.rb'
83
+ autoload :WeekDetails, 'generated/azure_mgmt_devtestlabs/models/week_details.rb'
84
+ autoload :ResponseWithContinuationVirtualNetwork, 'generated/azure_mgmt_devtestlabs/models/response_with_continuation_virtual_network.rb'
85
+ autoload :VirtualNetwork, 'generated/azure_mgmt_devtestlabs/models/virtual_network.rb'
86
+ autoload :Subnet, 'generated/azure_mgmt_devtestlabs/models/subnet.rb'
87
+ autoload :SubnetOverride, 'generated/azure_mgmt_devtestlabs/models/subnet_override.rb'
88
+ autoload :SubscriptionNotification, 'generated/azure_mgmt_devtestlabs/models/subscription_notification.rb'
89
+ autoload :SubscriptionNotificationProperties, 'generated/azure_mgmt_devtestlabs/models/subscription_notification_properties.rb'
90
+ autoload :SourceControlType, 'generated/azure_mgmt_devtestlabs/models/source_control_type.rb'
91
+ autoload :EnableStatus, 'generated/azure_mgmt_devtestlabs/models/enable_status.rb'
92
+ autoload :LabCostType, 'generated/azure_mgmt_devtestlabs/models/lab_cost_type.rb'
93
+ autoload :WindowsOsState, 'generated/azure_mgmt_devtestlabs/models/windows_os_state.rb'
94
+ autoload :LinuxOsState, 'generated/azure_mgmt_devtestlabs/models/linux_os_state.rb'
95
+ autoload :CustomImageOsType, 'generated/azure_mgmt_devtestlabs/models/custom_image_os_type.rb'
96
+ autoload :LabStorageType, 'generated/azure_mgmt_devtestlabs/models/lab_storage_type.rb'
97
+ autoload :PolicyStatus, 'generated/azure_mgmt_devtestlabs/models/policy_status.rb'
98
+ autoload :PolicyFactName, 'generated/azure_mgmt_devtestlabs/models/policy_fact_name.rb'
99
+ autoload :PolicyEvaluatorType, 'generated/azure_mgmt_devtestlabs/models/policy_evaluator_type.rb'
100
+ autoload :UsagePermissionType, 'generated/azure_mgmt_devtestlabs/models/usage_permission_type.rb'
101
+ autoload :SubscriptionNotificationState, 'generated/azure_mgmt_devtestlabs/models/subscription_notification_state.rb'
102
+ end
103
+ end
@@ -0,0 +1,477 @@
1
+ # encoding: utf-8
2
+ # Code generated by Microsoft (R) AutoRest Code Generator 0.17.0.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 ArtifactOperations
11
+ include Azure::ARM::DevTestLabs::Models
12
+ include MsRestAzure
13
+
14
+ #
15
+ # Creates and initializes a new instance of the ArtifactOperations class.
16
+ # @param client service class for accessing basic functionality.
17
+ #
18
+ def initialize(client)
19
+ @client = client
20
+ end
21
+
22
+ # @return reference to the DevTestLabsClient
23
+ attr_reader :client
24
+
25
+ #
26
+ # List artifacts in a given artifact source.
27
+ #
28
+ # @param resource_group_name [String] The name of the resource group.
29
+ # @param lab_name [String] The name of the lab.
30
+ # @param artifact_source_name [String] The name of the artifact source.
31
+ # @param filter [String] The filter to apply on the operation.
32
+ # @param top [Integer] The maximum number of resources to return from the
33
+ # operation.
34
+ # @param order_by [String] The ordering expression for the results, using
35
+ # OData notation.
36
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
37
+ # will be added to the HTTP request.
38
+ #
39
+ # @return [ResponseWithContinuationArtifact] which provide lazy access to
40
+ # pages of the response.
41
+ #
42
+ def list_as_lazy(resource_group_name, lab_name, artifact_source_name, filter = nil, top = nil, order_by = nil, custom_headers = nil)
43
+ response = list_async(resource_group_name, lab_name, artifact_source_name, filter, top, order_by, custom_headers).value!
44
+ unless response.nil?
45
+ page = response.body
46
+ page.next_method = Proc.new do |next_link|
47
+ list_next_async(next_link, custom_headers)
48
+ end
49
+ page
50
+ end
51
+ end
52
+
53
+ #
54
+ # List artifacts in a given artifact source.
55
+ #
56
+ # @param resource_group_name [String] The name of the resource group.
57
+ # @param lab_name [String] The name of the lab.
58
+ # @param artifact_source_name [String] The name of the artifact source.
59
+ # @param filter [String] The filter to apply on the operation.
60
+ # @param top [Integer] The maximum number of resources to return from the
61
+ # operation.
62
+ # @param order_by [String] The ordering expression for the results, using
63
+ # OData notation.
64
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
65
+ # will be added to the HTTP request.
66
+ #
67
+ # @return [Array<Artifact>] operation results.
68
+ #
69
+ def list(resource_group_name, lab_name, artifact_source_name, filter = nil, top = nil, order_by = nil, custom_headers = nil)
70
+ first_page = list_as_lazy(resource_group_name, lab_name, artifact_source_name, filter, top, order_by, custom_headers)
71
+ first_page.get_all_items
72
+ end
73
+
74
+ #
75
+ # List artifacts in a given artifact source.
76
+ #
77
+ # @param resource_group_name [String] The name of the resource group.
78
+ # @param lab_name [String] The name of the lab.
79
+ # @param artifact_source_name [String] The name of the artifact source.
80
+ # @param filter [String] The filter to apply on the operation.
81
+ # @param top [Integer] The maximum number of resources to return from the
82
+ # operation.
83
+ # @param order_by [String] The ordering expression for the results, using
84
+ # OData notation.
85
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
86
+ # will be added to the HTTP request.
87
+ #
88
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
89
+ #
90
+ def list_with_http_info(resource_group_name, lab_name, artifact_source_name, filter = nil, top = nil, order_by = nil, custom_headers = nil)
91
+ list_async(resource_group_name, lab_name, artifact_source_name, filter, top, order_by, custom_headers).value!
92
+ end
93
+
94
+ #
95
+ # List artifacts in a given artifact source.
96
+ #
97
+ # @param resource_group_name [String] The name of the resource group.
98
+ # @param lab_name [String] The name of the lab.
99
+ # @param artifact_source_name [String] The name of the artifact source.
100
+ # @param filter [String] The filter to apply on the operation.
101
+ # @param top [Integer] The maximum number of resources to return from the
102
+ # operation.
103
+ # @param order_by [String] The ordering expression for the results, using
104
+ # OData notation.
105
+ # @param [Hash{String => String}] A hash of custom headers that will be added
106
+ # to the HTTP request.
107
+ #
108
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
109
+ #
110
+ def list_async(resource_group_name, lab_name, artifact_source_name, filter = nil, top = nil, order_by = nil, custom_headers = nil)
111
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
112
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
113
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
114
+ fail ArgumentError, 'artifact_source_name is nil' if artifact_source_name.nil?
115
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
116
+
117
+
118
+ request_headers = {}
119
+
120
+ # Set Headers
121
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
122
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
123
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts'
124
+ options = {
125
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
126
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'artifactSourceName' => artifact_source_name},
127
+ query_params: {'$filter' => filter,'$top' => top,'$orderBy' => order_by,'api-version' => @client.api_version},
128
+ headers: request_headers.merge(custom_headers || {})
129
+ }
130
+
131
+ request_url = @base_url || @client.base_url
132
+
133
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
134
+ promise = request.run_promise do |req|
135
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
136
+ end
137
+
138
+ promise = promise.then do |http_response|
139
+ status_code = http_response.status
140
+ response_content = http_response.body
141
+ unless status_code == 200
142
+ error_model = JSON.load(response_content)
143
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
144
+ end
145
+
146
+ # Create Result
147
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
148
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
149
+ # Deserialize Response
150
+ if status_code == 200
151
+ begin
152
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
153
+ result_mapper = ResponseWithContinuationArtifact.mapper()
154
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
155
+ rescue Exception => e
156
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
157
+ end
158
+ end
159
+
160
+ result
161
+ end
162
+
163
+ promise.execute
164
+ end
165
+
166
+ #
167
+ # Get artifact.
168
+ #
169
+ # @param resource_group_name [String] The name of the resource group.
170
+ # @param lab_name [String] The name of the lab.
171
+ # @param artifact_source_name [String] The name of the artifact source.
172
+ # @param name [String] The name of the artifact.
173
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
174
+ # will be added to the HTTP request.
175
+ #
176
+ # @return [Artifact] operation results.
177
+ #
178
+ def get_resource(resource_group_name, lab_name, artifact_source_name, name, custom_headers = nil)
179
+ response = get_resource_async(resource_group_name, lab_name, artifact_source_name, name, custom_headers).value!
180
+ response.body unless response.nil?
181
+ end
182
+
183
+ #
184
+ # Get artifact.
185
+ #
186
+ # @param resource_group_name [String] The name of the resource group.
187
+ # @param lab_name [String] The name of the lab.
188
+ # @param artifact_source_name [String] The name of the artifact source.
189
+ # @param name [String] The name of the artifact.
190
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
191
+ # will be added to the HTTP request.
192
+ #
193
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
194
+ #
195
+ def get_resource_with_http_info(resource_group_name, lab_name, artifact_source_name, name, custom_headers = nil)
196
+ get_resource_async(resource_group_name, lab_name, artifact_source_name, name, custom_headers).value!
197
+ end
198
+
199
+ #
200
+ # Get artifact.
201
+ #
202
+ # @param resource_group_name [String] The name of the resource group.
203
+ # @param lab_name [String] The name of the lab.
204
+ # @param artifact_source_name [String] The name of the artifact source.
205
+ # @param name [String] The name of the artifact.
206
+ # @param [Hash{String => String}] A hash of custom headers that will be added
207
+ # to the HTTP request.
208
+ #
209
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
210
+ #
211
+ def get_resource_async(resource_group_name, lab_name, artifact_source_name, name, custom_headers = nil)
212
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
213
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
214
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
215
+ fail ArgumentError, 'artifact_source_name is nil' if artifact_source_name.nil?
216
+ fail ArgumentError, 'name is nil' if name.nil?
217
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
218
+
219
+
220
+ request_headers = {}
221
+
222
+ # Set Headers
223
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
224
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
225
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts/{name}'
226
+ options = {
227
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
228
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'artifactSourceName' => artifact_source_name,'name' => name},
229
+ query_params: {'api-version' => @client.api_version},
230
+ headers: request_headers.merge(custom_headers || {})
231
+ }
232
+
233
+ request_url = @base_url || @client.base_url
234
+
235
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
236
+ promise = request.run_promise do |req|
237
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
238
+ end
239
+
240
+ promise = promise.then do |http_response|
241
+ status_code = http_response.status
242
+ response_content = http_response.body
243
+ unless status_code == 200
244
+ error_model = JSON.load(response_content)
245
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
246
+ end
247
+
248
+ # Create Result
249
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
250
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
251
+ # Deserialize Response
252
+ if status_code == 200
253
+ begin
254
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
255
+ result_mapper = Artifact.mapper()
256
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
257
+ rescue Exception => e
258
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
259
+ end
260
+ end
261
+
262
+ result
263
+ end
264
+
265
+ promise.execute
266
+ end
267
+
268
+ #
269
+ # Generates an ARM template for the given artifact, uploads the required files
270
+ # to a storage account, and validates the generated artifact.
271
+ #
272
+ # @param resource_group_name [String] The name of the resource group.
273
+ # @param lab_name [String] The name of the lab.
274
+ # @param artifact_source_name [String] The name of the artifact source.
275
+ # @param name [String] The name of the artifact.
276
+ # @param generate_arm_template_request [GenerateArmTemplateRequest]
277
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
278
+ # will be added to the HTTP request.
279
+ #
280
+ # @return [ArmTemplateInfo] operation results.
281
+ #
282
+ def generate_arm_template(resource_group_name, lab_name, artifact_source_name, name, generate_arm_template_request, custom_headers = nil)
283
+ response = generate_arm_template_async(resource_group_name, lab_name, artifact_source_name, name, generate_arm_template_request, custom_headers).value!
284
+ response.body unless response.nil?
285
+ end
286
+
287
+ #
288
+ # Generates an ARM template for the given artifact, uploads the required files
289
+ # to a storage account, and validates the generated artifact.
290
+ #
291
+ # @param resource_group_name [String] The name of the resource group.
292
+ # @param lab_name [String] The name of the lab.
293
+ # @param artifact_source_name [String] The name of the artifact source.
294
+ # @param name [String] The name of the artifact.
295
+ # @param generate_arm_template_request [GenerateArmTemplateRequest]
296
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
297
+ # will be added to the HTTP request.
298
+ #
299
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
300
+ #
301
+ def generate_arm_template_with_http_info(resource_group_name, lab_name, artifact_source_name, name, generate_arm_template_request, custom_headers = nil)
302
+ generate_arm_template_async(resource_group_name, lab_name, artifact_source_name, name, generate_arm_template_request, custom_headers).value!
303
+ end
304
+
305
+ #
306
+ # Generates an ARM template for the given artifact, uploads the required files
307
+ # to a storage account, and validates the generated artifact.
308
+ #
309
+ # @param resource_group_name [String] The name of the resource group.
310
+ # @param lab_name [String] The name of the lab.
311
+ # @param artifact_source_name [String] The name of the artifact source.
312
+ # @param name [String] The name of the artifact.
313
+ # @param generate_arm_template_request [GenerateArmTemplateRequest]
314
+ # @param [Hash{String => String}] A hash of custom headers that will be added
315
+ # to the HTTP request.
316
+ #
317
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
318
+ #
319
+ def generate_arm_template_async(resource_group_name, lab_name, artifact_source_name, name, generate_arm_template_request, custom_headers = nil)
320
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
321
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
322
+ fail ArgumentError, 'lab_name is nil' if lab_name.nil?
323
+ fail ArgumentError, 'artifact_source_name is nil' if artifact_source_name.nil?
324
+ fail ArgumentError, 'name is nil' if name.nil?
325
+ fail ArgumentError, 'generate_arm_template_request is nil' if generate_arm_template_request.nil?
326
+ fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
327
+
328
+
329
+ request_headers = {}
330
+
331
+ # Set Headers
332
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
333
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
334
+
335
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
336
+
337
+ # Serialize Request
338
+ request_mapper = GenerateArmTemplateRequest.mapper()
339
+ request_content = @client.serialize(request_mapper, generate_arm_template_request, 'generate_arm_template_request')
340
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
341
+
342
+ path_template = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevTestLab/labs/{labName}/artifactsources/{artifactSourceName}/artifacts/{name}/generateArmTemplate'
343
+ options = {
344
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
345
+ path_params: {'subscriptionId' => @client.subscription_id,'resourceGroupName' => resource_group_name,'labName' => lab_name,'artifactSourceName' => artifact_source_name,'name' => name},
346
+ query_params: {'api-version' => @client.api_version},
347
+ body: request_content,
348
+ headers: request_headers.merge(custom_headers || {})
349
+ }
350
+
351
+ request_url = @base_url || @client.base_url
352
+
353
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :post, options)
354
+ promise = request.run_promise do |req|
355
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
356
+ end
357
+
358
+ promise = promise.then do |http_response|
359
+ status_code = http_response.status
360
+ response_content = http_response.body
361
+ unless status_code == 200
362
+ error_model = JSON.load(response_content)
363
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
364
+ end
365
+
366
+ # Create Result
367
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
368
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
369
+ # Deserialize Response
370
+ if status_code == 200
371
+ begin
372
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
373
+ result_mapper = ArmTemplateInfo.mapper()
374
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
375
+ rescue Exception => e
376
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
377
+ end
378
+ end
379
+
380
+ result
381
+ end
382
+
383
+ promise.execute
384
+ end
385
+
386
+ #
387
+ # List artifacts in a given artifact source.
388
+ #
389
+ # @param next_page_link [String] The NextLink from the previous successful
390
+ # call to List operation.
391
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
392
+ # will be added to the HTTP request.
393
+ #
394
+ # @return [ResponseWithContinuationArtifact] operation results.
395
+ #
396
+ def list_next(next_page_link, custom_headers = nil)
397
+ response = list_next_async(next_page_link, custom_headers).value!
398
+ response.body unless response.nil?
399
+ end
400
+
401
+ #
402
+ # List artifacts in a given artifact source.
403
+ #
404
+ # @param next_page_link [String] The NextLink from the previous successful
405
+ # call to List operation.
406
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
407
+ # will be added to the HTTP request.
408
+ #
409
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
410
+ #
411
+ def list_next_with_http_info(next_page_link, custom_headers = nil)
412
+ list_next_async(next_page_link, custom_headers).value!
413
+ end
414
+
415
+ #
416
+ # List artifacts in a given artifact source.
417
+ #
418
+ # @param next_page_link [String] The NextLink from the previous successful
419
+ # call to List operation.
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 list_next_async(next_page_link, custom_headers = nil)
426
+ fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
427
+
428
+
429
+ request_headers = {}
430
+
431
+ # Set Headers
432
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
433
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
434
+ path_template = '{nextLink}'
435
+ options = {
436
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
437
+ skip_encoding_path_params: {'nextLink' => next_page_link},
438
+ headers: request_headers.merge(custom_headers || {})
439
+ }
440
+
441
+ request_url = @base_url || @client.base_url
442
+
443
+ request = MsRest::HttpOperationRequest.new(request_url, path_template, :get, options)
444
+ promise = request.run_promise do |req|
445
+ @client.credentials.sign_request(req) unless @client.credentials.nil?
446
+ end
447
+
448
+ promise = promise.then do |http_response|
449
+ status_code = http_response.status
450
+ response_content = http_response.body
451
+ unless status_code == 200
452
+ error_model = JSON.load(response_content)
453
+ fail MsRestAzure::AzureOperationError.new(request, http_response, error_model)
454
+ end
455
+
456
+ # Create Result
457
+ result = MsRestAzure::AzureOperationResponse.new(request, http_response)
458
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
459
+ # Deserialize Response
460
+ if status_code == 200
461
+ begin
462
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
463
+ result_mapper = ResponseWithContinuationArtifact.mapper()
464
+ result.body = @client.deserialize(result_mapper, parsed_response, 'result.body')
465
+ rescue Exception => e
466
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
467
+ end
468
+ end
469
+
470
+ result
471
+ end
472
+
473
+ promise.execute
474
+ end
475
+
476
+ end
477
+ end