azure_mgmt_service_fabric 0.15.2 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/cluster_versions.rb +51 -44
  3. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/clusters.rb +62 -58
  4. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/operations.rb +15 -13
  5. data/lib/2016-09-01/generated/azure_mgmt_service_fabric/service_fabric_management_client.rb +4 -1
  6. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric.rb +91 -0
  7. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/application.rb +691 -0
  8. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/application_type.rb +487 -0
  9. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/cluster_versions.rb +471 -0
  10. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/clusters.rb +778 -0
  11. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_health_policy.rb +104 -0
  12. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_metric_description.rb +113 -0
  13. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_parameter.rb +58 -0
  14. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource.rb +206 -0
  15. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource_list.rb +55 -0
  16. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource_update.rb +182 -0
  17. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_type_resource.rb +83 -0
  18. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_type_resource_list.rb +55 -0
  19. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_upgrade_policy.rb +81 -0
  20. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/available_operation_display.rb +79 -0
  21. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/azure_active_directory.rb +68 -0
  22. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/certificate_description.rb +70 -0
  23. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/client_certificate_common_name.rb +70 -0
  24. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/client_certificate_thumbprint.rb +59 -0
  25. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster.rb +398 -0
  26. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_code_versions_list_result.rb +66 -0
  27. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_code_versions_result.rb +102 -0
  28. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_health_policy.rb +70 -0
  29. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_list_result.rb +66 -0
  30. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_update_parameters.rb +246 -0
  31. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_upgrade_delta_health_policy.rb +97 -0
  32. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_upgrade_policy.rb +156 -0
  33. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_version_details.rb +69 -0
  34. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/diagnostics_storage_account_config.rb +91 -0
  35. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/endpoint_range_description.rb +57 -0
  36. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/error_model.rb +57 -0
  37. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/named_partition_scheme_description.rb +81 -0
  38. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/node_type_description.rb +189 -0
  39. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/operation_list_result.rb +101 -0
  40. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/operation_result.rb +81 -0
  41. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/partition_scheme_description.rb +48 -0
  42. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/provisioning_state.rb +18 -0
  43. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/proxy_resource.rb +82 -0
  44. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/resource.rb +101 -0
  45. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/rolling_upgrade_monitoring_policy.rb +90 -0
  46. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_correlation_description.rb +58 -0
  47. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_load_metric_description.rb +98 -0
  48. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_placement_policy_description.rb +46 -0
  49. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_properties.rb +151 -0
  50. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_properties_base.rb +123 -0
  51. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource.rb +207 -0
  52. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource_list.rb +55 -0
  53. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource_update.rb +169 -0
  54. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_delta_health_policy.rb +51 -0
  55. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_health_policy.rb +108 -0
  56. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_health_policy_map_item.rb +60 -0
  57. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_update_properties.rb +113 -0
  58. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/settings_parameter_description.rb +57 -0
  59. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/settings_section_description.rb +67 -0
  60. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/singleton_partition_scheme_description.rb +51 -0
  61. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateful_service_properties.rb +227 -0
  62. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateful_service_update_properties.rb +186 -0
  63. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateless_service_properties.rb +161 -0
  64. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateless_service_update_properties.rb +133 -0
  65. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/uniform_int64range_partition_scheme_description.rb +91 -0
  66. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/version_resource.rb +115 -0
  67. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/models/version_resource_list.rb +55 -0
  68. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/module_definition.rb +9 -0
  69. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/operations.rb +230 -0
  70. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/service.rb +735 -0
  71. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/service_fabric_management_client.rb +147 -0
  72. data/lib/2017-07-01-preview/generated/azure_mgmt_service_fabric/version.rb +559 -0
  73. data/lib/azure_mgmt_service_fabric.rb +1 -0
  74. data/lib/profiles/latest/modules/servicefabric_profile_module.rb +269 -114
  75. data/lib/profiles/latest/servicefabric_latest_profile_client.rb +28 -9
  76. data/lib/profiles/latest/servicefabric_module_definition.rb +0 -1
  77. data/lib/version.rb +1 -1
  78. metadata +70 -3
