ibm_cloud_resource_controller 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +148 -0
  4. data/Rakefile +10 -0
  5. data/docs/Credentials.md +25 -0
  6. data/docs/ErrorReport.md +23 -0
  7. data/docs/PlanHistoryItem.md +19 -0
  8. data/docs/Reclamation.md +45 -0
  9. data/docs/ReclamationActionsPost.md +19 -0
  10. data/docs/ReclamationsList.md +17 -0
  11. data/docs/ResourceAlias.md +57 -0
  12. data/docs/ResourceAliasPatch.md +17 -0
  13. data/docs/ResourceAliasPost.md +21 -0
  14. data/docs/ResourceAliasesApi.md +302 -0
  15. data/docs/ResourceAliasesList.md +21 -0
  16. data/docs/ResourceBinding.md +57 -0
  17. data/docs/ResourceBindingPatch.md +17 -0
  18. data/docs/ResourceBindingPost.md +25 -0
  19. data/docs/ResourceBindingPostParameters.md +17 -0
  20. data/docs/ResourceBindingsApi.md +300 -0
  21. data/docs/ResourceBindingsList.md +21 -0
  22. data/docs/ResourceInstance.md +81 -0
  23. data/docs/ResourceInstancePatch.md +23 -0
  24. data/docs/ResourceInstancePost.md +29 -0
  25. data/docs/ResourceInstancesApi.md +418 -0
  26. data/docs/ResourceInstancesList.md +21 -0
  27. data/docs/ResourceKey.md +53 -0
  28. data/docs/ResourceKeyPatch.md +17 -0
  29. data/docs/ResourceKeyPost.md +23 -0
  30. data/docs/ResourceKeysApi.md +298 -0
  31. data/docs/ResourceKeysList.md +21 -0
  32. data/docs/ResourceReclamationsApi.md +128 -0
  33. data/git_push.sh +58 -0
  34. data/ibm_cloud_resource_controller.gemspec +38 -0
  35. data/lib/ibm_cloud_resource_controller.rb +67 -0
  36. data/lib/ibm_cloud_resource_controller/api/resource_aliases_api.rb +363 -0
  37. data/lib/ibm_cloud_resource_controller/api/resource_bindings_api.rb +360 -0
  38. data/lib/ibm_cloud_resource_controller/api/resource_instances_api.rb +493 -0
  39. data/lib/ibm_cloud_resource_controller/api/resource_keys_api.rb +357 -0
  40. data/lib/ibm_cloud_resource_controller/api/resource_reclamations_api.rb +156 -0
  41. data/lib/ibm_cloud_resource_controller/api_client.rb +388 -0
  42. data/lib/ibm_cloud_resource_controller/api_error.rb +57 -0
  43. data/lib/ibm_cloud_resource_controller/configuration.rb +248 -0
  44. data/lib/ibm_cloud_resource_controller/models/credentials.rb +250 -0
  45. data/lib/ibm_cloud_resource_controller/models/error_report.rb +240 -0
  46. data/lib/ibm_cloud_resource_controller/models/plan_history_item.rb +230 -0
  47. data/lib/ibm_cloud_resource_controller/models/reclamation.rb +352 -0
  48. data/lib/ibm_cloud_resource_controller/models/reclamation_actions_post.rb +220 -0
  49. data/lib/ibm_cloud_resource_controller/models/reclamations_list.rb +212 -0
  50. data/lib/ibm_cloud_resource_controller/models/resource_alias.rb +410 -0
  51. data/lib/ibm_cloud_resource_controller/models/resource_alias_patch.rb +236 -0
  52. data/lib/ibm_cloud_resource_controller/models/resource_alias_post.rb +266 -0
  53. data/lib/ibm_cloud_resource_controller/models/resource_aliases_list.rb +247 -0
  54. data/lib/ibm_cloud_resource_controller/models/resource_binding.rb +410 -0
  55. data/lib/ibm_cloud_resource_controller/models/resource_binding_patch.rb +236 -0
  56. data/lib/ibm_cloud_resource_controller/models/resource_binding_post.rb +278 -0
  57. data/lib/ibm_cloud_resource_controller/models/resource_binding_post_parameters.rb +210 -0
  58. data/lib/ibm_cloud_resource_controller/models/resource_bindings_list.rb +247 -0
  59. data/lib/ibm_cloud_resource_controller/models/resource_instance.rb +536 -0
  60. data/lib/ibm_cloud_resource_controller/models/resource_instance_patch.rb +259 -0
  61. data/lib/ibm_cloud_resource_controller/models/resource_instance_post.rb +317 -0
  62. data/lib/ibm_cloud_resource_controller/models/resource_instances_list.rb +247 -0
  63. data/lib/ibm_cloud_resource_controller/models/resource_key.rb +390 -0
  64. data/lib/ibm_cloud_resource_controller/models/resource_key_patch.rb +236 -0
  65. data/lib/ibm_cloud_resource_controller/models/resource_key_post.rb +251 -0
  66. data/lib/ibm_cloud_resource_controller/models/resource_keys_list.rb +247 -0
  67. data/lib/ibm_cloud_resource_controller/version.rb +15 -0
  68. data/spec/api/resource_aliases_api_spec.rb +104 -0
  69. data/spec/api/resource_bindings_api_spec.rb +103 -0
  70. data/spec/api/resource_instances_api_spec.rb +130 -0
  71. data/spec/api/resource_keys_api_spec.rb +102 -0
  72. data/spec/api/resource_reclamations_api_spec.rb +62 -0
  73. data/spec/api_client_spec.rb +226 -0
  74. data/spec/configuration_spec.rb +42 -0
  75. data/spec/models/credentials_spec.rb +65 -0
  76. data/spec/models/error_report_spec.rb +59 -0
  77. data/spec/models/plan_history_item_spec.rb +47 -0
  78. data/spec/models/reclamation_actions_post_spec.rb +47 -0
  79. data/spec/models/reclamation_spec.rb +125 -0
  80. data/spec/models/reclamations_list_spec.rb +41 -0
  81. data/spec/models/resource_alias_patch_spec.rb +41 -0
  82. data/spec/models/resource_alias_post_spec.rb +53 -0
  83. data/spec/models/resource_alias_spec.rb +143 -0
  84. data/spec/models/resource_aliases_list_spec.rb +53 -0
  85. data/spec/models/resource_binding_patch_spec.rb +41 -0
  86. data/spec/models/resource_binding_post_parameters_spec.rb +41 -0
  87. data/spec/models/resource_binding_post_spec.rb +65 -0
  88. data/spec/models/resource_binding_spec.rb +137 -0
  89. data/spec/models/resource_bindings_list_spec.rb +53 -0
  90. data/spec/models/resource_instance_patch_spec.rb +59 -0
  91. data/spec/models/resource_instance_post_spec.rb +77 -0
  92. data/spec/models/resource_instance_spec.rb +191 -0
  93. data/spec/models/resource_instances_list_spec.rb +53 -0
  94. data/spec/models/resource_key_patch_spec.rb +41 -0
  95. data/spec/models/resource_key_post_spec.rb +59 -0
  96. data/spec/models/resource_key_spec.rb +125 -0
  97. data/spec/models/resource_keys_list_spec.rb +53 -0
  98. data/spec/spec_helper.rb +111 -0
  99. metadata +211 -0
