Class: IbmCloudIam::ServiceIDsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/ibm_cloud_iam/api/service_ids_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ServiceIDsApi

Returns a new instance of ServiceIDsApi.



19
20
21
# File 'lib/ibm_cloud_iam/api/service_ids_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_iam/api/service_ids_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_service_id(authorization, create_service_id_request, opts = {}) ⇒ ServiceId

Create a service ID Creates a service ID for an IBM Cloud account. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.

Parameters:

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • create_service_id_request (CreateServiceIdRequest)

    Request to create a service ID.

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

    the optional parameters

Options Hash (opts):

  • :show_group_id (String)

    Defines if the service ID group ID is included in the response.

  • :entity_lock (String)

    Indicates if the service ID is locked for further write operations. False by default. (default to 'false')

Returns:



30
31
32
33
# File 'lib/ibm_cloud_iam/api/service_ids_api.rb', line 30

def create_service_id(authorization, create_service_id_request, opts = {})
  data, _status_code, _headers = create_service_id_with_http_info(authorization, create_service_id_request, opts)
  data
end

#create_service_id_with_http_info(authorization, create_service_id_request, opts = {}) ⇒ Array<(ServiceId, Integer, Hash)>

Create a service ID Creates a service ID for an IBM Cloud account. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.

Parameters:

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • create_service_id_request (CreateServiceIdRequest)

    Request to create a service ID.

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

    the optional parameters

Options Hash (opts):

  • :show_group_id (String)

    Defines if the service ID group ID is included in the response.

  • :entity_lock (String)

    Indicates if the service ID is locked for further write operations. False by default. (default to 'false')

Returns:

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

    ServiceId data, response status code and response headers



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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/ibm_cloud_iam/api/service_ids_api.rb', line 43