@@ -0,0 +1,147 @@
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::V2017_07_01_preview
7
+ #
8
+ # A service client - single point of access to the REST API.
9
+ #
10
+ class ServiceFabricManagementClient < MsRestAzure::AzureServiceClient
11
+ include MsRestAzure
12
+ include MsRestAzure::Serialization
13
+
14
+ # @return [String] the base URI of the service.
15
+ attr_accessor :base_url
16
+
17
+ # @return Credentials needed for the client to connect to Azure.
18
+ attr_reader :credentials
19
+
20
+ # @return [String] Gets or sets the preferred language for the response.
21
+ attr_accessor :accept_language
22
+
23
+ # @return [Integer] Gets or sets the retry timeout in seconds for Long
24
+ # Running Operations. Default value is 30.
25
+ attr_accessor :long_running_operation_retry_timeout
26
+
27
+ # @return [Boolean] When set to true a unique x-ms-client-request-id value
28
+ # is generated and included in each request. Default is true.
29
+ attr_accessor :generate_client_request_id
30
+
31
+ # @return [Clusters] clusters
32
+ attr_reader :clusters
33
+
34
+ # @return [ClusterVersions] cluster_versions
35
+ attr_reader :cluster_versions
36
+
37
+ # @return [Operations] operations
38
+ attr_reader :operations
39
+
40
+ # @return [ApplicationType] application_type
41
+ attr_reader :application_type
42
+
43
+ # @return [Version] version
44
+ attr_reader :version
45
+
46
+ # @return [Application] application
47
+ attr_reader :application
48
+
49
+ # @return [Service] service
50
+ attr_reader :service
51
+
52
+ #
53
+ # Creates initializes a new instance of the ServiceFabricManagementClient class.
54
+ # @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
55
+ # @param base_url [String] the base URI of the service.
56
+ # @param options [Array] filters to be applied to the HTTP requests.
57
+ #
58
+ def initialize(credentials = nil, base_url = nil, options = nil)
59
+ super(credentials, options)
60
+ @base_url = base_url || 'https://management.azure.com'
61
+
62
+ fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
63
+ @credentials = credentials
64
+
65
+ @clusters = Clusters.new(self)
66
+ @cluster_versions = ClusterVersions.new(self)
67
+ @operations = Operations.new(self)
68
+ @application_type = ApplicationType.new(self)
69
+ @version = Version.new(self)
70
+ @application = Application.new(self)
71
+ @service = Service.new(self)
72
+ @accept_language = 'en-US'
73
+ @long_running_operation_retry_timeout = 30
74
+ @generate_client_request_id = true
75
+ add_telemetry
76
+ end
77
+
78
+ #
79
+ # Makes a request and returns the body of the response.
80
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
81
+ # @param path [String] the path, relative to {base_url}.
82
+ # @param options [Hash{String=>String}] specifying any request options like :body.
83
+ # @return [Hash{String=>String}] containing the body of the response.
84
+ # Example:
85
+ #
86
+ # request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
87
+ # path = "/path"
88
+ # options = {
89
+ # body: request_content,
90
+ # query_params: {'api-version' => '2016-02-01'}
91
+ # }
92
+ # result = @client.make_request(:put, path, options)
93
+ #
94
+ def make_request(method, path, options = {})
95
+ result = make_request_with_http_info(method, path, options)
96
+ result.body unless result.nil?
97
+ end
98
+
99
+ #
100
+ # Makes a request and returns the operation response.
101
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
102
+ # @param path [String] the path, relative to {base_url}.
103
+ # @param options [Hash{String=>String}] specifying any request options like :body.
104
+ # @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
105
+ #
106
+ def make_request_with_http_info(method, path, options = {})
107
+ result = make_request_async(method, path, options).value!
108
+ result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
109
+ result
110
+ end
111
+
112
+ #
113
+ # Makes a request asynchronously.
114
+ # @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
115
+ # @param path [String] the path, relative to {base_url}.
116
+ # @param options [Hash{String=>String}] specifying any request options like :body.
117
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
118
+ #
119
+ def make_request_async(method, path, options = {})
120
+ fail ArgumentError, 'method is nil' if method.nil?
121
+ fail ArgumentError, 'path is nil' if path.nil?
122
+
123
+ request_url = options[:base_url] || @base_url
124
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
125
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
126
+ end
127
+
128
+ request_headers = @request_headers
129
+ request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
130
+ options.merge!({headers: request_headers.merge(options[:headers] || {})})
131
+ options.merge!({credentials: @credentials}) unless @credentials.nil?
132
+
133
+ super(request_url, method, path, options)
134
+ end
135
+
136
+
137
+ private
138
+ #
139
+ # Adds telemetry information.
140
+ #
141
+ def add_telemetry
142
+ sdk_information = 'azure_mgmt_service_fabric'
143
+ sdk_information = "#{sdk_information}/0.16.0"
144
+ add_user_agent_information(sdk_information)
145
+ end
146
+ end
147
+ end
@@ -0,0 +1,559 @@
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::V2017_07_01_preview
7
+ #
8
+ # Azure Service Fabric Resource Provider API Client
9
+ #
10
+ class Version
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Version 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
+ # Returns an application type version resource.
26
+ #
27
+ # @param subscription_id [String] The customer subscription identifier
28
+ # @param resource_group_name [String] The name of the resource group.
29
+ # @param cluster_name [String] The name of the cluster resource
30
+ # @param application_type_name [String] The name of the application type name
31
+ # resource
32
+ # @param version [String] The application type version.
33
+ # @param api_version [String] The version of the API.
34
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
35
+ # will be added to the HTTP request.
36
+ #
37
+ # @return [VersionResource] operation results.
38
+ #
39
+ def get(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:nil)
40
+ response = get_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:custom_headers).value!
41
+ response.body unless response.nil?
42
+ end
43
+
44
+ #
45
+ # Returns an application type version resource.
46
+ #
47
+ # @param subscription_id [String] The customer subscription identifier
48
+ # @param resource_group_name [String] The name of the resource group.
49
+ # @param cluster_name [String] The name of the cluster resource
50
+ # @param application_type_name [String] The name of the application type name
51
+ # resource
52
+ # @param version [String] The application type version.
53
+ # @param api_version [String] The version of the API.
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 get_with_http_info(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:nil)
60
+ get_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:custom_headers).value!
61
+ end
62
+
63
+ #
64
+ # Returns an application type version resource.
65
+ #
66
+ # @param subscription_id [String] The customer subscription identifier
67
+ # @param resource_group_name [String] The name of the resource group.
68
+ # @param cluster_name [String] The name of the cluster resource
69
+ # @param application_type_name [String] The name of the application type name
70
+ # resource
71
+ # @param version [String] The application type version.
72
+ # @param api_version [String] The version of the API.
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 get_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:nil)
79
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
80
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
81
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
82
+ fail ArgumentError, 'application_type_name is nil' if application_type_name.nil?
83
+ fail ArgumentError, 'version is nil' if version.nil?
84
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
85
+
86
+
87
+ request_headers = {}
88
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
89
+
90
+ # Set Headers
91
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
92
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
93
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}'
94
+
95
+ request_url = @base_url || @client.base_url
96
+
97
+ options = {
98
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
99
+ path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationTypeName' => application_type_name,'version' => version},
100
+ query_params: {'api-version' => api_version},
101
+ headers: request_headers.merge(custom_headers || {}),
102
+ base_url: request_url
103
+ }
104
+ promise = @client.make_request_async(:get, path_template, options)
105
+
106
+ promise = promise.then do |result|
107
+ http_response = result.response
108
+ status_code = http_response.status
109
+ response_content = http_response.body
110
+ unless status_code == 200
111
+ error_model = JSON.load(response_content)
112
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
113
+ end
114
+
115
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
116
+ # Deserialize Response
117
+ if status_code == 200
118
+ begin
119
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
120
+ result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::VersionResource.mapper()
121
+ result.body = @client.deserialize(result_mapper, parsed_response)
122
+ rescue Exception => e
123
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
124
+ end
125
+ end
126
+
127
+ result
128
+ end
129
+
130
+ promise.execute
131
+ end
132
+
133
+ #
134
+ # Provisions an application type version resource.
135
+ #
136
+ # @param subscription_id [String] The customer subscription identifier
137
+ # @param resource_group_name [String] The name of the resource group.
138
+ # @param cluster_name [String] The name of the cluster resource
139
+ # @param application_type_name [String] The name of the application type name
140
+ # resource
141
+ # @param version [String] The application type version.
142
+ # @param api_version [String] The version of the API.
143
+ # @param parameters [VersionResource] The application type version resource.
144
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
145
+ # will be added to the HTTP request.
146
+ #
147
+ # @return [VersionResource] operation results.
148
+ #
149
+ def put(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, parameters, custom_headers:nil)
150
+ response = put_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, parameters, custom_headers:custom_headers).value!
151
+ response.body unless response.nil?
152
+ end
153
+
154
+ #
155
+ # @param subscription_id [String] The customer subscription identifier
156
+ # @param resource_group_name [String] The name of the resource group.
157
+ # @param cluster_name [String] The name of the cluster resource
158
+ # @param application_type_name [String] The name of the application type name
159
+ # resource
160
+ # @param version [String] The application type version.
161
+ # @param api_version [String] The version of the API.
162
+ # @param parameters [VersionResource] The application type version resource.
163
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
164
+ # will be added to the HTTP request.
165
+ #
166
+ # @return [Concurrent::Promise] promise which provides async access to http
167
+ # response.
168
+ #
169
+ def put_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, parameters, custom_headers:nil)
170
+ # Send request
171
+ promise = begin_put_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, parameters, custom_headers:custom_headers)
172
+
173
+ promise = promise.then do |response|
174
+ # Defining deserialization method.
175
+ deserialize_method = lambda do |parsed_response|
176
+ result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::VersionResource.mapper()
177
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
178
+ end
179
+
180
+ # Waiting for response.
181
+ @client.get_long_running_operation_result(response, deserialize_method)
182
+ end
183
+
184
+ promise
185
+ end
186
+
187
+ #
188
+ # Unprovisions an application type version resource.
189
+ #
190
+ # @param subscription_id [String] The customer subscription identifier
191
+ # @param resource_group_name [String] The name of the resource group.
192
+ # @param cluster_name [String] The name of the cluster resource
193
+ # @param application_type_name [String] The name of the application type name
194
+ # resource
195
+ # @param version [String] The application type version.
196
+ # @param api_version [String] The version of the API.
197
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
198
+ # will be added to the HTTP request.
199
+ #
200
+ def delete(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:nil)
201
+ response = delete_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:custom_headers).value!
202
+ nil
203
+ end
204
+
205
+ #
206
+ # @param subscription_id [String] The customer subscription identifier
207
+ # @param resource_group_name [String] The name of the resource group.
208
+ # @param cluster_name [String] The name of the cluster resource
209
+ # @param application_type_name [String] The name of the application type name
210
+ # resource
211
+ # @param version [String] The application type version.
212
+ # @param api_version [String] The version of the API.
213
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
214
+ # will be added to the HTTP request.
215
+ #
216
+ # @return [Concurrent::Promise] promise which provides async access to http
217
+ # response.
218
+ #
219
+ def delete_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:nil)
220
+ # Send request
221
+ promise = begin_delete_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:custom_headers)
222
+
223
+ promise = promise.then do |response|
224
+ # Defining deserialization method.
225
+ deserialize_method = lambda do |parsed_response|
226
+ end
227
+
228
+ # Waiting for response.
229
+ @client.get_long_running_operation_result(response, deserialize_method)
230
+ end
231
+
232
+ promise
233
+ end
234
+
235
+ #
236
+ # Returns all versions for the specified application type.
237
+ #
238
+ # @param subscription_id [String] The customer subscription identifier
239
+ # @param resource_group_name [String] The name of the resource group.
240
+ # @param cluster_name [String] The name of the cluster resource
241
+ # @param application_type_name [String] The name of the application type name
242
+ # resource
243
+ # @param api_version [String] The version of the API.
244
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
245
+ # will be added to the HTTP request.
246
+ #
247
+ # @return [VersionResourceList] operation results.
248
+ #
249
+ def list(subscription_id, resource_group_name, cluster_name, application_type_name, api_version, custom_headers:nil)
250
+ response = list_async(subscription_id, resource_group_name, cluster_name, application_type_name, api_version, custom_headers:custom_headers).value!
251
+ response.body unless response.nil?
252
+ end
253
+
254
+ #
255
+ # Returns all versions for the specified application type.
256
+ #
257
+ # @param subscription_id [String] The customer subscription identifier
258
+ # @param resource_group_name [String] The name of the resource group.
259
+ # @param cluster_name [String] The name of the cluster resource
260
+ # @param application_type_name [String] The name of the application type name
261
+ # resource
262
+ # @param api_version [String] The version of the API.
263
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
264
+ # will be added to the HTTP request.
265
+ #
266
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
267
+ #
268
+ def list_with_http_info(subscription_id, resource_group_name, cluster_name, application_type_name, api_version, custom_headers:nil)
269
+ list_async(subscription_id, resource_group_name, cluster_name, application_type_name, api_version, custom_headers:custom_headers).value!
270
+ end
271
+
272
+ #
273
+ # Returns all versions for the specified application type.
274
+ #
275
+ # @param subscription_id [String] The customer subscription identifier
276
+ # @param resource_group_name [String] The name of the resource group.
277
+ # @param cluster_name [String] The name of the cluster resource
278
+ # @param application_type_name [String] The name of the application type name
279
+ # resource
280
+ # @param api_version [String] The version of the API.
281
+ # @param [Hash{String => String}] A hash of custom headers that will be added
282
+ # to the HTTP request.
283
+ #
284
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
285
+ #
286
+ def list_async(subscription_id, resource_group_name, cluster_name, application_type_name, api_version, custom_headers:nil)
287
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
288
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
289
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
290
+ fail ArgumentError, 'application_type_name is nil' if application_type_name.nil?
291
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
292
+
293
+
294
+ request_headers = {}
295
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
296
+
297
+ # Set Headers
298
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
299
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
300
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions'
301
+
302
+ request_url = @base_url || @client.base_url
303
+
304
+ options = {
305
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
306
+ path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationTypeName' => application_type_name},
307
+ query_params: {'api-version' => api_version},
308
+ headers: request_headers.merge(custom_headers || {}),
309
+ base_url: request_url
310
+ }
311
+ promise = @client.make_request_async(:get, path_template, options)
312
+
313
+ promise = promise.then do |result|
314
+ http_response = result.response
315
+ status_code = http_response.status
316
+ response_content = http_response.body
317
+ unless status_code == 200
318
+ error_model = JSON.load(response_content)
319
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
320
+ end
321
+
322
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
323
+ # Deserialize Response
324
+ if status_code == 200
325
+ begin
326
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
327
+ result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::VersionResourceList.mapper()
328
+ result.body = @client.deserialize(result_mapper, parsed_response)
329
+ rescue Exception => e
330
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
331
+ end
332
+ end
333
+
334
+ result
335
+ end
336
+
337
+ promise.execute
338
+ end
339
+
340
+ #
341
+ # Provisions an application type version resource.
342
+ #
343
+ # @param subscription_id [String] The customer subscription identifier
344
+ # @param resource_group_name [String] The name of the resource group.
345
+ # @param cluster_name [String] The name of the cluster resource
346
+ # @param application_type_name [String] The name of the application type name
347
+ # resource
348
+ # @param version [String] The application type version.
349
+ # @param api_version [String] The version of the API.
350
+ # @param parameters [VersionResource] The application type version resource.
351
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
352
+ # will be added to the HTTP request.
353
+ #
354
+ # @return [VersionResource] operation results.
355
+ #
356
+ def begin_put(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, parameters, custom_headers:nil)
357
+ response = begin_put_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, parameters, custom_headers:custom_headers).value!
358
+ response.body unless response.nil?
359
+ end
360
+
361
+ #
362
+ # Provisions an application type version resource.
363
+ #
364
+ # @param subscription_id [String] The customer subscription identifier
365
+ # @param resource_group_name [String] The name of the resource group.
366
+ # @param cluster_name [String] The name of the cluster resource
367
+ # @param application_type_name [String] The name of the application type name
368
+ # resource
369
+ # @param version [String] The application type version.
370
+ # @param api_version [String] The version of the API.
371
+ # @param parameters [VersionResource] The application type version resource.
372
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
373
+ # will be added to the HTTP request.
374
+ #
375
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
376
+ #
377
+ def begin_put_with_http_info(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, parameters, custom_headers:nil)
378
+ begin_put_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, parameters, custom_headers:custom_headers).value!
379
+ end
380
+
381
+ #
382
+ # Provisions an application type version resource.
383
+ #
384
+ # @param subscription_id [String] The customer subscription identifier
385
+ # @param resource_group_name [String] The name of the resource group.
386
+ # @param cluster_name [String] The name of the cluster resource
387
+ # @param application_type_name [String] The name of the application type name
388
+ # resource
389
+ # @param version [String] The application type version.
390
+ # @param api_version [String] The version of the API.
391
+ # @param parameters [VersionResource] The application type version resource.
392
+ # @param [Hash{String => String}] A hash of custom headers that will be added
393
+ # to the HTTP request.
394
+ #
395
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
396
+ #
397
+ def begin_put_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, parameters, custom_headers:nil)
398
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
399
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
400
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
401
+ fail ArgumentError, 'application_type_name is nil' if application_type_name.nil?
402
+ fail ArgumentError, 'version is nil' if version.nil?
403
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
404
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
405
+
406
+
407
+ request_headers = {}
408
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
409
+
410
+ # Set Headers
411
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
412
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
413
+
414
+ # Serialize Request
415
+ request_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::VersionResource.mapper()
416
+ request_content = @client.serialize(request_mapper, parameters)
417
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
418
+
419
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}'
420
+
421
+ request_url = @base_url || @client.base_url
422
+
423
+ options = {
424
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
425
+ path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationTypeName' => application_type_name,'version' => version},
426
+ query_params: {'api-version' => api_version},
427
+ body: request_content,
428
+ headers: request_headers.merge(custom_headers || {}),
429
+ base_url: request_url
430
+ }
431
+ promise = @client.make_request_async(:put, path_template, options)
432
+
433
+ promise = promise.then do |result|
434
+ http_response = result.response
435
+ status_code = http_response.status
436
+ response_content = http_response.body
437
+ unless status_code == 202
438
+ error_model = JSON.load(response_content)
439
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
440
+ end
441
+
442
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
443
+ # Deserialize Response
444
+ if status_code == 202
445
+ begin
446
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
447
+ result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::VersionResource.mapper()
448
+ result.body = @client.deserialize(result_mapper, parsed_response)
449
+ rescue Exception => e
450
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
451
+ end
452
+ end
453
+
454
+ result
455
+ end
456
+
457
+ promise.execute
458
+ end
459
+
460
+ #
461
+ # Unprovisions an application type version resource.
462
+ #
463
+ # @param subscription_id [String] The customer subscription identifier
464
+ # @param resource_group_name [String] The name of the resource group.
465
+ # @param cluster_name [String] The name of the cluster resource
466
+ # @param application_type_name [String] The name of the application type name
467
+ # resource
468
+ # @param version [String] The application type version.
469
+ # @param api_version [String] The version of the API.
470
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
471
+ # will be added to the HTTP request.
472
+ #
473
+ #
474
+ def begin_delete(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:nil)
475
+ response = begin_delete_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:custom_headers).value!
476
+ nil
477
+ end
478
+
479
+ #
480
+ # Unprovisions an application type version resource.
481
+ #
482
+ # @param subscription_id [String] The customer subscription identifier
483
+ # @param resource_group_name [String] The name of the resource group.
484
+ # @param cluster_name [String] The name of the cluster resource
485
+ # @param application_type_name [String] The name of the application type name
486
+ # resource
487
+ # @param version [String] The application type version.
488
+ # @param api_version [String] The version of the API.
489
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
490
+ # will be added to the HTTP request.
491
+ #
492
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
493
+ #
494
+ def begin_delete_with_http_info(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:nil)
495
+ begin_delete_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:custom_headers).value!
496
+ end
497
+
498
+ #
499
+ # Unprovisions an application type version resource.
500
+ #
501
+ # @param subscription_id [String] The customer subscription identifier
502
+ # @param resource_group_name [String] The name of the resource group.
503
+ # @param cluster_name [String] The name of the cluster resource
504
+ # @param application_type_name [String] The name of the application type name
505
+ # resource
506
+ # @param version [String] The application type version.
507
+ # @param api_version [String] The version of the API.
508
+ # @param [Hash{String => String}] A hash of custom headers that will be added
509
+ # to the HTTP request.
510
+ #
511
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
512
+ #
513
+ def begin_delete_async(subscription_id, resource_group_name, cluster_name, application_type_name, version, api_version, custom_headers:nil)
514
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
515
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
516
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
517
+ fail ArgumentError, 'application_type_name is nil' if application_type_name.nil?
518
+ fail ArgumentError, 'version is nil' if version.nil?
519
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
520
+
521
+
522
+ request_headers = {}
523
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
524
+
525
+ # Set Headers
526
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
527
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
528
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}'
529
+
530
+ request_url = @base_url || @client.base_url
531
+
532
+ options = {
533
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
534
+ path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationTypeName' => application_type_name,'version' => version},
535
+ query_params: {'api-version' => api_version},
536
+ headers: request_headers.merge(custom_headers || {}),
537
+ base_url: request_url
538
+ }
539
+ promise = @client.make_request_async(:delete, path_template, options)
540
+
541
+ promise = promise.then do |result|
542
+ http_response = result.response
543
+ status_code = http_response.status
544
+ response_content = http_response.body
545
+ unless status_code == 202 || status_code == 204
546
+ error_model = JSON.load(response_content)
547
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
548
+ end
549
+
550
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
551
+
552
+ result
553
+ end
554
+
555
+ promise.execute
556
+ end
557
+
558
+ end
559
+ end