Class: OracleBMC::Identity::IdentityClient

Inherits:
Object
  • Object
show all
Defined in:
lib/oraclebmc/identity/identity_client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config: nil, region: nil) ⇒ IdentityClient

Creates a new IdentityClient. If a config is not specified, then the global OracleBMC.config will be used.

A region must be specified in either the config or the region parameter. If specified in both, then the region parameter will be used.

Parameters:

  • config (Config) (defaults to: nil)

    A Config object.

  • region (String) (defaults to: nil)

    A region used to determine the service endpoint. This will usually correspond to a value in Regions::REGION_ENUM, but may be an arbitrary string.



32
33
34
35
36
37
38
39
# File 'lib/oraclebmc/identity/identity_client.rb', line 32

def initialize(config:nil, region:nil)
  config ||= OracleBMC.config
  signer = Signer.new(config.user, config.fingerprint, config.tenancy, config.key_file, pass_phrase: config.pass_phrase)
  @api_client = ApiClient.new(config, signer)

  region ||= config.region
  self.region = region
end

Instance Attribute Details

#api_clientOracleBMC::ApiClient (readonly)

Client used to make HTTP requests.



12
13
14
# File 'lib/oraclebmc/identity/identity_client.rb', line 12

def api_client
  @api_client
end

#endpointString (readonly)

Fully qualified endpoint URL

Returns:

  • (String)


16
17
18
# File 'lib/oraclebmc/identity/identity_client.rb', line 16

def endpoint
  @endpoint
end

#regionString

The region, which will usually correspond to a value in Regions::REGION_ENUM.

Returns:

  • (String)


20
21
22
# File 'lib/oraclebmc/identity/identity_client.rb', line 20

def region
  @region
end

Instance Method Details

#add_user_to_group(add_user_to_group_details, opts = {}) ⇒ Response

Adds the specified user to the specified group and returns a ‘UserGroupMembership` object with its own OCID.

After you send your request, the new object’s ‘lifecycleState` will temporarily be CREATING. Before using the object, first make sure its `lifecycleState` has changed to ACTIVE.

Parameters:

  • add_user_to_group_details (AddUserToGroupDetails)

    Request object for adding a user to a group.

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

    the optional parameters

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::UserGroupMembership



73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# File 'lib/oraclebmc/identity/identity_client.rb', line 73

