Class: IbmCloudIam::APIKeysApi
- Inherits:
-
Object
- Object
- IbmCloudIam::APIKeysApi
- Defined in:
- lib/ibm_cloud_iam/api/api_keys_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_api_key(authorization, create_api_key_request, opts = {}) ⇒ ApiKey
Create an API key Creates an API key for a UserID or service ID.
-
#create_api_key_with_http_info(authorization, create_api_key_request, opts = {}) ⇒ Array<(ApiKey, Integer, Hash)>
Create an API key Creates an API key for a UserID or service ID.
-
#delete_api_key(id, authorization, opts = {}) ⇒ nil
Deletes an API key Deletes an API key.
-
#delete_api_key_with_http_info(id, authorization, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Deletes an API key Deletes an API key.
-
#disable_api_key(id, authorization, opts = {}) ⇒ nil
Disable the API key Disable an API key.
-
#disable_api_key_with_http_info(id, authorization, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Disable the API key Disable an API key.
-
#enable_api_key(id, authorization, opts = {}) ⇒ nil
Enable the API key Enable an API key.
-
#enable_api_key_with_http_info(id, authorization, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Enable the API key Enable an API key.
-
#get_api_key(id, authorization, opts = {}) ⇒ ApiKey
Get details of an API key Returns the details of an API key.
-
#get_api_key_with_http_info(id, authorization, opts = {}) ⇒ Array<(ApiKey, Integer, Hash)>
Get details of an API key Returns the details of an API key.
-
#get_api_keys_details(authorization, opts = {}) ⇒ ApiKey
Get details of an API key by its value.
-
#get_api_keys_details_with_http_info(authorization, opts = {}) ⇒ Array<(ApiKey, Integer, Hash)>
Get details of an API key by its value.
-
#initialize(api_client = ApiClient.default) ⇒ APIKeysApi
constructor
A new instance of APIKeysApi.
-
#list_api_keys(authorization, opts = {}) ⇒ ApiKeyList
Get API keys for a given service or user IAM ID and account ID Returns the list of API key details for a given service or user IAM ID and account ID.
-
#list_api_keys_with_http_info(authorization, opts = {}) ⇒ Array<(ApiKeyList, Integer, Hash)>
Get API keys for a given service or user IAM ID and account ID Returns the list of API key details for a given service or user IAM ID and account ID.
-
#lock_api_key(id, authorization, opts = {}) ⇒ nil
Lock the API key Locks an API key by ID.
-
#lock_api_key_with_http_info(id, authorization, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Lock the API key Locks an API key by ID.
-
#unlock_api_key(id, authorization, opts = {}) ⇒ nil
Unlock the API key Unlocks an API key by ID.
-
#unlock_api_key_with_http_info(id, authorization, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Unlock the API key Unlocks an API key by ID.
-
#update_api_key(id, if_match, authorization, update_api_key_request, opts = {}) ⇒ ApiKey
Updates an API key Updates properties of an API key.
-
#update_api_key_with_http_info(id, if_match, authorization, update_api_key_request, opts = {}) ⇒ Array<(ApiKey, Integer, Hash)>
Updates an API key Updates properties of an API key.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ APIKeysApi
Returns a new instance of APIKeysApi.
19 20 21 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_api_key(authorization, create_api_key_request, opts = {}) ⇒ ApiKey
Create an API key Creates an API key for a UserID or service ID. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.
30 31 32 33 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 30 def create_api_key(, create_api_key_request, opts = {}) data, _status_code, _headers = create_api_key_with_http_info(, create_api_key_request, opts) data end |
#create_api_key_with_http_info(authorization, create_api_key_request, opts = {}) ⇒ Array<(ApiKey, Integer, Hash)>
Create an API key Creates an API key for a UserID or service ID. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.
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/api_keys_api.rb', line 43 def create_api_key_with_http_info(, create_api_key_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: APIKeysApi.create_api_key ...' end # verify the required parameter 'authorization' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'authorization' when calling APIKeysApi.create_api_key" end # verify the required parameter 'create_api_key_request' is set if @api_client.config.client_side_validation && create_api_key_request.nil? fail ArgumentError, "Missing the required parameter 'create_api_key_request' when calling APIKeysApi.create_api_key" end # resource path local_var_path = '/v1/apikeys' # 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']) 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'] = header_params[:'Entity-Lock'] = opts[:'entity_lock'] if !opts[:'entity_lock'].nil? header_params[:'Entity-Disable'] = opts[:'entity_disable'] if !opts[:'entity_disable'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(create_api_key_request) # return_type return_type = opts[:debug_return_type] || 'ApiKey' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"APIKeysApi.create_api_key", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: APIKeysApi#create_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#delete_api_key(id, authorization, opts = {}) ⇒ nil
Deletes an API key Deletes an API key. Existing tokens will remain valid until expired. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.
109 110 111 112 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 109 def delete_api_key(id, , opts = {}) delete_api_key_with_http_info(id, , opts) nil end |
#delete_api_key_with_http_info(id, authorization, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Deletes an API key Deletes an API key. Existing tokens will remain valid until expired. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.
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/api_keys_api.rb', line 120 def delete_api_key_with_http_info(id, , opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: APIKeysApi.delete_api_key ...' 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 APIKeysApi.delete_api_key" end # verify the required parameter 'authorization' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'authorization' when calling APIKeysApi.delete_api_key" end # resource path local_var_path = '/v1/apikeys/{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'] = # 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] || [] = opts.merge( :operation => :"APIKeysApi.delete_api_key", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: APIKeysApi#delete_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#disable_api_key(id, authorization, opts = {}) ⇒ nil
Disable the API key Disable an API key. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.
177 178 179 180 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 177 def disable_api_key(id, , opts = {}) disable_api_key_with_http_info(id, , opts) nil end |
#disable_api_key_with_http_info(id, authorization, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Disable the API key Disable an API key. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.
188 189 190 191 192 193 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 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 188 def disable_api_key_with_http_info(id, , opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: APIKeysApi.disable_api_key ...' 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 APIKeysApi.disable_api_key" end # verify the required parameter 'authorization' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'authorization' when calling APIKeysApi.disable_api_key" end # resource path local_var_path = '/v1/apikeys/{id}/disable'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} header_params[:'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] || [] = opts.merge( :operation => :"APIKeysApi.disable_api_key", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: APIKeysApi#disable_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#enable_api_key(id, authorization, opts = {}) ⇒ nil
Enable the API key Enable an API key. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.
245 246 247 248 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 245 def enable_api_key(id, , opts = {}) enable_api_key_with_http_info(id, , opts) nil end |
#enable_api_key_with_http_info(id, authorization, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Enable the API key Enable an API key. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.
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 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 256 def enable_api_key_with_http_info(id, , opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: APIKeysApi.enable_api_key ...' 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 APIKeysApi.enable_api_key" end # verify the required parameter 'authorization' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'authorization' when calling APIKeysApi.enable_api_key" end # resource path local_var_path = '/v1/apikeys/{id}/disable'.sub('{id}', CGI.escape(id.to_s)) # query parameters query_params = opts[:query_params] || {} # header parameters header_params = opts[:header_params] || {} header_params[:'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] || [] = opts.merge( :operation => :"APIKeysApi.enable_api_key", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: APIKeysApi#enable_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_api_key(id, authorization, opts = {}) ⇒ ApiKey
Get details of an API key Returns the details of an API key. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.
315 316 317 318 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 315 def get_api_key(id, , opts = {}) data, _status_code, _headers = get_api_key_with_http_info(id, , opts) data end |
#get_api_key_with_http_info(id, authorization, opts = {}) ⇒ Array<(ApiKey, Integer, Hash)>
Get details of an API key Returns the details of an API key. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.
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 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 328 def get_api_key_with_http_info(id, , opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: APIKeysApi.get_api_key ...' 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 APIKeysApi.get_api_key" end # verify the required parameter 'authorization' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'authorization' when calling APIKeysApi.get_api_key" end # resource path local_var_path = '/v1/apikeys/{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? # 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'] = # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ApiKey' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"APIKeysApi.get_api_key", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: APIKeysApi#get_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#get_api_keys_details(authorization, opts = {}) ⇒ ApiKey
Get details of an API key by its value. Returns the details of an API key by its value. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.
390 391 392 393 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 390 def get_api_keys_details(, opts = {}) data, _status_code, _headers = get_api_keys_details_with_http_info(, opts) data end |
#get_api_keys_details_with_http_info(authorization, opts = {}) ⇒ Array<(ApiKey, Integer, Hash)>
Get details of an API key by its value. Returns the details of an API key by its value. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 402 def get_api_keys_details_with_http_info(, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: APIKeysApi.get_api_keys_details ...' end # verify the required parameter 'authorization' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'authorization' when calling APIKeysApi.get_api_keys_details" end # resource path local_var_path = '/v1/apikeys/details' # query parameters query_params = opts[:query_params] || {} query_params[:'include_history'] = opts[:'include_history'] if !opts[:'include_history'].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'] = header_params[:'IAM-ApiKey'] = opts[:'iam_api_key'] if !opts[:'iam_api_key'].nil? # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ApiKey' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"APIKeysApi.get_api_keys_details", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: APIKeysApi#get_api_keys_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#list_api_keys(authorization, opts = {}) ⇒ ApiKeyList
Get API keys for a given service or user IAM ID and account ID Returns the list of API key details for a given service or user IAM ID and account ID. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.
469 470 471 472 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 469 def list_api_keys(, opts = {}) data, _status_code, _headers = list_api_keys_with_http_info(, opts) data end |
#list_api_keys_with_http_info(authorization, opts = {}) ⇒ Array<(ApiKeyList, Integer, Hash)>
Get API keys for a given service or user IAM ID and account ID Returns the list of API key details for a given service or user IAM ID and account ID. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.
490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 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 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 490 def list_api_keys_with_http_info(, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: APIKeysApi.list_api_keys ...' end # verify the required parameter 'authorization' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'authorization' when calling APIKeysApi.list_api_keys" end allowable_values = ["entity", "account"] if @api_client.config.client_side_validation && opts[:'scope'] && !allowable_values.include?(opts[:'scope']) fail ArgumentError, "invalid value for \"scope\", must be one of #{allowable_values}" end allowable_values = ["user", "serviceid"] if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type']) fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}" 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/apikeys' # query parameters query_params = opts[:query_params] || {} query_params[:'account_id'] = opts[:'account_id'] if !opts[:'account_id'].nil? query_params[:'iam_id'] = opts[:'iam_id'] if !opts[:'iam_id'].nil? query_params[:'pagesize'] = opts[:'pagesize'] if !opts[:'pagesize'].nil? query_params[:'pagetoken'] = opts[:'pagetoken'] if !opts[:'pagetoken'].nil? query_params[:'scope'] = opts[:'scope'] if !opts[:'scope'].nil? query_params[:'type'] = opts[:'type'] if !opts[:'type'].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[:'group_id'] = opts[:'group_id'] if !opts[:'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'] = # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ApiKeyList' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"APIKeysApi.list_api_keys", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: APIKeysApi#list_api_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#lock_api_key(id, authorization, opts = {}) ⇒ nil
Lock the API key Locks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.
568 569 570 571 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 568 def lock_api_key(id, , opts = {}) lock_api_key_with_http_info(id, , opts) nil end |
#lock_api_key_with_http_info(id, authorization, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Lock the API key Locks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.
579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 579 def lock_api_key_with_http_info(id, , opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: APIKeysApi.lock_api_key ...' 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 APIKeysApi.lock_api_key" end # verify the required parameter 'authorization' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'authorization' when calling APIKeysApi.lock_api_key" end # resource path local_var_path = '/v1/apikeys/{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'] = # 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] || [] = opts.merge( :operation => :"APIKeysApi.lock_api_key", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: APIKeysApi#lock_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#unlock_api_key(id, authorization, opts = {}) ⇒ nil
Unlock the API key Unlocks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.
636 637 638 639 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 636 def unlock_api_key(id, , opts = {}) unlock_api_key_with_http_info(id, , opts) nil end |
#unlock_api_key_with_http_info(id, authorization, opts = {}) ⇒ Array<(nil, Integer, Hash)>
Unlock the API key Unlocks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs they have access to.
647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 647 def unlock_api_key_with_http_info(id, , opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: APIKeysApi.unlock_api_key ...' 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 APIKeysApi.unlock_api_key" end # verify the required parameter 'authorization' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'authorization' when calling APIKeysApi.unlock_api_key" end # resource path local_var_path = '/v1/apikeys/{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'] = # 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] || [] = opts.merge( :operation => :"APIKeysApi.unlock_api_key", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: APIKeysApi#unlock_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |
#update_api_key(id, if_match, authorization, update_api_key_request, opts = {}) ⇒ ApiKey
Updates an API key Updates properties of an API key. This does NOT affect existing access tokens. Their token content will stay unchanged until the access token is refreshed. To update an API key, 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.
706 707 708 709 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 706 def update_api_key(id, if_match, , update_api_key_request, opts = {}) data, _status_code, _headers = update_api_key_with_http_info(id, if_match, , update_api_key_request, opts) data end |
#update_api_key_with_http_info(id, if_match, authorization, update_api_key_request, opts = {}) ⇒ Array<(ApiKey, Integer, Hash)>
Updates an API key Updates properties of an API key. This does NOT affect existing access tokens. Their token content will stay unchanged until the access token is refreshed. To update an API key, 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.
719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 |
# File 'lib/ibm_cloud_iam/api/api_keys_api.rb', line 719 def update_api_key_with_http_info(id, if_match, , update_api_key_request, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: APIKeysApi.update_api_key ...' 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 APIKeysApi.update_api_key" 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 APIKeysApi.update_api_key" end # verify the required parameter 'authorization' is set if @api_client.config.client_side_validation && .nil? fail ArgumentError, "Missing the required parameter 'authorization' when calling APIKeysApi.update_api_key" end # verify the required parameter 'update_api_key_request' is set if @api_client.config.client_side_validation && update_api_key_request.nil? fail ArgumentError, "Missing the required parameter 'update_api_key_request' when calling APIKeysApi.update_api_key" end # resource path local_var_path = '/v1/apikeys/{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']) 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'] = # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] || @api_client.object_to_http_body(update_api_key_request) # return_type return_type = opts[:debug_return_type] || 'ApiKey' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"APIKeysApi.update_api_key", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: APIKeysApi#update_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |