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
@@ -29,8 +29,8 @@ module Azure::ServiceFabric::Mgmt::V2016_09_01
29
29
  #
30
30
  # @return [Array<OperationResult>] operation results.
31
31
  #
32
- def list(custom_headers = nil)
33
- first_page = list_as_lazy(custom_headers)
32
+ def list(custom_headers:nil)
33
+ first_page = list_as_lazy(custom_headers:custom_headers)
34
34
  first_page.get_all_items
35
35
  end
36
36
 
@@ -42,8 +42,8 @@ module Azure::ServiceFabric::Mgmt::V2016_09_01
42
42
  #
43
43
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
44
44
  #
45
- def list_with_http_info(custom_headers = nil)
46
- list_async(custom_headers).value!
45
+ def list_with_http_info(custom_headers:nil)
46
+ list_async(custom_headers:custom_headers).value!
47
47
  end
48
48
 
49
49
  #
@@ -54,11 +54,12 @@ module Azure::ServiceFabric::Mgmt::V2016_09_01
54
54
  #
55
55
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
56
56
  #
57
- def list_async(custom_headers = nil)
57
+ def list_async(custom_headers:nil)
58
58
  fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
59
59
 
60
60
 
61
61
  request_headers = {}
62
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
62
63
 
63
64
  # Set Headers
64
65
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -112,8 +113,8 @@ module Azure::ServiceFabric::Mgmt::V2016_09_01
112
113
  #
113
114
  # @return [OperationListResult] operation results.
114
115
  #
115
- def list_next(next_page_link, custom_headers = nil)
116
- response = list_next_async(next_page_link, custom_headers).value!
116
+ def list_next(next_page_link, custom_headers:nil)
117
+ response = list_next_async(next_page_link, custom_headers:custom_headers).value!
117
118
  response.body unless response.nil?
118
119
  end
119
120
 
@@ -127,8 +128,8 @@ module Azure::ServiceFabric::Mgmt::V2016_09_01
127
128
  #
128
129
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
129
130
  #
130
- def list_next_with_http_info(next_page_link, custom_headers = nil)
131
- list_next_async(next_page_link, custom_headers).value!
131
+ def list_next_with_http_info(next_page_link, custom_headers:nil)
132
+ list_next_async(next_page_link, custom_headers:custom_headers).value!
132
133
  end
133
134
 
134
135
  #
@@ -141,11 +142,12 @@ module Azure::ServiceFabric::Mgmt::V2016_09_01
141
142
  #
142
143
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
143
144
  #
144
- def list_next_async(next_page_link, custom_headers = nil)
145
+ def list_next_async(next_page_link, custom_headers:nil)
145
146
  fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
146
147
 
147
148
 
148
149
  request_headers = {}
150
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
149
151
 
150
152
  # Set Headers
151
153
  request_headers['x-ms-client-request-id'] = SecureRandom.uuid
@@ -198,12 +200,12 @@ module Azure::ServiceFabric::Mgmt::V2016_09_01
198
200
  # @return [OperationListResult] which provide lazy access to pages of the
199
201
  # response.
200
202
  #
201
- def list_as_lazy(custom_headers = nil)
202
- response = list_async(custom_headers).value!
203
+ def list_as_lazy(custom_headers:nil)
204
+ response = list_async(custom_headers:custom_headers).value!
203
205
  unless response.nil?
204
206
  page = response.body
205
207
  page.next_method = Proc.new do |next_page_link|
206
- list_next_async(next_page_link, custom_headers)
208
+ list_next_async(next_page_link, custom_headers:custom_headers)
207
209
  end
208
210
  page
209
211
  end
@@ -112,6 +112,9 @@ module Azure::ServiceFabric::Mgmt::V2016_09_01
112
112
  fail ArgumentError, 'path is nil' if path.nil?
113
113
 
114
114
  request_url = options[:base_url] || @base_url
115
+ if(!options[:headers].nil? && !options[:headers]['Content-Type'].nil?)
116
+ @request_headers['Content-Type'] = options[:headers]['Content-Type']
117
+ end
115
118
 
116
119
  request_headers = @request_headers
117
120
  request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
@@ -128,7 +131,7 @@ module Azure::ServiceFabric::Mgmt::V2016_09_01
128
131
  #
129
132
  def add_telemetry
