ibm_cloud_iam 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +131 -0
  4. data/Rakefile +10 -0
  5. data/docs/ApiKey.md +43 -0
  6. data/docs/ApiKeyInsideCreateServiceIdRequest.md +23 -0
  7. data/docs/ApiKeyList.md +29 -0
  8. data/docs/CreateApiKeyRequest.md +27 -0
  9. data/docs/CreateServiceIdRequest.md +25 -0
  10. data/docs/EnityHistoryRecord.md +27 -0
  11. data/docs/Error.md +23 -0
  12. data/docs/ExceptionResponse.md +23 -0
  13. data/docs/ExceptionResponseContext.md +39 -0
  14. data/docs/IdentityOperationsApi.md +828 -0
  15. data/docs/InlineObject.md +19 -0
  16. data/docs/InlineObject1.md +23 -0
  17. data/docs/InlineObject2.md +21 -0
  18. data/docs/InlineObject3.md +25 -0
  19. data/docs/MFARequirementsResponse.md +21 -0
  20. data/docs/OidcExceptionResponse.md +25 -0
  21. data/docs/ResponseContext.md +37 -0
  22. data/docs/ServiceId.md +43 -0
  23. data/docs/ServiceIdList.md +29 -0
  24. data/docs/TokenOperationsApi.md +226 -0
  25. data/docs/TokenResponse.md +27 -0
  26. data/docs/UpdateApiKeyRequest.md +19 -0
  27. data/docs/UpdateServiceIdRequest.md +21 -0
  28. data/git_push.sh +58 -0
  29. data/ibm_cloud_iam-1.0.0.gem +0 -0
  30. data/ibm_cloud_iam.gemspec +38 -0
  31. data/lib/ibm_cloud_iam.rb +62 -0
  32. data/lib/ibm_cloud_iam/api/identity_operations_api.rb +1083 -0
  33. data/lib/ibm_cloud_iam/api/token_operations_api.rb +351 -0
  34. data/lib/ibm_cloud_iam/api_client.rb +387 -0
  35. data/lib/ibm_cloud_iam/api_error.rb +57 -0
  36. data/lib/ibm_cloud_iam/configuration.rb +241 -0
  37. data/lib/ibm_cloud_iam/models/api_key.rb +381 -0
  38. data/lib/ibm_cloud_iam/models/api_key_inside_create_service_id_request.rb +245 -0
  39. data/lib/ibm_cloud_iam/models/api_key_list.rb +276 -0
  40. data/lib/ibm_cloud_iam/models/create_api_key_request.rb +270 -0
  41. data/lib/ibm_cloud_iam/models/create_service_id_request.rb +261 -0
  42. data/lib/ibm_cloud_iam/models/enity_history_record.rb +292 -0
  43. data/lib/ibm_cloud_iam/models/error.rb +255 -0
  44. data/lib/ibm_cloud_iam/models/exception_response.rb +251 -0
  45. data/lib/ibm_cloud_iam/models/exception_response_context.rb +320 -0
  46. data/lib/ibm_cloud_iam/models/inline_object.rb +229 -0
  47. data/lib/ibm_cloud_iam/models/inline_object1.rb +254 -0
  48. data/lib/ibm_cloud_iam/models/inline_object2.rb +244 -0
  49. data/lib/ibm_cloud_iam/models/inline_object3.rb +269 -0
  50. data/lib/ibm_cloud_iam/models/mfa_requirements_response.rb +245 -0
  51. data/lib/ibm_cloud_iam/models/oidc_exception_response.rb +258 -0
  52. data/lib/ibm_cloud_iam/models/response_context.rb +310 -0
  53. data/lib/ibm_cloud_iam/models/service_id.rb +377 -0
  54. data/lib/ibm_cloud_iam/models/service_id_list.rb +276 -0
  55. data/lib/ibm_cloud_iam/models/token_response.rb +260 -0
  56. data/lib/ibm_cloud_iam/models/update_api_key_request.rb +220 -0
  57. data/lib/ibm_cloud_iam/models/update_service_id_request.rb +232 -0
  58. data/lib/ibm_cloud_iam/version.rb +15 -0
  59. data/spec/api/identity_operations_api_spec.rb +253 -0
  60. data/spec/api/token_operations_api_spec.rb +94 -0
  61. data/spec/api_client_spec.rb +226 -0
  62. data/spec/configuration_spec.rb +42 -0
  63. data/spec/models/api_key_inside_create_service_id_request_spec.rb +59 -0
  64. data/spec/models/api_key_list_spec.rb +77 -0
  65. data/spec/models/api_key_spec.rb +119 -0
  66. data/spec/models/create_api_key_request_spec.rb +71 -0
  67. data/spec/models/create_service_id_request_spec.rb +65 -0
  68. data/spec/models/enity_history_record_spec.rb +71 -0
  69. data/spec/models/error_spec.rb +59 -0
  70. data/spec/models/exception_response_context_spec.rb +107 -0
  71. data/spec/models/exception_response_spec.rb +59 -0
  72. data/spec/models/inline_object1_spec.rb +59 -0
  73. data/spec/models/inline_object2_spec.rb +53 -0
  74. data/spec/models/inline_object3_spec.rb +65 -0
  75. data/spec/models/inline_object_spec.rb +47 -0
  76. data/spec/models/mfa_requirements_response_spec.rb +53 -0
  77. data/spec/models/oidc_exception_response_spec.rb +65 -0
  78. data/spec/models/response_context_spec.rb +101 -0
  79. data/spec/models/service_id_list_spec.rb +77 -0
  80. data/spec/models/service_id_spec.rb +119 -0
  81. data/spec/models/token_response_spec.rb +71 -0
  82. data/spec/models/update_api_key_request_spec.rb +47 -0
  83. data/spec/models/update_service_id_request_spec.rb +53 -0
  84. data/spec/spec_helper.rb +111 -0
  85. metadata +192 -0