def add_user_to_group(add_user_to_group_details, opts = {})
  logger.debug "Calling operation IdentityClient#add_user_to_group." if logger

  fail "Missing the required parameter 'add_user_to_group_details' when calling add_user_to_group." if add_user_to_group_details.nil?

  path = "/userGroupMemberships/"

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']

  post_body = @api_client.object_to_http_body(add_user_to_group_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::UserGroupMembership')
end

#create_compartment(create_compartment_details, opts = {}) ⇒ Response

Creates a new compartment in your tenancy.

Important: Compartments cannot be renamed or deleted.

You must specify your tenancy’s OCID as the compartment ID in the request object. Remember that the tenancy is simply the root compartment. For information about OCIDs, see [Resource Identifiers](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).

You must also specify a name for the compartment, which must be unique across all compartments in your tenancy and cannot be changed. You can use this name or the OCID when writing policies that apply to the compartment. For more information about policies, see [How Policies Work](docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policies.htm).

You must also specify a description for the compartment (although it can be an empty string). It does not have to be unique, and you can change it anytime with update_compartment.

After you send your request, the new object’s ‘lifecycleState` will temporarily be CREATING. Before using the object, first make sure its `lifecycleState` has changed to ACTIVE.

Parameters:

  • create_compartment_details (CreateCompartmentDetails)

    Request object for creating a new compartment.

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

    the optional parameters

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::Compartment



130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
# File 'lib/oraclebmc/identity/identity_client.rb', line 130

def create_compartment(create_compartment_details, opts = {})
  logger.debug "Calling operation IdentityClient#create_compartment." if logger

  fail "Missing the required parameter 'create_compartment_details' when calling create_compartment." if create_compartment_details.nil?

  path = "/compartments/"

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']

  post_body = @api_client.object_to_http_body(create_compartment_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::Compartment')
end

#create_group(create_group_details, opts = {}) ⇒ Response

Creates a new group in your tenancy.

You must specify your tenancy’s OCID as the compartment ID in the request object (remember that the tenancy is simply the root compartment). Notice that IAM resources (users, groups, compartments, and some policies) reside within the tenancy itself, unlike cloud resources such as compute instances, which typically reside within compartments inside the tenancy. For information about OCIDs, see [Resource Identifiers](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).

You must also specify a name for the group, which must be unique across all groups in your tenancy and cannot be changed. You can use this name or the OCID when writing policies that apply to the group. For more information about policies, see [How Policies Work](docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policies.htm).

You must also specify a description for the group (although it can be an empty string). It does not have to be unique, and you can change it anytime with update_group.

After you send your request, the new object’s ‘lifecycleState` will temporarily be CREATING. Before using the object, first make sure its `lifecycleState` has changed to ACTIVE.

After creating the group, you need to put users in it and write policies for it. See add_user_to_group and create_policy.

Parameters:

  • create_group_details (CreateGroupDetails)

    Request object for creating a new group.

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

    the optional parameters

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::Group



189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/oraclebmc/identity/identity_client.rb', line 189

def create_group(create_group_details, opts = {})
  logger.debug "Calling operation IdentityClient#create_group." if logger

  fail "Missing the required parameter 'create_group_details' when calling create_group." if create_group_details.nil?

  path = "/groups/"

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']

  post_body = @api_client.object_to_http_body(create_group_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::Group')
end

#create_identity_provider(create_identity_provider_details, opts = {}) ⇒ Response

Creates a new identity provider in your tenancy. For more information, see [Identity Providers and Federation](docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/federation.htm).

You must specify your tenancy’s OCID as the compartment ID in the request object. Remember that the tenancy is simply the root compartment. For information about OCIDs, see [Resource Identifiers](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).

You must also specify a name for the ‘IdentityProvider`, which must be unique across all `IdentityProvider` objects in your tenancy and cannot be changed.

You must also specify a description for the ‘IdentityProvider` (although it can be an empty string). It does not have to be unique, and you can change it anytime with update_identity_provider.

After you send your request, the new object’s ‘lifecycleState` will temporarily be CREATING. Before using the object, first make sure its `lifecycleState` has changed to ACTIVE.

Parameters:

  • create_identity_provider_details (CreateIdentityProviderDetails)

    Request object for creating a new SAML2 identity provider.

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

    the optional parameters

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::IdentityProvider



245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
# File 'lib/oraclebmc/identity/identity_client.rb', line 245

def create_identity_provider(create_identity_provider_details, opts = {})
  logger.debug "Calling operation IdentityClient#create_identity_provider." if logger

  fail "Missing the required parameter 'create_identity_provider_details' when calling create_identity_provider." if create_identity_provider_details.nil?

  path = "/identityProviders/"

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']

  post_body = @api_client.object_to_http_body(create_identity_provider_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::IdentityProvider')
end

#create_idp_group_mapping(create_idp_group_mapping_details, identity_provider_id, opts = {}) ⇒ Response

Creates a single mapping between an IdP group and an IAM Service Group.

Parameters:

  • create_idp_group_mapping_details (CreateIdpGroupMappingDetails)

    Add a mapping from an SAML2.0 identity provider group to a BMC group.

  • identity_provider_id (String)

    The OCID of the identity provider.

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

    the optional parameters

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::IdpGroupMapping



286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
# File 'lib/oraclebmc/identity/identity_client.rb', line 286

def create_idp_group_mapping(create_idp_group_mapping_details, identity_provider_id, opts = {})
  logger.debug "Calling operation IdentityClient#create_idp_group_mapping." if logger

  fail "Missing the required parameter 'create_idp_group_mapping_details' when calling create_idp_group_mapping." if create_idp_group_mapping_details.nil?
  fail "Missing the required parameter 'identity_provider_id' when calling create_idp_group_mapping." if identity_provider_id.nil?

  path = "/identityProviders/{identityProviderId}/groupMappings/".sub('{identityProviderId}', identity_provider_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']

  post_body = @api_client.object_to_http_body(create_idp_group_mapping_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::IdpGroupMapping')
end

#create_or_reset_ui_password(user_id, opts = {}) ⇒ Response

Creates a new Console one-time password for the specified user. For more information about user credentials, see [User Credentials](docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/usercredentials.htm).

Use this operation after creating a new user, or if a user forgets their password. The new one-time password is returned to you in the response, and you must securely deliver it to the user. They’ll be prompted to change this password the next time they sign in to the Console. If they don’t change it within 7 days, the password will expire and you’ll need to create a new one-time password for the user.

Note: The user’s Console login is the unique name you specified when you created the user (see create_user).

Parameters:

  • user_id (String)

    The OCID of the user.

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

    the optional parameters

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::UIPassword



336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
# File 'lib/oraclebmc/identity/identity_client.rb', line 336

def create_or_reset_ui_password(user_id, opts = {})
  logger.debug "Calling operation IdentityClient#create_or_reset_ui_password." if logger

  fail "Missing the required parameter 'user_id' when calling create_or_reset_ui_password." if user_id.nil?

  path = "/users/{userId}/uiPassword".sub('{userId}', user_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']

  post_body = nil

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::UIPassword')
end

#create_policy(create_policy_details, opts = {}) ⇒ Response

Creates a new policy in the specified compartment (either the tenancy or another of your compartments). If you’re new to policies, see [Getting Started with Policies](docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm).

You must specify a name for the policy, which must be unique across all policies in your tenancy and cannot be changed.

You must also specify a description for the policy (although it can be an empty string). It does not have to be unique, and you can change it anytime with update_policy.

You must specify one or more policy statements in the statements array. For information about writing policies, see [How Policies Work](docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policies.htm) and [Common Policies](docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/commonpolicies.htm).

After you send your request, the new object’s ‘lifecycleState` will temporarily be CREATING. Before using the object, first make sure its `lifecycleState` has changed to ACTIVE.

New policies take effect typically within 10 seconds.

Parameters:

  • create_policy_details (CreatePolicyDetails)

    Request object for creating a new policy.

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

    the optional parameters

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::Policy



391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
# File 'lib/oraclebmc/identity/identity_client.rb', line 391

def create_policy(create_policy_details, opts = {})
  logger.debug "Calling operation IdentityClient#create_policy." if logger

  fail "Missing the required parameter 'create_policy_details' when calling create_policy." if create_policy_details.nil?

  path = "/policies/"

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']

  post_body = @api_client.object_to_http_body(create_policy_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::Policy')
end

#create_region_subscription(create_region_subscription_details, tenancy_id, opts = {}) ⇒ Response

Creates a subscription to a region for a tenancy.

Parameters:

  • create_region_subscription_details (CreateRegionSubscriptionDetails)

    Request object for activate a new region.

  • tenancy_id (String)

    The OCID of the tenancy.

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

    the optional parameters

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::RegionSubscription



431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
# File 'lib/oraclebmc/identity/identity_client.rb', line 431

def create_region_subscription(create_region_subscription_details, tenancy_id, opts = {})
  logger.debug "Calling operation IdentityClient#create_region_subscription." if logger

  fail "Missing the required parameter 'create_region_subscription_details' when calling create_region_subscription." if create_region_subscription_details.nil?
  fail "Missing the required parameter 'tenancy_id' when calling create_region_subscription." if tenancy_id.nil?

  path = "/tenancies/{tenancyId}/regionSubscriptions".sub('{tenancyId}', tenancy_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']

  post_body = @api_client.object_to_http_body(create_region_subscription_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::RegionSubscription')
end

#create_swift_password(create_swift_password_details, user_id, opts = {}) ⇒ Response

Creates a new Swift password for the specified user. For information about what Swift passwords are for, see [Managing User Credentials](docs.us-phoenix-1.oraclecloud.com/Content/Identity/Tasks/managingcredentials.htm).

You must specify a description for the Swift password (although it can be an empty string). It does not have to be unique, and you can change it anytime with update_swift_password.

Every user has permission to create a Swift password for *their own user ID*. An administrator in your organization does not need to write a policy to give users this ability. To compare, administrators who have permission to the tenancy can use this operation to create a Swift password for any user, including themselves.

Parameters:

  • create_swift_password_details (CreateSwiftPasswordDetails)

    Request object for creating a new swift password.

  • user_id (String)

    The OCID of the user.

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

    the optional parameters

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::SwiftPassword



481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
# File 'lib/oraclebmc/identity/identity_client.rb', line 481

def create_swift_password(create_swift_password_details, user_id, opts = {})
  logger.debug "Calling operation IdentityClient#create_swift_password." if logger

  fail "Missing the required parameter 'create_swift_password_details' when calling create_swift_password." if create_swift_password_details.nil?
  fail "Missing the required parameter 'user_id' when calling create_swift_password." if user_id.nil?

  path = "/users/{userId}/swiftPasswords/".sub('{userId}', user_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']

  post_body = @api_client.object_to_http_body(create_swift_password_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::SwiftPassword')
end

#create_user(create_user_details, opts = {}) ⇒ Response

Creates a new user in your tenancy. For conceptual information about users, your tenancy, and other IAM Service components, see [Overview of the IAM Service](docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm).

You must specify your tenancy’s OCID as the compartment ID in the request object (remember that the tenancy is simply the root compartment). Notice that IAM resources (users, groups, compartments, and some policies) reside within the tenancy itself, unlike cloud resources such as compute instances, which typically reside within compartments inside the tenancy. For information about OCIDs, see [Resource Identifiers](docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).

You must also specify a name for the user, which must be unique across all users in your tenancy and cannot be changed. Allowed characters: No spaces. Only letters, numerals, hyphens, periods, underscores, +, and @. If you specify a name that’s already in use, you’ll get a 409 error. This name will be the user’s login to the Console. You might want to pick a name that your company’s own identity system (e.g., Active Directory, LDAP, etc.) already uses. If you delete a user and then create a new user with the same name, they’ll be considered different users because they have different OCIDs.

You must also specify a description for the user (although it can be an empty string). It does not have to be unique, and you can change it anytime with update_user. You can use the field to provide the user’s full name, a description, a nickname, or other information to generally identify the user.

After you send your request, the new object’s ‘lifecycleState` will temporarily be CREATING. Before using the object, first make sure its `lifecycleState` has changed to ACTIVE.

A new user has no permissions until you place the user in one or more groups (see add_user_to_group). If the user needs to access the Console, you need to provide the user a password (see create_or_reset_ui_password). If the user needs to access the Oracle Bare Metal Cloud Services REST API, you need to upload a public API signing key for that user (see [Required Keys and OCIDs](docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm) and also upload_api_key).

Important: Make sure to inform the new user which compartment(s) they have access to.

Parameters:

  • create_user_details (CreateUserDetails)

    Request object for creating a new user.

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

    the optional parameters

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::User



555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
# File 'lib/oraclebmc/identity/identity_client.rb', line 555

def create_user(create_user_details, opts = {})
  logger.debug "Calling operation IdentityClient#create_user." if logger

  fail "Missing the required parameter 'create_user_details' when calling create_user." if create_user_details.nil?

  path = "/users/"

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']

  post_body = @api_client.object_to_http_body(create_user_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::User')
end

#delete_api_key(user_id, fingerprint, opts = {}) ⇒ Response

Deletes the specified API signing key for the specified user.

Every user has permission to use this operation to delete a key for *their own user ID*. An administrator in your organization does not need to write a policy to give users this ability. To compare, administrators who have permission to the tenancy can use this operation to delete a key for any user, including themselves.

Parameters:

  • user_id (String)

    The OCID of the user.

  • fingerprint (String)

    The key's fingerprint.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
# File 'lib/oraclebmc/identity/identity_client.rb', line 598

def delete_api_key(user_id, fingerprint, opts = {})
  logger.debug "Calling operation IdentityClient#delete_api_key." if logger

  fail "Missing the required parameter 'user_id' when calling delete_api_key." if user_id.nil?
  fail "Missing the required parameter 'fingerprint' when calling delete_api_key." if fingerprint.nil?

  path = "/users/{userId}/apiKeys/{fingerprint}".sub('{userId}', user_id.to_s).sub('{fingerprint}', fingerprint.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#delete_group(group_id, opts = {}) ⇒ Response

Deletes the specified group. The group must be empty.

Parameters:

  • group_id (String)

    The OCID of the group.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
# File 'lib/oraclebmc/identity/identity_client.rb', line 635

def delete_group(group_id, opts = {})
  logger.debug "Calling operation IdentityClient#delete_group." if logger

  fail "Missing the required parameter 'group_id' when calling delete_group." if group_id.nil?

  path = "/groups/{groupId}".sub('{groupId}', group_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#delete_identity_provider(identity_provider_id, opts = {}) ⇒ Response

Deletes the specified identity provider. The identity provider must not have any group mappings (see IdpGroupMapping).

Parameters:

  • identity_provider_id (String)

    The OCID of the identity provider.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
# File 'lib/oraclebmc/identity/identity_client.rb', line 672

def delete_identity_provider(identity_provider_id, opts = {})
  logger.debug "Calling operation IdentityClient#delete_identity_provider." if logger

  fail "Missing the required parameter 'identity_provider_id' when calling delete_identity_provider." if identity_provider_id.nil?

  path = "/identityProviders/{identityProviderId}".sub('{identityProviderId}', identity_provider_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#delete_idp_group_mapping(identity_provider_id, mapping_id, opts = {}) ⇒ Response

Deletes the specified group mapping.

Parameters:

  • identity_provider_id (String)

    The OCID of the identity provider.

  • mapping_id (String)

    The OCID of the group mapping.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
# File 'lib/oraclebmc/identity/identity_client.rb', line 708

def delete_idp_group_mapping(identity_provider_id, mapping_id, opts = {})
  logger.debug "Calling operation IdentityClient#delete_idp_group_mapping." if logger

  fail "Missing the required parameter 'identity_provider_id' when calling delete_idp_group_mapping." if identity_provider_id.nil?
  fail "Missing the required parameter 'mapping_id' when calling delete_idp_group_mapping." if mapping_id.nil?

  path = "/identityProviders/{identityProviderId}/groupMappings/{mappingId}".sub('{identityProviderId}', identity_provider_id.to_s).sub('{mappingId}', mapping_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#delete_policy(policy_id, opts = {}) ⇒ Response

Deletes the specified policy. The deletion takes effect typically within 10 seconds.

Parameters:

  • policy_id (String)

    The OCID of the policy.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
# File 'lib/oraclebmc/identity/identity_client.rb', line 744

def delete_policy(policy_id, opts = {})
  logger.debug "Calling operation IdentityClient#delete_policy." if logger

  fail "Missing the required parameter 'policy_id' when calling delete_policy." if policy_id.nil?

  path = "/policies/{policyId}".sub('{policyId}', policy_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#delete_swift_password(user_id, swift_password_id, opts = {}) ⇒ Response

Deletes the specified Swift password for the specified user.

Parameters:

  • user_id (String)

    The OCID of the user.

  • swift_password_id (String)

    The OCID of the Swift password.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
# File 'lib/oraclebmc/identity/identity_client.rb', line 781

def delete_swift_password(user_id, swift_password_id, opts = {})
  logger.debug "Calling operation IdentityClient#delete_swift_password." if logger

  fail "Missing the required parameter 'user_id' when calling delete_swift_password." if user_id.nil?
  fail "Missing the required parameter 'swift_password_id' when calling delete_swift_password." if swift_password_id.nil?

  path = "/users/{userId}/swiftPasswords/{swiftPasswordId}".sub('{userId}', user_id.to_s).sub('{swiftPasswordId}', swift_password_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#delete_user(user_id, opts = {}) ⇒ Response

Deletes the specified user. The user must not be in any groups.

Parameters:

  • user_id (String)

    The OCID of the user.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
# File 'lib/oraclebmc/identity/identity_client.rb', line 817

def delete_user(user_id, opts = {})
  logger.debug "Calling operation IdentityClient#delete_user." if logger

  fail "Missing the required parameter 'user_id' when calling delete_user." if user_id.nil?

  path = "/users/{userId}".sub('{userId}', user_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#get_compartment(compartment_id, opts = {}) ⇒ Response

Gets the specified compartment’s information.

This operation does not return a list of all the resources inside the compartment. There is no single API operation that does that. Compartments can contain multiple types of resources (instances, block storage volumes, etc.). To find out what’s in a compartment, you must call the "List" operation for each resource type and specify the compartment’s OCID as a query parameter in the request. For example, call the list_instances operation in the Cloud Compute Service or the list_volumes operation in Cloud Block Storage.

Parameters:

  • compartment_id (String)

    The OCID of the compartment.

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

    the optional parameters

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::Compartment



856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
# File 'lib/oraclebmc/identity/identity_client.rb', line 856

def get_compartment(compartment_id, opts = {})
  logger.debug "Calling operation IdentityClient#get_compartment." if logger

  fail "Missing the required parameter 'compartment_id' when calling get_compartment." if compartment_id.nil?

  path = "/compartments/{compartmentId}".sub('{compartmentId}', compartment_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::Compartment')
end

#get_group(group_id, opts = {}) ⇒ Response

Gets the specified group’s information.

This operation does not return a list of all the users in the group. To do that, use list_user_group_memberships and provide the group’s OCID as a query parameter in the request.

Parameters:

  • group_id (String)

    The OCID of the group.

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

    the optional parameters

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::Group



892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
# File 'lib/oraclebmc/identity/identity_client.rb', line 892

def get_group(group_id, opts = {})
  logger.debug "Calling operation IdentityClient#get_group." if logger

  fail "Missing the required parameter 'group_id' when calling get_group." if group_id.nil?

  path = "/groups/{groupId}".sub('{groupId}', group_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::Group')
end

#get_identity_provider(identity_provider_id, opts = {}) ⇒ Response

Gets the specified identity provider’s information.

Parameters:

  • identity_provider_id (String)

    The OCID of the identity provider.

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

    the optional parameters

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::IdentityProvider



923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
# File 'lib/oraclebmc/identity/identity_client.rb', line 923

def get_identity_provider(identity_provider_id, opts = {})
  logger.debug "Calling operation IdentityClient#get_identity_provider." if logger

  fail "Missing the required parameter 'identity_provider_id' when calling get_identity_provider." if identity_provider_id.nil?

  path = "/identityProviders/{identityProviderId}".sub('{identityProviderId}', identity_provider_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::IdentityProvider')
end

#get_idp_group_mapping(identity_provider_id, mapping_id, opts = {}) ⇒ Response

Gets the specified group mapping.

Parameters:

  • identity_provider_id (String)

    The OCID of the identity provider.

  • mapping_id (String)

    The OCID of the group mapping.

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

    the optional parameters

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::IdpGroupMapping



955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
# File 'lib/oraclebmc/identity/identity_client.rb', line 955

def get_idp_group_mapping(identity_provider_id, mapping_id, opts = {})
  logger.debug "Calling operation IdentityClient#get_idp_group_mapping." if logger

  fail "Missing the required parameter 'identity_provider_id' when calling get_idp_group_mapping." if identity_provider_id.nil?
  fail "Missing the required parameter 'mapping_id' when calling get_idp_group_mapping." if mapping_id.nil?

  path = "/identityProviders/{identityProviderId}/groupMappings/{mappingId}".sub('{identityProviderId}', identity_provider_id.to_s).sub('{mappingId}', mapping_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::IdpGroupMapping')
end

#get_policy(policy_id, opts = {}) ⇒ Response

Gets the specified policy’s information.

Parameters:

  • policy_id (String)

    The OCID of the policy.

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

    the optional parameters

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::Policy



987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
# File 'lib/oraclebmc/identity/identity_client.rb', line 987

def get_policy(policy_id, opts = {})
  logger.debug "Calling operation IdentityClient#get_policy." if logger

  fail "Missing the required parameter 'policy_id' when calling get_policy." if policy_id.nil?

  path = "/policies/{policyId}".sub('{policyId}', policy_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::Policy')
end

#get_tenancy(tenancy_id, opts = {}) ⇒ Response

Get the specified tenancy’s information.

Parameters:

  • tenancy_id (String)

    The OCID of the tenancy.

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

    the optional parameters

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::Tenancy



1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
# File 'lib/oraclebmc/identity/identity_client.rb', line 1018

def get_tenancy(tenancy_id, opts = {})
  logger.debug "Calling operation IdentityClient#get_tenancy." if logger

  fail "Missing the required parameter 'tenancy_id' when calling get_tenancy." if tenancy_id.nil?

  path = "/tenancies/{tenancyId}".sub('{tenancyId}', tenancy_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::Tenancy')
end

#get_user(user_id, opts = {}) ⇒ Response

Gets the specified user’s information.

Parameters:

  • user_id (String)

    The OCID of the user.

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

    the optional parameters

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::User



1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
# File 'lib/oraclebmc/identity/identity_client.rb', line 1049

def get_user(user_id, opts = {})
  logger.debug "Calling operation IdentityClient#get_user." if logger

  fail "Missing the required parameter 'user_id' when calling get_user." if user_id.nil?

  path = "/users/{userId}".sub('{userId}', user_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::User')
end

#get_user_group_membership(user_group_membership_id, opts = {}) ⇒ Response

Gets the specified UserGroupMembership’s information.

Parameters:

  • user_group_membership_id (String)

    The OCID of the userGroupMembership.

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

    the optional parameters

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::UserGroupMembership



1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
# File 'lib/oraclebmc/identity/identity_client.rb', line 1080

def get_user_group_membership(user_group_membership_id, opts = {})
  logger.debug "Calling operation IdentityClient#get_user_group_membership." if logger

  fail "Missing the required parameter 'user_group_membership_id' when calling get_user_group_membership." if user_group_membership_id.nil?

  path = "/userGroupMemberships/{userGroupMembershipId}".sub('{userGroupMembershipId}', user_group_membership_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::UserGroupMembership')
end

#list_api_keys(user_id, opts = {}) ⇒ Response

Lists the API signing keys for the specified user. A user can have a maximum of three keys.

Every user has permission to use this API call for *their own user ID*. An administrator in your organization does not need to write a policy to give users this ability.

Parameters:

  • user_id (String)

    The OCID of the user.

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

    the optional parameters

Returns:

  • (Response)

    A Response object with data of type Array<OracleBMC::Identity::Models::ApiKey>



1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
# File 'lib/oraclebmc/identity/identity_client.rb', line 1115

def list_api_keys(user_id, opts = {})
  logger.debug "Calling operation IdentityClient#list_api_keys." if logger

  fail "Missing the required parameter 'user_id' when calling list_api_keys." if user_id.nil?

  path = "/users/{userId}/apiKeys/".sub('{userId}', user_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::Identity::Models::ApiKey>')
end

#list_availability_domains(compartment_id, opts = {}) ⇒ Response

Lists the Availability Domains in your tenancy. Specify the OCID of either the tenancy or another of your compartments as the value for the compartment ID (remember that the tenancy is simply the root compartment). See [Where to Get the Tenancy’s OCID and User’s OCID](docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five).

Parameters:

  • compartment_id (String)

    The OCID of the compartment (remember that the tenancy is simply the root compartment).

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

    the optional parameters

Returns:

  • (Response)

    A Response object with data of type Array<OracleBMC::Identity::Models::AvailabilityDomain>



1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
# File 'lib/oraclebmc/identity/identity_client.rb', line 1150

def list_availability_domains(compartment_id, opts = {})
  logger.debug "Calling operation IdentityClient#list_availability_domains." if logger

  fail "Missing the required parameter 'compartment_id' when calling list_availability_domains." if compartment_id.nil?

  path = "/availabilityDomains/"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::Identity::Models::AvailabilityDomain>')
end

#list_compartments(compartment_id, opts = {}) ⇒ Response

Lists the compartments in your tenancy. You must specify your tenancy’s OCID as the value for the compartment ID (remember that the tenancy is simply the root compartment). See [Where to Get the Tenancy’s OCID and User’s OCID](docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five).

Parameters:

  • compartment_id (String)

    The OCID of the compartment (remember that the tenancy is simply the root compartment).

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

    the optional parameters

Options Hash (opts):

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous &quot;List&quot; call.

  • :limit (Integer)

    The maximum number of items to return in a paginated &quot;List&quot; call.

Returns:

  • (Response)

    A Response object with data of type Array<OracleBMC::Identity::Models::Compartment>



1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
# File 'lib/oraclebmc/identity/identity_client.rb', line 1190

def list_compartments(compartment_id, opts = {})
  logger.debug "Calling operation IdentityClient#list_compartments." if logger

  fail "Missing the required parameter 'compartment_id' when calling list_compartments." if compartment_id.nil?

  path = "/compartments/"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::Identity::Models::Compartment>')
end

#list_groups(compartment_id, opts = {}) ⇒ Response

Lists the groups in your tenancy. You must specify your tenancy’s OCID as the value for the compartment ID (remember that the tenancy is simply the root compartment). See [Where to Get the Tenancy’s OCID and User’s OCID](docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five).

Parameters:

  • compartment_id (String)

    The OCID of the compartment (remember that the tenancy is simply the root compartment).

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

    the optional parameters

Options Hash (opts):

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous &quot;List&quot; call.

  • :limit (Integer)

    The maximum number of items to return in a paginated &quot;List&quot; call.

Returns:

  • (Response)

    A Response object with data of type Array<OracleBMC::Identity::Models::Group>



1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
# File 'lib/oraclebmc/identity/identity_client.rb', line 1232

def list_groups(compartment_id, opts = {})
  logger.debug "Calling operation IdentityClient#list_groups." if logger

  fail "Missing the required parameter 'compartment_id' when calling list_groups." if compartment_id.nil?

  path = "/groups/"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::Identity::Models::Group>')
end

#list_identity_providers(protocol, compartment_id, opts = {}) ⇒ Response

Lists all the identity providers in your tenancy. You must specify the identity provider type (e.g., ‘SAML2` for identity providers using the SAML2.0 protocol). You must specify your tenancy’s OCID as the value for the compartment ID (remember that the tenancy is simply the root compartment). See [Where to Get the Tenancy’s OCID and User’s OCID](docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five).

Parameters:

  • protocol (String)

    The protocol used for federation.

  • compartment_id (String)

    The OCID of the compartment (remember that the tenancy is simply the root compartment).

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

    the optional parameters

Options Hash (opts):

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous &quot;List&quot; call.

  • :limit (Integer)

    The maximum number of items to return in a paginated &quot;List&quot; call.

Returns:

  • (Response)

    A Response object with data of type Array<OracleBMC::Identity::Models::IdentityProvider>



1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
# File 'lib/oraclebmc/identity/identity_client.rb', line 1276

def list_identity_providers(protocol, compartment_id, opts = {})
  logger.debug "Calling operation IdentityClient#list_identity_providers." if logger

  fail "Missing the required parameter 'protocol' when calling list_identity_providers." if protocol.nil?
  unless ['SAML2'].include?(protocol)
    fail "Invalid value for 'protocol', must be one of SAML2."
  end
  fail "Missing the required parameter 'compartment_id' when calling list_identity_providers." if compartment_id.nil?

  path = "/identityProviders/"

  # Query Params
  query_params = {}
  query_params[:'protocol'] = protocol
  query_params[:'compartmentId'] = compartment_id
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::Identity::Models::IdentityProvider>')
end

#list_idp_group_mappings(identity_provider_id, opts = {}) ⇒ Response

Lists the group mappings for the specified identity provider.

Parameters:

  • identity_provider_id (String)

    The OCID of the identity provider.

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

    the optional parameters

Options Hash (opts):

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous &quot;List&quot; call.

  • :limit (Integer)

    The maximum number of items to return in a paginated &quot;List&quot; call.

Returns:

  • (Response)

    A Response object with data of type Array<OracleBMC::Identity::Models::IdpGroupMapping>



1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
# File 'lib/oraclebmc/identity/identity_client.rb', line 1320

def list_idp_group_mappings(identity_provider_id, opts = {})
  logger.debug "Calling operation IdentityClient#list_idp_group_mappings." if logger

  fail "Missing the required parameter 'identity_provider_id' when calling list_idp_group_mappings." if identity_provider_id.nil?

  path = "/identityProviders/{identityProviderId}/groupMappings/".sub('{identityProviderId}', identity_provider_id.to_s)

  # Query Params
  query_params = {}
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::Identity::Models::IdpGroupMapping>')
end

#list_policies(compartment_id, opts = {}) ⇒ Response

Lists the policies in the specified compartment (either the tenancy or another of your compartments). See [Where to Get the Tenancy’s OCID and User’s OCID](docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five).

To determine which policies apply to a particular group or compartment, you must view the individual statements inside all your policies. There isn’t a way to automatically obtain that information via the API.

Parameters:

  • compartment_id (String)

    The OCID of the compartment (remember that the tenancy is simply the root compartment).

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

    the optional parameters

Options Hash (opts):

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous &quot;List&quot; call.

  • :limit (Integer)

    The maximum number of items to return in a paginated &quot;List&quot; call.

Returns:

  • (Response)

    A Response object with data of type Array<OracleBMC::Identity::Models::Policy>



1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
# File 'lib/oraclebmc/identity/identity_client.rb', line 1363

def list_policies(compartment_id, opts = {})
  logger.debug "Calling operation IdentityClient#list_policies." if logger

  fail "Missing the required parameter 'compartment_id' when calling list_policies." if compartment_id.nil?

  path = "/policies/"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::Identity::Models::Policy>')
end

#list_region_subscriptions(tenancy_id, opts = {}) ⇒ Response

Lists the region subscriptions for the specified tenancy.

Parameters:

  • tenancy_id (String)

    The OCID of the tenancy.

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

    the optional parameters

Returns:

  • (Response)

    A Response object with data of type Array<OracleBMC::Identity::Models::RegionSubscription>



1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
# File 'lib/oraclebmc/identity/identity_client.rb', line 1397

def list_region_subscriptions(tenancy_id, opts = {})
  logger.debug "Calling operation IdentityClient#list_region_subscriptions." if logger

  fail "Missing the required parameter 'tenancy_id' when calling list_region_subscriptions." if tenancy_id.nil?

  path = "/tenancies/{tenancyId}/regionSubscriptions".sub('{tenancyId}', tenancy_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::Identity::Models::RegionSubscription>')
end

#list_regions(opts = {}) ⇒ Response

Lists all the regions offered by Oracle Bare Metal Cloud Services.

Parameters:

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

    the optional parameters

Returns:

  • (Response)

    A Response object with data of type Array<OracleBMC::Identity::Models::Region>



1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
# File 'lib/oraclebmc/identity/identity_client.rb', line 1427

def list_regions(opts = {})
  logger.debug "Calling operation IdentityClient#list_regions." if logger


  path = "/regions"

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::Identity::Models::Region>')
end

#list_swift_passwords(user_id, opts = {}) ⇒ Response

Lists the Swift passwords for the specified user. The returned object contains the password’s OCID, but not the password itself. The actual password is returned only upon creation.

Parameters:

  • user_id (String)

    The OCID of the user.

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

    the optional parameters

Returns:

  • (Response)

    A Response object with data of type Array<OracleBMC::Identity::Models::SwiftPassword>



1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
# File 'lib/oraclebmc/identity/identity_client.rb', line 1459

def list_swift_passwords(user_id, opts = {})
  logger.debug "Calling operation IdentityClient#list_swift_passwords." if logger

  fail "Missing the required parameter 'user_id' when calling list_swift_passwords." if user_id.nil?

  path = "/users/{userId}/swiftPasswords/".sub('{userId}', user_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::Identity::Models::SwiftPassword>')
end

#list_user_group_memberships(compartment_id, opts = {}) ⇒ Response

Lists the ‘UserGroupMembership` objects in your tenancy. You must specify your tenancy’s OCID as the value for the compartment ID (see [Where to Get the Tenancy’s OCID and User’s OCID](docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five)). You must also then filter the list in one of these ways:

  • You can limit the results to just the memberships for a given user by specifying a ‘userId`.

  • Similarly, you can limit the results to just the memberships for a given group by specifying a ‘groupId`.

  • You can set both the ‘userId` and `groupId` to determine if the specified user is in the specified group.

If the answer is no, the response is an empty list.

Parameters:

  • compartment_id (String)

    The OCID of the compartment (remember that the tenancy is simply the root compartment).

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

    the optional parameters

Options Hash (opts):

  • :user_id (String)

    The OCID of the user.

  • :group_id (String)

    The OCID of the group.

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous &quot;List&quot; call.

  • :limit (Integer)

    The maximum number of items to return in a paginated &quot;List&quot; call.

Returns:

  • (Response)

    A Response object with data of type Array<OracleBMC::Identity::Models::UserGroupMembership>



1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
# File 'lib/oraclebmc/identity/identity_client.rb', line 1506

def list_user_group_memberships(compartment_id, opts = {})
  logger.debug "Calling operation IdentityClient#list_user_group_memberships." if logger

  fail "Missing the required parameter 'compartment_id' when calling list_user_group_memberships." if compartment_id.nil?

  path = "/userGroupMemberships/"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id
  query_params[:'userId'] = opts[:'user_id'] if opts[:'user_id']
  query_params[:'groupId'] = opts[:'group_id'] if opts[:'group_id']
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::Identity::Models::UserGroupMembership>')
end

#list_users(compartment_id, opts = {}) ⇒ Response

Lists the users in your tenancy. You must specify your tenancy’s OCID as the value for the compartment ID (remember that the tenancy is simply the root compartment). See [Where to Get the Tenancy’s OCID and User’s OCID](docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five).

Parameters:

  • compartment_id (String)

    The OCID of the compartment (remember that the tenancy is simply the root compartment).

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

    the optional parameters

Options Hash (opts):

  • :page (String)

    The value of the ‘opc-next-page` response header from the previous &quot;List&quot; call.

  • :limit (Integer)

    The maximum number of items to return in a paginated &quot;List&quot; call.

Returns:

  • (Response)

    A Response object with data of type Array<OracleBMC::Identity::Models::User>



1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
# File 'lib/oraclebmc/identity/identity_client.rb', line 1550

def list_users(compartment_id, opts = {})
  logger.debug "Calling operation IdentityClient#list_users." if logger

  fail "Missing the required parameter 'compartment_id' when calling list_users." if compartment_id.nil?

  path = "/users/"

  # Query Params
  query_params = {}
  query_params[:'compartmentId'] = compartment_id
  query_params[:'page'] = opts[:'page'] if opts[:'page']
  query_params[:'limit'] = opts[:'limit'] if opts[:'limit']

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'

  post_body = nil

  return @api_client.call_api(
    :GET,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'Array<OracleBMC::Identity::Models::User>')
end

#loggerLogger

Returns The logger for this client. May be nil.

Returns:

  • (Logger)

    The logger for this client. May be nil.



54
55
56
# File 'lib/oraclebmc/identity/identity_client.rb', line 54

def logger
  @api_client.config.logger
end

#remove_user_from_group(user_group_membership_id, opts = {}) ⇒ Response

Removes a user from a group by deleting the corresponding ‘UserGroupMembership`.

Parameters:

  • user_group_membership_id (String)

    The OCID of the userGroupMembership.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource&#39;s current etag value.

Returns:

  • (Response)

    A Response object with data of type nil



1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
# File 'lib/oraclebmc/identity/identity_client.rb', line 1588

def remove_user_from_group(user_group_membership_id, opts = {})
  logger.debug "Calling operation IdentityClient#remove_user_from_group." if logger

  fail "Missing the required parameter 'user_group_membership_id' when calling remove_user_from_group." if user_group_membership_id.nil?

  path = "/userGroupMemberships/{userGroupMembershipId}".sub('{userGroupMembershipId}', user_group_membership_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = nil

  return @api_client.call_api(
    :DELETE,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body)
end

#update_compartment(compartment_id, update_compartment_details, opts = {}) ⇒ Response

Updates the specified compartment’s description.

Parameters:

  • compartment_id (String)

    The OCID of the compartment.

  • update_compartment_details (UpdateCompartmentDetails)

    Request object for updating a compartment.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource&#39;s current etag value.

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::Compartment



1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
# File 'lib/oraclebmc/identity/identity_client.rb', line 1624

def update_compartment(compartment_id, update_compartment_details, opts = {})
  logger.debug "Calling operation IdentityClient#update_compartment." if logger

  fail "Missing the required parameter 'compartment_id' when calling update_compartment." if compartment_id.nil?
  fail "Missing the required parameter 'update_compartment_details' when calling update_compartment." if update_compartment_details.nil?

  path = "/compartments/{compartmentId}".sub('{compartmentId}', compartment_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = @api_client.object_to_http_body(update_compartment_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::Compartment')
end

#update_group(group_id, update_group_details, opts = {}) ⇒ Response

Updates the specified group.

Parameters:

  • group_id (String)

    The OCID of the group.

  • update_group_details (UpdateGroupDetails)

    Request object for updating a group.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource&#39;s current etag value.

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::Group



1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
# File 'lib/oraclebmc/identity/identity_client.rb', line 1662

def update_group(group_id, update_group_details, opts = {})
  logger.debug "Calling operation IdentityClient#update_group." if logger

  fail "Missing the required parameter 'group_id' when calling update_group." if group_id.nil?
  fail "Missing the required parameter 'update_group_details' when calling update_group." if update_group_details.nil?

  path = "/groups/{groupId}".sub('{groupId}', group_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = @api_client.object_to_http_body(update_group_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::Group')
end

#update_identity_provider(identity_provider_id, update_identity_provider_details, opts = {}) ⇒ Response

Updates the specified identity provider.

Parameters:

  • identity_provider_id (String)

    The OCID of the identity provider.

  • update_identity_provider_details (UpdateIdentityProviderDetails)

    Request object for updating a identity provider.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource&#39;s current etag value.

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::IdentityProvider



1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
# File 'lib/oraclebmc/identity/identity_client.rb', line 1700

def update_identity_provider(identity_provider_id, update_identity_provider_details, opts = {})
  logger.debug "Calling operation IdentityClient#update_identity_provider." if logger

  fail "Missing the required parameter 'identity_provider_id' when calling update_identity_provider." if identity_provider_id.nil?
  fail "Missing the required parameter 'update_identity_provider_details' when calling update_identity_provider." if update_identity_provider_details.nil?

  path = "/identityProviders/{identityProviderId}".sub('{identityProviderId}', identity_provider_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = @api_client.object_to_http_body(update_identity_provider_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::IdentityProvider')
end

#update_idp_group_mapping(identity_provider_id, mapping_id, update_idp_group_mapping_details, opts = {}) ⇒ Response

Updates the specified group mapping.

Parameters:

  • identity_provider_id (String)

    The OCID of the identity provider.

  • mapping_id (String)

    The OCID of the group mapping.

  • update_idp_group_mapping_details (UpdateIdpGroupMappingDetails)

    Request object for updating an identity provider group mapping

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource&#39;s current etag value.

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::IdpGroupMapping



1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
# File 'lib/oraclebmc/identity/identity_client.rb', line 1739

def update_idp_group_mapping(identity_provider_id, mapping_id, update_idp_group_mapping_details, opts = {})
  logger.debug "Calling operation IdentityClient#update_idp_group_mapping." if logger

  fail "Missing the required parameter 'identity_provider_id' when calling update_idp_group_mapping." if identity_provider_id.nil?
  fail "Missing the required parameter 'mapping_id' when calling update_idp_group_mapping." if mapping_id.nil?
  fail "Missing the required parameter 'update_idp_group_mapping_details' when calling update_idp_group_mapping." if update_idp_group_mapping_details.nil?

  path = "/identityProviders/{identityProviderId}/groupMappings/{mappingId}".sub('{identityProviderId}', identity_provider_id.to_s).sub('{mappingId}', mapping_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = @api_client.object_to_http_body(update_idp_group_mapping_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::IdpGroupMapping')
end

#update_policy(policy_id, update_policy_details, opts = {}) ⇒ Response

Updates the specified policy. You can update the description or the policy statements themselves.

Policy changes take effect typically within 10 seconds.

Parameters:

  • policy_id (String)

    The OCID of the policy.

  • update_policy_details (UpdatePolicyDetails)

    Request object for updating a policy.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource&#39;s current etag value.

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::Policy



1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
# File 'lib/oraclebmc/identity/identity_client.rb', line 1781

def update_policy(policy_id, update_policy_details, opts = {})
  logger.debug "Calling operation IdentityClient#update_policy." if logger

  fail "Missing the required parameter 'policy_id' when calling update_policy." if policy_id.nil?
  fail "Missing the required parameter 'update_policy_details' when calling update_policy." if update_policy_details.nil?

  path = "/policies/{policyId}".sub('{policyId}', policy_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = @api_client.object_to_http_body(update_policy_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::Policy')
end

#update_swift_password(user_id, swift_password_id, update_swift_password_details, opts = {}) ⇒ Response

Updates the specified Swift password’s description.

Parameters:

  • user_id (String)

    The OCID of the user.

  • swift_password_id (String)

    The OCID of the Swift password.

  • update_swift_password_details (UpdateSwiftPasswordDetails)

    Request object for updating a Swift password.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource&#39;s current etag value.

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::SwiftPassword



1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
# File 'lib/oraclebmc/identity/identity_client.rb', line 1821

def update_swift_password(user_id, swift_password_id, update_swift_password_details, opts = {})
  logger.debug "Calling operation IdentityClient#update_swift_password." if logger

  fail "Missing the required parameter 'user_id' when calling update_swift_password." if user_id.nil?
  fail "Missing the required parameter 'swift_password_id' when calling update_swift_password." if swift_password_id.nil?
  fail "Missing the required parameter 'update_swift_password_details' when calling update_swift_password." if update_swift_password_details.nil?

  path = "/users/{userId}/swiftPasswords/{swiftPasswordId}".sub('{userId}', user_id.to_s).sub('{swiftPasswordId}', swift_password_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = @api_client.object_to_http_body(update_swift_password_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::SwiftPassword')
end

#update_user(user_id, update_user_details, opts = {}) ⇒ Response

Updates the description of the specified user.

Parameters:

  • user_id (String)

    The OCID of the user.

  • update_user_details (UpdateUserDetails)

    Request object for updating a user.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource&#39;s current etag value.

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::User



1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
# File 'lib/oraclebmc/identity/identity_client.rb', line 1860

def update_user(user_id, update_user_details, opts = {})
  logger.debug "Calling operation IdentityClient#update_user." if logger

  fail "Missing the required parameter 'user_id' when calling update_user." if user_id.nil?
  fail "Missing the required parameter 'update_user_details' when calling update_user." if update_user_details.nil?

  path = "/users/{userId}".sub('{userId}', user_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = @api_client.object_to_http_body(update_user_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::User')
end

#update_user_state(user_id, update_state_details, opts = {}) ⇒ Response

Updates the state of the specified user.

Parameters:

  • user_id (String)

    The OCID of the user.

  • update_state_details (UpdateStateDetails)

    Request object for updating a user state.

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

    the optional parameters

Options Hash (opts):

  • :if_match (String)

    For optimistic concurrency control. In the PUT or DELETE call for a resource, set the ‘if-match` parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource&#39;s current etag value.

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::User



1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
# File 'lib/oraclebmc/identity/identity_client.rb', line 1899

def update_user_state(user_id, update_state_details, opts = {})
  logger.debug "Calling operation IdentityClient#update_user_state." if logger

  fail "Missing the required parameter 'user_id' when calling update_user_state." if user_id.nil?
  fail "Missing the required parameter 'update_state_details' when calling update_user_state." if update_state_details.nil?

  path = "/users/{userId}/state/".sub('{userId}', user_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']

  post_body = @api_client.object_to_http_body(update_state_details)

  return @api_client.call_api(
    :PUT,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::User')
end

#upload_api_key(user_id, create_api_key_details, opts = {}) ⇒ Response

Uploads an API signing key for the specified user.

Every user has permission to use this operation to upload a key for *their own user ID*. An administrator in your organization does not need to write a policy to give users this ability. To compare, administrators who have permission to the tenancy can use this operation to upload a key for any user, including themselves.

Important: Even though you have permission to upload an API key, you might not yet have permission to do much else. If you try calling an operation unrelated to your own credential management (e.g., ‘ListUsers`, `LaunchInstance`) and receive an "unauthorized" error, check with an administrator to confirm which IAM Service group(s) you’re in and what access you have. Also confirm you’re working in the correct compartment.

After you send your request, the new object’s ‘lifecycleState` will temporarily be CREATING. Before using the object, first make sure its `lifecycleState` has changed to ACTIVE.

Parameters:

  • user_id (String)

    The OCID of the user.

  • create_api_key_details (CreateApiKeyDetails)

    Request object for uploading an API key for a user.

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

    the optional parameters

Options Hash (opts):

  • :opc_retry_token (String)

    A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (e.g., if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).

Returns:

  • (Response)

    A Response object with data of type OracleBMC::Identity::Models::ApiKey



1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
# File 'lib/oraclebmc/identity/identity_client.rb', line 1954

def upload_api_key(user_id, create_api_key_details, opts = {})
  logger.debug "Calling operation IdentityClient#upload_api_key." if logger

  fail "Missing the required parameter 'user_id' when calling upload_api_key." if user_id.nil?
  fail "Missing the required parameter 'create_api_key_details' when calling upload_api_key." if create_api_key_details.nil?

  path = "/users/{userId}/apiKeys/".sub('{userId}', user_id.to_s)

  # Query Params
  query_params = {}

  # Header Params
  header_params = {}
  header_params['accept'] = 'application/json'
  header_params['content-type'] = 'application/json'
  header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']

  post_body = @api_client.object_to_http_body(create_api_key_details)

  return @api_client.call_api(
    :POST,
    path,
    endpoint,
    :header_params => header_params,
    :query_params => query_params,
    :body => post_body,
    :return_type => 'OracleBMC::Identity::Models::ApiKey')
end