azure_mgmt_service_fabric 0.15.2 → 0.17.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +5 -5
  2. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/cluster_versions.rb +52 -45
  3. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/clusters.rb +63 -59
  4. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/models/cluster_code_versions_list_result.rb +1 -1
  5. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/models/cluster_list_result.rb +1 -1
  6. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/models/operation_list_result.rb +1 -1
  7. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/models/resource.rb +9 -0
  8. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/operations.rb +16 -14
  9. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/service_fabric_management_client.rb +10 -6
  10. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric.rb +91 -0
  11. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/application.rb +691 -0
  12. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/application_type.rb +487 -0
  13. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/cluster_versions.rb +471 -0
  14. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/clusters.rb +778 -0
  15. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_health_policy.rb +104 -0
  16. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_metric_description.rb +113 -0
  17. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_parameter.rb +58 -0
  18. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource.rb +206 -0
  19. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource_list.rb +55 -0
  20. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource_update.rb +182 -0
  21. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_type_resource.rb +83 -0
  22. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_type_resource_list.rb +55 -0
  23. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_upgrade_policy.rb +81 -0
  24. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/available_operation_display.rb +79 -0
  25. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/azure_active_directory.rb +68 -0
  26. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/certificate_description.rb +70 -0
  27. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/client_certificate_common_name.rb +70 -0
  28. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/client_certificate_thumbprint.rb +59 -0
  29. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster.rb +398 -0
  30. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_code_versions_list_result.rb +66 -0
  31. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_code_versions_result.rb +102 -0
  32. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_health_policy.rb +70 -0
  33. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_list_result.rb +66 -0
  34. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_update_parameters.rb +246 -0
  35. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_upgrade_delta_health_policy.rb +97 -0
  36. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_upgrade_policy.rb +156 -0
  37. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_version_details.rb +69 -0
  38. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/diagnostics_storage_account_config.rb +91 -0
  39. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/endpoint_range_description.rb +57 -0
  40. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/error_model.rb +57 -0
  41. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/named_partition_scheme_description.rb +81 -0
  42. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/node_type_description.rb +189 -0
  43. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/operation_list_result.rb +101 -0
  44. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/operation_result.rb +81 -0
  45. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/partition_scheme_description.rb +48 -0
  46. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/provisioning_state.rb +18 -0
  47. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/proxy_resource.rb +82 -0
  48. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/resource.rb +110 -0
  49. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/rolling_upgrade_monitoring_policy.rb +90 -0
  50. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_correlation_description.rb +58 -0
  51. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_load_metric_description.rb +98 -0
  52. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_placement_policy_description.rb +46 -0
  53. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_properties.rb +151 -0
  54. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_properties_base.rb +123 -0
  55. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource.rb +207 -0
  56. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource_list.rb +55 -0
  57. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource_update.rb +169 -0
  58. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_delta_health_policy.rb +51 -0
  59. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_health_policy.rb +108 -0
  60. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_health_policy_map_item.rb +60 -0
  61. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_update_properties.rb +113 -0
  62. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/settings_parameter_description.rb +57 -0
  63. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/settings_section_description.rb +67 -0
  64. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/singleton_partition_scheme_description.rb +51 -0
  65. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateful_service_properties.rb +227 -0
  66. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateful_service_update_properties.rb +186 -0
  67. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateless_service_properties.rb +161 -0
  68. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateless_service_update_properties.rb +133 -0
  69. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/uniform_int64range_partition_scheme_description.rb +91 -0
  70. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/version_resource.rb +115 -0
  71. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/version_resource_list.rb +55 -0
  72. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/module_definition.rb +9 -0
  73. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/operations.rb +230 -0
  74. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/service.rb +735 -0
  75. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/service_fabric_management_client.rb +148 -0
  76. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/version.rb +559 -0
  77. data/lib/2018-02-01/generated/azure_mgmt_service_fabric.rb +61 -0
  78. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/cluster_versions.rb +456 -0
  79. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/clusters.rb +753 -0
  80. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/application_delta_health_policy.rb +73 -0
  81. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/application_health_policy.rb +71 -0
  82. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/available_operation_display.rb +79 -0
  83. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/azure_active_directory.rb +68 -0
  84. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/certificate_description.rb +70 -0
  85. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/client_certificate_common_name.rb +70 -0
  86. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/client_certificate_thumbprint.rb +59 -0
  87. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/cluster.rb +476 -0
  88. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_code_versions_list_result.rb +66 -0
  89. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_code_versions_result.rb +102 -0
  90. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_health_policy.rb +121 -0
  91. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_list_result.rb +66 -0
  92. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_update_parameters.rb +276 -0
  93. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_upgrade_delta_health_policy.rb +125 -0
  94. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_upgrade_policy.rb +156 -0
  95. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_version_details.rb +69 -0
  96. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/diagnostics_storage_account_config.rb +91 -0
  97. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/endpoint_range_description.rb +57 -0
  98. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/error_model.rb +47 -0
  99. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/error_model_error.rb +57 -0
  100. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/node_type_description.rb +198 -0
  101. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/operation_list_result.rb +101 -0
  102. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/operation_result.rb +81 -0
  103. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/provisioning_state.rb +18 -0
  104. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/resource.rb +110 -0
  105. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/server_certificate_common_name.rb +57 -0
  106. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/server_certificate_common_names.rb +71 -0
  107. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/service_type_delta_health_policy.rb +60 -0
  108. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/service_type_health_policy.rb +55 -0
  109. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/settings_parameter_description.rb +57 -0
  110. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/models/settings_section_description.rb +67 -0
  111. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/module_definition.rb +9 -0
  112. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/operations.rb +237 -0
  113. data/lib/2018-02-01/generated/azure_mgmt_service_fabric/service_fabric_management_client.rb +141 -0
  114. data/lib/azure_mgmt_service_fabric.rb +2 -0
  115. data/lib/profiles/latest/modules/servicefabric_profile_module.rb +293 -114
  116. data/lib/profiles/latest/servicefabric_latest_profile_client.rb +28 -9
  117. data/lib/profiles/latest/servicefabric_module_definition.rb +0 -1
  118. data/lib/version.rb +1 -1
  119. metadata +109 -5
@@ -0,0 +1,61 @@
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
+ 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 '2018-02-01/generated/azure_mgmt_service_fabric/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::ServiceFabric::Mgmt::V2018_02_01
23
+ autoload :Clusters, '2018-02-01/generated/azure_mgmt_service_fabric/clusters.rb'
24
+ autoload :ClusterVersions, '2018-02-01/generated/azure_mgmt_service_fabric/cluster_versions.rb'
25
+ autoload :Operations, '2018-02-01/generated/azure_mgmt_service_fabric/operations.rb'
26
+ autoload :ServiceFabricManagementClient, '2018-02-01/generated/azure_mgmt_service_fabric/service_fabric_management_client.rb'
27
+
28
+ module Models
29
+ autoload :EndpointRangeDescription, '2018-02-01/generated/azure_mgmt_service_fabric/models/endpoint_range_description.rb'
30
+ autoload :ServiceTypeDeltaHealthPolicy, '2018-02-01/generated/azure_mgmt_service_fabric/models/service_type_delta_health_policy.rb'
31
+ autoload :NodeTypeDescription, '2018-02-01/generated/azure_mgmt_service_fabric/models/node_type_description.rb'
32
+ autoload :ServiceTypeHealthPolicy, '2018-02-01/generated/azure_mgmt_service_fabric/models/service_type_health_policy.rb'
33
+ autoload :ClusterHealthPolicy, '2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_health_policy.rb'
34
+ autoload :AvailableOperationDisplay, '2018-02-01/generated/azure_mgmt_service_fabric/models/available_operation_display.rb'
35
+ autoload :ClusterUpgradeDeltaHealthPolicy, '2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_upgrade_delta_health_policy.rb'
36
+ autoload :CertificateDescription, '2018-02-01/generated/azure_mgmt_service_fabric/models/certificate_description.rb'
37
+ autoload :ClusterUpgradePolicy, '2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_upgrade_policy.rb'
38
+ autoload :ClientCertificateThumbprint, '2018-02-01/generated/azure_mgmt_service_fabric/models/client_certificate_thumbprint.rb'
39
+ autoload :ClusterVersionDetails, '2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_version_details.rb'
40
+ autoload :ServerCertificateCommonNames, '2018-02-01/generated/azure_mgmt_service_fabric/models/server_certificate_common_names.rb'
41
+ autoload :ClusterCodeVersionsResult, '2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_code_versions_result.rb'
42
+ autoload :SettingsParameterDescription, '2018-02-01/generated/azure_mgmt_service_fabric/models/settings_parameter_description.rb'
43
+ autoload :ClusterCodeVersionsListResult, '2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_code_versions_list_result.rb'
44
+ autoload :ApplicationDeltaHealthPolicy, '2018-02-01/generated/azure_mgmt_service_fabric/models/application_delta_health_policy.rb'
45
+ autoload :ClusterListResult, '2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_list_result.rb'
46
+ autoload :AzureActiveDirectory, '2018-02-01/generated/azure_mgmt_service_fabric/models/azure_active_directory.rb'
47
+ autoload :ClusterUpdateParameters, '2018-02-01/generated/azure_mgmt_service_fabric/models/cluster_update_parameters.rb'
48
+ autoload :ServerCertificateCommonName, '2018-02-01/generated/azure_mgmt_service_fabric/models/server_certificate_common_name.rb'
49
+ autoload :OperationResult, '2018-02-01/generated/azure_mgmt_service_fabric/models/operation_result.rb'
50
+ autoload :SettingsSectionDescription, '2018-02-01/generated/azure_mgmt_service_fabric/models/settings_section_description.rb'
51
+ autoload :OperationListResult, '2018-02-01/generated/azure_mgmt_service_fabric/models/operation_list_result.rb'
52
+ autoload :ClientCertificateCommonName, '2018-02-01/generated/azure_mgmt_service_fabric/models/client_certificate_common_name.rb'
53
+ autoload :Resource, '2018-02-01/generated/azure_mgmt_service_fabric/models/resource.rb'
54
+ autoload :ApplicationHealthPolicy, '2018-02-01/generated/azure_mgmt_service_fabric/models/application_health_policy.rb'
55
+ autoload :ErrorModelError, '2018-02-01/generated/azure_mgmt_service_fabric/models/error_model_error.rb'
56
+ autoload :DiagnosticsStorageAccountConfig, '2018-02-01/generated/azure_mgmt_service_fabric/models/diagnostics_storage_account_config.rb'
57
+ autoload :ErrorModel, '2018-02-01/generated/azure_mgmt_service_fabric/models/error_model.rb'
58
+ autoload :Cluster, '2018-02-01/generated/azure_mgmt_service_fabric/models/cluster.rb'
59
+ autoload :ProvisioningState, '2018-02-01/generated/azure_mgmt_service_fabric/models/provisioning_state.rb'
60
+ end
61
+ end
@@ -0,0 +1,456 @@
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::ServiceFabric::Mgmt::V2018_02_01
7
+ #
8
+ # Azure Service Fabric Resource Provider API Client
9
+ #
10
+ class ClusterVersions
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the ClusterVersions class.
15
+ # @param client service class for accessing basic functionality.
16
+ #
17
+ def initialize(client)
18
+ @client = client
19
+ end
20
+
21
+ # @return [ServiceFabricManagementClient] reference to the ServiceFabricManagementClient
22
+ attr_reader :client
23
+
24
+ #
25
+ # Gets information about a Service Fabric cluster code version available in the
26
+ # specified location.
27
+ #
28
+ # Gets information about an available Service Fabric cluster code version.
29
+ #
30
+ # @param location [String] The location for the cluster code versions. This is
31
+ # different from cluster location.
32
+ # @param cluster_version [String] The cluster code version.
33
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
34
+ # will be added to the HTTP request.
35
+ #
36
+ # @return [ClusterCodeVersionsListResult] operation results.
37
+ #
38
+ def get(location, cluster_version, custom_headers:nil)
39
+ response = get_async(location, cluster_version, custom_headers:custom_headers).value!
40
+ response.body unless response.nil?
41
+ end
42
+
43
+ #
44
+ # Gets information about a Service Fabric cluster code version available in the
45
+ # specified location.
46
+ #
47
+ # Gets information about an available Service Fabric cluster code version.
48
+ #
49
+ # @param location [String] The location for the cluster code versions. This is
50
+ # different from cluster location.
51
+ # @param cluster_version [String] The cluster code version.
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 get_with_http_info(location, cluster_version, custom_headers:nil)
58
+ get_async(location, cluster_version, custom_headers:custom_headers).value!
59
+ end
60
+
61
+ #
62
+ # Gets information about a Service Fabric cluster code version available in the
63
+ # specified location.
64
+ #
65
+ # Gets information about an available Service Fabric cluster code version.
66
+ #
67
+ # @param location [String] The location for the cluster code versions. This is
68
+ # different from cluster location.
69
+ # @param cluster_version [String] The cluster code version.
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 get_async(location, cluster_version, custom_headers:nil)
76
+ fail ArgumentError, 'location is nil' if location.nil?
77
+ @client.api_version = '2018-02-01'
78
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
79
+ fail ArgumentError, 'cluster_version is nil' if cluster_version.nil?
80
+
81
+
82
+ request_headers = {}
83
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
84
+
85
+ # Set Headers
86
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
87
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
88
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions/{clusterVersion}'
89
+
90
+ request_url = @base_url || @client.base_url
91
+
92
+ options = {
93
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
94
+ path_params: {'location' => location,'subscriptionId' => @client.subscription_id,'clusterVersion' => cluster_version},
95
+ query_params: {'api-version' => @client.api_version},
96
+ headers: request_headers.merge(custom_headers || {}),
97
+ base_url: request_url
98
+ }
99
+ promise = @client.make_request_async(:get, path_template, options)
100
+
101
+ promise = promise.then do |result|
102
+ http_response = result.response
103
+ status_code = http_response.status
104
+ response_content = http_response.body
105
+ unless status_code == 200
106
+ error_model = JSON.load(response_content)
107
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
108
+ end
109
+
110
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
111
+ # Deserialize Response
112
+ if status_code == 200
113
+ begin
114
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
115
+ result_mapper = Azure::ServiceFabric::Mgmt::V2018_02_01::Models::ClusterCodeVersionsListResult.mapper()
116
+ result.body = @client.deserialize(result_mapper, parsed_response)
117
+ rescue Exception => e
118
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
119
+ end
120
+ end
121
+
122
+ result
123
+ end
124
+
125
+ promise.execute
126
+ end
127
+
128
+ #
129
+ # Gets information about a Service Fabric cluster code version available for
130
+ # the specified environment.
131
+ #
132
+ # Gets information about an available Service Fabric cluster code version by
133
+ # environment.
134
+ #
135
+ # @param location [String] The location for the cluster code versions. This is
136
+ # different from cluster location.
137
+ # @param environment [Enum] The operating system of the cluster. The default
138
+ # means all. Possible values include: 'Windows', 'Linux'
139
+ # @param cluster_version [String] The cluster code version.
140
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
141
+ # will be added to the HTTP request.
142
+ #
143
+ # @return [ClusterCodeVersionsListResult] operation results.
144
+ #
145
+ def get_by_environment(location, environment, cluster_version, custom_headers:nil)
146
+ response = get_by_environment_async(location, environment, cluster_version, custom_headers:custom_headers).value!
147
+ response.body unless response.nil?
148
+ end
149
+
150
+ #
151
+ # Gets information about a Service Fabric cluster code version available for
152
+ # the specified environment.
153
+ #
154
+ # Gets information about an available Service Fabric cluster code version by
155
+ # environment.
156
+ #
157
+ # @param location [String] The location for the cluster code versions. This is
158
+ # different from cluster location.
159
+ # @param environment [Enum] The operating system of the cluster. The default
160
+ # means all. Possible values include: 'Windows', 'Linux'
161
+ # @param cluster_version [String] The cluster code version.
162
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
163
+ # will be added to the HTTP request.
164
+ #
165
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
166
+ #
167
+ def get_by_environment_with_http_info(location, environment, cluster_version, custom_headers:nil)
168
+ get_by_environment_async(location, environment, cluster_version, custom_headers:custom_headers).value!
169
+ end
170
+
171
+ #
172
+ # Gets information about a Service Fabric cluster code version available for
173
+ # the specified environment.
174
+ #
175
+ # Gets information about an available Service Fabric cluster code version by
176
+ # environment.
177
+ #
178
+ # @param location [String] The location for the cluster code versions. This is
179
+ # different from cluster location.
180
+ # @param environment [Enum] The operating system of the cluster. The default
181
+ # means all. Possible values include: 'Windows', 'Linux'
182
+ # @param cluster_version [String] The cluster code version.
183
+ # @param [Hash{String => String}] A hash of custom headers that will be added
184
+ # to the HTTP request.
185
+ #
186
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
187
+ #
188
+ def get_by_environment_async(location, environment, cluster_version, custom_headers:nil)
189
+ fail ArgumentError, 'location is nil' if location.nil?
190
+ fail ArgumentError, 'environment is nil' if environment.nil?
191
+ @client.api_version = '2018-02-01'
192
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
193
+ fail ArgumentError, 'cluster_version is nil' if cluster_version.nil?
194
+
195
+
196
+ request_headers = {}
197
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
198
+
199
+ # Set Headers
200
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
201
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
202
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions/{clusterVersion}'
203
+
204
+ request_url = @base_url || @client.base_url
205
+
206
+ options = {
207
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
208
+ path_params: {'location' => location,'environment' => environment,'subscriptionId' => @client.subscription_id,'clusterVersion' => cluster_version},
209
+ query_params: {'api-version' => @client.api_version},
210
+ headers: request_headers.merge(custom_headers || {}),
211
+ base_url: request_url
212
+ }
213
+ promise = @client.make_request_async(:get, path_template, options)
214
+
215
+ promise = promise.then do |result|
216
+ http_response = result.response
217
+ status_code = http_response.status
218
+ response_content = http_response.body
219
+ unless status_code == 200
220
+ error_model = JSON.load(response_content)
221
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
222
+ end
223
+
224
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
225
+ # Deserialize Response
226
+ if status_code == 200
227
+ begin
228
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
229
+ result_mapper = Azure::ServiceFabric::Mgmt::V2018_02_01::Models::ClusterCodeVersionsListResult.mapper()
230
+ result.body = @client.deserialize(result_mapper, parsed_response)
231
+ rescue Exception => e
232
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
233
+ end
234
+ end
235
+
236
+ result
237
+ end
238
+
239
+ promise.execute
240
+ end
241
+
242
+ #
243
+ # Gets the list of Service Fabric cluster code versions available for the
244
+ # specified location.
245
+ #
246
+ # Gets all available code versions for Service Fabric cluster resources by
247
+ # location.
248
+ #
249
+ # @param location [String] The location for the cluster code versions. This is
250
+ # different from cluster location.
251
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
252
+ # will be added to the HTTP request.
253
+ #
254
+ # @return [ClusterCodeVersionsListResult] operation results.
255
+ #
256
+ def list(location, custom_headers:nil)
257
+ response = list_async(location, custom_headers:custom_headers).value!
258
+ response.body unless response.nil?
259
+ end
260
+
261
+ #
262
+ # Gets the list of Service Fabric cluster code versions available for the
263
+ # specified location.
264
+ #
265
+ # Gets all available code versions for Service Fabric cluster resources by
266
+ # location.
267
+ #
268
+ # @param location [String] The location for the cluster code versions. This is
269
+ # different from cluster location.
270
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
271
+ # will be added to the HTTP request.
272
+ #
273
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
274
+ #
275
+ def list_with_http_info(location, custom_headers:nil)
276
+ list_async(location, custom_headers:custom_headers).value!
277
+ end
278
+
279
+ #
280
+ # Gets the list of Service Fabric cluster code versions available for the
281
+ # specified location.
282
+ #
283
+ # Gets all available code versions for Service Fabric cluster resources by
284
+ # location.
285
+ #
286
+ # @param location [String] The location for the cluster code versions. This is
287
+ # different from cluster location.
288
+ # @param [Hash{String => String}] A hash of custom headers that will be added
289
+ # to the HTTP request.
290
+ #
291
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
292
+ #
293
+ def list_async(location, custom_headers:nil)
294
+ fail ArgumentError, 'location is nil' if location.nil?
295
+ @client.api_version = '2018-02-01'
296
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
297
+
298
+
299
+ request_headers = {}
300
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
301
+
302
+ # Set Headers
303
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
304
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
305
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/clusterVersions'
306
+
307
+ request_url = @base_url || @client.base_url
308
+
309
+ options = {
310
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
311
+ path_params: {'location' => location,'subscriptionId' => @client.subscription_id},
312
+ query_params: {'api-version' => @client.api_version},
313
+ headers: request_headers.merge(custom_headers || {}),
314
+ base_url: request_url
315
+ }
316
+ promise = @client.make_request_async(:get, path_template, options)
317
+
318
+ promise = promise.then do |result|
319
+ http_response = result.response
320
+ status_code = http_response.status
321
+ response_content = http_response.body
322
+ unless status_code == 200
323
+ error_model = JSON.load(response_content)
324
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
325
+ end
326
+
327
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
328
+ # Deserialize Response
329
+ if status_code == 200
330
+ begin
331
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
332
+ result_mapper = Azure::ServiceFabric::Mgmt::V2018_02_01::Models::ClusterCodeVersionsListResult.mapper()
333
+ result.body = @client.deserialize(result_mapper, parsed_response)
334
+ rescue Exception => e
335
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
336
+ end
337
+ end
338
+
339
+ result
340
+ end
341
+
342
+ promise.execute
343
+ end
344
+
345
+ #
346
+ # Gets the list of Service Fabric cluster code versions available for the
347
+ # specified environment.
348
+ #
349
+ # Gets all available code versions for Service Fabric cluster resources by
350
+ # environment.
351
+ #
352
+ # @param location [String] The location for the cluster code versions. This is
353
+ # different from cluster location.
354
+ # @param environment [Enum] The operating system of the cluster. The default
355
+ # means all. Possible values include: 'Windows', 'Linux'
356
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
357
+ # will be added to the HTTP request.
358
+ #
359
+ # @return [ClusterCodeVersionsListResult] operation results.
360
+ #
361
+ def list_by_environment(location, environment, custom_headers:nil)
362
+ response = list_by_environment_async(location, environment, custom_headers:custom_headers).value!
363
+ response.body unless response.nil?
364
+ end
365
+
366
+ #
367
+ # Gets the list of Service Fabric cluster code versions available for the
368
+ # specified environment.
369
+ #
370
+ # Gets all available code versions for Service Fabric cluster resources by
371
+ # environment.
372
+ #
373
+ # @param location [String] The location for the cluster code versions. This is
374
+ # different from cluster location.
375
+ # @param environment [Enum] The operating system of the cluster. The default
376
+ # means all. Possible values include: 'Windows', 'Linux'
377
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
378
+ # will be added to the HTTP request.
379
+ #
380
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
381
+ #
382
+ def list_by_environment_with_http_info(location, environment, custom_headers:nil)
383
+ list_by_environment_async(location, environment, custom_headers:custom_headers).value!
384
+ end
385
+
386
+ #
387
+ # Gets the list of Service Fabric cluster code versions available for the
388
+ # specified environment.
389
+ #
390
+ # Gets all available code versions for Service Fabric cluster resources by
391
+ # environment.
392
+ #
393
+ # @param location [String] The location for the cluster code versions. This is
394
+ # different from cluster location.
395
+ # @param environment [Enum] The operating system of the cluster. The default
396
+ # means all. Possible values include: 'Windows', 'Linux'
397
+ # @param [Hash{String => String}] A hash of custom headers that will be added
398
+ # to the HTTP request.
399
+ #
400
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
401
+ #
402
+ def list_by_environment_async(location, environment, custom_headers:nil)
403
+ fail ArgumentError, 'location is nil' if location.nil?
404
+ fail ArgumentError, 'environment is nil' if environment.nil?
405
+ @client.api_version = '2018-02-01'
406
+ fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
407
+
408
+
409
+ request_headers = {}
410
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
411
+
412
+ # Set Headers
413
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
414
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
415
+ path_template = 'subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/clusterVersions'
416
+
417
+ request_url = @base_url || @client.base_url
418
+
419
+ options = {
420
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
421
+ path_params: {'location' => location,'environment' => environment,'subscriptionId' => @client.subscription_id},
422
+ query_params: {'api-version' => @client.api_version},
423
+ headers: request_headers.merge(custom_headers || {}),
424
+ base_url: request_url
425
+ }
426
+ promise = @client.make_request_async(:get, path_template, options)
427
+
428
+ promise = promise.then do |result|
429
+ http_response = result.response
430
+ status_code = http_response.status
431
+ response_content = http_response.body
432
+ unless status_code == 200
433
+ error_model = JSON.load(response_content)
434
+ fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
435
+ end
436
+
437
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
438
+ # Deserialize Response
439
+ if status_code == 200
440
+ begin
441
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
442
+ result_mapper = Azure::ServiceFabric::Mgmt::V2018_02_01::Models::ClusterCodeVersionsListResult.mapper()
443
+ result.body = @client.deserialize(result_mapper, parsed_response)
444
+ rescue Exception => e
445
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
446
+ end
447
+ end
448
+
449
+ result
450
+ end
451
+
452
+ promise.execute
453
+ end
454
+
455
+ end
456
+ end