@@ -0,0 +1,19 @@
1
+ # IbmCloudIam::InlineObject
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **grant_type** | **String** | Grant type for this API call. You must set the grant type to `urn:ibm:params:oauth:grant-type:apikey`. |
8
+ **apikey** | **String** | The value of the api key |
9
+
10
+ ## Code Sample
11
+
12
+ ```ruby
13
+ require 'IbmCloudIam'
14
+
15
+ instance = IbmCloudIam::InlineObject.new(grant_type: null,
16
+ apikey: null)
17
+ ```
18
+
19
+
@@ -0,0 +1,23 @@
1
+ # IbmCloudIam::InlineObject1
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **grant_type** | **String** | Grant type for this API call. You must set the grant type to `password`. |
8
+ **username** | **String** | The value of the username |
9
+ **password** | **String** | The value of the password |
10
+ **account** | **String** | The 32 character identifier of the account. Specify this parameter to get an account-specific IAM token. IBM Cloud APIs require that IAM tokens are account-specific. | [optional]
11
+
12
+ ## Code Sample
13
+
14
+ ```ruby
15
+ require 'IbmCloudIam'
16
+
17
+ instance = IbmCloudIam::InlineObject1.new(grant_type: null,
18
+ username: null,
19
+ password: null,
20
+ account: null)
21
+ ```
22
+
23
+
@@ -0,0 +1,21 @@
1
+ # IbmCloudIam::InlineObject2
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **grant_type** | **String** | Grant type for this API call. You must set the grant type to `urn:ibm:params:oauth:grant-type:iam-authz`. |
8
+ **access_token** | **String** | The IAM access token of the identity that has the appropriate authorization to create an IAM access token for a given resource. |
9
+ **desired_iam_id** | **String** | The IAM ID of the IAM access token identity that should be created. The desired_iam_id identifies a resource identity. The IAM ID consists of the prefix crn- and the CRN of the target identity, e.g. crn-crn:v1:bluemix:public:cloud-object-storage:global:a/59bcbfa6ea2f006b4ed7094c1a08dcdd:1a0ec336-f391-4091-a6fb-5e084a4c56f4::. |
10
+
11
+ ## Code Sample
12
+
13
+ ```ruby
14
+ require 'IbmCloudIam'
15
+
16
+ instance = IbmCloudIam::InlineObject2.new(grant_type: null,
17
+ access_token: null,
18
+ desired_iam_id: null)
19
+ ```
20
+
21
+
@@ -0,0 +1,25 @@
1
+ # IbmCloudIam::InlineObject3
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **grant_type** | **String** | Grant type for this API call. You must set the grant type to `urn:ibm:params:oauth:grant-type:apikey`. |
8
+ **apikey** | **String** | The value of the API key. |
9
+ **response_type** | **String** | Either 'delegated_refresh_token' to receive a delegated refresh token only, or 'cloud_iam delegated_refresh_token' to receive both an IAM access token and a delegated refresh token in one API call. |
10
+ **receiver_client_ids** | **String** | A comma separated list of one or more client IDs that will be able to consume the delegated refresh token. The service that accepts a delegated refresh token as API parameter must expose its client ID to allow this API call. The receiver of the delegated refresh token will be able to use the refresh token until it expires. |
11
+ **delegated_refresh_token_expiry** | **Integer** | Expiration in seconds until the delegated refresh token must be consumed by the receiver client IDs. After the expiration, no client ID can consume the delegated refresh token, even if the life time of the refresh token inside is still not expired. The default, if not specified, is 518,400 seconds which corresponds to 6 days. | [optional]
12
+
13
+ ## Code Sample
14
+
15
+ ```ruby
16
+ require 'IbmCloudIam'
17
+
18
+ instance = IbmCloudIam::InlineObject3.new(grant_type: null,
19
+ apikey: null,
20
+ response_type: null,
21
+ receiver_client_ids: null,
22
+ delegated_refresh_token_expiry: null)
23
+ ```
24
+
25
+
@@ -0,0 +1,21 @@
1
+ # IbmCloudIam::MFARequirementsResponse
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **error** | **String** | MFA error. |
8
+ **code** | **String** | MFA Code. |
9
+ **authorization_token** | **String** | MFA AuthorizationToken. |
10
+
11
+ ## Code Sample
12
+
13
+ ```ruby
14
+ require 'IbmCloudIam'
15
+
16
+ instance = IbmCloudIam::MFARequirementsResponse.new(error: null,
17
+ code: null,
18
+ authorization_token: null)
19
+ ```
20
+
21
+
@@ -0,0 +1,25 @@
1
+ # IbmCloudIam::OidcExceptionResponse
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **context** | [**ExceptionResponseContext**](ExceptionResponseContext.md) | | [optional]
8
+ **error_code** | **String** | Error message code of the REST Exception. |
9
+ **error_message** | **String** | Error message of the REST Exception. Error messages are derived base on the input locale of the REST request and the available Message catalogs. Dynamic fallback to 'us-english' is happening if no message catalog is available for the provided input locale. |
10
+ **error_details** | **String** | Error details of the REST Exception. | [optional]
11
+ **requirements** | [**MFARequirementsResponse**](MFARequirementsResponse.md) | | [optional]
12
+
13
+ ## Code Sample
14
+
15
+ ```ruby
16
+ require 'IbmCloudIam'
17
+
18
+ instance = IbmCloudIam::OidcExceptionResponse.new(context: null,
19
+ error_code: null,
20
+ error_message: null,
21
+ error_details: null,
22
+ requirements: null)
23
+ ```
24
+
25
+
@@ -0,0 +1,37 @@
1
+ # IbmCloudIam::ResponseContext
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **transaction_id** | **String** | The transaction ID of the inbound REST request. | [optional]
8
+ **operation** | **String** | The operation of the inbound REST request. | [optional]
9
+ **user_agent** | **String** | The user agent of the inbound REST request. | [optional]
10
+ **url** | **String** | The URL of that cluster. | [optional]
11
+ **instance_id** | **String** | The instance ID of the server instance processing the request. | [optional]
12
+ **thread_id** | **String** | The thread ID of the server instance processing the request. | [optional]
13
+ **host** | **String** | The host of the server instance processing the request. | [optional]
14
+ **start_time** | **String** | The start time of the request. | [optional]
15
+ **end_time** | **String** | The finish time of the request. | [optional]
16
+ **elapsed_time** | **String** | The elapsed time in msec. | [optional]
17
+ **cluster_name** | **String** | The cluster name. | [optional]
18
+
19
+ ## Code Sample
20
+
21
+ ```ruby
22
+ require 'IbmCloudIam'
23
+
24
+ instance = IbmCloudIam::ResponseContext.new(transaction_id: null,
25
+ operation: null,
26
+ user_agent: null,
27
+ url: null,
28
+ instance_id: null,
29
+ thread_id: null,
30
+ host: null,
31
+ start_time: null,
32
+ end_time: null,
33
+ elapsed_time: null,
34
+ cluster_name: null)
35
+ ```
36
+
37
+
@@ -0,0 +1,43 @@
1
+ # IbmCloudIam::ServiceId
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **context** | [**ResponseContext**](ResponseContext.md) | | [optional]
8
+ **id** | **String** | Unique identifier of this Service Id. |
9
+ **iam_id** | **String** | Cloud wide identifier for identities of this service ID. |
10
+ **entity_tag** | **String** | Version of the service ID details object. You need to specify this value when updating the service ID to avoid stale updates. | [optional]
11
+ **crn** | **String** | Cloud Resource Name of the item. Example Cloud Resource Name: 'crn:v1:bluemix:public:iam-identity:us-south:a/myaccount::serviceid:1234-5678-9012' |
12
+ **locked** | **Boolean** | The service ID cannot be changed if set to true. |
13
+ **created_at** | **DateTime** | If set contains a date time string of the creation date in ISO format | [optional]
14
+ **modified_at** | **DateTime** | If set contains a date time string of the last modification date in ISO format | [optional]
15
+ **account_id** | **String** | ID of the account the service ID belongs to. |
16
+ **name** | **String** | Name of the Service Id. The name is not checked for uniqueness. Therefore multiple names with the same value can exist. Access is done via the UUID of the Service Id. |
17
+ **description** | **String** | The optional description of the Service Id. The 'description' property is only available if a description was provided during a create of a Service Id. | [optional]
18
+ **unique_instance_crns** | **Array<String>** | Optional list of CRNs (string array) which point to the services connected to the service ID. | [optional]
19
+ **history** | [**Array<EnityHistoryRecord>**](EnityHistoryRecord.md) | History of the Service ID | [optional]
20
+ **apikey** | [**ApiKey**](ApiKey.md) | |
21
+
22
+ ## Code Sample
23
+
24
+ ```ruby
25
+ require 'IbmCloudIam'
26
+
27
+ instance = IbmCloudIam::ServiceId.new(context: null,
28
+ id: null,
29
+ iam_id: null,
30
+ entity_tag: null,
31
+ crn: null,
32
+ locked: null,
33
+ created_at: null,
34
+ modified_at: null,
35
+ account_id: null,
36
+ name: null,
37
+ description: null,
38
+ unique_instance_crns: null,
39
+ history: null,
40
+ apikey: null)
41
+ ```
42
+
43
+
@@ -0,0 +1,29 @@
1
+ # IbmCloudIam::ServiceIdList
2
+
3
+ ## Properties
4
+
5
+ Name | Type | Description | Notes
6
+ ------------ | ------------- | ------------- | -------------
7
+ **context** | [**ResponseContext**](ResponseContext.md) | | [optional]
8
+ **offset** | **Integer** | The offset of the current page. | [optional]
9
+ **limit** | **Integer** | Optional size of a single page. Default is 20 items per page. Valid range is 1 to 100 | [optional]
10
+ **first** | **String** | Link to the first page. | [optional]
11
+ **previous** | **String** | Link to the previous available page. If 'previous' property is not part of the response no previous page is available. | [optional]
12
+ **_next** | **String** | Link to the next available page. If 'next' property is not part of the response no next page is available. | [optional]
13
+ **serviceids** | [**Array<ServiceId>**](ServiceId.md) | List of service IDs based on the query paramters and the page size. The service IDs array is always part of the response but might be empty depending on the query parameter values provided. |
14
+
15
+ ## Code Sample
16
+
17
+ ```ruby
18
+ require 'IbmCloudIam'
19
+
20
+ instance = IbmCloudIam::ServiceIdList.new(context: null,
21
+ offset: null,
22
+ limit: null,
23
+ first: null,
24
+ previous: null,
25
+ _next: null,
26
+ serviceids: null)
27
+ ```
28
+
29
+
@@ -0,0 +1,226 @@
1
+ # IbmCloudIam::TokenOperationsApi
2
+
3
+ All URIs are relative to *https://iam.cloud.ibm.com*
4
+
5
+ Method | HTTP request | Description
6
+ ------------- | ------------- | -------------
7
+ [**get_token_api_key**](TokenOperationsApi.md#get_token_api_key) | **POST** /identity/token#apikey | Create an IAM access token for a user or service ID using an API key
8
+ [**get_token_api_key_delegated_refresh_token**](TokenOperationsApi.md#get_token_api_key_delegated_refresh_token) | **POST** /identity/token#apikey-delegated-refresh-token | Create an IAM access token and delegated refresh token for a user or service ID
9
+ [**get_token_iam_authz**](TokenOperationsApi.md#get_token_iam_authz) | **POST** /identity/token#iam-authz | Create an IAM access token based on an authorization policy
10
+ [**get_token_password**](TokenOperationsApi.md#get_token_password) | **POST** /identity/token#password | Create an IAM access token for a user using username / password credentials and an optional account identifier
11
+
12
+
13
+
14
+ ## get_token_api_key
15
+
16
+ > TokenResponse get_token_api_key(grant_type, apikey)
17
+
18
+ Create an IAM access token for a user or service ID using an API key
19
+
20
+ Creates a non-opaque access token for an API key.
21
+
22
+ ### Example
23
+
24
+ ```ruby
25
+ # load the gem
26
+ require 'ibm_cloud_iam'
27
+
28
+ api_instance = IbmCloudIam::TokenOperationsApi.new
29
+ grant_type = 'grant_type_example' # String | Grant type for this API call. You must set the grant type to `urn:ibm:params:oauth:grant-type:apikey`.
30
+ apikey = 'apikey_example' # String | The value of the api key
31
+
32
+ begin
33
+ #Create an IAM access token for a user or service ID using an API key
34
+ result = api_instance.get_token_api_key(grant_type, apikey)
35
+ p result
36
+ rescue IbmCloudIam::ApiError => e
37
+ puts "Exception when calling TokenOperationsApi->get_token_api_key: #{e}"
38
+ end
39
+ ```
40
+
41
+ ### Parameters
42
+
43
+
44
+ Name | Type | Description | Notes
45
+ ------------- | ------------- | ------------- | -------------
46
+ **grant_type** | **String**| Grant type for this API call. You must set the grant type to `urn:ibm:params:oauth:grant-type:apikey`. |
47
+ **apikey** | **String**| The value of the api key |
48
+
49
+ ### Return type
50
+
51
+ [**TokenResponse**](TokenResponse.md)
52
+
53
+ ### Authorization
54
+
55
+ No authorization required
56
+
57
+ ### HTTP request headers
58
+
59
+ - **Content-Type**: application/x-www-form-urlencoded
60
+ - **Accept**: application/json
61
+
62
+
63
+ ## get_token_api_key_delegated_refresh_token
64
+
65
+ > TokenResponse get_token_api_key_delegated_refresh_token(grant_type, apikey, response_type, receiver_client_ids, opts)
66
+
67
+ Create an IAM access token and delegated refresh token for a user or service ID
68
+
69
+ Creates a non-opaque access token and a delegated refresh token for an API key.
70
+
71
+ ### Example
72
+
73
+ ```ruby
74
+ # load the gem
75
+ require 'ibm_cloud_iam'
76
+
77
+ api_instance = IbmCloudIam::TokenOperationsApi.new
78
+ grant_type = 'grant_type_example' # String | Grant type for this API call. You must set the grant type to `urn:ibm:params:oauth:grant-type:apikey`.
79
+ apikey = 'apikey_example' # String | The value of the API key.
80
+ response_type = 'response_type_example' # String | Either 'delegated_refresh_token' to receive a delegated refresh token only, or 'cloud_iam delegated_refresh_token' to receive both an IAM access token and a delegated refresh token in one API call.
81
+ receiver_client_ids = 'receiver_client_ids_example' # String | A comma separated list of one or more client IDs that will be able to consume the delegated refresh token. The service that accepts a delegated refresh token as API parameter must expose its client ID to allow this API call. The receiver of the delegated refresh token will be able to use the refresh token until it expires.
82
+ opts = {
83
+ delegated_refresh_token_expiry: 56 # Integer | Expiration in seconds until the delegated refresh token must be consumed by the receiver client IDs. After the expiration, no client ID can consume the delegated refresh token, even if the life time of the refresh token inside is still not expired. The default, if not specified, is 518,400 seconds which corresponds to 6 days.
84
+ }
85
+
86
+ begin
87
+ #Create an IAM access token and delegated refresh token for a user or service ID
88
+ result = api_instance.get_token_api_key_delegated_refresh_token(grant_type, apikey, response_type, receiver_client_ids, opts)
89
+ p result
90
+ rescue IbmCloudIam::ApiError => e
91
+ puts "Exception when calling TokenOperationsApi->get_token_api_key_delegated_refresh_token: #{e}"
92
+ end
93
+ ```
94
+
95
+ ### Parameters
96
+
97
+
98
+ Name | Type | Description | Notes
99
+ ------------- | ------------- | ------------- | -------------
100
+ **grant_type** | **String**| Grant type for this API call. You must set the grant type to `urn:ibm:params:oauth:grant-type:apikey`. |
101
+ **apikey** | **String**| The value of the API key. |
102
+ **response_type** | **String**| Either 'delegated_refresh_token' to receive a delegated refresh token only, or 'cloud_iam delegated_refresh_token' to receive both an IAM access token and a delegated refresh token in one API call. |
103
+ **receiver_client_ids** | **String**| A comma separated list of one or more client IDs that will be able to consume the delegated refresh token. The service that accepts a delegated refresh token as API parameter must expose its client ID to allow this API call. The receiver of the delegated refresh token will be able to use the refresh token until it expires. |
104
+ **delegated_refresh_token_expiry** | **Integer**| Expiration in seconds until the delegated refresh token must be consumed by the receiver client IDs. After the expiration, no client ID can consume the delegated refresh token, even if the life time of the refresh token inside is still not expired. The default, if not specified, is 518,400 seconds which corresponds to 6 days. | [optional]
105
+
106
+ ### Return type
107
+
108
+ [**TokenResponse**](TokenResponse.md)
109
+
110
+ ### Authorization
111
+
112
+ No authorization required
113
+
114
+ ### HTTP request headers
115
+
116
+ - **Content-Type**: application/x-www-form-urlencoded
117
+ - **Accept**: application/json
118
+
119
+
120
+ ## get_token_iam_authz
121
+
122
+ > TokenResponse get_token_iam_authz(grant_type, access_token, desired_iam_id)
123
+
124
+ Create an IAM access token based on an authorization policy
125
+
126
+ Creates a non-opaque access token, if an appropriate authorization policy is in place. This kind of IAM access token is typically used for access between services.
127
+
128
+ ### Example
129
+
130
+ ```ruby
131
+ # load the gem
132
+ require 'ibm_cloud_iam'
133
+
134
+ api_instance = IbmCloudIam::TokenOperationsApi.new
135
+ grant_type = 'grant_type_example' # String | Grant type for this API call. You must set the grant type to `urn:ibm:params:oauth:grant-type:iam-authz`.
136
+ access_token = 'access_token_example' # String | The IAM access token of the identity that has the appropriate authorization to create an IAM access token for a given resource.
137
+ desired_iam_id = 'desired_iam_id_example' # String | The IAM ID of the IAM access token identity that should be created. The desired_iam_id identifies a resource identity. The IAM ID consists of the prefix crn- and the CRN of the target identity, e.g. crn-crn:v1:bluemix:public:cloud-object-storage:global:a/59bcbfa6ea2f006b4ed7094c1a08dcdd:1a0ec336-f391-4091-a6fb-5e084a4c56f4::.
138
+
139
+ begin
140
+ #Create an IAM access token based on an authorization policy
141
+ result = api_instance.get_token_iam_authz(grant_type, access_token, desired_iam_id)
142
+ p result
143
+ rescue IbmCloudIam::ApiError => e
144
+ puts "Exception when calling TokenOperationsApi->get_token_iam_authz: #{e}"
145
+ end
146
+ ```
147
+
148
+ ### Parameters
149
+
150
+
151
+ Name | Type | Description | Notes
152
+ ------------- | ------------- | ------------- | -------------
153
+ **grant_type** | **String**| Grant type for this API call. You must set the grant type to `urn:ibm:params:oauth:grant-type:iam-authz`. |
154
+ **access_token** | **String**| The IAM access token of the identity that has the appropriate authorization to create an IAM access token for a given resource. |
155
+ **desired_iam_id** | **String**| The IAM ID of the IAM access token identity that should be created. The desired_iam_id identifies a resource identity. The IAM ID consists of the prefix crn- and the CRN of the target identity, e.g. crn-crn:v1:bluemix:public:cloud-object-storage:global:a/59bcbfa6ea2f006b4ed7094c1a08dcdd:1a0ec336-f391-4091-a6fb-5e084a4c56f4::. |
156
+
157
+ ### Return type
158
+
159
+ [**TokenResponse**](TokenResponse.md)
160
+
161
+ ### Authorization
162
+
163
+ No authorization required
164
+
165
+ ### HTTP request headers
166
+
167
+ - **Content-Type**: application/x-www-form-urlencoded
168
+ - **Accept**: application/json
169
+
170
+
171
+ ## get_token_password
172
+
173
+ > TokenResponse get_token_password(authorization, grant_type, username, password, opts)
174
+
175
+ Create an IAM access token for a user using username / password credentials and an optional account identifier
176
+
177
+ Creates a non-opaque access token for a username and password. To be able to call IBM Cloud APIs, the token must be made account-specific. For this purpose, also pass the 32 character long identifier for your account in the API call. This API call is possible only for non-federated IBMid users.
178
+
179
+ ### Example
180
+
181
+ ```ruby
182
+ # load the gem
183
+ require 'ibm_cloud_iam'
184
+
185
+ api_instance = IbmCloudIam::TokenOperationsApi.new
186
+ authorization = 'authorization_example' # String | Basic Authorization Header containing a valid client ID and secret. If this header is omitted the request fails with BXNIM0308E: 'No authorization header found'. You can use the client ID and secret that is used by the IBM Cloud CLI: `bx / bx`
187
+ grant_type = 'grant_type_example' # String | Grant type for this API call. You must set the grant type to `password`.
188
+ username = 'username_example' # String | The value of the username
189
+ password = 'password_example' # String | The value of the password
190
+ opts = {
191
+ account: 'account_example' # String | The 32 character identifier of the account. Specify this parameter to get an account-specific IAM token. IBM Cloud APIs require that IAM tokens are account-specific.
192
+ }
193
+
194
+ begin
195
+ #Create an IAM access token for a user using username / password credentials and an optional account identifier
196
+ result = api_instance.get_token_password(authorization, grant_type, username, password, opts)
197
+ p result
198
+ rescue IbmCloudIam::ApiError => e
199
+ puts "Exception when calling TokenOperationsApi->get_token_password: #{e}"
200
+ end
201
+ ```
202
+
203
+ ### Parameters
204
+
205
+
206
+ Name | Type | Description | Notes
207
+ ------------- | ------------- | ------------- | -------------
208
+ **authorization** | **String**| Basic Authorization Header containing a valid client ID and secret. If this header is omitted the request fails with BXNIM0308E: 'No authorization header found'. You can use the client ID and secret that is used by the IBM Cloud CLI: `bx / bx` |
209
+ **grant_type** | **String**| Grant type for this API call. You must set the grant type to `password`. |
210
+ **username** | **String**| The value of the username |
211
+ **password** | **String**| The value of the password |
212
+ **account** | **String**| The 32 character identifier of the account. Specify this parameter to get an account-specific IAM token. IBM Cloud APIs require that IAM tokens are account-specific. | [optional]
213
+
214
+ ### Return type
215
+
216
+ [**TokenResponse**](TokenResponse.md)
217
+
218
+ ### Authorization
219
+
220
+ No authorization required
221
+
222
+ ### HTTP request headers
223
+
224
+ - **Content-Type**: application/x-www-form-urlencoded
225
+ - **Accept**: application/json
226
+