@@ -0,0 +1,360 @@
1
+ =begin
2
+ #IBM Cloud Resource Controller API
3
+
4
+ #Manage lifecycle of your Cloud resources using Resource Controller APIs. Resources are provisioned globally in an account scope. Supports asynchronous provisioning of resources. Enables consumption of a global resource through a Cloud Foundry space in any region.
5
+
6
+ The version of the OpenAPI document: 2.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0-beta2
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module IbmCloudResourceController
16
+ class ResourceBindingsApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create a new resource binding
23
+ # Create a new resource binding.
24
+ # @param resource_binding_post [ResourceBindingPost]
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [ResourceBinding]
27
+ def create_resource_binding(resource_binding_post, opts = {})
28
+ data, _status_code, _headers = create_resource_binding_with_http_info(resource_binding_post, opts)
29
+ data
30
+ end
31
+
32
+ # Create a new resource binding
33
+ # Create a new resource binding.
34
+ # @param resource_binding_post [ResourceBindingPost]
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(ResourceBinding, Integer, Hash)>] ResourceBinding data, response status code and response headers
37
+ def create_resource_binding_with_http_info(resource_binding_post, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: ResourceBindingsApi.create_resource_binding ...'
40
+ end
41
+ # verify the required parameter 'resource_binding_post' is set
42
+ if @api_client.config.client_side_validation && resource_binding_post.nil?
43
+ fail ArgumentError, "Missing the required parameter 'resource_binding_post' when calling ResourceBindingsApi.create_resource_binding"
44
+ end
45
+ # resource path
46
+ local_var_path = '/v2/resource_bindings'
47
+
48
+ # query parameters
49
+ query_params = opts[:query_params] || {}
50
+
51
+ # header parameters
52
+ header_params = opts[:header_params] || {}
53
+ # HTTP header 'Accept' (if needed)
54
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
55
+ # HTTP header 'Content-Type'
56
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
57
+
58
+ # form parameters
59
+ form_params = opts[:form_params] || {}
60
+
61
+ # http body (model)
62
+ post_body = opts[:body] || @api_client.object_to_http_body(resource_binding_post)
63
+
64
+ # return_type
65
+ return_type = opts[:return_type] || 'ResourceBinding'
66
+
67
+ # auth_names
68
+ auth_names = opts[:auth_names] || ['IAM']
69
+
70
+ new_options = opts.merge(
71
+ :header_params => header_params,
72
+ :query_params => query_params,
73
+ :form_params => form_params,
74
+ :body => post_body,
75
+ :auth_names => auth_names,
76
+ :return_type => return_type
77
+ )
78
+
79
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
80
+ if @api_client.config.debugging
81
+ @api_client.config.logger.debug "API called: ResourceBindingsApi#create_resource_binding\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
82
+ end
83
+ return data, status_code, headers
84
+ end
85
+
86
+ # Delete a resource binding
87
+ # Delete a resource binding by ID
88
+ # @param id [String] The short or long ID of the binding.
89
+ # @param [Hash] opts the optional parameters
90
+ # @return [nil]
91
+ def delete_resource_binding(id, opts = {})
92
+ delete_resource_binding_with_http_info(id, opts)
93
+ nil
94
+ end
95
+
96
+ # Delete a resource binding
97
+ # Delete a resource binding by ID
98
+ # @param id [String] The short or long ID of the binding.
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
101
+ def delete_resource_binding_with_http_info(id, opts = {})
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug 'Calling API: ResourceBindingsApi.delete_resource_binding ...'
104
+ end
105
+ # verify the required parameter 'id' is set
106
+ if @api_client.config.client_side_validation && id.nil?
107
+ fail ArgumentError, "Missing the required parameter 'id' when calling ResourceBindingsApi.delete_resource_binding"
108
+ end
109
+ # resource path
110
+ local_var_path = '/v2/resource_bindings/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
111
+
112
+ # query parameters
113
+ query_params = opts[:query_params] || {}
114
+
115
+ # header parameters
116
+ header_params = opts[:header_params] || {}
117
+ # HTTP header 'Accept' (if needed)
118
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
119
+
120
+ # form parameters
121
+ form_params = opts[:form_params] || {}
122
+
123
+ # http body (model)
124
+ post_body = opts[:body]
125
+
126
+ # return_type
127
+ return_type = opts[:return_type]
128
+
129
+ # auth_names
130
+ auth_names = opts[:auth_names] || ['IAM']
131
+
132
+ new_options = opts.merge(
133
+ :header_params => header_params,
134
+ :query_params => query_params,
135
+ :form_params => form_params,
136
+ :body => post_body,
137
+ :auth_names => auth_names,
138
+ :return_type => return_type
139
+ )
140
+
141
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
142
+ if @api_client.config.debugging
143
+ @api_client.config.logger.debug "API called: ResourceBindingsApi#delete_resource_binding\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
144
+ end
145
+ return data, status_code, headers
146
+ end
147
+
148
+ # Get a resource binding
149
+ # Retrieve a resource binding by ID.
150
+ # @param id [String] The short or long ID of the binding.
151
+ # @param [Hash] opts the optional parameters
152
+ # @return [ResourceBinding]
153
+ def get_resource_binding(id, opts = {})
154
+ data, _status_code, _headers = get_resource_binding_with_http_info(id, opts)
155
+ data
156
+ end
157
+
158
+ # Get a resource binding
159
+ # Retrieve a resource binding by ID.
160
+ # @param id [String] The short or long ID of the binding.
161
+ # @param [Hash] opts the optional parameters
162
+ # @return [Array<(ResourceBinding, Integer, Hash)>] ResourceBinding data, response status code and response headers
163
+ def get_resource_binding_with_http_info(id, opts = {})
164
+ if @api_client.config.debugging
165
+ @api_client.config.logger.debug 'Calling API: ResourceBindingsApi.get_resource_binding ...'
166
+ end
167
+ # verify the required parameter 'id' is set
168
+ if @api_client.config.client_side_validation && id.nil?
169
+ fail ArgumentError, "Missing the required parameter 'id' when calling ResourceBindingsApi.get_resource_binding"
170
+ end
171
+ # resource path
172
+ local_var_path = '/v2/resource_bindings/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
173
+
174
+ # query parameters
175
+ query_params = opts[:query_params] || {}
176
+
177
+ # header parameters
178
+ header_params = opts[:header_params] || {}
179
+ # HTTP header 'Accept' (if needed)
180
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
181
+
182
+ # form parameters
183
+ form_params = opts[:form_params] || {}
184
+
185
+ # http body (model)
186
+ post_body = opts[:body]
187
+
188
+ # return_type
189
+ return_type = opts[:return_type] || 'ResourceBinding'
190
+
191
+ # auth_names
192
+ auth_names = opts[:auth_names] || ['IAM']
193
+
194
+ new_options = opts.merge(
195
+ :header_params => header_params,
196
+ :query_params => query_params,
197
+ :form_params => form_params,
198
+ :body => post_body,
199
+ :auth_names => auth_names,
200
+ :return_type => return_type
201
+ )
202
+
203
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
204
+ if @api_client.config.debugging
205
+ @api_client.config.logger.debug "API called: ResourceBindingsApi#get_resource_binding\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
206
+ end
207
+ return data, status_code, headers
208
+ end
209
+
210
+ # Get a list of all resource bindings
211
+ # Get a list of all resource bindings.
212
+ # @param [Hash] opts the optional parameters
213
+ # @option opts [String] :guid The short ID of the binding.
214
+ # @option opts [String] :name The human-readable name of the binding.
215
+ # @option opts [String] :resource_group_id Short ID of the resource group.
216
+ # @option opts [String] :resource_id The unique ID of the offering (service name). This value is provided by and stored in the global catalog.
217
+ # @option opts [String] :region_binding_id Short ID of the binding in the specific targeted environment, e.g. service_binding_id in a given IBM Cloud environment.
218
+ # @option opts [String] :limit Limit on how many items should be returned
219
+ # @option opts [String] :updated_from Start date inclusive filter.
220
+ # @option opts [String] :updated_to End date inclusive filter.
221
+ # @return [ResourceBindingsList]
222
+ def list_resource_bindings(opts = {})
223
+ data, _status_code, _headers = list_resource_bindings_with_http_info(opts)
224
+ data
225
+ end
226
+
227
+ # Get a list of all resource bindings
228
+ # Get a list of all resource bindings.
229
+ # @param [Hash] opts the optional parameters
230
+ # @option opts [String] :guid The short ID of the binding.
231
+ # @option opts [String] :name The human-readable name of the binding.
232
+ # @option opts [String] :resource_group_id Short ID of the resource group.
233
+ # @option opts [String] :resource_id The unique ID of the offering (service name). This value is provided by and stored in the global catalog.
234
+ # @option opts [String] :region_binding_id Short ID of the binding in the specific targeted environment, e.g. service_binding_id in a given IBM Cloud environment.
235
+ # @option opts [String] :limit Limit on how many items should be returned
236
+ # @option opts [String] :updated_from Start date inclusive filter.
237
+ # @option opts [String] :updated_to End date inclusive filter.
238
+ # @return [Array<(ResourceBindingsList, Integer, Hash)>] ResourceBindingsList data, response status code and response headers
239
+ def list_resource_bindings_with_http_info(opts = {})
240
+ if @api_client.config.debugging
241
+ @api_client.config.logger.debug 'Calling API: ResourceBindingsApi.list_resource_bindings ...'
242
+ end
243
+ # resource path
244
+ local_var_path = '/v2/resource_bindings'
245
+
246
+ # query parameters
247
+ query_params = opts[:query_params] || {}
248
+ query_params[:'guid'] = opts[:'guid'] if !opts[:'guid'].nil?
249
+ query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
250
+ query_params[:'resource_group_id'] = opts[:'resource_group_id'] if !opts[:'resource_group_id'].nil?
251
+ query_params[:'resource_id'] = opts[:'resource_id'] if !opts[:'resource_id'].nil?
252
+ query_params[:'region_binding_id'] = opts[:'region_binding_id'] if !opts[:'region_binding_id'].nil?
253
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
254
+ query_params[:'updated_from'] = opts[:'updated_from'] if !opts[:'updated_from'].nil?
255
+ query_params[:'updated_to'] = opts[:'updated_to'] if !opts[:'updated_to'].nil?
256
+
257
+ # header parameters
258
+ header_params = opts[:header_params] || {}
259
+ # HTTP header 'Accept' (if needed)
260
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
261
+
262
+ # form parameters
263
+ form_params = opts[:form_params] || {}
264
+
265
+ # http body (model)
266
+ post_body = opts[:body]
267
+
268
+ # return_type
269
+ return_type = opts[:return_type] || 'ResourceBindingsList'
270
+
271
+ # auth_names
272
+ auth_names = opts[:auth_names] || ['IAM']
273
+
274
+ new_options = opts.merge(
275
+ :header_params => header_params,
276
+ :query_params => query_params,
277
+ :form_params => form_params,
278
+ :body => post_body,
279
+ :auth_names => auth_names,
280
+ :return_type => return_type
281
+ )
282
+
283
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
284
+ if @api_client.config.debugging
285
+ @api_client.config.logger.debug "API called: ResourceBindingsApi#list_resource_bindings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
286
+ end
287
+ return data, status_code, headers
288
+ end
289
+
290
+ # Update a resource binding
291
+ # Update a resource binding by ID.
292
+ # @param id [String] The short or long ID of the binding.
293
+ # @param resource_binding_patch [ResourceBindingPatch]
294
+ # @param [Hash] opts the optional parameters
295
+ # @return [ResourceBinding]
296
+ def update_resource_binding(id, resource_binding_patch, opts = {})
297
+ data, _status_code, _headers = update_resource_binding_with_http_info(id, resource_binding_patch, opts)
298
+ data
299
+ end
300
+
301
+ # Update a resource binding
302
+ # Update a resource binding by ID.
303
+ # @param id [String] The short or long ID of the binding.
304
+ # @param resource_binding_patch [ResourceBindingPatch]
305
+ # @param [Hash] opts the optional parameters
306
+ # @return [Array<(ResourceBinding, Integer, Hash)>] ResourceBinding data, response status code and response headers
307
+ def update_resource_binding_with_http_info(id, resource_binding_patch, opts = {})
308
+ if @api_client.config.debugging
309
+ @api_client.config.logger.debug 'Calling API: ResourceBindingsApi.update_resource_binding ...'
310
+ end
311
+ # verify the required parameter 'id' is set
312
+ if @api_client.config.client_side_validation && id.nil?
313
+ fail ArgumentError, "Missing the required parameter 'id' when calling ResourceBindingsApi.update_resource_binding"
314
+ end
315
+ # verify the required parameter 'resource_binding_patch' is set
316
+ if @api_client.config.client_side_validation && resource_binding_patch.nil?
317
+ fail ArgumentError, "Missing the required parameter 'resource_binding_patch' when calling ResourceBindingsApi.update_resource_binding"
318
+ end
319
+ # resource path
320
+ local_var_path = '/v2/resource_bindings/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
321
+
322
+ # query parameters
323
+ query_params = opts[:query_params] || {}
324
+
325
+ # header parameters
326
+ header_params = opts[:header_params] || {}
327
+ # HTTP header 'Accept' (if needed)
328
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
329
+ # HTTP header 'Content-Type'
330
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
331
+
332
+ # form parameters
333
+ form_params = opts[:form_params] || {}
334
+
335
+ # http body (model)
336
+ post_body = opts[:body] || @api_client.object_to_http_body(resource_binding_patch)
337
+
338
+ # return_type
339
+ return_type = opts[:return_type] || 'ResourceBinding'
340
+
341
+ # auth_names
342
+ auth_names = opts[:auth_names] || ['IAM']
343
+
344
+ new_options = opts.merge(
345
+ :header_params => header_params,
346
+ :query_params => query_params,
347
+ :form_params => form_params,
348
+ :body => post_body,
349
+ :auth_names => auth_names,
350
+ :return_type => return_type
351
+ )
352
+
353
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
354
+ if @api_client.config.debugging
355
+ @api_client.config.logger.debug "API called: ResourceBindingsApi#update_resource_binding\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
356
+ end
357
+ return data, status_code, headers
358
+ end
359
+ end
360
+ end
@@ -0,0 +1,493 @@
1
+ =begin
2
+ #IBM Cloud Resource Controller API
3
+
4
+ #Manage lifecycle of your Cloud resources using Resource Controller APIs. Resources are provisioned globally in an account scope. Supports asynchronous provisioning of resources. Enables consumption of a global resource through a Cloud Foundry space in any region.
5
+
6
+ The version of the OpenAPI document: 2.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.0.0-beta2
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module IbmCloudResourceController
16
+ class ResourceInstancesApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create (provision) a new resource instance
23
+ # Provision a new resource in the specified location for the selected plan.
24
+ # @param resource_instance_post [ResourceInstancePost]
25
+ # @param [Hash] opts the optional parameters
26
+ # @option opts [String] :entity_lock Indicates if the resource instance is locked for further update or delete operations. It does not affect actions performed on child resources like aliases, bindings or keys. False by default. (default to 'false')
27
+ # @return [ResourceInstance]
28
+ def create_resource_instance(resource_instance_post, opts = {})
29
+ data, _status_code, _headers = create_resource_instance_with_http_info(resource_instance_post, opts)
30
+ data
31
+ end
32
+
33
+ # Create (provision) a new resource instance
34
+ # Provision a new resource in the specified location for the selected plan.
35
+ # @param resource_instance_post [ResourceInstancePost]
36
+ # @param [Hash] opts the optional parameters
37
+ # @option opts [String] :entity_lock Indicates if the resource instance is locked for further update or delete operations. It does not affect actions performed on child resources like aliases, bindings or keys. False by default.
38
+ # @return [Array<(ResourceInstance, Integer, Hash)>] ResourceInstance data, response status code and response headers
39
+ def create_resource_instance_with_http_info(resource_instance_post, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: ResourceInstancesApi.create_resource_instance ...'
42
+ end
43
+ # verify the required parameter 'resource_instance_post' is set
44
+ if @api_client.config.client_side_validation && resource_instance_post.nil?
45
+ fail ArgumentError, "Missing the required parameter 'resource_instance_post' when calling ResourceInstancesApi.create_resource_instance"
46
+ end
47
+ # resource path
48
+ local_var_path = '/v2/resource_instances'
49
+
50
+ # query parameters
51
+ query_params = opts[:query_params] || {}
52
+
53
+ # header parameters
54
+ header_params = opts[:header_params] || {}
55
+ # HTTP header 'Accept' (if needed)
56
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
57
+ # HTTP header 'Content-Type'
58
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
59
+ header_params[:'Entity-Lock'] = opts[:'entity_lock'] if !opts[:'entity_lock'].nil?
60
+
61
+ # form parameters
62
+ form_params = opts[:form_params] || {}
63
+
64
+ # http body (model)
65
+ post_body = opts[:body] || @api_client.object_to_http_body(resource_instance_post)
66
+
67
+ # return_type
68
+ return_type = opts[:return_type] || 'ResourceInstance'
69
+
70
+ # auth_names
71
+ auth_names = opts[:auth_names] || ['IAM']
72
+
73
+ new_options = opts.merge(
74
+ :header_params => header_params,
75
+ :query_params => query_params,
76
+ :form_params => form_params,
77
+ :body => post_body,
78
+ :auth_names => auth_names,
79
+ :return_type => return_type
80
+ )
81
+
82
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
83
+ if @api_client.config.debugging
84
+ @api_client.config.logger.debug "API called: ResourceInstancesApi#create_resource_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
85
+ end
86
+ return data, status_code, headers
87
+ end
88
+
89
+ # Delete a resource instance
90
+ # Delete a resource instance by ID.
91
+ # @param id [String] The short or long ID of the instance.
92
+ # @param [Hash] opts the optional parameters
93
+ # @return [nil]
94
+ def delete_resource_instance(id, opts = {})
95
+ delete_resource_instance_with_http_info(id, opts)
96
+ nil
97
+ end
98
+
99
+ # Delete a resource instance
100
+ # Delete a resource instance by ID.
101
+ # @param id [String] The short or long ID of the instance.
102
+ # @param [Hash] opts the optional parameters
103
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
104
+ def delete_resource_instance_with_http_info(id, opts = {})
105
+ if @api_client.config.debugging
106
+ @api_client.config.logger.debug 'Calling API: ResourceInstancesApi.delete_resource_instance ...'
107
+ end
108
+ # verify the required parameter 'id' is set
109
+ if @api_client.config.client_side_validation && id.nil?
110
+ fail ArgumentError, "Missing the required parameter 'id' when calling ResourceInstancesApi.delete_resource_instance"
111
+ end
112
+ # resource path
113
+ local_var_path = '/v2/resource_instances/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
114
+
115
+ # query parameters
116
+ query_params = opts[:query_params] || {}
117
+
118
+ # header parameters
119
+ header_params = opts[:header_params] || {}
120
+ # HTTP header 'Accept' (if needed)
121
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
122
+
123
+ # form parameters
124
+ form_params = opts[:form_params] || {}
125
+
126
+ # http body (model)
127
+ post_body = opts[:body]
128
+
129
+ # return_type
130
+ return_type = opts[:return_type]
131
+
132
+ # auth_names
133
+ auth_names = opts[:auth_names] || ['IAM']
134
+
135
+ new_options = opts.merge(
136
+ :header_params => header_params,
137
+ :query_params => query_params,
138
+ :form_params => form_params,
139
+ :body => post_body,
140
+ :auth_names => auth_names,
141
+ :return_type => return_type
142
+ )
143
+
144
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
145
+ if @api_client.config.debugging
146
+ @api_client.config.logger.debug "API called: ResourceInstancesApi#delete_resource_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
147
+ end
148
+ return data, status_code, headers
149
+ end
150
+
151
+ # Get a resource instance
152
+ # Retrieve a resource instance by ID.
153
+ # @param id [String] The short or long ID of the instance.
154
+ # @param [Hash] opts the optional parameters
155
+ # @return [ResourceInstance]
156
+ def get_resource_instance(id, opts = {})
157
+ data, _status_code, _headers = get_resource_instance_with_http_info(id, opts)
158
+ data
159
+ end
160
+
161
+ # Get a resource instance
162
+ # Retrieve a resource instance by ID.
163
+ # @param id [String] The short or long ID of the instance.
164
+ # @param [Hash] opts the optional parameters
165
+ # @return [Array<(ResourceInstance, Integer, Hash)>] ResourceInstance data, response status code and response headers
166
+ def get_resource_instance_with_http_info(id, opts = {})
167
+ if @api_client.config.debugging
168
+ @api_client.config.logger.debug 'Calling API: ResourceInstancesApi.get_resource_instance ...'
169
+ end
170
+ # verify the required parameter 'id' is set
171
+ if @api_client.config.client_side_validation && id.nil?
172
+ fail ArgumentError, "Missing the required parameter 'id' when calling ResourceInstancesApi.get_resource_instance"
173
+ end
174
+ # resource path
175
+ local_var_path = '/v2/resource_instances/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
176
+
177
+ # query parameters
178
+ query_params = opts[:query_params] || {}
179
+
180
+ # header parameters
181
+ header_params = opts[:header_params] || {}
182
+ # HTTP header 'Accept' (if needed)
183
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
184
+
185
+ # form parameters
186
+ form_params = opts[:form_params] || {}
187
+
188
+ # http body (model)
189
+ post_body = opts[:body]
190
+
191
+ # return_type
192
+ return_type = opts[:return_type] || 'ResourceInstance'
193
+
194
+ # auth_names
195
+ auth_names = opts[:auth_names] || ['IAM']
196
+
197
+ new_options = opts.merge(
198
+ :header_params => header_params,
199
+ :query_params => query_params,
200
+ :form_params => form_params,
201
+ :body => post_body,
202
+ :auth_names => auth_names,
203
+ :return_type => return_type
204
+ )
205
+
206
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
207
+ if @api_client.config.debugging
208
+ @api_client.config.logger.debug "API called: ResourceInstancesApi#get_resource_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
209
+ end
210
+ return data, status_code, headers
211
+ end
212
+
213
+ # Get a list of all resource instances
214
+ # Get a list of all resource instances.
215
+ # @param [Hash] opts the optional parameters
216
+ # @option opts [String] :guid When you provision a new resource in the specified location for the selected plan, a GUID (globally unique identifier) is created. This is a unique internal GUID managed by Resource controller that corresponds to the instance.
217
+ # @option opts [String] :name The human-readable name of the instance.
218
+ # @option opts [String] :resource_group_id Short ID of a resource group.
219
+ # @option opts [String] :resource_id The unique ID of the offering. This value is provided by and stored in the global catalog.
220
+ # @option opts [String] :resource_plan_id The unique ID of the plan associated with the offering. This value is provided by and stored in the global catalog.
221
+ # @option opts [String] :type The type of the instance. For example, &#x60;service_instance&#x60;.
222
+ # @option opts [String] :sub_type The sub-type of instance, e.g. &#x60;cfaas&#x60;.
223
+ # @option opts [String] :limit Limit on how many items should be returned.
224
+ # @option opts [String] :updated_from Start date inclusive filter.
225
+ # @option opts [String] :updated_to End date inclusive filter.
226
+ # @return [ResourceInstancesList]
227
+ def list_resource_instances(opts = {})
228
+ data, _status_code, _headers = list_resource_instances_with_http_info(opts)
229
+ data
230
+ end
231
+
232
+ # Get a list of all resource instances
233
+ # Get a list of all resource instances.
234
+ # @param [Hash] opts the optional parameters
235
+ # @option opts [String] :guid When you provision a new resource in the specified location for the selected plan, a GUID (globally unique identifier) is created. This is a unique internal GUID managed by Resource controller that corresponds to the instance.
236
+ # @option opts [String] :name The human-readable name of the instance.
237
+ # @option opts [String] :resource_group_id Short ID of a resource group.
238
+ # @option opts [String] :resource_id The unique ID of the offering. This value is provided by and stored in the global catalog.
239
+ # @option opts [String] :resource_plan_id The unique ID of the plan associated with the offering. This value is provided by and stored in the global catalog.
240
+ # @option opts [String] :type The type of the instance. For example, &#x60;service_instance&#x60;.
241
+ # @option opts [String] :sub_type The sub-type of instance, e.g. &#x60;cfaas&#x60;.
242
+ # @option opts [String] :limit Limit on how many items should be returned.
243
+ # @option opts [String] :updated_from Start date inclusive filter.
244
+ # @option opts [String] :updated_to End date inclusive filter.
245
+ # @return [Array<(ResourceInstancesList, Integer, Hash)>] ResourceInstancesList data, response status code and response headers
246
+ def list_resource_instances_with_http_info(opts = {})
247
+ if @api_client.config.debugging
248
+ @api_client.config.logger.debug 'Calling API: ResourceInstancesApi.list_resource_instances ...'
249
+ end
250
+ # resource path
251
+ local_var_path = '/v2/resource_instances'
252
+
253
+ # query parameters
254
+ query_params = opts[:query_params] || {}
255
+ query_params[:'guid'] = opts[:'guid'] if !opts[:'guid'].nil?
256
+ query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
257
+ query_params[:'resource_group_id'] = opts[:'resource_group_id'] if !opts[:'resource_group_id'].nil?
258
+ query_params[:'resource_id'] = opts[:'resource_id'] if !opts[:'resource_id'].nil?
259
+ query_params[:'resource_plan_id'] = opts[:'resource_plan_id'] if !opts[:'resource_plan_id'].nil?
260
+ query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
261
+ query_params[:'sub_type'] = opts[:'sub_type'] if !opts[:'sub_type'].nil?
262
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
263
+ query_params[:'updated_from'] = opts[:'updated_from'] if !opts[:'updated_from'].nil?
264
+ query_params[:'updated_to'] = opts[:'updated_to'] if !opts[:'updated_to'].nil?
265
+
266
+ # header parameters
267
+ header_params = opts[:header_params] || {}
268
+ # HTTP header 'Accept' (if needed)
269
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
270
+
271
+ # form parameters
272
+ form_params = opts[:form_params] || {}
273
+
274
+ # http body (model)
275
+ post_body = opts[:body]
276
+
277
+ # return_type
278
+ return_type = opts[:return_type] || 'ResourceInstancesList'
279
+
280
+ # auth_names
281
+ auth_names = opts[:auth_names] || ['IAM']
282
+
283
+ new_options = opts.merge(
284
+ :header_params => header_params,
285
+ :query_params => query_params,
286
+ :form_params => form_params,
287
+ :body => post_body,
288
+ :auth_names => auth_names,
289
+ :return_type => return_type
290
+ )
291
+
292
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
293
+ if @api_client.config.debugging
294
+ @api_client.config.logger.debug "API called: ResourceInstancesApi#list_resource_instances\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
295
+ end
296
+ return data, status_code, headers
297
+ end
298
+
299
+ # Lock a resource instance
300
+ # Locks a resource instance by ID. A locked instance can not be updated or deleted. It does not affect actions performed on child resources like aliases, bindings or keys.
301
+ # @param id [String] The short or long ID of the instance.
302
+ # @param [Hash] opts the optional parameters
303
+ # @return [ResourceInstance]
304
+ def lock_resource_instance(id, opts = {})
305
+ data, _status_code, _headers = lock_resource_instance_with_http_info(id, opts)
306
+ data
307
+ end
308
+
309
+ # Lock a resource instance
310
+ # Locks a resource instance by ID. A locked instance can not be updated or deleted. It does not affect actions performed on child resources like aliases, bindings or keys.
311
+ # @param id [String] The short or long ID of the instance.
312
+ # @param [Hash] opts the optional parameters
313
+ # @return [Array<(ResourceInstance, Integer, Hash)>] ResourceInstance data, response status code and response headers
314
+ def lock_resource_instance_with_http_info(id, opts = {})
315
+ if @api_client.config.debugging
316
+ @api_client.config.logger.debug 'Calling API: ResourceInstancesApi.lock_resource_instance ...'
317
+ end
318
+ # verify the required parameter 'id' is set
319
+ if @api_client.config.client_side_validation && id.nil?
320
+ fail ArgumentError, "Missing the required parameter 'id' when calling ResourceInstancesApi.lock_resource_instance"
321
+ end
322
+ # resource path
323
+ local_var_path = '/v2/resource_instances/{id}/lock'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
324
+
325
+ # query parameters
326
+ query_params = opts[:query_params] || {}
327
+
328
+ # header parameters
329
+ header_params = opts[:header_params] || {}
330
+ # HTTP header 'Accept' (if needed)
331
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
332
+
333
+ # form parameters
334
+ form_params = opts[:form_params] || {}
335
+
336
+ # http body (model)
337
+ post_body = opts[:body]
338
+
339
+ # return_type
340
+ return_type = opts[:return_type] || 'ResourceInstance'
341
+
342
+ # auth_names
343
+ auth_names = opts[:auth_names] || ['IAM']
344
+
345
+ new_options = opts.merge(
346
+ :header_params => header_params,
347
+ :query_params => query_params,
348
+ :form_params => form_params,
349
+ :body => post_body,
350
+ :auth_names => auth_names,
351
+ :return_type => return_type
352
+ )
353
+
354
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
355
+ if @api_client.config.debugging
356
+ @api_client.config.logger.debug "API called: ResourceInstancesApi#lock_resource_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
357
+ end
358
+ return data, status_code, headers
359
+ end
360
+
361
+ # Unlock a resource instance
362
+ # Unlocks a resource instance by ID.
363
+ # @param id [String] The short or long ID of the instance.
364
+ # @param [Hash] opts the optional parameters
365
+ # @return [ResourceInstance]
366
+ def unlock_resource_instance(id, opts = {})
367
+ data, _status_code, _headers = unlock_resource_instance_with_http_info(id, opts)
368
+ data
369
+ end
370
+
371
+ # Unlock a resource instance
372
+ # Unlocks a resource instance by ID.
373
+ # @param id [String] The short or long ID of the instance.
374
+ # @param [Hash] opts the optional parameters
375
+ # @return [Array<(ResourceInstance, Integer, Hash)>] ResourceInstance data, response status code and response headers
376
+ def unlock_resource_instance_with_http_info(id, opts = {})
377
+ if @api_client.config.debugging
378
+ @api_client.config.logger.debug 'Calling API: ResourceInstancesApi.unlock_resource_instance ...'
379
+ end
380
+ # verify the required parameter 'id' is set
381
+ if @api_client.config.client_side_validation && id.nil?
382
+ fail ArgumentError, "Missing the required parameter 'id' when calling ResourceInstancesApi.unlock_resource_instance"
383
+ end
384
+ # resource path
385
+ local_var_path = '/v2/resource_instances/{id}/lock'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
386
+
387
+ # query parameters
388
+ query_params = opts[:query_params] || {}
389
+
390
+ # header parameters
391
+ header_params = opts[:header_params] || {}
392
+ # HTTP header 'Accept' (if needed)
393
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
394
+
395
+ # form parameters
396
+ form_params = opts[:form_params] || {}
397
+
398
+ # http body (model)
399
+ post_body = opts[:body]
400
+
401
+ # return_type
402
+ return_type = opts[:return_type] || 'ResourceInstance'
403
+
404
+ # auth_names
405
+ auth_names = opts[:auth_names] || ['IAM']
406
+
407
+ new_options = opts.merge(
408
+ :header_params => header_params,
409
+ :query_params => query_params,
410
+ :form_params => form_params,
411
+ :body => post_body,
412
+ :auth_names => auth_names,
413
+ :return_type => return_type
414
+ )
415
+
416
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
417
+ if @api_client.config.debugging
418
+ @api_client.config.logger.debug "API called: ResourceInstancesApi#unlock_resource_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
419
+ end
420
+ return data, status_code, headers
421
+ end
422
+
423
+ # Update a resource instance
424
+ # Update a resource instance by ID.
425
+ # @param id [String] The short or long ID of the instance.
426
+ # @param resource_instance_patch [ResourceInstancePatch]
427
+ # @param [Hash] opts the optional parameters
428
+ # @return [ResourceInstance]
429
+ def update_resource_instance(id, resource_instance_patch, opts = {})
430
+ data, _status_code, _headers = update_resource_instance_with_http_info(id, resource_instance_patch, opts)
431
+ data
432
+ end
433
+
434
+ # Update a resource instance
435
+ # Update a resource instance by ID.
436
+ # @param id [String] The short or long ID of the instance.
437
+ # @param resource_instance_patch [ResourceInstancePatch]
438
+ # @param [Hash] opts the optional parameters
439
+ # @return [Array<(ResourceInstance, Integer, Hash)>] ResourceInstance data, response status code and response headers
440
+ def update_resource_instance_with_http_info(id, resource_instance_patch, opts = {})
441
+ if @api_client.config.debugging
442
+ @api_client.config.logger.debug 'Calling API: ResourceInstancesApi.update_resource_instance ...'
443
+ end
444
+ # verify the required parameter 'id' is set
445
+ if @api_client.config.client_side_validation && id.nil?
446
+ fail ArgumentError, "Missing the required parameter 'id' when calling ResourceInstancesApi.update_resource_instance"
447
+ end
448
+ # verify the required parameter 'resource_instance_patch' is set
449
+ if @api_client.config.client_side_validation && resource_instance_patch.nil?
450
+ fail ArgumentError, "Missing the required parameter 'resource_instance_patch' when calling ResourceInstancesApi.update_resource_instance"
451
+ end
452
+ # resource path
453
+ local_var_path = '/v2/resource_instances/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
454
+
455
+ # query parameters
456
+ query_params = opts[:query_params] || {}
457
+
458
+ # header parameters
459
+ header_params = opts[:header_params] || {}
460
+ # HTTP header 'Accept' (if needed)
461
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
462
+ # HTTP header 'Content-Type'
463
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
464
+
465
+ # form parameters
466
+ form_params = opts[:form_params] || {}
467
+
468
+ # http body (model)
469
+ post_body = opts[:body] || @api_client.object_to_http_body(resource_instance_patch)
470
+
471
+ # return_type
472
+ return_type = opts[:return_type] || 'ResourceInstance'
473
+
474
+ # auth_names
475
+ auth_names = opts[:auth_names] || ['IAM']
476
+
477
+ new_options = opts.merge(
478
+ :header_params => header_params,
479
+ :query_params => query_params,
480
+ :form_params => form_params,
481
+ :body => post_body,
482
+ :auth_names => auth_names,
483
+ :return_type => return_type
484
+ )
485
+
486
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
487
+ if @api_client.config.debugging
488
+ @api_client.config.logger.debug "API called: ResourceInstancesApi#update_resource_instance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
489
+ end
490
+ return data, status_code, headers
491
+ end
492
+ end
493
+ end