Class: IbmCloudResourceController::ResourceBindingsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ibm_cloud_resource_controller/api/resource_bindings_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ResourceBindingsApi

Returns a new instance of ResourceBindingsApi.



19
20
21
# File 'lib/ibm_cloud_resource_controller/api/resource_bindings_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/ibm_cloud_resource_controller/api/resource_bindings_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_resource_binding(resource_binding_post, opts = {}) ⇒ ResourceBinding

Create a new resource binding Create a new resource binding.

Parameters:

  • resource_binding_post (ResourceBindingPost)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



27
28
29
30
# File 'lib/ibm_cloud_resource_controller/api/resource_bindings_api.rb', line 27

def create_resource_binding(resource_binding_post, opts = {})
  data, _status_code, _headers = create_resource_binding_with_http_info(resource_binding_post, opts)
  data
end

#create_resource_binding_with_http_info(resource_binding_post, opts = {}) ⇒ Array<(ResourceBinding, Integer, Hash)>

Create a new resource binding Create a new resource binding.

Parameters:

  • resource_binding_post (ResourceBindingPost)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ResourceBinding, Integer, Hash)>)

    ResourceBinding data, response status code and response headers



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/ibm_cloud_resource_controller/api/resource_bindings_api.rb', line 37

def create_resource_binding_with_http_info(resource_binding_post, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ResourceBindingsApi.create_resource_binding ...'
  end
  # verify the required parameter 'resource_binding_post' is set
  if @api_client.config.client_side_validation && resource_binding_post.nil?
    fail ArgumentError, "Missing the required parameter 'resource_binding_post' when calling ResourceBindingsApi.create_resource_binding"
  end
  # resource path
  local_var_path = '/v2/resource_bindings'

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(resource_binding_post) 

  # return_type
  return_type = opts[:return_type] || 'ResourceBinding' 

  # auth_names
  auth_names = opts[:auth_names] || ['IAM']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ResourceBindingsApi#create_resource_binding\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_resource_binding(id, opts = {}) ⇒ nil

Delete a resource binding Delete a resource binding by ID

Parameters:

  • id (String)

    The short or long ID of the binding.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


91
92
93
94
# File 'lib/ibm_cloud_resource_controller/api/resource_bindings_api.rb', line 91

def delete_resource_binding(id, opts = {})
  delete_resource_binding_with_http_info(id, opts)
  nil
end

#delete_resource_binding_with_http_info(id, opts = {}) ⇒ Array<(nil, Integer, Hash)>

Delete a resource binding Delete a resource binding by ID

Parameters:

  • id (String)

    The short or long ID of the binding.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Integer, Hash)>)

    nil, response status code and response headers



101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# File 'lib/ibm_cloud_resource_controller/api/resource_bindings_api.rb', line 101

def delete_resource_binding_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ResourceBindingsApi.delete_resource_binding ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ResourceBindingsApi.delete_resource_binding"
  end
  # resource path
  local_var_path = '/v2/resource_bindings/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] 

  # auth_names
  auth_names = opts[:auth_names] || ['IAM']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ResourceBindingsApi#delete_resource_binding\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_resource_binding(id, opts = {}) ⇒ ResourceBinding

Get a resource binding Retrieve a resource binding by ID.

Parameters:

  • id (String)

    The short or long ID of the binding.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



153
154
155
156
# File 'lib/ibm_cloud_resource_controller/api/resource_bindings_api.rb', line 153

def get_resource_binding(id, opts = {})
  data, _status_code, _headers = get_resource_binding_with_http_info(id, opts)
  data
end

#get_resource_binding_with_http_info(id, opts = {}) ⇒ Array<(ResourceBinding, Integer, Hash)>

Get a resource binding Retrieve a resource binding by ID.

Parameters:

  • id (String)

    The short or long ID of the binding.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ResourceBinding, Integer, Hash)>)

    ResourceBinding data, response status code and response headers



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/ibm_cloud_resource_controller/api/resource_bindings_api.rb', line 163

def get_resource_binding_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ResourceBindingsApi.get_resource_binding ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ResourceBindingsApi.get_resource_binding"
  end
  # resource path
  local_var_path = '/v2/resource_bindings/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'ResourceBinding' 

  # auth_names
  auth_names = opts[:auth_names] || ['IAM']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ResourceBindingsApi#get_resource_binding\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_resource_bindings(opts = {}) ⇒ ResourceBindingsList

Get a list of all resource bindings Get a list of all resource bindings.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :guid (String)

    The short ID of the binding.

  • :name (String)

    The human-readable name of the binding.

  • :resource_group_id (String)

    Short ID of the resource group.

  • :resource_id (String)

    The unique ID of the offering (service name). This value is provided by and stored in the global catalog.

  • :region_binding_id (String)

    Short ID of the binding in the specific targeted environment, e.g. service_binding_id in a given IBM Cloud environment.

  • :limit (String)

    Limit on how many items should be returned

  • :updated_from (String)

    Start date inclusive filter.

  • :updated_to (String)

    End date inclusive filter.

Returns:



222
223
224
225
# File 'lib/ibm_cloud_resource_controller/api/resource_bindings_api.rb', line 222

def list_resource_bindings(opts = {})
  data, _status_code, _headers = list_resource_bindings_with_http_info(opts)
  data
end

#list_resource_bindings_with_http_info(opts = {}) ⇒ Array<(ResourceBindingsList, Integer, Hash)>

Get a list of all resource bindings Get a list of all resource bindings.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :guid (String)

    The short ID of the binding.

  • :name (String)

    The human-readable name of the binding.

  • :resource_group_id (String)

    Short ID of the resource group.

  • :resource_id (String)

    The unique ID of the offering (service name). This value is provided by and stored in the global catalog.

  • :region_binding_id (String)

    Short ID of the binding in the specific targeted environment, e.g. service_binding_id in a given IBM Cloud environment.

  • :limit (String)

    Limit on how many items should be returned

  • :updated_from (String)

    Start date inclusive filter.

  • :updated_to (String)

    End date inclusive filter.

Returns:

  • (Array<(ResourceBindingsList, Integer, Hash)>)

    ResourceBindingsList data, response status code and response headers



239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
# File 'lib/ibm_cloud_resource_controller/api/resource_bindings_api.rb', line 239

def list_resource_bindings_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ResourceBindingsApi.list_resource_bindings ...'
  end
  # resource path
  local_var_path = '/v2/resource_bindings'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'guid'] = opts[:'guid'] if !opts[:'guid'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
  query_params[:'resource_group_id'] = opts[:'resource_group_id'] if !opts[:'resource_group_id'].nil?
  query_params[:'resource_id'] = opts[:'resource_id'] if !opts[:'resource_id'].nil?
  query_params[:'region_binding_id'] = opts[:'region_binding_id'] if !opts[:'region_binding_id'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'updated_from'] = opts[:'updated_from'] if !opts[:'updated_from'].nil?
  query_params[:'updated_to'] = opts[:'updated_to'] if !opts[:'updated_to'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] 

  # return_type
  return_type = opts[:return_type] || 'ResourceBindingsList' 

  # auth_names
  auth_names = opts[:auth_names] || ['IAM']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ResourceBindingsApi#list_resource_bindings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_resource_binding(id, resource_binding_patch, opts = {}) ⇒ ResourceBinding

Update a resource binding Update a resource binding by ID.

Parameters:

  • id (String)

    The short or long ID of the binding.

  • resource_binding_patch (ResourceBindingPatch)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



296
297
298
299
# File 'lib/ibm_cloud_resource_controller/api/resource_bindings_api.rb', line 296

def update_resource_binding(id, resource_binding_patch, opts = {})
  data, _status_code, _headers = update_resource_binding_with_http_info(id, resource_binding_patch, opts)
  data
end

#update_resource_binding_with_http_info(id, resource_binding_patch, opts = {}) ⇒ Array<(ResourceBinding, Integer, Hash)>

Update a resource binding Update a resource binding by ID.

Parameters:

  • id (String)

    The short or long ID of the binding.

  • resource_binding_patch (ResourceBindingPatch)
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(ResourceBinding, Integer, Hash)>)

    ResourceBinding data, response status code and response headers



307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
# File 'lib/ibm_cloud_resource_controller/api/resource_bindings_api.rb', line 307

def update_resource_binding_with_http_info(id, resource_binding_patch, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ResourceBindingsApi.update_resource_binding ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling ResourceBindingsApi.update_resource_binding"
  end
  # verify the required parameter 'resource_binding_patch' is set
  if @api_client.config.client_side_validation && resource_binding_patch.nil?
    fail ArgumentError, "Missing the required parameter 'resource_binding_patch' when calling ResourceBindingsApi.update_resource_binding"
  end
  # resource path
  local_var_path = '/v2/resource_bindings/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:body] || @api_client.object_to_http_body(resource_binding_patch) 

  # return_type
  return_type = opts[:return_type] || 'ResourceBinding' 

  # auth_names
  auth_names = opts[:auth_names] || ['IAM']

  new_options = opts.merge(
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ResourceBindingsApi#update_resource_binding\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end