def create_service_id_with_http_info(authorization, create_service_id_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceIDsApi.create_service_id ...'
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling ServiceIDsApi.create_service_id"
  end
  # verify the required parameter 'create_service_id_request' is set
  if @api_client.config.client_side_validation && create_service_id_request.nil?
    fail ArgumentError, "Missing the required parameter 'create_service_id_request' when calling ServiceIDsApi.create_service_id"
  end
  # resource path
  local_var_path = '/v1/serviceids/'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'show_group_id'] = opts[:'show_group_id'] if !opts[:'show_group_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'Authorization'] = authorization
  header_params[:'Entity-Lock'] = opts[:'entity_lock'] if !opts[:'entity_lock'].nil?

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'ServiceId'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ServiceIDsApi.create_service_id",
    :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: ServiceIDsApi#create_service_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_service_id(id, authorization, opts = {}) ⇒ nil

Deletes a service ID and associated API keys Deletes a service ID and all API keys associated to it. Before deleting the service ID, all associated API keys are deleted. In case a Delete Conflict (status code 409) a retry of the request may help as the service ID is only deleted if the associated API keys were successfully deleted before. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.

Parameters:

  • id (String)

    Unique ID of the service ID.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Returns:

  • (nil)


109
110
111
112
# File 'lib/ibm_cloud_iam/api/service_ids_api.rb', line 109

def delete_service_id(id, authorization, opts = {})
  delete_service_id_with_http_info(id, authorization, opts)
  nil
end

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

Deletes a service ID and associated API keys Deletes a service ID and all API keys associated to it. Before deleting the service ID, all associated API keys are deleted. In case a Delete Conflict (status code 409) a retry of the request may help as the service ID is only deleted if the associated API keys were successfully deleted before. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.

Parameters:

  • id (String)

    Unique ID of the service ID.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/ibm_cloud_iam/api/service_ids_api.rb', line 120

def delete_service_id_with_http_info(id, authorization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceIDsApi.delete_service_id ...'
  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 ServiceIDsApi.delete_service_id"
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling ServiceIDsApi.delete_service_id"
  end
  # resource path
  local_var_path = '/v1/serviceids/{id}'.sub('{id}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'Authorization'] = authorization

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

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

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ServiceIDsApi.delete_service_id",
    :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: ServiceIDsApi#delete_service_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_service_id(id, authorization, opts = {}) ⇒ ServiceId

Get details of a service ID Returns the details of a service ID. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to. Note: apikey details are only included in the response when creating a Service ID with an api key.

Parameters:

  • id (String)

    Unique ID of the service ID.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Options Hash (opts):

  • :include_history (Boolean)

    Defines if the entity history is included in the response. (default to false)

  • :include_activity (Boolean)

    Defines if the entity's activity is included in the response. Retrieving activity data is an expensive operation, so only request this when needed. (default to false)

  • :show_group_id (String)

    Defines if the service ID group ID is included in the response.

Returns:



180
181
182
183
# File 'lib/ibm_cloud_iam/api/service_ids_api.rb', line 180

def get_service_id(id, authorization, opts = {})
  data, _status_code, _headers = get_service_id_with_http_info(id, authorization, opts)
  data
end

#get_service_id_with_http_info(id, authorization, opts = {}) ⇒ Array<(ServiceId, Integer, Hash)>

Get details of a service ID Returns the details of a service ID. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to. Note: apikey details are only included in the response when creating a Service ID with an api key.

Parameters:

  • id (String)

    Unique ID of the service ID.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Options Hash (opts):

  • :include_history (Boolean)

    Defines if the entity history is included in the response. (default to false)

  • :include_activity (Boolean)

    Defines if the entity's activity is included in the response. Retrieving activity data is an expensive operation, so only request this when needed. (default to false)

  • :show_group_id (String)

    Defines if the service ID group ID is included in the response.

Returns:

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

    ServiceId data, response status code and response headers



194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/ibm_cloud_iam/api/service_ids_api.rb', line 194

def get_service_id_with_http_info(id, authorization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceIDsApi.get_service_id ...'
  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 ServiceIDsApi.get_service_id"
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling ServiceIDsApi.get_service_id"
  end
  # resource path
  local_var_path = '/v1/serviceids/{id}'.sub('{id}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'include_history'] = opts[:'include_history'] if !opts[:'include_history'].nil?
  query_params[:'include_activity'] = opts[:'include_activity'] if !opts[:'include_activity'].nil?
  query_params[:'show_group_id'] = opts[:'show_group_id'] if !opts[:'show_group_id'].nil?

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

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'ServiceId'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ServiceIDsApi.get_service_id",
    :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: ServiceIDsApi#get_service_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#list_service_ids(authorization, opts = {}) ⇒ ServiceIdList

List service IDs Returns a list of service IDs. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to. Note: apikey details are only included in the response when creating a Service ID with an api key.

Parameters:

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Account ID of the service ID(s) to query. This parameter is required (unless using a pagetoken).

  • :group_id (String)

    Group ID of the service ID(s) to query. If this parameter is not provided the default group is applied.

  • :name (String)

    Name of the service ID(s) to query. Optional.20 items per page. Valid range is 1 to 100.

  • :pagesize (Integer)

    Optional size of a single page. Default is 20 items per page. Valid range is 1 to 100.

  • :pagetoken (String)

    Optional Prev or Next page token returned from a previous query execution. Default is start with first page.

  • :sort (String)

    Optional sort property, valid values are name, description, created_at and modified_at. If specified, the items are sorted by the value of this property.

  • :order (String)

    Optional sort order, valid values are asc and desc. Default: asc. (default to 'asc')

  • :include_history (Boolean)

    Defines if the entity history is included in the response. (default to false)

  • :filter (String)

    An optional filter query parameter used to refine the results of the search operation. For more information see Filtering list results section.

  • :show_group_id (String)

    Defines if the service ID group ID is included in the response.

Returns:



265
266
267
268
# File 'lib/ibm_cloud_iam/api/service_ids_api.rb', line 265

def list_service_ids(authorization, opts = {})
  data, _status_code, _headers = list_service_ids_with_http_info(authorization, opts)
  data
end

#list_service_ids_with_http_info(authorization, opts = {}) ⇒ Array<(ServiceIdList, Integer, Hash)>

List service IDs Returns a list of service IDs. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to. Note: apikey details are only included in the response when creating a Service ID with an api key.

Parameters:

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Options Hash (opts):

  • :account_id (String)

    Account ID of the service ID(s) to query. This parameter is required (unless using a pagetoken).

  • :group_id (String)

    Group ID of the service ID(s) to query. If this parameter is not provided the default group is applied.

  • :name (String)

    Name of the service ID(s) to query. Optional.20 items per page. Valid range is 1 to 100.

  • :pagesize (Integer)

    Optional size of a single page. Default is 20 items per page. Valid range is 1 to 100.

  • :pagetoken (String)

    Optional Prev or Next page token returned from a previous query execution. Default is start with first page.

  • :sort (String)

    Optional sort property, valid values are name, description, created_at and modified_at. If specified, the items are sorted by the value of this property.

  • :order (String)

    Optional sort order, valid values are asc and desc. Default: asc. (default to 'asc')

  • :include_history (Boolean)

    Defines if the entity history is included in the response. (default to false)

  • :filter (String)

    An optional filter query parameter used to refine the results of the search operation. For more information see Filtering list results section.

  • :show_group_id (String)

    Defines if the service ID group ID is included in the response.

Returns:

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

    ServiceIdList data, response status code and response headers



285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
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
# File 'lib/ibm_cloud_iam/api/service_ids_api.rb', line 285

def list_service_ids_with_http_info(authorization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceIDsApi.list_service_ids ...'
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling ServiceIDsApi.list_service_ids"
  end
  allowable_values = ["asc", "desc"]
  if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
    fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/v1/serviceids/'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'account_id'] = opts[:'account_id'] if !opts[:'account_id'].nil?
  query_params[:'group_id'] = opts[:'group_id'] if !opts[:'group_id'].nil?
  query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
  query_params[:'pagesize'] = opts[:'pagesize'] if !opts[:'pagesize'].nil?
  query_params[:'pagetoken'] = opts[:'pagetoken'] if !opts[:'pagetoken'].nil?
  query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
  query_params[:'include_history'] = opts[:'include_history'] if !opts[:'include_history'].nil?
  query_params[:'filter'] = opts[:'filter'] if !opts[:'filter'].nil?
  query_params[:'show_group_id'] = opts[:'show_group_id'] if !opts[:'show_group_id'].nil?

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

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'ServiceIdList'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ServiceIDsApi.list_service_ids",
    :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: ServiceIDsApi#list_service_ids\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#lock_service_id(id, authorization, opts = {}) ⇒ nil

Lock the service ID Locks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.

Parameters:

  • id (String)

    Unique ID of the service ID.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Returns:

  • (nil)


354
355
356
357
# File 'lib/ibm_cloud_iam/api/service_ids_api.rb', line 354

def lock_service_id(id, authorization, opts = {})
  lock_service_id_with_http_info(id, authorization, opts)
  nil
end

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

Lock the service ID Locks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.

Parameters:

  • id (String)

    Unique ID of the service ID.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
# File 'lib/ibm_cloud_iam/api/service_ids_api.rb', line 365

def lock_service_id_with_http_info(id, authorization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceIDsApi.lock_service_id ...'
  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 ServiceIDsApi.lock_service_id"
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling ServiceIDsApi.lock_service_id"
  end
  # resource path
  local_var_path = '/v1/serviceids/{id}/lock'.sub('{id}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'Authorization'] = authorization

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

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

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ServiceIDsApi.lock_service_id",
    :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: ServiceIDsApi#lock_service_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#unlock_service_id(id, authorization, opts = {}) ⇒ nil

Unlock the service ID Unlocks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.

Parameters:

  • id (String)

    Unique ID of the service ID.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Returns:

  • (nil)


422
423
424
425
# File 'lib/ibm_cloud_iam/api/service_ids_api.rb', line 422

def unlock_service_id(id, authorization, opts = {})
  unlock_service_id_with_http_info(id, authorization, opts)
  nil
end

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

Unlock the service ID Unlocks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.

Parameters:

  • id (String)

    Unique ID of the service ID.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
# File 'lib/ibm_cloud_iam/api/service_ids_api.rb', line 433

def unlock_service_id_with_http_info(id, authorization, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceIDsApi.unlock_service_id ...'
  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 ServiceIDsApi.unlock_service_id"
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling ServiceIDsApi.unlock_service_id"
  end
  # resource path
  local_var_path = '/v1/serviceids/{id}/lock'.sub('{id}', CGI.escape(id.to_s))

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

  # header parameters
  header_params = opts[:header_params] || {}
  header_params[:'Authorization'] = authorization

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

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

  # return_type
  return_type = opts[:debug_return_type]

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ServiceIDsApi.unlock_service_id",
    :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: ServiceIDsApi#unlock_service_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_service_id(id, if_match, authorization, update_service_id_request, opts = {}) ⇒ ServiceId

Update service ID Updates properties of a service ID. This does NOT affect existing access tokens. Their token content will stay unchanged until the access token is refreshed. To update a service ID, pass the property to be modified. To delete one property's value, pass the property with an empty value "".Users can manage user API keys for themself, or service ID API keys for service IDs they have access to. Note: apikey details are only included in the response when creating a Service ID with an apikey.

Parameters:

  • id (String)

    Unique ID of the service ID to be updated.

  • if_match (String)

    Version of the service ID to be updated. Specify the version that you retrieved as entity_tag (ETag header) when reading the service ID. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • update_service_id_request (UpdateServiceIdRequest)

    Request to update a service ID.

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

    the optional parameters

Options Hash (opts):

  • :show_group_id (String)

    Defines if the service ID group ID is included in the response.

Returns:



493
494
495
496
# File 'lib/ibm_cloud_iam/api/service_ids_api.rb', line 493

def update_service_id(id, if_match, authorization, update_service_id_request, opts = {})
  data, _status_code, _headers = update_service_id_with_http_info(id, if_match, authorization, update_service_id_request, opts)
  data
end

#update_service_id_with_http_info(id, if_match, authorization, update_service_id_request, opts = {}) ⇒ Array<(ServiceId, Integer, Hash)>

Update service ID Updates properties of a service ID. This does NOT affect existing access tokens. Their token content will stay unchanged until the access token is refreshed. To update a service ID, pass the property to be modified. To delete one property's value, pass the property with an empty value &quot;&quot;.Users can manage user API keys for themself, or service ID API keys for service IDs they have access to. Note: apikey details are only included in the response when creating a Service ID with an apikey.

Parameters:

  • id (String)

    Unique ID of the service ID to be updated.

  • if_match (String)

    Version of the service ID to be updated. Specify the version that you retrieved as entity_tag (ETag header) when reading the service ID. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates.

  • authorization (String)

    Authorization Token used for the request. The supported token type is a Cloud IAM Access Token. If the token is omitted the request will fail with BXNIM0308E: 'No authorization header found'. Make sure that the provided token has the required authority for the request.

  • update_service_id_request (UpdateServiceIdRequest)

    Request to update a service ID.

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

    the optional parameters

Options Hash (opts):

  • :show_group_id (String)

    Defines if the service ID group ID is included in the response.

Returns:

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

    ServiceId data, response status code and response headers



507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
# File 'lib/ibm_cloud_iam/api/service_ids_api.rb', line 507

def update_service_id_with_http_info(id, if_match, authorization, update_service_id_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ServiceIDsApi.update_service_id ...'
  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 ServiceIDsApi.update_service_id"
  end
  # verify the required parameter 'if_match' is set
  if @api_client.config.client_side_validation && if_match.nil?
    fail ArgumentError, "Missing the required parameter 'if_match' when calling ServiceIDsApi.update_service_id"
  end
  # verify the required parameter 'authorization' is set
  if @api_client.config.client_side_validation && authorization.nil?
    fail ArgumentError, "Missing the required parameter 'authorization' when calling ServiceIDsApi.update_service_id"
  end
  # verify the required parameter 'update_service_id_request' is set
  if @api_client.config.client_side_validation && update_service_id_request.nil?
    fail ArgumentError, "Missing the required parameter 'update_service_id_request' when calling ServiceIDsApi.update_service_id"
  end
  # resource path
  local_var_path = '/v1/serviceids/{id}'.sub('{id}', CGI.escape(id.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'show_group_id'] = opts[:'show_group_id'] if !opts[:'show_group_id'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
  # HTTP header 'Content-Type'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end
  header_params[:'If-Match'] = if_match
  header_params[:'Authorization'] = authorization

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

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

  # return_type
  return_type = opts[:debug_return_type] || 'ServiceId'

  # auth_names
  auth_names = opts[:debug_auth_names] || []

  new_options = opts.merge(
    :operation => :"ServiceIDsApi.update_service_id",
    :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(:PUT, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ServiceIDsApi#update_service_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end