130
133
  sdk_information = 'azure_mgmt_service_fabric'
131
- sdk_information = "#{sdk_information}/0.15.2"
134
+ sdk_information = "#{sdk_information}/0.16.0"
132
135
  add_user_agent_information(sdk_information)
133
136
  end
134
137
  end
@@ -0,0 +1,91 @@
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 '2017-07-01-preview/generated/azure_mgmt_service_fabric/module_definition'
20
+ require 'ms_rest_azure'
21
+
22
+ module Azure::ServiceFabric::Mgmt::V2017_07_01_preview
23
+ autoload :Clusters, '2017-07-01-preview/generated/azure_mgmt_service_fabric/clusters.rb'
24
+ autoload :ClusterVersions, '2017-07-01-preview/generated/azure_mgmt_service_fabric/cluster_versions.rb'
25
+ autoload :Operations, '2017-07-01-preview/generated/azure_mgmt_service_fabric/operations.rb'
26
+ autoload :ApplicationType, '2017-07-01-preview/generated/azure_mgmt_service_fabric/application_type.rb'
27
+ autoload :Version, '2017-07-01-preview/generated/azure_mgmt_service_fabric/version.rb'
28
+ autoload :Application, '2017-07-01-preview/generated/azure_mgmt_service_fabric/application.rb'
29
+ autoload :Service, '2017-07-01-preview/generated/azure_mgmt_service_fabric/service.rb'
30
+ autoload :ServiceFabricManagementClient, '2017-07-01-preview/generated/azure_mgmt_service_fabric/service_fabric_management_client.rb'
31
+
32
+ module Models
33
+ autoload :ServicePropertiesBase, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_properties_base.rb'
34
+ autoload :ErrorModel, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/error_model.rb'
35
+ autoload :ServiceTypeHealthPolicyMapItem, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_health_policy_map_item.rb'
36
+ autoload :OperationListResult, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/operation_list_result.rb'
37
+ autoload :ApplicationMetricDescription, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_metric_description.rb'
38
+ autoload :OperationResult, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/operation_result.rb'
39
+ autoload :ServiceCorrelationDescription, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_correlation_description.rb'
40
+ autoload :ServicePlacementPolicyDescription, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_placement_policy_description.rb'
41
+ autoload :ServiceTypeDeltaHealthPolicy, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_delta_health_policy.rb'
42
+ autoload :ApplicationHealthPolicy, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_health_policy.rb'
43
+ autoload :ClusterUpdateParameters, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_update_parameters.rb'
44
+ autoload :ApplicationParameter, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_parameter.rb'
45
+ autoload :ClusterCodeVersionsListResult, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_code_versions_list_result.rb'
46
+ autoload :ServiceLoadMetricDescription, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_load_metric_description.rb'
47
+ autoload :ClusterCodeVersionsResult, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_code_versions_result.rb'
48
+ autoload :PartitionSchemeDescription, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/partition_scheme_description.rb'
49
+ autoload :ProxyResource, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/proxy_resource.rb'
50
+ autoload :DiagnosticsStorageAccountConfig, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/diagnostics_storage_account_config.rb'
51
+ autoload :RollingUpgradeMonitoringPolicy, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/rolling_upgrade_monitoring_policy.rb'
52
+ autoload :Resource, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/resource.rb'
53
+ autoload :ClusterUpgradePolicy, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_upgrade_policy.rb'
54
+ autoload :AvailableOperationDisplay, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/available_operation_display.rb'
55
+ autoload :ClusterHealthPolicy, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_health_policy.rb'
56
+ autoload :AzureActiveDirectory, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/azure_active_directory.rb'
57
+ autoload :ServiceTypeHealthPolicy, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_type_health_policy.rb'
58
+ autoload :CertificateDescription, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/certificate_description.rb'
59
+ autoload :ApplicationTypeResourceList, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_type_resource_list.rb'
60
+ autoload :ClientCertificateCommonName, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/client_certificate_common_name.rb'
61
+ autoload :ApplicationResourceList, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource_list.rb'
62
+ autoload :ClientCertificateThumbprint, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/client_certificate_thumbprint.rb'
63
+ autoload :ClusterUpgradeDeltaHealthPolicy, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_upgrade_delta_health_policy.rb'
64
+ autoload :ClusterVersionDetails, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_version_details.rb'
65
+ autoload :ClusterListResult, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster_list_result.rb'
66
+ autoload :SettingsParameterDescription, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/settings_parameter_description.rb'
67
+ autoload :ApplicationUpgradePolicy, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_upgrade_policy.rb'
68
+ autoload :SettingsSectionDescription, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/settings_section_description.rb'
69
+ autoload :VersionResourceList, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/version_resource_list.rb'
70
+ autoload :EndpointRangeDescription, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/endpoint_range_description.rb'
71
+ autoload :ServiceResourceList, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource_list.rb'
72
+ autoload :NodeTypeDescription, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/node_type_description.rb'
73
+ autoload :NamedPartitionSchemeDescription, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/named_partition_scheme_description.rb'
74
+ autoload :SingletonPartitionSchemeDescription, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/singleton_partition_scheme_description.rb'
75
+ autoload :UniformInt64RangePartitionSchemeDescription, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/uniform_int64range_partition_scheme_description.rb'
76
+ autoload :ApplicationTypeResource, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_type_resource.rb'
77
+ autoload :VersionResource, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/version_resource.rb'
78
+ autoload :ApplicationResource, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource.rb'
79
+ autoload :ApplicationResourceUpdate, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/application_resource_update.rb'
80
+ autoload :ServiceProperties, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_properties.rb'
81
+ autoload :ServiceResource, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource.rb'
82
+ autoload :ServiceUpdateProperties, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_update_properties.rb'
83
+ autoload :ServiceResourceUpdate, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/service_resource_update.rb'
84
+ autoload :StatelessServiceProperties, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateless_service_properties.rb'
85
+ autoload :StatelessServiceUpdateProperties, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateless_service_update_properties.rb'
86
+ autoload :StatefulServiceProperties, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateful_service_properties.rb'
87
+ autoload :StatefulServiceUpdateProperties, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/stateful_service_update_properties.rb'
88
+ autoload :Cluster, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/cluster.rb'
89
+ autoload :ProvisioningState, '2017-07-01-preview/generated/azure_mgmt_service_fabric/models/provisioning_state.rb'
90
+ end
91
+ end
@@ -0,0 +1,691 @@
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 Application
11
+ include MsRestAzure
12
+
13
+ #
14
+ # Creates and initializes a new instance of the Application 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 resource with the specified name.
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_name [String] The name of the application resource.
31
+ # @param api_version [String] The version of the API.
32
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
33
+ # will be added to the HTTP request.
34
+ #
35
+ # @return [ApplicationResource] operation results.
36
+ #
37
+ def get(subscription_id, resource_group_name, cluster_name, application_name, api_version, custom_headers:nil)
38
+ response = get_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, custom_headers:custom_headers).value!
39
+ response.body unless response.nil?
40
+ end
41
+
42
+ #
43
+ # Returns an application resource with the specified name.
44
+ #
45
+ # @param subscription_id [String] The customer subscription identifier
46
+ # @param resource_group_name [String] The name of the resource group.
47
+ # @param cluster_name [String] The name of the cluster resource
48
+ # @param application_name [String] The name of the application resource.
49
+ # @param api_version [String] The version of the API.
50
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
51
+ # will be added to the HTTP request.
52
+ #
53
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
54
+ #
55
+ def get_with_http_info(subscription_id, resource_group_name, cluster_name, application_name, api_version, custom_headers:nil)
56
+ get_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, custom_headers:custom_headers).value!
57
+ end
58
+
59
+ #
60
+ # Returns an application resource with the specified name.
61
+ #
62
+ # @param subscription_id [String] The customer subscription identifier
63
+ # @param resource_group_name [String] The name of the resource group.
64
+ # @param cluster_name [String] The name of the cluster resource
65
+ # @param application_name [String] The name of the application resource.
66
+ # @param api_version [String] The version of the API.
67
+ # @param [Hash{String => String}] A hash of custom headers that will be added
68
+ # to the HTTP request.
69
+ #
70
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
71
+ #
72
+ def get_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, custom_headers:nil)
73
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
74
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
75
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
76
+ fail ArgumentError, 'application_name is nil' if application_name.nil?
77
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
78
+
79
+
80
+ request_headers = {}
81
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
82
+
83
+ # Set Headers
84
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
85
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
86
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}'
87
+
88
+ request_url = @base_url || @client.base_url
89
+
90
+ options = {
91
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
92
+ path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationName' => application_name},
93
+ query_params: {'api-version' => api_version},
94
+ headers: request_headers.merge(custom_headers || {}),
95
+ base_url: request_url
96
+ }
97
+ promise = @client.make_request_async(:get, path_template, options)
98
+
99
+ promise = promise.then do |result|
100
+ http_response = result.response
101
+ status_code = http_response.status
102
+ response_content = http_response.body
103
+ unless status_code == 200
104
+ error_model = JSON.load(response_content)
105
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
106
+ end
107
+
108
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
109
+ # Deserialize Response
110
+ if status_code == 200
111
+ begin
112
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
113
+ result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ApplicationResource.mapper()
114
+ result.body = @client.deserialize(result_mapper, parsed_response)
115
+ rescue Exception => e
116
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
117
+ end
118
+ end
119
+
120
+ result
121
+ end
122
+
123
+ promise.execute
124
+ end
125
+
126
+ #
127
+ # Creates or updates an application resource with the specified name.
128
+ #
129
+ # @param subscription_id [String] The customer subscription identifier
130
+ # @param resource_group_name [String] The name of the resource group.
131
+ # @param cluster_name [String] The name of the cluster resource
132
+ # @param application_name [String] The name of the application resource.
133
+ # @param api_version [String] The version of the API.
134
+ # @param parameters [ApplicationResource] The application resource.
135
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
136
+ # will be added to the HTTP request.
137
+ #
138
+ # @return [ApplicationResource] operation results.
139
+ #
140
+ def put(subscription_id, resource_group_name, cluster_name, application_name, api_version, parameters, custom_headers:nil)
141
+ response = put_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, parameters, custom_headers:custom_headers).value!
142
+ response.body unless response.nil?
143
+ end
144
+
145
+ #
146
+ # @param subscription_id [String] The customer subscription identifier
147
+ # @param resource_group_name [String] The name of the resource group.
148
+ # @param cluster_name [String] The name of the cluster resource
149
+ # @param application_name [String] The name of the application resource.
150
+ # @param api_version [String] The version of the API.
151
+ # @param parameters [ApplicationResource] The application resource.
152
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
153
+ # will be added to the HTTP request.
154
+ #
155
+ # @return [Concurrent::Promise] promise which provides async access to http
156
+ # response.
157
+ #
158
+ def put_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, parameters, custom_headers:nil)
159
+ # Send request
160
+ promise = begin_put_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, parameters, custom_headers:custom_headers)
161
+
162
+ promise = promise.then do |response|
163
+ # Defining deserialization method.
164
+ deserialize_method = lambda do |parsed_response|
165
+ result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ApplicationResource.mapper()
166
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
167
+ end
168
+
169
+ # Waiting for response.
170
+ @client.get_long_running_operation_result(response, deserialize_method)
171
+ end
172
+
173
+ promise
174
+ end
175
+
176
+ #
177
+ # Updates an application resource with the specified name.
178
+ #
179
+ # @param subscription_id [String] The customer subscription identifier
180
+ # @param resource_group_name [String] The name of the resource group.
181
+ # @param cluster_name [String] The name of the cluster resource
182
+ # @param application_name [String] The name of the application resource.
183
+ # @param api_version [String] The version of the API.
184
+ # @param parameters [ApplicationResourceUpdate] The application resource for
185
+ # patch operations.
186
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
187
+ # will be added to the HTTP request.
188
+ #
189
+ # @return [ApplicationResourceUpdate] operation results.
190
+ #
191
+ def patch(subscription_id, resource_group_name, cluster_name, application_name, api_version, parameters, custom_headers:nil)
192
+ response = patch_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, parameters, custom_headers:custom_headers).value!
193
+ response.body unless response.nil?
194
+ end
195
+
196
+ #
197
+ # @param subscription_id [String] The customer subscription identifier
198
+ # @param resource_group_name [String] The name of the resource group.
199
+ # @param cluster_name [String] The name of the cluster resource
200
+ # @param application_name [String] The name of the application resource.
201
+ # @param api_version [String] The version of the API.
202
+ # @param parameters [ApplicationResourceUpdate] The application resource for
203
+ # patch operations.
204
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
205
+ # will be added to the HTTP request.
206
+ #
207
+ # @return [Concurrent::Promise] promise which provides async access to http
208
+ # response.
209
+ #
210
+ def patch_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, parameters, custom_headers:nil)
211
+ # Send request
212
+ promise = begin_patch_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, parameters, custom_headers:custom_headers)
213
+
214
+ promise = promise.then do |response|
215
+ # Defining deserialization method.
216
+ deserialize_method = lambda do |parsed_response|
217
+ result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ApplicationResourceUpdate.mapper()
218
+ parsed_response = @client.deserialize(result_mapper, parsed_response)
219
+ end
220
+
221
+ # Waiting for response.
222
+ @client.get_long_running_operation_result(response, deserialize_method)
223
+ end
224
+
225
+ promise
226
+ end
227
+
228
+ #
229
+ # Deletes an application resource with the specified name.
230
+ #
231
+ # @param subscription_id [String] The customer subscription identifier
232
+ # @param resource_group_name [String] The name of the resource group.
233
+ # @param cluster_name [String] The name of the cluster resource
234
+ # @param application_name [String] The name of the application resource.
235
+ # @param api_version [String] The version of the API.
236
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
237
+ # will be added to the HTTP request.
238
+ #
239
+ def delete(subscription_id, resource_group_name, cluster_name, application_name, api_version, custom_headers:nil)
240
+ response = delete_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, custom_headers:custom_headers).value!
241
+ nil
242
+ end
243
+
244
+ #
245
+ # @param subscription_id [String] The customer subscription identifier
246
+ # @param resource_group_name [String] The name of the resource group.
247
+ # @param cluster_name [String] The name of the cluster resource
248
+ # @param application_name [String] The name of the application resource.
249
+ # @param api_version [String] The version of the API.
250
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
251
+ # will be added to the HTTP request.
252
+ #
253
+ # @return [Concurrent::Promise] promise which provides async access to http
254
+ # response.
255
+ #
256
+ def delete_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, custom_headers:nil)
257
+ # Send request
258
+ promise = begin_delete_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, custom_headers:custom_headers)
259
+
260
+ promise = promise.then do |response|
261
+ # Defining deserialization method.
262
+ deserialize_method = lambda do |parsed_response|
263
+ end
264
+
265
+ # Waiting for response.
266
+ @client.get_long_running_operation_result(response, deserialize_method)
267
+ end
268
+
269
+ promise
270
+ end
271
+
272
+ #
273
+ # Returns all application resources in the specified cluster.
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 api_version [String] The version of the API.
279
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
280
+ # will be added to the HTTP request.
281
+ #
282
+ # @return [ApplicationResourceList] operation results.
283
+ #
284
+ def list(subscription_id, resource_group_name, cluster_name, api_version, custom_headers:nil)
285
+ response = list_async(subscription_id, resource_group_name, cluster_name, api_version, custom_headers:custom_headers).value!
286
+ response.body unless response.nil?
287
+ end
288
+
289
+ #
290
+ # Returns all application resources in the specified cluster.
291
+ #
292
+ # @param subscription_id [String] The customer subscription identifier
293
+ # @param resource_group_name [String] The name of the resource group.
294
+ # @param cluster_name [String] The name of the cluster resource
295
+ # @param api_version [String] The version of the API.
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 list_with_http_info(subscription_id, resource_group_name, cluster_name, api_version, custom_headers:nil)
302
+ list_async(subscription_id, resource_group_name, cluster_name, api_version, custom_headers:custom_headers).value!
303
+ end
304
+
305
+ #
306
+ # Returns all application resources in the specified cluster.
307
+ #
308
+ # @param subscription_id [String] The customer subscription identifier
309
+ # @param resource_group_name [String] The name of the resource group.
310
+ # @param cluster_name [String] The name of the cluster resource
311
+ # @param api_version [String] The version of the API.
312
+ # @param [Hash{String => String}] A hash of custom headers that will be added
313
+ # to the HTTP request.
314
+ #
315
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
316
+ #
317
+ def list_async(subscription_id, resource_group_name, cluster_name, api_version, custom_headers:nil)
318
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
319
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
320
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
321
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
322
+
323
+
324
+ request_headers = {}
325
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
326
+
327
+ # Set Headers
328
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
329
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
330
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications'
331
+
332
+ request_url = @base_url || @client.base_url
333
+
334
+ options = {
335
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
336
+ path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name},
337
+ query_params: {'api-version' => api_version},
338
+ headers: request_headers.merge(custom_headers || {}),
339
+ base_url: request_url
340
+ }
341
+ promise = @client.make_request_async(:get, path_template, options)
342
+
343
+ promise = promise.then do |result|
344
+ http_response = result.response
345
+ status_code = http_response.status
346
+ response_content = http_response.body
347
+ unless status_code == 200
348
+ error_model = JSON.load(response_content)
349
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
350
+ end
351
+
352
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
353
+ # Deserialize Response
354
+ if status_code == 200
355
+ begin
356
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
357
+ result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ApplicationResourceList.mapper()
358
+ result.body = @client.deserialize(result_mapper, parsed_response)
359
+ rescue Exception => e
360
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
361
+ end
362
+ end
363
+
364
+ result
365
+ end
366
+
367
+ promise.execute
368
+ end
369
+
370
+ #
371
+ # Creates or updates an application resource with the specified name.
372
+ #
373
+ # @param subscription_id [String] The customer subscription identifier
374
+ # @param resource_group_name [String] The name of the resource group.
375
+ # @param cluster_name [String] The name of the cluster resource
376
+ # @param application_name [String] The name of the application resource.
377
+ # @param api_version [String] The version of the API.
378
+ # @param parameters [ApplicationResource] The application resource.
379
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
380
+ # will be added to the HTTP request.
381
+ #
382
+ # @return [ApplicationResource] operation results.
383
+ #
384
+ def begin_put(subscription_id, resource_group_name, cluster_name, application_name, api_version, parameters, custom_headers:nil)
385
+ response = begin_put_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, parameters, custom_headers:custom_headers).value!
386
+ response.body unless response.nil?
387
+ end
388
+
389
+ #
390
+ # Creates or updates an application resource with the specified name.
391
+ #
392
+ # @param subscription_id [String] The customer subscription identifier
393
+ # @param resource_group_name [String] The name of the resource group.
394
+ # @param cluster_name [String] The name of the cluster resource
395
+ # @param application_name [String] The name of the application resource.
396
+ # @param api_version [String] The version of the API.
397
+ # @param parameters [ApplicationResource] The application resource.
398
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
399
+ # will be added to the HTTP request.
400
+ #
401
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
402
+ #
403
+ def begin_put_with_http_info(subscription_id, resource_group_name, cluster_name, application_name, api_version, parameters, custom_headers:nil)
404
+ begin_put_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, parameters, custom_headers:custom_headers).value!
405
+ end
406
+
407
+ #
408
+ # Creates or updates an application resource with the specified name.
409
+ #
410
+ # @param subscription_id [String] The customer subscription identifier
411
+ # @param resource_group_name [String] The name of the resource group.
412
+ # @param cluster_name [String] The name of the cluster resource
413
+ # @param application_name [String] The name of the application resource.
414
+ # @param api_version [String] The version of the API.
415
+ # @param parameters [ApplicationResource] The application resource.
416
+ # @param [Hash{String => String}] A hash of custom headers that will be added
417
+ # to the HTTP request.
418
+ #
419
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
420
+ #
421
+ def begin_put_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, parameters, custom_headers:nil)
422
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
423
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
424
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
425
+ fail ArgumentError, 'application_name is nil' if application_name.nil?
426
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
427
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
428
+
429
+
430
+ request_headers = {}
431
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
432
+
433
+ # Set Headers
434
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
435
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
436
+
437
+ # Serialize Request
438
+ request_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ApplicationResource.mapper()
439
+ request_content = @client.serialize(request_mapper, parameters)
440
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
441
+
442
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}'
443
+
444
+ request_url = @base_url || @client.base_url
445
+
446
+ options = {
447
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
448
+ path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationName' => application_name},
449
+ query_params: {'api-version' => api_version},
450
+ body: request_content,
451
+ headers: request_headers.merge(custom_headers || {}),
452
+ base_url: request_url
453
+ }
454
+ promise = @client.make_request_async(:put, path_template, options)
455
+
456
+ promise = promise.then do |result|
457
+ http_response = result.response
458
+ status_code = http_response.status
459
+ response_content = http_response.body
460
+ unless status_code == 202
461
+ error_model = JSON.load(response_content)
462
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
463
+ end
464
+
465
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
466
+ # Deserialize Response
467
+ if status_code == 202
468
+ begin
469
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
470
+ result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ApplicationResource.mapper()
471
+ result.body = @client.deserialize(result_mapper, parsed_response)
472
+ rescue Exception => e
473
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
474
+ end
475
+ end
476
+
477
+ result
478
+ end
479
+
480
+ promise.execute
481
+ end
482
+
483
+ #
484
+ # Updates an application resource with the specified name.
485
+ #
486
+ # @param subscription_id [String] The customer subscription identifier
487
+ # @param resource_group_name [String] The name of the resource group.
488
+ # @param cluster_name [String] The name of the cluster resource
489
+ # @param application_name [String] The name of the application resource.
490
+ # @param api_version [String] The version of the API.
491
+ # @param parameters [ApplicationResourceUpdate] The application resource for
492
+ # patch operations.
493
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
494
+ # will be added to the HTTP request.
495
+ #
496
+ # @return [ApplicationResourceUpdate] operation results.
497
+ #
498
+ def begin_patch(subscription_id, resource_group_name, cluster_name, application_name, api_version, parameters, custom_headers:nil)
499
+ response = begin_patch_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, parameters, custom_headers:custom_headers).value!
500
+ response.body unless response.nil?
501
+ end
502
+
503
+ #
504
+ # Updates an application resource with the specified name.
505
+ #
506
+ # @param subscription_id [String] The customer subscription identifier
507
+ # @param resource_group_name [String] The name of the resource group.
508
+ # @param cluster_name [String] The name of the cluster resource
509
+ # @param application_name [String] The name of the application resource.
510
+ # @param api_version [String] The version of the API.
511
+ # @param parameters [ApplicationResourceUpdate] The application resource for
512
+ # patch operations.
513
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
514
+ # will be added to the HTTP request.
515
+ #
516
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
517
+ #
518
+ def begin_patch_with_http_info(subscription_id, resource_group_name, cluster_name, application_name, api_version, parameters, custom_headers:nil)
519
+ begin_patch_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, parameters, custom_headers:custom_headers).value!
520
+ end
521
+
522
+ #
523
+ # Updates an application resource with the specified name.
524
+ #
525
+ # @param subscription_id [String] The customer subscription identifier
526
+ # @param resource_group_name [String] The name of the resource group.
527
+ # @param cluster_name [String] The name of the cluster resource
528
+ # @param application_name [String] The name of the application resource.
529
+ # @param api_version [String] The version of the API.
530
+ # @param parameters [ApplicationResourceUpdate] The application resource for
531
+ # patch operations.
532
+ # @param [Hash{String => String}] A hash of custom headers that will be added
533
+ # to the HTTP request.
534
+ #
535
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
536
+ #
537
+ def begin_patch_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, parameters, custom_headers:nil)
538
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
539
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
540
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
541
+ fail ArgumentError, 'application_name is nil' if application_name.nil?
542
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
543
+ fail ArgumentError, 'parameters is nil' if parameters.nil?
544
+
545
+
546
+ request_headers = {}
547
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
548
+
549
+ # Set Headers
550
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
551
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
552
+
553
+ # Serialize Request
554
+ request_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ApplicationResourceUpdate.mapper()
555
+ request_content = @client.serialize(request_mapper, parameters)
556
+ request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
557
+
558
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}'
559
+
560
+ request_url = @base_url || @client.base_url
561
+
562
+ options = {
563
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
564
+ path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationName' => application_name},
565
+ query_params: {'api-version' => api_version},
566
+ body: request_content,
567
+ headers: request_headers.merge(custom_headers || {}),
568
+ base_url: request_url
569
+ }
570
+ promise = @client.make_request_async(:patch, path_template, options)
571
+
572
+ promise = promise.then do |result|
573
+ http_response = result.response
574
+ status_code = http_response.status
575
+ response_content = http_response.body
576
+ unless status_code == 202
577
+ error_model = JSON.load(response_content)
578
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
579
+ end
580
+
581
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
582
+ # Deserialize Response
583
+ if status_code == 202
584
+ begin
585
+ parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
586
+ result_mapper = Azure::ServiceFabric::Mgmt::V2017_07_01_preview::Models::ApplicationResourceUpdate.mapper()
587
+ result.body = @client.deserialize(result_mapper, parsed_response)
588
+ rescue Exception => e
589
+ fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
590
+ end
591
+ end
592
+
593
+ result
594
+ end
595
+
596
+ promise.execute
597
+ end
598
+
599
+ #
600
+ # Deletes an application resource with the specified name.
601
+ #
602
+ # @param subscription_id [String] The customer subscription identifier
603
+ # @param resource_group_name [String] The name of the resource group.
604
+ # @param cluster_name [String] The name of the cluster resource
605
+ # @param application_name [String] The name of the application resource.
606
+ # @param api_version [String] The version of the API.
607
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
608
+ # will be added to the HTTP request.
609
+ #
610
+ #
611
+ def begin_delete(subscription_id, resource_group_name, cluster_name, application_name, api_version, custom_headers:nil)
612
+ response = begin_delete_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, custom_headers:custom_headers).value!
613
+ nil
614
+ end
615
+
616
+ #
617
+ # Deletes an application resource with the specified name.
618
+ #
619
+ # @param subscription_id [String] The customer subscription identifier
620
+ # @param resource_group_name [String] The name of the resource group.
621
+ # @param cluster_name [String] The name of the cluster resource
622
+ # @param application_name [String] The name of the application resource.
623
+ # @param api_version [String] The version of the API.
624
+ # @param custom_headers [Hash{String => String}] A hash of custom headers that
625
+ # will be added to the HTTP request.
626
+ #
627
+ # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
628
+ #
629
+ def begin_delete_with_http_info(subscription_id, resource_group_name, cluster_name, application_name, api_version, custom_headers:nil)
630
+ begin_delete_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, custom_headers:custom_headers).value!
631
+ end
632
+
633
+ #
634
+ # Deletes an application resource with the specified name.
635
+ #
636
+ # @param subscription_id [String] The customer subscription identifier
637
+ # @param resource_group_name [String] The name of the resource group.
638
+ # @param cluster_name [String] The name of the cluster resource
639
+ # @param application_name [String] The name of the application resource.
640
+ # @param api_version [String] The version of the API.
641
+ # @param [Hash{String => String}] A hash of custom headers that will be added
642
+ # to the HTTP request.
643
+ #
644
+ # @return [Concurrent::Promise] Promise object which holds the HTTP response.
645
+ #
646
+ def begin_delete_async(subscription_id, resource_group_name, cluster_name, application_name, api_version, custom_headers:nil)
647
+ fail ArgumentError, 'subscription_id is nil' if subscription_id.nil?
648
+ fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
649
+ fail ArgumentError, 'cluster_name is nil' if cluster_name.nil?
650
+ fail ArgumentError, 'application_name is nil' if application_name.nil?
651
+ fail ArgumentError, 'api_version is nil' if api_version.nil?
652
+
653
+
654
+ request_headers = {}
655
+ request_headers['Content-Type'] = 'application/json; charset=utf-8'
656
+
657
+ # Set Headers
658
+ request_headers['x-ms-client-request-id'] = SecureRandom.uuid
659
+ request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
660
+ path_template = 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/clusters/{clusterName}/applications/{applicationName}'
661
+
662
+ request_url = @base_url || @client.base_url
663
+
664
+ options = {
665
+ middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
666
+ path_params: {'subscriptionId' => subscription_id,'resourceGroupName' => resource_group_name,'clusterName' => cluster_name,'applicationName' => application_name},
667
+ query_params: {'api-version' => api_version},
668
+ headers: request_headers.merge(custom_headers || {}),
669
+ base_url: request_url
670
+ }
671
+ promise = @client.make_request_async(:delete, path_template, options)
672
+
673
+ promise = promise.then do |result|
674
+ http_response = result.response
675
+ status_code = http_response.status
676
+ response_content = http_response.body
677
+ unless status_code == 202 || status_code == 204
678
+ error_model = JSON.load(response_content)
679
+ fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
680
+ end
681
+
682
+ result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
683
+
684
+ result
685
+ end
686
+
687
+ promise.execute
688
+ end
689
+
690
+ end
691
+ end