ibm_cloud_iam 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +131 -0
- data/Rakefile +10 -0
- data/docs/ApiKey.md +43 -0
- data/docs/ApiKeyInsideCreateServiceIdRequest.md +23 -0
- data/docs/ApiKeyList.md +29 -0
- data/docs/CreateApiKeyRequest.md +27 -0
- data/docs/CreateServiceIdRequest.md +25 -0
- data/docs/EnityHistoryRecord.md +27 -0
- data/docs/Error.md +23 -0
- data/docs/ExceptionResponse.md +23 -0
- data/docs/ExceptionResponseContext.md +39 -0
- data/docs/IdentityOperationsApi.md +828 -0
- data/docs/InlineObject.md +19 -0
- data/docs/InlineObject1.md +23 -0
- data/docs/InlineObject2.md +21 -0
- data/docs/InlineObject3.md +25 -0
- data/docs/MFARequirementsResponse.md +21 -0
- data/docs/OidcExceptionResponse.md +25 -0
- data/docs/ResponseContext.md +37 -0
- data/docs/ServiceId.md +43 -0
- data/docs/ServiceIdList.md +29 -0
- data/docs/TokenOperationsApi.md +226 -0
- data/docs/TokenResponse.md +27 -0
- data/docs/UpdateApiKeyRequest.md +19 -0
- data/docs/UpdateServiceIdRequest.md +21 -0
- data/git_push.sh +58 -0
- data/ibm_cloud_iam-1.0.0.gem +0 -0
- data/ibm_cloud_iam.gemspec +38 -0
- data/lib/ibm_cloud_iam.rb +62 -0
- data/lib/ibm_cloud_iam/api/identity_operations_api.rb +1083 -0
- data/lib/ibm_cloud_iam/api/token_operations_api.rb +351 -0
- data/lib/ibm_cloud_iam/api_client.rb +387 -0
- data/lib/ibm_cloud_iam/api_error.rb +57 -0
- data/lib/ibm_cloud_iam/configuration.rb +241 -0
- data/lib/ibm_cloud_iam/models/api_key.rb +381 -0
- data/lib/ibm_cloud_iam/models/api_key_inside_create_service_id_request.rb +245 -0
- data/lib/ibm_cloud_iam/models/api_key_list.rb +276 -0
- data/lib/ibm_cloud_iam/models/create_api_key_request.rb +270 -0
- data/lib/ibm_cloud_iam/models/create_service_id_request.rb +261 -0
- data/lib/ibm_cloud_iam/models/enity_history_record.rb +292 -0
- data/lib/ibm_cloud_iam/models/error.rb +255 -0
- data/lib/ibm_cloud_iam/models/exception_response.rb +251 -0
- data/lib/ibm_cloud_iam/models/exception_response_context.rb +320 -0
- data/lib/ibm_cloud_iam/models/inline_object.rb +229 -0
- data/lib/ibm_cloud_iam/models/inline_object1.rb +254 -0
- data/lib/ibm_cloud_iam/models/inline_object2.rb +244 -0
- data/lib/ibm_cloud_iam/models/inline_object3.rb +269 -0
- data/lib/ibm_cloud_iam/models/mfa_requirements_response.rb +245 -0
- data/lib/ibm_cloud_iam/models/oidc_exception_response.rb +258 -0
- data/lib/ibm_cloud_iam/models/response_context.rb +310 -0
- data/lib/ibm_cloud_iam/models/service_id.rb +377 -0
- data/lib/ibm_cloud_iam/models/service_id_list.rb +276 -0
- data/lib/ibm_cloud_iam/models/token_response.rb +260 -0
- data/lib/ibm_cloud_iam/models/update_api_key_request.rb +220 -0
- data/lib/ibm_cloud_iam/models/update_service_id_request.rb +232 -0
- data/lib/ibm_cloud_iam/version.rb +15 -0
- data/spec/api/identity_operations_api_spec.rb +253 -0
- data/spec/api/token_operations_api_spec.rb +94 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/api_key_inside_create_service_id_request_spec.rb +59 -0
- data/spec/models/api_key_list_spec.rb +77 -0
- data/spec/models/api_key_spec.rb +119 -0
- data/spec/models/create_api_key_request_spec.rb +71 -0
- data/spec/models/create_service_id_request_spec.rb +65 -0
- data/spec/models/enity_history_record_spec.rb +71 -0
- data/spec/models/error_spec.rb +59 -0
- data/spec/models/exception_response_context_spec.rb +107 -0
- data/spec/models/exception_response_spec.rb +59 -0
- data/spec/models/inline_object1_spec.rb +59 -0
- data/spec/models/inline_object2_spec.rb +53 -0
- data/spec/models/inline_object3_spec.rb +65 -0
- data/spec/models/inline_object_spec.rb +47 -0
- data/spec/models/mfa_requirements_response_spec.rb +53 -0
- data/spec/models/oidc_exception_response_spec.rb +65 -0
- data/spec/models/response_context_spec.rb +101 -0
- data/spec/models/service_id_list_spec.rb +77 -0
- data/spec/models/service_id_spec.rb +119 -0
- data/spec/models/token_response_spec.rb +71 -0
- data/spec/models/update_api_key_request_spec.rb +47 -0
- data/spec/models/update_service_id_request_spec.rb +53 -0
- data/spec/spec_helper.rb +111 -0
- metadata +192 -0
@@ -0,0 +1,27 @@
|
|
1
|
+
# IbmCloudIam::TokenResponse
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**access_token** | **String** | The IAM access token that can be used to invoke various IBM Cloud APIs. Use this token with the prefix Bearer in the HTTP header Authorization for invocations of IAM compatible APIs. | [optional]
|
8
|
+
**refresh_token** | **String** | (optional) A refresh token that can be used to get a new IAM access token if that token is expired. When using the default client (no basic authorization header) as described in this documentation, this refresh_token cannot be used to retrieve a new IAM access token. When the IAM access token is about to be expired, use the API key to create a new access token. | [optional]
|
9
|
+
**delegated_refresh_token** | **String** | (optional) A delegated refresh token that can only be consumed by the clients that have been specified in the API call as 'receiver_client_ids' | [optional]
|
10
|
+
**token_type** | **String** | The type of the token. Currently, only Bearer is returned. | [optional]
|
11
|
+
**expires_in** | **Integer** | Number of seconds until the IAM access token will expire. | [optional]
|
12
|
+
**expiration** | **Integer** | Number of seconds counted since January 1st, 1970, until the IAM access token will expire. | [optional]
|
13
|
+
|
14
|
+
## Code Sample
|
15
|
+
|
16
|
+
```ruby
|
17
|
+
require 'IbmCloudIam'
|
18
|
+
|
19
|
+
instance = IbmCloudIam::TokenResponse.new(access_token: null,
|
20
|
+
refresh_token: null,
|
21
|
+
delegated_refresh_token: null,
|
22
|
+
token_type: null,
|
23
|
+
expires_in: null,
|
24
|
+
expiration: null)
|
25
|
+
```
|
26
|
+
|
27
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# IbmCloudIam::UpdateApiKeyRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**name** | **String** | The name of the API key to update. If specified in the request the parameter must not be empty. The name is not checked for uniqueness. Failure to this will result in an Error condition. | [optional]
|
8
|
+
**description** | **String** | The description of the API key to update. If specified an empty description will clear the description of the API key. If a non empty value is provided the API key will be updated. | [optional]
|
9
|
+
|
10
|
+
## Code Sample
|
11
|
+
|
12
|
+
```ruby
|
13
|
+
require 'IbmCloudIam'
|
14
|
+
|
15
|
+
instance = IbmCloudIam::UpdateApiKeyRequest.new(name: null,
|
16
|
+
description: null)
|
17
|
+
```
|
18
|
+
|
19
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# IbmCloudIam::UpdateServiceIdRequest
|
2
|
+
|
3
|
+
## Properties
|
4
|
+
|
5
|
+
Name | Type | Description | Notes
|
6
|
+
------------ | ------------- | ------------- | -------------
|
7
|
+
**name** | **String** | The name of the service ID to update. If specified in the request the parameter must not be empty. The name is not checked for uniqueness. Failure to this will result in an Error condition. | [optional]
|
8
|
+
**description** | **String** | The description of the service ID to update. If specified an empty description will clear the description of the service ID. If an non empty value is provided the service ID will be updated. | [optional]
|
9
|
+
**unique_instance_crns** | **Array<String>** | List of CRNs which point to the services connected to this service ID. If specified an empty list will clear all existing unique instance crns of the service ID. | [optional]
|
10
|
+
|
11
|
+
## Code Sample
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
require 'IbmCloudIam'
|
15
|
+
|
16
|
+
instance = IbmCloudIam::UpdateServiceIdRequest.new(name: null,
|
17
|
+
description: null,
|
18
|
+
unique_instance_crns: null)
|
19
|
+
```
|
20
|
+
|
21
|
+
|
data/git_push.sh
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
|
3
|
+
#
|
4
|
+
# Usage example: /bin/sh ./git_push.sh wing328 openapi-pestore-perl "minor update" "gitlab.com"
|
5
|
+
|
6
|
+
git_user_id=$1
|
7
|
+
git_repo_id=$2
|
8
|
+
release_note=$3
|
9
|
+
git_host=$4
|
10
|
+
|
11
|
+
if [ "$git_host" = "" ]; then
|
12
|
+
git_host="github.com"
|
13
|
+
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
|
14
|
+
fi
|
15
|
+
|
16
|
+
if [ "$git_user_id" = "" ]; then
|
17
|
+
git_user_id="GIT_USER_ID"
|
18
|
+
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
|
19
|
+
fi
|
20
|
+
|
21
|
+
if [ "$git_repo_id" = "" ]; then
|
22
|
+
git_repo_id="GIT_REPO_ID"
|
23
|
+
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
|
24
|
+
fi
|
25
|
+
|
26
|
+
if [ "$release_note" = "" ]; then
|
27
|
+
release_note="Minor update"
|
28
|
+
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
|
29
|
+
fi
|
30
|
+
|
31
|
+
# Initialize the local directory as a Git repository
|
32
|
+
git init
|
33
|
+
|
34
|
+
# Adds the files in the local repository and stages them for commit.
|
35
|
+
git add .
|
36
|
+
|
37
|
+
# Commits the tracked changes and prepares them to be pushed to a remote repository.
|
38
|
+
git commit -m "$release_note"
|
39
|
+
|
40
|
+
# Sets the new remote
|
41
|
+
git_remote=`git remote`
|
42
|
+
if [ "$git_remote" = "" ]; then # git remote not defined
|
43
|
+
|
44
|
+
if [ "$GIT_TOKEN" = "" ]; then
|
45
|
+
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
|
46
|
+
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
|
47
|
+
else
|
48
|
+
git remote add origin https://${git_user_id}:${GIT_TOKEN}@${git_host}/${git_user_id}/${git_repo_id}.git
|
49
|
+
fi
|
50
|
+
|
51
|
+
fi
|
52
|
+
|
53
|
+
git pull origin master
|
54
|
+
|
55
|
+
# Pushes (Forces) the changes in the local repository up to the remote repository
|
56
|
+
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
|
57
|
+
git push origin master 2>&1 | grep -v 'To https'
|
58
|
+
|
Binary file
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
|
3
|
+
=begin
|
4
|
+
#IAM Identity Services API
|
5
|
+
|
6
|
+
#The IAM Identity Service API allows for the management of Identities (Service IDs, ApiKeys).
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.0.0
|
9
|
+
|
10
|
+
Generated by: https://openapi-generator.tech
|
11
|
+
OpenAPI Generator version: 5.0.0-beta2
|
12
|
+
|
13
|
+
=end
|
14
|
+
|
15
|
+
$:.push File.expand_path("../lib", __FILE__)
|
16
|
+
require "ibm_cloud_iam/version"
|
17
|
+
|
18
|
+
Gem::Specification.new do |s|
|
19
|
+
s.name = "ibm_cloud_iam"
|
20
|
+
s.version = IbmCloudIam::VERSION
|
21
|
+
s.platform = Gem::Platform::RUBY
|
22
|
+
s.authors = ["IBM Cloud Developers"]
|
23
|
+
s.email = [""]
|
24
|
+
s.homepage = "https://openapi-generator.tech"
|
25
|
+
s.summary = "IBM Cloud IAM Identity Services"
|
26
|
+
s.description = "Ruby gem for IBM Cloud IAM Identity Services"
|
27
|
+
s.license = 'Apache-2.0'
|
28
|
+
s.required_ruby_version = ">= 1.9"
|
29
|
+
|
30
|
+
s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1'
|
31
|
+
|
32
|
+
s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'
|
33
|
+
|
34
|
+
s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
|
35
|
+
s.test_files = `find spec/*`.split("\n")
|
36
|
+
s.executables = []
|
37
|
+
s.require_paths = ["lib"]
|
38
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
=begin
|
2
|
+
#IAM Identity Services API
|
3
|
+
|
4
|
+
#The IAM Identity Service API allows for the management of Identities (Service IDs, ApiKeys).
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 5.0.0-beta2
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
# Common files
|
14
|
+
require 'ibm_cloud_iam/api_client'
|
15
|
+
require 'ibm_cloud_iam/api_error'
|
16
|
+
require 'ibm_cloud_iam/version'
|
17
|
+
require 'ibm_cloud_iam/configuration'
|
18
|
+
|
19
|
+
# Models
|
20
|
+
require 'ibm_cloud_iam/models/api_key'
|
21
|
+
require 'ibm_cloud_iam/models/api_key_inside_create_service_id_request'
|
22
|
+
require 'ibm_cloud_iam/models/api_key_list'
|
23
|
+
require 'ibm_cloud_iam/models/create_api_key_request'
|
24
|
+
require 'ibm_cloud_iam/models/create_service_id_request'
|
25
|
+
require 'ibm_cloud_iam/models/enity_history_record'
|
26
|
+
require 'ibm_cloud_iam/models/error'
|
27
|
+
require 'ibm_cloud_iam/models/exception_response'
|
28
|
+
require 'ibm_cloud_iam/models/exception_response_context'
|
29
|
+
require 'ibm_cloud_iam/models/inline_object'
|
30
|
+
require 'ibm_cloud_iam/models/inline_object1'
|
31
|
+
require 'ibm_cloud_iam/models/inline_object2'
|
32
|
+
require 'ibm_cloud_iam/models/inline_object3'
|
33
|
+
require 'ibm_cloud_iam/models/mfa_requirements_response'
|
34
|
+
require 'ibm_cloud_iam/models/oidc_exception_response'
|
35
|
+
require 'ibm_cloud_iam/models/response_context'
|
36
|
+
require 'ibm_cloud_iam/models/service_id'
|
37
|
+
require 'ibm_cloud_iam/models/service_id_list'
|
38
|
+
require 'ibm_cloud_iam/models/token_response'
|
39
|
+
require 'ibm_cloud_iam/models/update_api_key_request'
|
40
|
+
require 'ibm_cloud_iam/models/update_service_id_request'
|
41
|
+
|
42
|
+
# APIs
|
43
|
+
require 'ibm_cloud_iam/api/identity_operations_api'
|
44
|
+
require 'ibm_cloud_iam/api/token_operations_api'
|
45
|
+
|
46
|
+
module IbmCloudIam
|
47
|
+
class << self
|
48
|
+
# Customize default settings for the SDK using block.
|
49
|
+
# IbmCloudIam.configure do |config|
|
50
|
+
# config.username = "xxx"
|
51
|
+
# config.password = "xxx"
|
52
|
+
# end
|
53
|
+
# If no block given, return the default Configuration object.
|
54
|
+
def configure
|
55
|
+
if block_given?
|
56
|
+
yield(Configuration.default)
|
57
|
+
else
|
58
|
+
Configuration.default
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,1083 @@
|
|
1
|
+
=begin
|
2
|
+
#IAM Identity Services API
|
3
|
+
|
4
|
+
#The IAM Identity Service API allows for the management of Identities (Service IDs, ApiKeys).
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.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 IbmCloudIam
|
16
|
+
class IdentityOperationsApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Create an API key
|
23
|
+
# 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 that are bound to an entity they have access to.
|
24
|
+
# @param create_api_key_request [CreateApiKeyRequest] Request to create an API key
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
27
|
+
# @option opts [String] :entity_lock Indicates if the API key is locked for further write operations. False by default. (default to 'false')
|
28
|
+
# @return [ApiKey]
|
29
|
+
def create_api_key(create_api_key_request, opts = {})
|
30
|
+
data, _status_code, _headers = create_api_key_with_http_info(create_api_key_request, opts)
|
31
|
+
data
|
32
|
+
end
|
33
|
+
|
34
|
+
# Create an API key
|
35
|
+
# 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 that are bound to an entity they have access to.
|
36
|
+
# @param create_api_key_request [CreateApiKeyRequest] Request to create an API key
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
39
|
+
# @option opts [String] :entity_lock Indicates if the API key is locked for further write operations. False by default.
|
40
|
+
# @return [Array<(ApiKey, Integer, Hash)>] ApiKey data, response status code and response headers
|
41
|
+
def create_api_key_with_http_info(create_api_key_request, opts = {})
|
42
|
+
if @api_client.config.debugging
|
43
|
+
@api_client.config.logger.debug 'Calling API: IdentityOperationsApi.create_api_key ...'
|
44
|
+
end
|
45
|
+
# verify the required parameter 'create_api_key_request' is set
|
46
|
+
if @api_client.config.client_side_validation && create_api_key_request.nil?
|
47
|
+
fail ArgumentError, "Missing the required parameter 'create_api_key_request' when calling IdentityOperationsApi.create_api_key"
|
48
|
+
end
|
49
|
+
# resource path
|
50
|
+
local_var_path = '/v1/apikeys'
|
51
|
+
|
52
|
+
# query parameters
|
53
|
+
query_params = opts[:query_params] || {}
|
54
|
+
|
55
|
+
# header parameters
|
56
|
+
header_params = opts[:header_params] || {}
|
57
|
+
# HTTP header 'Accept' (if needed)
|
58
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
59
|
+
# HTTP header 'Content-Type'
|
60
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
61
|
+
header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?
|
62
|
+
header_params[:'Entity-Lock'] = opts[:'entity_lock'] if !opts[:'entity_lock'].nil?
|
63
|
+
|
64
|
+
# form parameters
|
65
|
+
form_params = opts[:form_params] || {}
|
66
|
+
|
67
|
+
# http body (model)
|
68
|
+
post_body = opts[:body] || @api_client.object_to_http_body(create_api_key_request)
|
69
|
+
|
70
|
+
# return_type
|
71
|
+
return_type = opts[:return_type] || 'ApiKey'
|
72
|
+
|
73
|
+
# auth_names
|
74
|
+
auth_names = opts[:auth_names] || []
|
75
|
+
|
76
|
+
new_options = opts.merge(
|
77
|
+
:header_params => header_params,
|
78
|
+
:query_params => query_params,
|
79
|
+
:form_params => form_params,
|
80
|
+
:body => post_body,
|
81
|
+
:auth_names => auth_names,
|
82
|
+
:return_type => return_type
|
83
|
+
)
|
84
|
+
|
85
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
86
|
+
if @api_client.config.debugging
|
87
|
+
@api_client.config.logger.debug "API called: IdentityOperationsApi#create_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
88
|
+
end
|
89
|
+
return data, status_code, headers
|
90
|
+
end
|
91
|
+
|
92
|
+
# Create a service ID
|
93
|
+
# 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 that are bound to an entity they have access to.
|
94
|
+
# @param create_service_id_request [CreateServiceIdRequest] Request to create a service ID
|
95
|
+
# @param [Hash] opts the optional parameters
|
96
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
97
|
+
# @option opts [String] :entity_lock Indicates if the service ID is locked for further write operations. False by default. (default to 'false')
|
98
|
+
# @return [ServiceId]
|
99
|
+
def create_service_id(create_service_id_request, opts = {})
|
100
|
+
data, _status_code, _headers = create_service_id_with_http_info(create_service_id_request, opts)
|
101
|
+
data
|
102
|
+
end
|
103
|
+
|
104
|
+
# Create a service ID
|
105
|
+
# 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 that are bound to an entity they have access to.
|
106
|
+
# @param create_service_id_request [CreateServiceIdRequest] Request to create a service ID
|
107
|
+
# @param [Hash] opts the optional parameters
|
108
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
109
|
+
# @option opts [String] :entity_lock Indicates if the service ID is locked for further write operations. False by default.
|
110
|
+
# @return [Array<(ServiceId, Integer, Hash)>] ServiceId data, response status code and response headers
|
111
|
+
def create_service_id_with_http_info(create_service_id_request, opts = {})
|
112
|
+
if @api_client.config.debugging
|
113
|
+
@api_client.config.logger.debug 'Calling API: IdentityOperationsApi.create_service_id ...'
|
114
|
+
end
|
115
|
+
# verify the required parameter 'create_service_id_request' is set
|
116
|
+
if @api_client.config.client_side_validation && create_service_id_request.nil?
|
117
|
+
fail ArgumentError, "Missing the required parameter 'create_service_id_request' when calling IdentityOperationsApi.create_service_id"
|
118
|
+
end
|
119
|
+
# resource path
|
120
|
+
local_var_path = '/v1/serviceids/'
|
121
|
+
|
122
|
+
# query parameters
|
123
|
+
query_params = opts[:query_params] || {}
|
124
|
+
|
125
|
+
# header parameters
|
126
|
+
header_params = opts[:header_params] || {}
|
127
|
+
# HTTP header 'Accept' (if needed)
|
128
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
129
|
+
# HTTP header 'Content-Type'
|
130
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
131
|
+
header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?
|
132
|
+
header_params[:'Entity-Lock'] = opts[:'entity_lock'] if !opts[:'entity_lock'].nil?
|
133
|
+
|
134
|
+
# form parameters
|
135
|
+
form_params = opts[:form_params] || {}
|
136
|
+
|
137
|
+
# http body (model)
|
138
|
+
post_body = opts[:body] || @api_client.object_to_http_body(create_service_id_request)
|
139
|
+
|
140
|
+
# return_type
|
141
|
+
return_type = opts[:return_type] || 'ServiceId'
|
142
|
+
|
143
|
+
# auth_names
|
144
|
+
auth_names = opts[:auth_names] || []
|
145
|
+
|
146
|
+
new_options = opts.merge(
|
147
|
+
:header_params => header_params,
|
148
|
+
:query_params => query_params,
|
149
|
+
:form_params => form_params,
|
150
|
+
:body => post_body,
|
151
|
+
:auth_names => auth_names,
|
152
|
+
:return_type => return_type
|
153
|
+
)
|
154
|
+
|
155
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
156
|
+
if @api_client.config.debugging
|
157
|
+
@api_client.config.logger.debug "API called: IdentityOperationsApi#create_service_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
158
|
+
end
|
159
|
+
return data, status_code, headers
|
160
|
+
end
|
161
|
+
|
162
|
+
# Deletes an API key
|
163
|
+
# Deletes an API key. Existing tokens will remain valid until expired. Refresh tokens will not work any more for this API key. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.
|
164
|
+
# @param id [String] Unique ID of the API key.
|
165
|
+
# @param [Hash] opts the optional parameters
|
166
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
167
|
+
# @return [nil]
|
168
|
+
def delete_api_key(id, opts = {})
|
169
|
+
delete_api_key_with_http_info(id, opts)
|
170
|
+
nil
|
171
|
+
end
|
172
|
+
|
173
|
+
# Deletes an API key
|
174
|
+
# Deletes an API key. Existing tokens will remain valid until expired. Refresh tokens will not work any more for this API key. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.
|
175
|
+
# @param id [String] Unique ID of the API key.
|
176
|
+
# @param [Hash] opts the optional parameters
|
177
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
178
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
179
|
+
def delete_api_key_with_http_info(id, opts = {})
|
180
|
+
if @api_client.config.debugging
|
181
|
+
@api_client.config.logger.debug 'Calling API: IdentityOperationsApi.delete_api_key ...'
|
182
|
+
end
|
183
|
+
# verify the required parameter 'id' is set
|
184
|
+
if @api_client.config.client_side_validation && id.nil?
|
185
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling IdentityOperationsApi.delete_api_key"
|
186
|
+
end
|
187
|
+
# resource path
|
188
|
+
local_var_path = '/v1/apikeys/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
189
|
+
|
190
|
+
# query parameters
|
191
|
+
query_params = opts[:query_params] || {}
|
192
|
+
|
193
|
+
# header parameters
|
194
|
+
header_params = opts[:header_params] || {}
|
195
|
+
header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?
|
196
|
+
|
197
|
+
# form parameters
|
198
|
+
form_params = opts[:form_params] || {}
|
199
|
+
|
200
|
+
# http body (model)
|
201
|
+
post_body = opts[:body]
|
202
|
+
|
203
|
+
# return_type
|
204
|
+
return_type = opts[:return_type]
|
205
|
+
|
206
|
+
# auth_names
|
207
|
+
auth_names = opts[:auth_names] || []
|
208
|
+
|
209
|
+
new_options = opts.merge(
|
210
|
+
:header_params => header_params,
|
211
|
+
:query_params => query_params,
|
212
|
+
:form_params => form_params,
|
213
|
+
:body => post_body,
|
214
|
+
:auth_names => auth_names,
|
215
|
+
:return_type => return_type
|
216
|
+
)
|
217
|
+
|
218
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
219
|
+
if @api_client.config.debugging
|
220
|
+
@api_client.config.logger.debug "API called: IdentityOperationsApi#delete_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
221
|
+
end
|
222
|
+
return data, status_code, headers
|
223
|
+
end
|
224
|
+
|
225
|
+
# Deletes a service ID and associated API keys
|
226
|
+
# 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 that are bound to an entity they have access to.
|
227
|
+
# @param id [String] Unique ID of the service ID.
|
228
|
+
# @param [Hash] opts the optional parameters
|
229
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
230
|
+
# @return [nil]
|
231
|
+
def delete_service_id(id, opts = {})
|
232
|
+
delete_service_id_with_http_info(id, opts)
|
233
|
+
nil
|
234
|
+
end
|
235
|
+
|
236
|
+
# Deletes a service ID and associated API keys
|
237
|
+
# 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 that are bound to an entity they have access to.
|
238
|
+
# @param id [String] Unique ID of the service ID.
|
239
|
+
# @param [Hash] opts the optional parameters
|
240
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
241
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
242
|
+
def delete_service_id_with_http_info(id, opts = {})
|
243
|
+
if @api_client.config.debugging
|
244
|
+
@api_client.config.logger.debug 'Calling API: IdentityOperationsApi.delete_service_id ...'
|
245
|
+
end
|
246
|
+
# verify the required parameter 'id' is set
|
247
|
+
if @api_client.config.client_side_validation && id.nil?
|
248
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling IdentityOperationsApi.delete_service_id"
|
249
|
+
end
|
250
|
+
# resource path
|
251
|
+
local_var_path = '/v1/serviceids/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
252
|
+
|
253
|
+
# query parameters
|
254
|
+
query_params = opts[:query_params] || {}
|
255
|
+
|
256
|
+
# header parameters
|
257
|
+
header_params = opts[:header_params] || {}
|
258
|
+
header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?
|
259
|
+
|
260
|
+
# form parameters
|
261
|
+
form_params = opts[:form_params] || {}
|
262
|
+
|
263
|
+
# http body (model)
|
264
|
+
post_body = opts[:body]
|
265
|
+
|
266
|
+
# return_type
|
267
|
+
return_type = opts[:return_type]
|
268
|
+
|
269
|
+
# auth_names
|
270
|
+
auth_names = opts[:auth_names] || []
|
271
|
+
|
272
|
+
new_options = opts.merge(
|
273
|
+
:header_params => header_params,
|
274
|
+
:query_params => query_params,
|
275
|
+
:form_params => form_params,
|
276
|
+
:body => post_body,
|
277
|
+
:auth_names => auth_names,
|
278
|
+
:return_type => return_type
|
279
|
+
)
|
280
|
+
|
281
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
282
|
+
if @api_client.config.debugging
|
283
|
+
@api_client.config.logger.debug "API called: IdentityOperationsApi#delete_service_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
284
|
+
end
|
285
|
+
return data, status_code, headers
|
286
|
+
end
|
287
|
+
|
288
|
+
# Get details of an API key
|
289
|
+
# Returns the details of an API key. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity.
|
290
|
+
# @param id [String] Unique ID of the API key.
|
291
|
+
# @param [Hash] opts the optional parameters
|
292
|
+
# @option opts [Boolean] :include_history Defines if the entity history is included in the response. (default to false)
|
293
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
294
|
+
# @return [ApiKey]
|
295
|
+
def get_api_key(id, opts = {})
|
296
|
+
data, _status_code, _headers = get_api_key_with_http_info(id, opts)
|
297
|
+
data
|
298
|
+
end
|
299
|
+
|
300
|
+
# Get details of an API key
|
301
|
+
# Returns the details of an API key. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity.
|
302
|
+
# @param id [String] Unique ID of the API key.
|
303
|
+
# @param [Hash] opts the optional parameters
|
304
|
+
# @option opts [Boolean] :include_history Defines if the entity history is included in the response.
|
305
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
306
|
+
# @return [Array<(ApiKey, Integer, Hash)>] ApiKey data, response status code and response headers
|
307
|
+
def get_api_key_with_http_info(id, opts = {})
|
308
|
+
if @api_client.config.debugging
|
309
|
+
@api_client.config.logger.debug 'Calling API: IdentityOperationsApi.get_api_key ...'
|
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 IdentityOperationsApi.get_api_key"
|
314
|
+
end
|
315
|
+
# resource path
|
316
|
+
local_var_path = '/v1/apikeys/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
317
|
+
|
318
|
+
# query parameters
|
319
|
+
query_params = opts[:query_params] || {}
|
320
|
+
query_params[:'include_history'] = opts[:'include_history'] if !opts[:'include_history'].nil?
|
321
|
+
|
322
|
+
# header parameters
|
323
|
+
header_params = opts[:header_params] || {}
|
324
|
+
# HTTP header 'Accept' (if needed)
|
325
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
326
|
+
header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?
|
327
|
+
|
328
|
+
# form parameters
|
329
|
+
form_params = opts[:form_params] || {}
|
330
|
+
|
331
|
+
# http body (model)
|
332
|
+
post_body = opts[:body]
|
333
|
+
|
334
|
+
# return_type
|
335
|
+
return_type = opts[:return_type] || 'ApiKey'
|
336
|
+
|
337
|
+
# auth_names
|
338
|
+
auth_names = opts[:auth_names] || []
|
339
|
+
|
340
|
+
new_options = opts.merge(
|
341
|
+
:header_params => header_params,
|
342
|
+
:query_params => query_params,
|
343
|
+
:form_params => form_params,
|
344
|
+
:body => post_body,
|
345
|
+
:auth_names => auth_names,
|
346
|
+
:return_type => return_type
|
347
|
+
)
|
348
|
+
|
349
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
350
|
+
if @api_client.config.debugging
|
351
|
+
@api_client.config.logger.debug "API called: IdentityOperationsApi#get_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
352
|
+
end
|
353
|
+
return data, status_code, headers
|
354
|
+
end
|
355
|
+
|
356
|
+
# Get details of an API key by its value
|
357
|
+
# 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 that are bound to an entity they have access to.
|
358
|
+
# @param [Hash] opts the optional parameters
|
359
|
+
# @option opts [String] :iam_api_key API key value.
|
360
|
+
# @option opts [Boolean] :include_history Defines if the entity history is included in the response (default to false)
|
361
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
362
|
+
# @return [ApiKey]
|
363
|
+
def get_api_keys_details(opts = {})
|
364
|
+
data, _status_code, _headers = get_api_keys_details_with_http_info(opts)
|
365
|
+
data
|
366
|
+
end
|
367
|
+
|
368
|
+
# Get details of an API key by its value
|
369
|
+
# 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 that are bound to an entity they have access to.
|
370
|
+
# @param [Hash] opts the optional parameters
|
371
|
+
# @option opts [String] :iam_api_key API key value.
|
372
|
+
# @option opts [Boolean] :include_history Defines if the entity history is included in the response
|
373
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
374
|
+
# @return [Array<(ApiKey, Integer, Hash)>] ApiKey data, response status code and response headers
|
375
|
+
def get_api_keys_details_with_http_info(opts = {})
|
376
|
+
if @api_client.config.debugging
|
377
|
+
@api_client.config.logger.debug 'Calling API: IdentityOperationsApi.get_api_keys_details ...'
|
378
|
+
end
|
379
|
+
# resource path
|
380
|
+
local_var_path = '/v1/apikeys/details'
|
381
|
+
|
382
|
+
# query parameters
|
383
|
+
query_params = opts[:query_params] || {}
|
384
|
+
query_params[:'include_history'] = opts[:'include_history'] if !opts[:'include_history'].nil?
|
385
|
+
|
386
|
+
# header parameters
|
387
|
+
header_params = opts[:header_params] || {}
|
388
|
+
# HTTP header 'Accept' (if needed)
|
389
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
390
|
+
header_params[:'IAM-ApiKey'] = opts[:'iam_api_key'] if !opts[:'iam_api_key'].nil?
|
391
|
+
header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?
|
392
|
+
|
393
|
+
# form parameters
|
394
|
+
form_params = opts[:form_params] || {}
|
395
|
+
|
396
|
+
# http body (model)
|
397
|
+
post_body = opts[:body]
|
398
|
+
|
399
|
+
# return_type
|
400
|
+
return_type = opts[:return_type] || 'ApiKey'
|
401
|
+
|
402
|
+
# auth_names
|
403
|
+
auth_names = opts[:auth_names] || []
|
404
|
+
|
405
|
+
new_options = opts.merge(
|
406
|
+
:header_params => header_params,
|
407
|
+
:query_params => query_params,
|
408
|
+
:form_params => form_params,
|
409
|
+
:body => post_body,
|
410
|
+
:auth_names => auth_names,
|
411
|
+
:return_type => return_type
|
412
|
+
)
|
413
|
+
|
414
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
415
|
+
if @api_client.config.debugging
|
416
|
+
@api_client.config.logger.debug "API called: IdentityOperationsApi#get_api_keys_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
417
|
+
end
|
418
|
+
return data, status_code, headers
|
419
|
+
end
|
420
|
+
|
421
|
+
# Get details of a service ID
|
422
|
+
# Returns the details of a service ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.
|
423
|
+
# @param id [String] Unique ID of the service ID.
|
424
|
+
# @param [Hash] opts the optional parameters
|
425
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
426
|
+
# @option opts [Boolean] :include_history Defines if the entity history is included in the response. (default to false)
|
427
|
+
# @return [ServiceId]
|
428
|
+
def get_service_id(id, opts = {})
|
429
|
+
data, _status_code, _headers = get_service_id_with_http_info(id, opts)
|
430
|
+
data
|
431
|
+
end
|
432
|
+
|
433
|
+
# Get details of a service ID
|
434
|
+
# Returns the details of a service ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.
|
435
|
+
# @param id [String] Unique ID of the service ID.
|
436
|
+
# @param [Hash] opts the optional parameters
|
437
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
438
|
+
# @option opts [Boolean] :include_history Defines if the entity history is included in the response.
|
439
|
+
# @return [Array<(ServiceId, Integer, Hash)>] ServiceId data, response status code and response headers
|
440
|
+
def get_service_id_with_http_info(id, opts = {})
|
441
|
+
if @api_client.config.debugging
|
442
|
+
@api_client.config.logger.debug 'Calling API: IdentityOperationsApi.get_service_id ...'
|
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 IdentityOperationsApi.get_service_id"
|
447
|
+
end
|
448
|
+
# resource path
|
449
|
+
local_var_path = '/v1/serviceids/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
450
|
+
|
451
|
+
# query parameters
|
452
|
+
query_params = opts[:query_params] || {}
|
453
|
+
query_params[:'include_history'] = opts[:'include_history'] if !opts[:'include_history'].nil?
|
454
|
+
|
455
|
+
# header parameters
|
456
|
+
header_params = opts[:header_params] || {}
|
457
|
+
# HTTP header 'Accept' (if needed)
|
458
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
459
|
+
header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?
|
460
|
+
|
461
|
+
# form parameters
|
462
|
+
form_params = opts[:form_params] || {}
|
463
|
+
|
464
|
+
# http body (model)
|
465
|
+
post_body = opts[:body]
|
466
|
+
|
467
|
+
# return_type
|
468
|
+
return_type = opts[:return_type] || 'ServiceId'
|
469
|
+
|
470
|
+
# auth_names
|
471
|
+
auth_names = opts[:auth_names] || []
|
472
|
+
|
473
|
+
new_options = opts.merge(
|
474
|
+
:header_params => header_params,
|
475
|
+
:query_params => query_params,
|
476
|
+
:form_params => form_params,
|
477
|
+
:body => post_body,
|
478
|
+
:auth_names => auth_names,
|
479
|
+
:return_type => return_type
|
480
|
+
)
|
481
|
+
|
482
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
483
|
+
if @api_client.config.debugging
|
484
|
+
@api_client.config.logger.debug "API called: IdentityOperationsApi#get_service_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
485
|
+
end
|
486
|
+
return data, status_code, headers
|
487
|
+
end
|
488
|
+
|
489
|
+
# Get API keys for a given service or user IAM ID and account ID
|
490
|
+
# 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 that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity.
|
491
|
+
# @param [Hash] opts the optional parameters
|
492
|
+
# @option opts [String] :account_id Account ID of the API keys(s) to query. If a service IAM ID is specified in iam_id then account_id must match the account of the IAM ID. If a user IAM ID is specified in iam_id then then account_id must match the account of the Authorization token.
|
493
|
+
# @option opts [String] :iam_id IAM ID of the API key(s) to be queried. The IAM ID may be that of a user or a service. For a user IAM ID iam_id must match the Authorization token.
|
494
|
+
# @option opts [Integer] :pagesize Optional size of a single page. Default is 20 items per page. Valid range is 1 to 100.
|
495
|
+
# @option opts [String] :pagetoken Optional Prev or Next page token returned from a previous query execution. Default is start with first page.
|
496
|
+
# @option opts [String] :scope Optional parameter to define the scope of the queried API Keys. Can be 'entity' (default) or 'account'. (default to 'entity')
|
497
|
+
# @option opts [String] :type Optional parameter to filter the type of the queried API Keys. Can be 'user' or 'serviceid'.
|
498
|
+
# @option opts [String] :sort Optional sort property, valid values are name, description, created_at and created_by. If specified, the items are sorted by the value of this property.
|
499
|
+
# @option opts [String] :order Optional sort order, valid values are asc and desc. Default: asc. (default to 'asc')
|
500
|
+
# @option opts [Boolean] :include_history Defines if the entity history is included in the response. (default to false)
|
501
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
502
|
+
# @return [ApiKeyList]
|
503
|
+
def list_api_keys(opts = {})
|
504
|
+
data, _status_code, _headers = list_api_keys_with_http_info(opts)
|
505
|
+
data
|
506
|
+
end
|
507
|
+
|
508
|
+
# Get API keys for a given service or user IAM ID and account ID
|
509
|
+
# 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 that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity.
|
510
|
+
# @param [Hash] opts the optional parameters
|
511
|
+
# @option opts [String] :account_id Account ID of the API keys(s) to query. If a service IAM ID is specified in iam_id then account_id must match the account of the IAM ID. If a user IAM ID is specified in iam_id then then account_id must match the account of the Authorization token.
|
512
|
+
# @option opts [String] :iam_id IAM ID of the API key(s) to be queried. The IAM ID may be that of a user or a service. For a user IAM ID iam_id must match the Authorization token.
|
513
|
+
# @option opts [Integer] :pagesize Optional size of a single page. Default is 20 items per page. Valid range is 1 to 100.
|
514
|
+
# @option opts [String] :pagetoken Optional Prev or Next page token returned from a previous query execution. Default is start with first page.
|
515
|
+
# @option opts [String] :scope Optional parameter to define the scope of the queried API Keys. Can be 'entity' (default) or 'account'.
|
516
|
+
# @option opts [String] :type Optional parameter to filter the type of the queried API Keys. Can be 'user' or 'serviceid'.
|
517
|
+
# @option opts [String] :sort Optional sort property, valid values are name, description, created_at and created_by. If specified, the items are sorted by the value of this property.
|
518
|
+
# @option opts [String] :order Optional sort order, valid values are asc and desc. Default: asc.
|
519
|
+
# @option opts [Boolean] :include_history Defines if the entity history is included in the response.
|
520
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
521
|
+
# @return [Array<(ApiKeyList, Integer, Hash)>] ApiKeyList data, response status code and response headers
|
522
|
+
def list_api_keys_with_http_info(opts = {})
|
523
|
+
if @api_client.config.debugging
|
524
|
+
@api_client.config.logger.debug 'Calling API: IdentityOperationsApi.list_api_keys ...'
|
525
|
+
end
|
526
|
+
allowable_values = ["entity", "account"]
|
527
|
+
if @api_client.config.client_side_validation && opts[:'scope'] && !allowable_values.include?(opts[:'scope'])
|
528
|
+
fail ArgumentError, "invalid value for \"scope\", must be one of #{allowable_values}"
|
529
|
+
end
|
530
|
+
allowable_values = ["user", "serviceid"]
|
531
|
+
if @api_client.config.client_side_validation && opts[:'type'] && !allowable_values.include?(opts[:'type'])
|
532
|
+
fail ArgumentError, "invalid value for \"type\", must be one of #{allowable_values}"
|
533
|
+
end
|
534
|
+
allowable_values = ["asc", "desc"]
|
535
|
+
if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
|
536
|
+
fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
|
537
|
+
end
|
538
|
+
# resource path
|
539
|
+
local_var_path = '/v1/apikeys'
|
540
|
+
|
541
|
+
# query parameters
|
542
|
+
query_params = opts[:query_params] || {}
|
543
|
+
query_params[:'account_id'] = opts[:'account_id'] if !opts[:'account_id'].nil?
|
544
|
+
query_params[:'iam_id'] = opts[:'iam_id'] if !opts[:'iam_id'].nil?
|
545
|
+
query_params[:'pagesize'] = opts[:'pagesize'] if !opts[:'pagesize'].nil?
|
546
|
+
query_params[:'pagetoken'] = opts[:'pagetoken'] if !opts[:'pagetoken'].nil?
|
547
|
+
query_params[:'scope'] = opts[:'scope'] if !opts[:'scope'].nil?
|
548
|
+
query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
|
549
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
550
|
+
query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
|
551
|
+
query_params[:'include_history'] = opts[:'include_history'] if !opts[:'include_history'].nil?
|
552
|
+
|
553
|
+
# header parameters
|
554
|
+
header_params = opts[:header_params] || {}
|
555
|
+
# HTTP header 'Accept' (if needed)
|
556
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
557
|
+
header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?
|
558
|
+
|
559
|
+
# form parameters
|
560
|
+
form_params = opts[:form_params] || {}
|
561
|
+
|
562
|
+
# http body (model)
|
563
|
+
post_body = opts[:body]
|
564
|
+
|
565
|
+
# return_type
|
566
|
+
return_type = opts[:return_type] || 'ApiKeyList'
|
567
|
+
|
568
|
+
# auth_names
|
569
|
+
auth_names = opts[:auth_names] || []
|
570
|
+
|
571
|
+
new_options = opts.merge(
|
572
|
+
:header_params => header_params,
|
573
|
+
:query_params => query_params,
|
574
|
+
:form_params => form_params,
|
575
|
+
:body => post_body,
|
576
|
+
:auth_names => auth_names,
|
577
|
+
:return_type => return_type
|
578
|
+
)
|
579
|
+
|
580
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
581
|
+
if @api_client.config.debugging
|
582
|
+
@api_client.config.logger.debug "API called: IdentityOperationsApi#list_api_keys\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
583
|
+
end
|
584
|
+
return data, status_code, headers
|
585
|
+
end
|
586
|
+
|
587
|
+
# List service IDs
|
588
|
+
# Returns a list of service IDs. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.
|
589
|
+
# @param [Hash] opts the optional parameters
|
590
|
+
# @option opts [String] :account_id Account ID of the service ID(s) to query. This parameter is required (unless using a pagetoken).
|
591
|
+
# @option opts [String] :name Name of the service ID(s) to query. Optional.20 items per page. Valid range is 1 to 100.
|
592
|
+
# @option opts [Integer] :pagesize Optional size of a single page. Default is 20 items per page. Valid range is 1 to 100.
|
593
|
+
# @option opts [String] :pagetoken Optional Prev or Next page token returned from a previous query execution. Default is start with first page.
|
594
|
+
# @option opts [String] :sort 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.
|
595
|
+
# @option opts [String] :order Optional sort order, valid values are asc and desc. Default: asc. (default to 'asc')
|
596
|
+
# @option opts [Boolean] :include_history Defines if the entity history is included in the response (default to false)
|
597
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
598
|
+
# @return [ServiceIdList]
|
599
|
+
def list_service_ids(opts = {})
|
600
|
+
data, _status_code, _headers = list_service_ids_with_http_info(opts)
|
601
|
+
data
|
602
|
+
end
|
603
|
+
|
604
|
+
# List service IDs
|
605
|
+
# Returns a list of service IDs. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to.
|
606
|
+
# @param [Hash] opts the optional parameters
|
607
|
+
# @option opts [String] :account_id Account ID of the service ID(s) to query. This parameter is required (unless using a pagetoken).
|
608
|
+
# @option opts [String] :name Name of the service ID(s) to query. Optional.20 items per page. Valid range is 1 to 100.
|
609
|
+
# @option opts [Integer] :pagesize Optional size of a single page. Default is 20 items per page. Valid range is 1 to 100.
|
610
|
+
# @option opts [String] :pagetoken Optional Prev or Next page token returned from a previous query execution. Default is start with first page.
|
611
|
+
# @option opts [String] :sort 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.
|
612
|
+
# @option opts [String] :order Optional sort order, valid values are asc and desc. Default: asc.
|
613
|
+
# @option opts [Boolean] :include_history Defines if the entity history is included in the response
|
614
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
615
|
+
# @return [Array<(ServiceIdList, Integer, Hash)>] ServiceIdList data, response status code and response headers
|
616
|
+
def list_service_ids_with_http_info(opts = {})
|
617
|
+
if @api_client.config.debugging
|
618
|
+
@api_client.config.logger.debug 'Calling API: IdentityOperationsApi.list_service_ids ...'
|
619
|
+
end
|
620
|
+
allowable_values = ["asc", "desc"]
|
621
|
+
if @api_client.config.client_side_validation && opts[:'order'] && !allowable_values.include?(opts[:'order'])
|
622
|
+
fail ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
|
623
|
+
end
|
624
|
+
# resource path
|
625
|
+
local_var_path = '/v1/serviceids/'
|
626
|
+
|
627
|
+
# query parameters
|
628
|
+
query_params = opts[:query_params] || {}
|
629
|
+
query_params[:'account_id'] = opts[:'account_id'] if !opts[:'account_id'].nil?
|
630
|
+
query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?
|
631
|
+
query_params[:'pagesize'] = opts[:'pagesize'] if !opts[:'pagesize'].nil?
|
632
|
+
query_params[:'pagetoken'] = opts[:'pagetoken'] if !opts[:'pagetoken'].nil?
|
633
|
+
query_params[:'sort'] = opts[:'sort'] if !opts[:'sort'].nil?
|
634
|
+
query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
|
635
|
+
query_params[:'include_history'] = opts[:'include_history'] if !opts[:'include_history'].nil?
|
636
|
+
|
637
|
+
# header parameters
|
638
|
+
header_params = opts[:header_params] || {}
|
639
|
+
# HTTP header 'Accept' (if needed)
|
640
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
641
|
+
header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?
|
642
|
+
|
643
|
+
# form parameters
|
644
|
+
form_params = opts[:form_params] || {}
|
645
|
+
|
646
|
+
# http body (model)
|
647
|
+
post_body = opts[:body]
|
648
|
+
|
649
|
+
# return_type
|
650
|
+
return_type = opts[:return_type] || 'ServiceIdList'
|
651
|
+
|
652
|
+
# auth_names
|
653
|
+
auth_names = opts[:auth_names] || []
|
654
|
+
|
655
|
+
new_options = opts.merge(
|
656
|
+
:header_params => header_params,
|
657
|
+
:query_params => query_params,
|
658
|
+
:form_params => form_params,
|
659
|
+
:body => post_body,
|
660
|
+
:auth_names => auth_names,
|
661
|
+
:return_type => return_type
|
662
|
+
)
|
663
|
+
|
664
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
665
|
+
if @api_client.config.debugging
|
666
|
+
@api_client.config.logger.debug "API called: IdentityOperationsApi#list_service_ids\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
667
|
+
end
|
668
|
+
return data, status_code, headers
|
669
|
+
end
|
670
|
+
|
671
|
+
# Lock the API key
|
672
|
+
# Locks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity.
|
673
|
+
# @param id [String] Unique ID of the API key.
|
674
|
+
# @param [Hash] opts the optional parameters
|
675
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
676
|
+
# @return [nil]
|
677
|
+
def lock_api_key(id, opts = {})
|
678
|
+
lock_api_key_with_http_info(id, opts)
|
679
|
+
nil
|
680
|
+
end
|
681
|
+
|
682
|
+
# Lock the API key
|
683
|
+
# Locks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity.
|
684
|
+
# @param id [String] Unique ID of the API key.
|
685
|
+
# @param [Hash] opts the optional parameters
|
686
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
687
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
688
|
+
def lock_api_key_with_http_info(id, opts = {})
|
689
|
+
if @api_client.config.debugging
|
690
|
+
@api_client.config.logger.debug 'Calling API: IdentityOperationsApi.lock_api_key ...'
|
691
|
+
end
|
692
|
+
# verify the required parameter 'id' is set
|
693
|
+
if @api_client.config.client_side_validation && id.nil?
|
694
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling IdentityOperationsApi.lock_api_key"
|
695
|
+
end
|
696
|
+
# resource path
|
697
|
+
local_var_path = '/v1/apikeys/{id}/lock'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
698
|
+
|
699
|
+
# query parameters
|
700
|
+
query_params = opts[:query_params] || {}
|
701
|
+
|
702
|
+
# header parameters
|
703
|
+
header_params = opts[:header_params] || {}
|
704
|
+
header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?
|
705
|
+
|
706
|
+
# form parameters
|
707
|
+
form_params = opts[:form_params] || {}
|
708
|
+
|
709
|
+
# http body (model)
|
710
|
+
post_body = opts[:body]
|
711
|
+
|
712
|
+
# return_type
|
713
|
+
return_type = opts[:return_type]
|
714
|
+
|
715
|
+
# auth_names
|
716
|
+
auth_names = opts[:auth_names] || []
|
717
|
+
|
718
|
+
new_options = opts.merge(
|
719
|
+
:header_params => header_params,
|
720
|
+
:query_params => query_params,
|
721
|
+
:form_params => form_params,
|
722
|
+
:body => post_body,
|
723
|
+
:auth_names => auth_names,
|
724
|
+
:return_type => return_type
|
725
|
+
)
|
726
|
+
|
727
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
728
|
+
if @api_client.config.debugging
|
729
|
+
@api_client.config.logger.debug "API called: IdentityOperationsApi#lock_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
730
|
+
end
|
731
|
+
return data, status_code, headers
|
732
|
+
end
|
733
|
+
|
734
|
+
# Lock the service ID
|
735
|
+
# Locks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity.
|
736
|
+
# @param id [String] Unique ID of the service ID.
|
737
|
+
# @param [Hash] opts the optional parameters
|
738
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
739
|
+
# @return [nil]
|
740
|
+
def lock_service_id(id, opts = {})
|
741
|
+
lock_service_id_with_http_info(id, opts)
|
742
|
+
nil
|
743
|
+
end
|
744
|
+
|
745
|
+
# Lock the service ID
|
746
|
+
# Locks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity.
|
747
|
+
# @param id [String] Unique ID of the service ID.
|
748
|
+
# @param [Hash] opts the optional parameters
|
749
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
750
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
751
|
+
def lock_service_id_with_http_info(id, opts = {})
|
752
|
+
if @api_client.config.debugging
|
753
|
+
@api_client.config.logger.debug 'Calling API: IdentityOperationsApi.lock_service_id ...'
|
754
|
+
end
|
755
|
+
# verify the required parameter 'id' is set
|
756
|
+
if @api_client.config.client_side_validation && id.nil?
|
757
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling IdentityOperationsApi.lock_service_id"
|
758
|
+
end
|
759
|
+
# resource path
|
760
|
+
local_var_path = '/v1/serviceids/{id}/lock'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
761
|
+
|
762
|
+
# query parameters
|
763
|
+
query_params = opts[:query_params] || {}
|
764
|
+
|
765
|
+
# header parameters
|
766
|
+
header_params = opts[:header_params] || {}
|
767
|
+
header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?
|
768
|
+
|
769
|
+
# form parameters
|
770
|
+
form_params = opts[:form_params] || {}
|
771
|
+
|
772
|
+
# http body (model)
|
773
|
+
post_body = opts[:body]
|
774
|
+
|
775
|
+
# return_type
|
776
|
+
return_type = opts[:return_type]
|
777
|
+
|
778
|
+
# auth_names
|
779
|
+
auth_names = opts[:auth_names] || []
|
780
|
+
|
781
|
+
new_options = opts.merge(
|
782
|
+
:header_params => header_params,
|
783
|
+
:query_params => query_params,
|
784
|
+
:form_params => form_params,
|
785
|
+
:body => post_body,
|
786
|
+
:auth_names => auth_names,
|
787
|
+
:return_type => return_type
|
788
|
+
)
|
789
|
+
|
790
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
791
|
+
if @api_client.config.debugging
|
792
|
+
@api_client.config.logger.debug "API called: IdentityOperationsApi#lock_service_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
793
|
+
end
|
794
|
+
return data, status_code, headers
|
795
|
+
end
|
796
|
+
|
797
|
+
# Unlock the API key
|
798
|
+
# Unlocks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity.
|
799
|
+
# @param id [String] Unique ID of the API key.
|
800
|
+
# @param [Hash] opts the optional parameters
|
801
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
802
|
+
# @return [nil]
|
803
|
+
def unlock_api_key(id, opts = {})
|
804
|
+
unlock_api_key_with_http_info(id, opts)
|
805
|
+
nil
|
806
|
+
end
|
807
|
+
|
808
|
+
# Unlock the API key
|
809
|
+
# Unlocks an API key by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity.
|
810
|
+
# @param id [String] Unique ID of the API key.
|
811
|
+
# @param [Hash] opts the optional parameters
|
812
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
813
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
814
|
+
def unlock_api_key_with_http_info(id, opts = {})
|
815
|
+
if @api_client.config.debugging
|
816
|
+
@api_client.config.logger.debug 'Calling API: IdentityOperationsApi.unlock_api_key ...'
|
817
|
+
end
|
818
|
+
# verify the required parameter 'id' is set
|
819
|
+
if @api_client.config.client_side_validation && id.nil?
|
820
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling IdentityOperationsApi.unlock_api_key"
|
821
|
+
end
|
822
|
+
# resource path
|
823
|
+
local_var_path = '/v1/apikeys/{id}/lock'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
824
|
+
|
825
|
+
# query parameters
|
826
|
+
query_params = opts[:query_params] || {}
|
827
|
+
|
828
|
+
# header parameters
|
829
|
+
header_params = opts[:header_params] || {}
|
830
|
+
header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?
|
831
|
+
|
832
|
+
# form parameters
|
833
|
+
form_params = opts[:form_params] || {}
|
834
|
+
|
835
|
+
# http body (model)
|
836
|
+
post_body = opts[:body]
|
837
|
+
|
838
|
+
# return_type
|
839
|
+
return_type = opts[:return_type]
|
840
|
+
|
841
|
+
# auth_names
|
842
|
+
auth_names = opts[:auth_names] || []
|
843
|
+
|
844
|
+
new_options = opts.merge(
|
845
|
+
:header_params => header_params,
|
846
|
+
:query_params => query_params,
|
847
|
+
:form_params => form_params,
|
848
|
+
:body => post_body,
|
849
|
+
:auth_names => auth_names,
|
850
|
+
:return_type => return_type
|
851
|
+
)
|
852
|
+
|
853
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
854
|
+
if @api_client.config.debugging
|
855
|
+
@api_client.config.logger.debug "API called: IdentityOperationsApi#unlock_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
856
|
+
end
|
857
|
+
return data, status_code, headers
|
858
|
+
end
|
859
|
+
|
860
|
+
# Unlock the service ID
|
861
|
+
# Unlocks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity.
|
862
|
+
# @param id [String] Unique ID of the service ID.
|
863
|
+
# @param [Hash] opts the optional parameters
|
864
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
865
|
+
# @return [nil]
|
866
|
+
def unlock_service_id(id, opts = {})
|
867
|
+
unlock_service_id_with_http_info(id, opts)
|
868
|
+
nil
|
869
|
+
end
|
870
|
+
|
871
|
+
# Unlock the service ID
|
872
|
+
# Unlocks a service ID by ID. Users can manage user API keys for themself, or service ID API keys for service IDs that are bound to an entity they have access to. In case of service IDs and their API keys, a user must be either an account owner, a IBM Cloud org manager or IBM Cloud space developer in order to manage service IDs of the entity.
|
873
|
+
# @param id [String] Unique ID of the service ID.
|
874
|
+
# @param [Hash] opts the optional parameters
|
875
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
876
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
877
|
+
def unlock_service_id_with_http_info(id, opts = {})
|
878
|
+
if @api_client.config.debugging
|
879
|
+
@api_client.config.logger.debug 'Calling API: IdentityOperationsApi.unlock_service_id ...'
|
880
|
+
end
|
881
|
+
# verify the required parameter 'id' is set
|
882
|
+
if @api_client.config.client_side_validation && id.nil?
|
883
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling IdentityOperationsApi.unlock_service_id"
|
884
|
+
end
|
885
|
+
# resource path
|
886
|
+
local_var_path = '/v1/serviceids/{id}/lock'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
887
|
+
|
888
|
+
# query parameters
|
889
|
+
query_params = opts[:query_params] || {}
|
890
|
+
|
891
|
+
# header parameters
|
892
|
+
header_params = opts[:header_params] || {}
|
893
|
+
header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?
|
894
|
+
|
895
|
+
# form parameters
|
896
|
+
form_params = opts[:form_params] || {}
|
897
|
+
|
898
|
+
# http body (model)
|
899
|
+
post_body = opts[:body]
|
900
|
+
|
901
|
+
# return_type
|
902
|
+
return_type = opts[:return_type]
|
903
|
+
|
904
|
+
# auth_names
|
905
|
+
auth_names = opts[:auth_names] || []
|
906
|
+
|
907
|
+
new_options = opts.merge(
|
908
|
+
:header_params => header_params,
|
909
|
+
:query_params => query_params,
|
910
|
+
:form_params => form_params,
|
911
|
+
:body => post_body,
|
912
|
+
:auth_names => auth_names,
|
913
|
+
:return_type => return_type
|
914
|
+
)
|
915
|
+
|
916
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
917
|
+
if @api_client.config.debugging
|
918
|
+
@api_client.config.logger.debug "API called: IdentityOperationsApi#unlock_service_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
919
|
+
end
|
920
|
+
return data, status_code, headers
|
921
|
+
end
|
922
|
+
|
923
|
+
# Updates an API key
|
924
|
+
# 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 that are bound to an entity they have access to.
|
925
|
+
# @param id [String] Unique ID of the API key to be updated.
|
926
|
+
# @param if_match [String] Version of the API key to be updated. Specify the version that you retrieved when reading the API key. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates.
|
927
|
+
# @param update_api_key_request [UpdateApiKeyRequest] Request to update an API key
|
928
|
+
# @param [Hash] opts the optional parameters
|
929
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
930
|
+
# @return [ApiKey]
|
931
|
+
def update_api_key(id, if_match, update_api_key_request, opts = {})
|
932
|
+
data, _status_code, _headers = update_api_key_with_http_info(id, if_match, update_api_key_request, opts)
|
933
|
+
data
|
934
|
+
end
|
935
|
+
|
936
|
+
# Updates an API key
|
937
|
+
# 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 that are bound to an entity they have access to.
|
938
|
+
# @param id [String] Unique ID of the API key to be updated.
|
939
|
+
# @param if_match [String] Version of the API key to be updated. Specify the version that you retrieved when reading the API key. This value helps identifying parallel usage of this API. Pass * to indicate to update any version available. This might result in stale updates.
|
940
|
+
# @param update_api_key_request [UpdateApiKeyRequest] Request to update an API key
|
941
|
+
# @param [Hash] opts the optional parameters
|
942
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
943
|
+
# @return [Array<(ApiKey, Integer, Hash)>] ApiKey data, response status code and response headers
|
944
|
+
def update_api_key_with_http_info(id, if_match, update_api_key_request, opts = {})
|
945
|
+
if @api_client.config.debugging
|
946
|
+
@api_client.config.logger.debug 'Calling API: IdentityOperationsApi.update_api_key ...'
|
947
|
+
end
|
948
|
+
# verify the required parameter 'id' is set
|
949
|
+
if @api_client.config.client_side_validation && id.nil?
|
950
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling IdentityOperationsApi.update_api_key"
|
951
|
+
end
|
952
|
+
# verify the required parameter 'if_match' is set
|
953
|
+
if @api_client.config.client_side_validation && if_match.nil?
|
954
|
+
fail ArgumentError, "Missing the required parameter 'if_match' when calling IdentityOperationsApi.update_api_key"
|
955
|
+
end
|
956
|
+
# verify the required parameter 'update_api_key_request' is set
|
957
|
+
if @api_client.config.client_side_validation && update_api_key_request.nil?
|
958
|
+
fail ArgumentError, "Missing the required parameter 'update_api_key_request' when calling IdentityOperationsApi.update_api_key"
|
959
|
+
end
|
960
|
+
# resource path
|
961
|
+
local_var_path = '/v1/apikeys/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
962
|
+
|
963
|
+
# query parameters
|
964
|
+
query_params = opts[:query_params] || {}
|
965
|
+
|
966
|
+
# header parameters
|
967
|
+
header_params = opts[:header_params] || {}
|
968
|
+
# HTTP header 'Accept' (if needed)
|
969
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
970
|
+
# HTTP header 'Content-Type'
|
971
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
972
|
+
header_params[:'If-Match'] = if_match
|
973
|
+
header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?
|
974
|
+
|
975
|
+
# form parameters
|
976
|
+
form_params = opts[:form_params] || {}
|
977
|
+
|
978
|
+
# http body (model)
|
979
|
+
post_body = opts[:body] || @api_client.object_to_http_body(update_api_key_request)
|
980
|
+
|
981
|
+
# return_type
|
982
|
+
return_type = opts[:return_type] || 'ApiKey'
|
983
|
+
|
984
|
+
# auth_names
|
985
|
+
auth_names = opts[:auth_names] || []
|
986
|
+
|
987
|
+
new_options = opts.merge(
|
988
|
+
:header_params => header_params,
|
989
|
+
:query_params => query_params,
|
990
|
+
:form_params => form_params,
|
991
|
+
:body => post_body,
|
992
|
+
:auth_names => auth_names,
|
993
|
+
:return_type => return_type
|
994
|
+
)
|
995
|
+
|
996
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
997
|
+
if @api_client.config.debugging
|
998
|
+
@api_client.config.logger.debug "API called: IdentityOperationsApi#update_api_key\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
999
|
+
end
|
1000
|
+
return data, status_code, headers
|
1001
|
+
end
|
1002
|
+
|
1003
|
+
# Update service ID
|
1004
|
+
# 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 that are bound to an entity they have access to.
|
1005
|
+
# @param id [String] Unique ID of the service ID to be updated.
|
1006
|
+
# @param 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.
|
1007
|
+
# @param update_service_id_request [UpdateServiceIdRequest] Request to update a service ID
|
1008
|
+
# @param [Hash] opts the optional parameters
|
1009
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
1010
|
+
# @return [ServiceId]
|
1011
|
+
def update_service_id(id, if_match, update_service_id_request, opts = {})
|
1012
|
+
data, _status_code, _headers = update_service_id_with_http_info(id, if_match, update_service_id_request, opts)
|
1013
|
+
data
|
1014
|
+
end
|
1015
|
+
|
1016
|
+
# Update service ID
|
1017
|
+
# 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 that are bound to an entity they have access to.
|
1018
|
+
# @param id [String] Unique ID of the service ID to be updated.
|
1019
|
+
# @param 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.
|
1020
|
+
# @param update_service_id_request [UpdateServiceIdRequest] Request to update a service ID
|
1021
|
+
# @param [Hash] opts the optional parameters
|
1022
|
+
# @option opts [String] :authorization 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'. Please make sure that the provided token has the required authority for the request.
|
1023
|
+
# @return [Array<(ServiceId, Integer, Hash)>] ServiceId data, response status code and response headers
|
1024
|
+
def update_service_id_with_http_info(id, if_match, update_service_id_request, opts = {})
|
1025
|
+
if @api_client.config.debugging
|
1026
|
+
@api_client.config.logger.debug 'Calling API: IdentityOperationsApi.update_service_id ...'
|
1027
|
+
end
|
1028
|
+
# verify the required parameter 'id' is set
|
1029
|
+
if @api_client.config.client_side_validation && id.nil?
|
1030
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling IdentityOperationsApi.update_service_id"
|
1031
|
+
end
|
1032
|
+
# verify the required parameter 'if_match' is set
|
1033
|
+
if @api_client.config.client_side_validation && if_match.nil?
|
1034
|
+
fail ArgumentError, "Missing the required parameter 'if_match' when calling IdentityOperationsApi.update_service_id"
|
1035
|
+
end
|
1036
|
+
# verify the required parameter 'update_service_id_request' is set
|
1037
|
+
if @api_client.config.client_side_validation && update_service_id_request.nil?
|
1038
|
+
fail ArgumentError, "Missing the required parameter 'update_service_id_request' when calling IdentityOperationsApi.update_service_id"
|
1039
|
+
end
|
1040
|
+
# resource path
|
1041
|
+
local_var_path = '/v1/serviceids/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
1042
|
+
|
1043
|
+
# query parameters
|
1044
|
+
query_params = opts[:query_params] || {}
|
1045
|
+
|
1046
|
+
# header parameters
|
1047
|
+
header_params = opts[:header_params] || {}
|
1048
|
+
# HTTP header 'Accept' (if needed)
|
1049
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1050
|
+
# HTTP header 'Content-Type'
|
1051
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
1052
|
+
header_params[:'If-Match'] = if_match
|
1053
|
+
header_params[:'Authorization'] = opts[:'authorization'] if !opts[:'authorization'].nil?
|
1054
|
+
|
1055
|
+
# form parameters
|
1056
|
+
form_params = opts[:form_params] || {}
|
1057
|
+
|
1058
|
+
# http body (model)
|
1059
|
+
post_body = opts[:body] || @api_client.object_to_http_body(update_service_id_request)
|
1060
|
+
|
1061
|
+
# return_type
|
1062
|
+
return_type = opts[:return_type] || 'ServiceId'
|
1063
|
+
|
1064
|
+
# auth_names
|
1065
|
+
auth_names = opts[:auth_names] || []
|
1066
|
+
|
1067
|
+
new_options = opts.merge(
|
1068
|
+
:header_params => header_params,
|
1069
|
+
:query_params => query_params,
|
1070
|
+
:form_params => form_params,
|
1071
|
+
:body => post_body,
|
1072
|
+
:auth_names => auth_names,
|
1073
|
+
:return_type => return_type
|
1074
|
+
)
|
1075
|
+
|
1076
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
1077
|
+
if @api_client.config.debugging
|
1078
|
+
@api_client.config.logger.debug "API called: IdentityOperationsApi#update_service_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1079
|
+
end
|
1080
|
+
return data, status_code, headers
|
1081
|
+
end
|
1082
|
+
end
|
1083
|
+
end
|