oci 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.txt +82 -0
- data/README.md +262 -0
- data/lib/oci.rb +25 -0
- data/lib/oci/api_client.rb +389 -0
- data/lib/oci/config.rb +118 -0
- data/lib/oci/config_file_loader.rb +96 -0
- data/lib/oci/core/blockstorage_client.rb +462 -0
- data/lib/oci/core/compute_client.rb +1415 -0
- data/lib/oci/core/core.rb +114 -0
- data/lib/oci/core/models/attach_i_scsi_volume_details.rb +137 -0
- data/lib/oci/core/models/attach_vnic_details.rb +144 -0
- data/lib/oci/core/models/attach_volume_details.rb +165 -0
- data/lib/oci/core/models/capture_console_history_details.rb +120 -0
- data/lib/oci/core/models/console_history.rb +213 -0
- data/lib/oci/core/models/cpe.rb +169 -0
- data/lib/oci/core/models/create_cpe_details.rb +145 -0
- data/lib/oci/core/models/create_cross_connect_details.rb +204 -0
- data/lib/oci/core/models/create_cross_connect_group_details.rb +133 -0
- data/lib/oci/core/models/create_dhcp_details.rb +153 -0
- data/lib/oci/core/models/create_drg_attachment_details.rb +142 -0
- data/lib/oci/core/models/create_drg_details.rb +131 -0
- data/lib/oci/core/models/create_image_details.rb +159 -0
- data/lib/oci/core/models/create_instance_console_connection_details.rb +131 -0
- data/lib/oci/core/models/create_internet_gateway_details.rb +153 -0
- data/lib/oci/core/models/create_ip_sec_connection_details.rb +168 -0
- data/lib/oci/core/models/create_private_ip_details.rb +173 -0
- data/lib/oci/core/models/create_route_table_details.rb +153 -0
- data/lib/oci/core/models/create_security_list_details.rb +164 -0
- data/lib/oci/core/models/create_subnet_details.rb +257 -0
- data/lib/oci/core/models/create_vcn_details.rb +171 -0
- data/lib/oci/core/models/create_virtual_circuit_details.rb +260 -0
- data/lib/oci/core/models/create_vnic_details.rb +214 -0
- data/lib/oci/core/models/create_volume_backup_details.rb +133 -0
- data/lib/oci/core/models/create_volume_details.rb +170 -0
- data/lib/oci/core/models/cross_connect.rb +235 -0
- data/lib/oci/core/models/cross_connect_group.rb +187 -0
- data/lib/oci/core/models/cross_connect_location.rb +134 -0
- data/lib/oci/core/models/cross_connect_mapping.rb +190 -0
- data/lib/oci/core/models/cross_connect_port_speed_shape.rb +137 -0
- data/lib/oci/core/models/cross_connect_status.rb +200 -0
- data/lib/oci/core/models/dhcp_dns_option.rb +171 -0
- data/lib/oci/core/models/dhcp_option.rb +135 -0
- data/lib/oci/core/models/dhcp_options.rb +208 -0
- data/lib/oci/core/models/dhcp_search_domain_option.rb +141 -0
- data/lib/oci/core/models/drg.rb +186 -0
- data/lib/oci/core/models/drg_attachment.rb +208 -0
- data/lib/oci/core/models/egress_security_rule.rb +198 -0
- data/lib/oci/core/models/export_image_details.rb +134 -0
- data/lib/oci/core/models/export_image_via_object_storage_tuple_details.rb +150 -0
- data/lib/oci/core/models/export_image_via_object_storage_uri_details.rb +130 -0
- data/lib/oci/core/models/fast_connect_provider_service.rb +145 -0
- data/lib/oci/core/models/i_scsi_volume_attachment.rb +212 -0
- data/lib/oci/core/models/icmp_options.rb +131 -0
- data/lib/oci/core/models/image.rb +245 -0
- data/lib/oci/core/models/image_source_details.rb +134 -0
- data/lib/oci/core/models/image_source_via_object_storage_tuple_details.rb +150 -0
- data/lib/oci/core/models/image_source_via_object_storage_uri_details.rb +128 -0
- data/lib/oci/core/models/ingress_security_rule.rb +198 -0
- data/lib/oci/core/models/instance.rb +307 -0
- data/lib/oci/core/models/instance_console_connection.rb +193 -0
- data/lib/oci/core/models/instance_credentials.rb +131 -0
- data/lib/oci/core/models/internet_gateway.rb +210 -0
- data/lib/oci/core/models/ip_sec_connection.rb +223 -0
- data/lib/oci/core/models/ip_sec_connection_device_config.rb +153 -0
- data/lib/oci/core/models/ip_sec_connection_device_status.rb +156 -0
- data/lib/oci/core/models/launch_instance_details.rb +336 -0
- data/lib/oci/core/models/letter_of_authority.rb +194 -0
- data/lib/oci/core/models/port_range.rb +133 -0
- data/lib/oci/core/models/private_ip.rb +248 -0
- data/lib/oci/core/models/route_rule.rb +135 -0
- data/lib/oci/core/models/route_table.rb +208 -0
- data/lib/oci/core/models/security_list.rb +219 -0
- data/lib/oci/core/models/shape.rb +122 -0
- data/lib/oci/core/models/subnet.rb +351 -0
- data/lib/oci/core/models/tcp_options.rb +135 -0
- data/lib/oci/core/models/tunnel_config.rb +151 -0
- data/lib/oci/core/models/tunnel_status.rb +178 -0
- data/lib/oci/core/models/udp_options.rb +135 -0
- data/lib/oci/core/models/update_cpe_details.rb +122 -0
- data/lib/oci/core/models/update_cross_connect_details.rb +138 -0
- data/lib/oci/core/models/update_cross_connect_group_details.rb +122 -0
- data/lib/oci/core/models/update_dhcp_details.rb +132 -0
- data/lib/oci/core/models/update_drg_attachment_details.rb +122 -0
- data/lib/oci/core/models/update_drg_details.rb +122 -0
- data/lib/oci/core/models/update_image_details.rb +124 -0
- data/lib/oci/core/models/update_instance_details.rb +124 -0
- data/lib/oci/core/models/update_internet_gateway_details.rb +133 -0
- data/lib/oci/core/models/update_ip_sec_connection_details.rb +122 -0
- data/lib/oci/core/models/update_private_ip_details.rb +157 -0
- data/lib/oci/core/models/update_route_table_details.rb +133 -0
- data/lib/oci/core/models/update_security_list_details.rb +144 -0
- data/lib/oci/core/models/update_subnet_details.rb +122 -0
- data/lib/oci/core/models/update_vcn_details.rb +122 -0
- data/lib/oci/core/models/update_virtual_circuit_details.rb +240 -0
- data/lib/oci/core/models/update_vnic_details.rb +144 -0
- data/lib/oci/core/models/update_volume_backup_details.rb +122 -0
- data/lib/oci/core/models/update_volume_details.rb +122 -0
- data/lib/oci/core/models/vcn.rb +276 -0
- data/lib/oci/core/models/virtual_circuit.rb +395 -0
- data/lib/oci/core/models/virtual_circuit_bandwidth_shape.rb +137 -0
- data/lib/oci/core/models/vnic.rb +287 -0
- data/lib/oci/core/models/vnic_attachment.rb +250 -0
- data/lib/oci/core/models/volume.rb +210 -0
- data/lib/oci/core/models/volume_attachment.rb +246 -0
- data/lib/oci/core/models/volume_backup.rb +235 -0
- data/lib/oci/core/util.rb +1 -0
- data/lib/oci/core/virtual_network_client.rb +3421 -0
- data/lib/oci/errors.rb +78 -0
- data/lib/oci/global_context.rb +20 -0
- data/lib/oci/identity/identity.rb +55 -0
- data/lib/oci/identity/identity_client.rb +2148 -0
- data/lib/oci/identity/models/add_user_to_group_details.rb +131 -0
- data/lib/oci/identity/models/api_key.rb +211 -0
- data/lib/oci/identity/models/availability_domain.rb +131 -0
- data/lib/oci/identity/models/compartment.rb +211 -0
- data/lib/oci/identity/models/create_api_key_details.rb +120 -0
- data/lib/oci/identity/models/create_compartment_details.rb +145 -0
- data/lib/oci/identity/models/create_customer_secret_key_details.rb +121 -0
- data/lib/oci/identity/models/create_group_details.rb +144 -0
- data/lib/oci/identity/models/create_identity_provider_details.rb +215 -0
- data/lib/oci/identity/models/create_idp_group_mapping_details.rb +133 -0
- data/lib/oci/identity/models/create_policy_details.rb +173 -0
- data/lib/oci/identity/models/create_region_subscription_details.rb +128 -0
- data/lib/oci/identity/models/create_saml2_identity_provider_details.rb +154 -0
- data/lib/oci/identity/models/create_swift_password_details.rb +121 -0
- data/lib/oci/identity/models/create_user_details.rb +144 -0
- data/lib/oci/identity/models/customer_secret_key.rb +225 -0
- data/lib/oci/identity/models/customer_secret_key_summary.rb +213 -0
- data/lib/oci/identity/models/group.rb +211 -0
- data/lib/oci/identity/models/identity_provider.rb +261 -0
- data/lib/oci/identity/models/idp_group_mapping.rb +220 -0
- data/lib/oci/identity/models/policy.rb +237 -0
- data/lib/oci/identity/models/region.rb +143 -0
- data/lib/oci/identity/models/region_subscription.rb +180 -0
- data/lib/oci/identity/models/saml2_identity_provider.rb +180 -0
- data/lib/oci/identity/models/swift_password.rb +226 -0
- data/lib/oci/identity/models/tenancy.rb +159 -0
- data/lib/oci/identity/models/ui_password.rb +187 -0
- data/lib/oci/identity/models/update_compartment_details.rb +132 -0
- data/lib/oci/identity/models/update_customer_secret_key_details.rb +120 -0
- data/lib/oci/identity/models/update_group_details.rb +120 -0
- data/lib/oci/identity/models/update_identity_provider_details.rb +160 -0
- data/lib/oci/identity/models/update_idp_group_mapping_details.rb +131 -0
- data/lib/oci/identity/models/update_policy_details.rb +148 -0
- data/lib/oci/identity/models/update_saml2_identity_provider_details.rb +145 -0
- data/lib/oci/identity/models/update_state_details.rb +121 -0
- data/lib/oci/identity/models/update_swift_password_details.rb +120 -0
- data/lib/oci/identity/models/update_user_details.rb +120 -0
- data/lib/oci/identity/models/user.rb +217 -0
- data/lib/oci/identity/models/user_group_membership.rb +209 -0
- data/lib/oci/identity/util.rb +1 -0
- data/lib/oci/internal/internal.rb +10 -0
- data/lib/oci/internal/util.rb +69 -0
- data/lib/oci/load_balancer/load_balancer.rb +51 -0
- data/lib/oci/load_balancer/load_balancer_client.rb +1449 -0
- data/lib/oci/load_balancer/models/backend.rb +220 -0
- data/lib/oci/load_balancer/models/backend_details.rb +206 -0
- data/lib/oci/load_balancer/models/backend_health.rb +158 -0
- data/lib/oci/load_balancer/models/backend_set.rb +182 -0
- data/lib/oci/load_balancer/models/backend_set_details.rb +165 -0
- data/lib/oci/load_balancer/models/backend_set_health.rb +207 -0
- data/lib/oci/load_balancer/models/certificate.rb +169 -0
- data/lib/oci/load_balancer/models/certificate_details.rb +205 -0
- data/lib/oci/load_balancer/models/create_backend_details.rb +206 -0
- data/lib/oci/load_balancer/models/create_backend_set_details.rb +181 -0
- data/lib/oci/load_balancer/models/create_certificate_details.rb +205 -0
- data/lib/oci/load_balancer/models/create_listener_details.rb +175 -0
- data/lib/oci/load_balancer/models/create_load_balancer_details.rb +220 -0
- data/lib/oci/load_balancer/models/health_check_result.rb +183 -0
- data/lib/oci/load_balancer/models/health_checker.rb +224 -0
- data/lib/oci/load_balancer/models/health_checker_details.rb +223 -0
- data/lib/oci/load_balancer/models/ip_address.rb +139 -0
- data/lib/oci/load_balancer/models/listener.rb +174 -0
- data/lib/oci/load_balancer/models/listener_details.rb +160 -0
- data/lib/oci/load_balancer/models/load_balancer.rb +280 -0
- data/lib/oci/load_balancer/models/load_balancer_health.rb +215 -0
- data/lib/oci/load_balancer/models/load_balancer_health_summary.rb +168 -0
- data/lib/oci/load_balancer/models/load_balancer_policy.rb +120 -0
- data/lib/oci/load_balancer/models/load_balancer_protocol.rb +120 -0
- data/lib/oci/load_balancer/models/load_balancer_shape.rb +120 -0
- data/lib/oci/load_balancer/models/session_persistence_configuration_details.rb +141 -0
- data/lib/oci/load_balancer/models/ssl_configuration.rb +155 -0
- data/lib/oci/load_balancer/models/ssl_configuration_details.rb +155 -0
- data/lib/oci/load_balancer/models/update_backend_details.rb +178 -0
- data/lib/oci/load_balancer/models/update_backend_set_details.rb +165 -0
- data/lib/oci/load_balancer/models/update_health_checker_details.rb +222 -0
- data/lib/oci/load_balancer/models/update_listener_details.rb +160 -0
- data/lib/oci/load_balancer/models/update_load_balancer_details.rb +124 -0
- data/lib/oci/load_balancer/models/work_request.rb +229 -0
- data/lib/oci/load_balancer/models/work_request_error.rb +145 -0
- data/lib/oci/load_balancer/util.rb +58 -0
- data/lib/oci/object_storage/models/bucket.rb +216 -0
- data/lib/oci/object_storage/models/bucket_summary.rb +175 -0
- data/lib/oci/object_storage/models/commit_multipart_upload_details.rb +133 -0
- data/lib/oci/object_storage/models/commit_multipart_upload_part_details.rb +131 -0
- data/lib/oci/object_storage/models/create_bucket_details.rb +173 -0
- data/lib/oci/object_storage/models/create_multipart_upload_details.rb +166 -0
- data/lib/oci/object_storage/models/create_preauthenticated_request_details.rb +171 -0
- data/lib/oci/object_storage/models/list_objects.rb +146 -0
- data/lib/oci/object_storage/models/multipart_upload.rb +164 -0
- data/lib/oci/object_storage/models/multipart_upload_part_summary.rb +153 -0
- data/lib/oci/object_storage/models/object_summary.rb +153 -0
- data/lib/oci/object_storage/models/preauthenticated_request.rb +207 -0
- data/lib/oci/object_storage/models/preauthenticated_request_summary.rb +196 -0
- data/lib/oci/object_storage/models/update_bucket_details.rb +171 -0
- data/lib/oci/object_storage/object_storage.rb +30 -0
- data/lib/oci/object_storage/object_storage_client.rb +1185 -0
- data/lib/oci/object_storage/util.rb +1 -0
- data/lib/oci/regions.rb +43 -0
- data/lib/oci/response.rb +80 -0
- data/lib/oci/response_headers.rb +144 -0
- data/lib/oci/signer.rb +157 -0
- data/lib/oci/version.rb +5 -0
- data/lib/oci/waiter.rb +101 -0
- data/lib/oraclebmc.rb +3 -0
- metadata +375 -0
data/lib/oci/errors.rb
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
module OCI
|
|
4
|
+
module Errors
|
|
5
|
+
# The base error for all requests that return error responses from the service.
|
|
6
|
+
class ServiceError < StandardError
|
|
7
|
+
# HTTP status code (such as 200 or 404)
|
|
8
|
+
#
|
|
9
|
+
# @return [Integer]
|
|
10
|
+
attr_reader :status_code
|
|
11
|
+
|
|
12
|
+
# A service-specific error code
|
|
13
|
+
#
|
|
14
|
+
# @return [String]
|
|
15
|
+
attr_reader :service_code
|
|
16
|
+
|
|
17
|
+
# The request ID, taken from the opc-request-id header.
|
|
18
|
+
#
|
|
19
|
+
# @return [String]
|
|
20
|
+
attr_reader :request_id
|
|
21
|
+
|
|
22
|
+
# The error message
|
|
23
|
+
#
|
|
24
|
+
# @return [String]
|
|
25
|
+
attr_reader :message
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def initialize(status_code, service_code, request_id, message)
|
|
29
|
+
# We need to mask the message attribute here as otherwise we use StandardError's
|
|
30
|
+
# implementation, which calls to_s and so referencing "message" in our to_s in
|
|
31
|
+
# this class would go into an infinite loop
|
|
32
|
+
|
|
33
|
+
@message = if message.nil? || message.strip.empty?
|
|
34
|
+
"The service returned error code #{status_code}"
|
|
35
|
+
else
|
|
36
|
+
message.strip
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
super @message
|
|
40
|
+
|
|
41
|
+
@status_code = status_code
|
|
42
|
+
@service_code = service_code
|
|
43
|
+
@request_id = request_id
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def to_s
|
|
47
|
+
"{ 'message': '#{message}', 'status': #{status_code}, " \
|
|
48
|
+
"'code': '#{service_code}', 'opc-request-id': '#{request_id}' }"
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# The base error for all network issues (that is, requests that do not reach the server)
|
|
53
|
+
class NetworkError < StandardError
|
|
54
|
+
# Error code, which is mapped to Net::HTTPResponse's message or exception's message property
|
|
55
|
+
attr_reader :code
|
|
56
|
+
|
|
57
|
+
def initialize(code)
|
|
58
|
+
super 'Request could not be completed due to a network error.'
|
|
59
|
+
@code = code
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Raised when the maximum wait time is exceeded.
|
|
64
|
+
class MaximumWaitTimeExceededError < StandardError; end
|
|
65
|
+
|
|
66
|
+
# Raised when a work request returns as failed while waiting on completion.
|
|
67
|
+
class WorkRequestFailedError < StandardError
|
|
68
|
+
# The failed work request.
|
|
69
|
+
attr_reader :work_request
|
|
70
|
+
|
|
71
|
+
def initialize(work_request)
|
|
72
|
+
# TODO: May also want to include error_details.
|
|
73
|
+
super "Work request failed. ID: #{work_request.id}"
|
|
74
|
+
@work_request = work_request
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
78
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
require_relative 'config_file_loader'
|
|
4
|
+
require_relative 'api_client'
|
|
5
|
+
require_relative 'signer'
|
|
6
|
+
|
|
7
|
+
# Top level module for the Oracle Cloud Infrastructure SDK
|
|
8
|
+
module OCI
|
|
9
|
+
# Gets the global Config, or loads the default config file if a Config has not been set.
|
|
10
|
+
#
|
|
11
|
+
# @return [Config]
|
|
12
|
+
def self.config
|
|
13
|
+
@config ||= ConfigFileLoader.load_config
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Set the global Config
|
|
17
|
+
def self.config=(c)
|
|
18
|
+
@config = c
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
module OCI
|
|
4
|
+
module Identity
|
|
5
|
+
module Models
|
|
6
|
+
end
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
# Require models
|
|
11
|
+
require 'oci/identity/models/add_user_to_group_details'
|
|
12
|
+
require 'oci/identity/models/api_key'
|
|
13
|
+
require 'oci/identity/models/availability_domain'
|
|
14
|
+
require 'oci/identity/models/compartment'
|
|
15
|
+
require 'oci/identity/models/create_api_key_details'
|
|
16
|
+
require 'oci/identity/models/create_compartment_details'
|
|
17
|
+
require 'oci/identity/models/create_customer_secret_key_details'
|
|
18
|
+
require 'oci/identity/models/create_group_details'
|
|
19
|
+
require 'oci/identity/models/create_identity_provider_details'
|
|
20
|
+
require 'oci/identity/models/create_idp_group_mapping_details'
|
|
21
|
+
require 'oci/identity/models/create_policy_details'
|
|
22
|
+
require 'oci/identity/models/create_region_subscription_details'
|
|
23
|
+
require 'oci/identity/models/create_saml2_identity_provider_details'
|
|
24
|
+
require 'oci/identity/models/create_swift_password_details'
|
|
25
|
+
require 'oci/identity/models/create_user_details'
|
|
26
|
+
require 'oci/identity/models/customer_secret_key'
|
|
27
|
+
require 'oci/identity/models/customer_secret_key_summary'
|
|
28
|
+
require 'oci/identity/models/group'
|
|
29
|
+
require 'oci/identity/models/identity_provider'
|
|
30
|
+
require 'oci/identity/models/idp_group_mapping'
|
|
31
|
+
require 'oci/identity/models/policy'
|
|
32
|
+
require 'oci/identity/models/region'
|
|
33
|
+
require 'oci/identity/models/region_subscription'
|
|
34
|
+
require 'oci/identity/models/saml2_identity_provider'
|
|
35
|
+
require 'oci/identity/models/swift_password'
|
|
36
|
+
require 'oci/identity/models/tenancy'
|
|
37
|
+
require 'oci/identity/models/ui_password'
|
|
38
|
+
require 'oci/identity/models/update_compartment_details'
|
|
39
|
+
require 'oci/identity/models/update_customer_secret_key_details'
|
|
40
|
+
require 'oci/identity/models/update_group_details'
|
|
41
|
+
require 'oci/identity/models/update_identity_provider_details'
|
|
42
|
+
require 'oci/identity/models/update_idp_group_mapping_details'
|
|
43
|
+
require 'oci/identity/models/update_policy_details'
|
|
44
|
+
require 'oci/identity/models/update_saml2_identity_provider_details'
|
|
45
|
+
require 'oci/identity/models/update_state_details'
|
|
46
|
+
require 'oci/identity/models/update_swift_password_details'
|
|
47
|
+
require 'oci/identity/models/update_user_details'
|
|
48
|
+
require 'oci/identity/models/user'
|
|
49
|
+
require 'oci/identity/models/user_group_membership'
|
|
50
|
+
|
|
51
|
+
# Require generated clients
|
|
52
|
+
require 'oci/identity/identity_client'
|
|
53
|
+
|
|
54
|
+
# Require service utilities
|
|
55
|
+
require 'oci/identity/util'
|
|
@@ -0,0 +1,2148 @@
|
|
|
1
|
+
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
require "uri"
|
|
4
|
+
require "logger"
|
|
5
|
+
|
|
6
|
+
module OCI
|
|
7
|
+
|
|
8
|
+
class Identity::IdentityClient
|
|
9
|
+
|
|
10
|
+
# Client used to make HTTP requests.
|
|
11
|
+
# @return [OCI::ApiClient]
|
|
12
|
+
attr_reader :api_client
|
|
13
|
+
|
|
14
|
+
# Fully qualified endpoint URL
|
|
15
|
+
# @return [String]
|
|
16
|
+
attr_reader :endpoint
|
|
17
|
+
|
|
18
|
+
# The region, which will usually correspond to a value in {OCI::Regions::REGION_ENUM}.
|
|
19
|
+
# @return [String]
|
|
20
|
+
attr_accessor :region
|
|
21
|
+
|
|
22
|
+
# Creates a new IdentityClient.
|
|
23
|
+
# If a config is not specified, then the global OCI.config will be used.
|
|
24
|
+
#
|
|
25
|
+
# A region must be specified in either the config or the region parameter. If specified
|
|
26
|
+
# in both, then the region parameter will be used.
|
|
27
|
+
#
|
|
28
|
+
# @param [Config] config A Config object.
|
|
29
|
+
# @param [String] region A region used to determine the service endpoint. This will usually
|
|
30
|
+
# correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
|
|
31
|
+
#
|
|
32
|
+
def initialize(config:nil, region:nil)
|
|
33
|
+
config ||= OCI.config
|
|
34
|
+
config.validate
|
|
35
|
+
|
|
36
|
+
signer = Signer.new(config.user, config.fingerprint, config.tenancy, config.key_file, pass_phrase: config.pass_phrase, private_key_content: config.key_content)
|
|
37
|
+
@api_client = ApiClient.new(config, signer)
|
|
38
|
+
|
|
39
|
+
region ||= config.region
|
|
40
|
+
self.region = region
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Set the region that will be used to determine the service endpoint.
|
|
44
|
+
# This will usually correspond to a value in {OCI::Regions::REGION_ENUM},
|
|
45
|
+
# but may be an arbitrary string.
|
|
46
|
+
def region=(r)
|
|
47
|
+
@region = r
|
|
48
|
+
|
|
49
|
+
fail 'A region must be specified.' unless @region
|
|
50
|
+
|
|
51
|
+
@endpoint = OCI::Regions.get_service_endpoint(@region, :IdentityClient) + '/20160918'
|
|
52
|
+
logger.info "IdentityClient endpoint set to '#{endpoint}'." if logger
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# @return [Logger] The logger for this client. May be nil.
|
|
56
|
+
def logger
|
|
57
|
+
@api_client.config.logger
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
# Adds the specified user to the specified group and returns a `UserGroupMembership` object with its own OCID.
|
|
62
|
+
#
|
|
63
|
+
# After you send your request, the new object's `lifecycleState` will temporarily be CREATING. Before using the
|
|
64
|
+
# object, first make sure its `lifecycleState` has changed to ACTIVE.
|
|
65
|
+
#
|
|
66
|
+
# @param [AddUserToGroupDetails] add_user_to_group_details Request object for adding a user to a group.
|
|
67
|
+
# @param [Hash] opts the optional parameters
|
|
68
|
+
# @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
|
|
69
|
+
# server error without risk of executing that same action again. Retry tokens expire after 24
|
|
70
|
+
# hours, but can be invalidated before then due to conflicting operations (e.g., if a resource
|
|
71
|
+
# has been deleted and purged from the system, then a retry of the original creation request
|
|
72
|
+
# may be rejected).
|
|
73
|
+
#
|
|
74
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::UserGroupMembership
|
|
75
|
+
def add_user_to_group(add_user_to_group_details, opts = {})
|
|
76
|
+
logger.debug "Calling operation IdentityClient#add_user_to_group." if logger
|
|
77
|
+
|
|
78
|
+
fail "Missing the required parameter 'add_user_to_group_details' when calling add_user_to_group." if add_user_to_group_details.nil?
|
|
79
|
+
|
|
80
|
+
path = "/userGroupMemberships/"
|
|
81
|
+
|
|
82
|
+
# Query Params
|
|
83
|
+
query_params = {}
|
|
84
|
+
|
|
85
|
+
# Header Params
|
|
86
|
+
header_params = {}
|
|
87
|
+
header_params['accept'] = 'application/json'
|
|
88
|
+
header_params['content-type'] = 'application/json'
|
|
89
|
+
header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
|
|
90
|
+
|
|
91
|
+
post_body = @api_client.object_to_http_body(add_user_to_group_details)
|
|
92
|
+
|
|
93
|
+
return @api_client.call_api(
|
|
94
|
+
:POST,
|
|
95
|
+
path,
|
|
96
|
+
endpoint,
|
|
97
|
+
:header_params => header_params,
|
|
98
|
+
:query_params => query_params,
|
|
99
|
+
:body => post_body,
|
|
100
|
+
:return_type => 'OCI::Identity::Models::UserGroupMembership')
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Creates a new compartment in your tenancy.
|
|
104
|
+
#
|
|
105
|
+
# **Important:** Compartments cannot be renamed or deleted.
|
|
106
|
+
#
|
|
107
|
+
# You must specify your tenancy's OCID as the compartment ID in the request object. Remember that the tenancy
|
|
108
|
+
# is simply the root compartment. For information about OCIDs, see
|
|
109
|
+
# [Resource Identifiers](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
|
|
110
|
+
#
|
|
111
|
+
# You must also specify a *name* for the compartment, which must be unique across all compartments in
|
|
112
|
+
# your tenancy and cannot be changed. You can use this name or the OCID when writing policies that apply
|
|
113
|
+
# to the compartment. For more information about policies, see
|
|
114
|
+
# [How Policies Work](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policies.htm).
|
|
115
|
+
#
|
|
116
|
+
# You must also specify a *description* for the compartment (although it can be an empty string). It does
|
|
117
|
+
# not have to be unique, and you can change it anytime with
|
|
118
|
+
# {#update_compartment update_compartment}.
|
|
119
|
+
#
|
|
120
|
+
# After you send your request, the new object's `lifecycleState` will temporarily be CREATING. Before using the
|
|
121
|
+
# object, first make sure its `lifecycleState` has changed to ACTIVE.
|
|
122
|
+
#
|
|
123
|
+
# @param [CreateCompartmentDetails] create_compartment_details Request object for creating a new compartment.
|
|
124
|
+
# @param [Hash] opts the optional parameters
|
|
125
|
+
# @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
|
|
126
|
+
# server error without risk of executing that same action again. Retry tokens expire after 24
|
|
127
|
+
# hours, but can be invalidated before then due to conflicting operations (e.g., if a resource
|
|
128
|
+
# has been deleted and purged from the system, then a retry of the original creation request
|
|
129
|
+
# may be rejected).
|
|
130
|
+
#
|
|
131
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::Compartment
|
|
132
|
+
def create_compartment(create_compartment_details, opts = {})
|
|
133
|
+
logger.debug "Calling operation IdentityClient#create_compartment." if logger
|
|
134
|
+
|
|
135
|
+
fail "Missing the required parameter 'create_compartment_details' when calling create_compartment." if create_compartment_details.nil?
|
|
136
|
+
|
|
137
|
+
path = "/compartments/"
|
|
138
|
+
|
|
139
|
+
# Query Params
|
|
140
|
+
query_params = {}
|
|
141
|
+
|
|
142
|
+
# Header Params
|
|
143
|
+
header_params = {}
|
|
144
|
+
header_params['accept'] = 'application/json'
|
|
145
|
+
header_params['content-type'] = 'application/json'
|
|
146
|
+
header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
|
|
147
|
+
|
|
148
|
+
post_body = @api_client.object_to_http_body(create_compartment_details)
|
|
149
|
+
|
|
150
|
+
return @api_client.call_api(
|
|
151
|
+
:POST,
|
|
152
|
+
path,
|
|
153
|
+
endpoint,
|
|
154
|
+
:header_params => header_params,
|
|
155
|
+
:query_params => query_params,
|
|
156
|
+
:body => post_body,
|
|
157
|
+
:return_type => 'OCI::Identity::Models::Compartment')
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Creates a new secret key for the specified user. Secret keys are used for authentication with the Object Storage Service's Amazon S3
|
|
161
|
+
# compatible API. For information, see
|
|
162
|
+
# [Managing User Credentials](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Tasks/managingcredentials.htm).
|
|
163
|
+
#
|
|
164
|
+
# You must specify a *description* for the secret key (although it can be an empty string). It does not
|
|
165
|
+
# have to be unique, and you can change it anytime with
|
|
166
|
+
# {#update_customer_secret_key update_customer_secret_key}.
|
|
167
|
+
#
|
|
168
|
+
# Every user has permission to create a secret key for *their own user ID*. An administrator in your organization
|
|
169
|
+
# does not need to write a policy to give users this ability. To compare, administrators who have permission to the
|
|
170
|
+
# tenancy can use this operation to create a secret key for any user, including themselves.
|
|
171
|
+
#
|
|
172
|
+
# @param [CreateCustomerSecretKeyDetails] create_customer_secret_key_details Request object for creating a new secret key.
|
|
173
|
+
# @param [String] user_id The OCID of the user.
|
|
174
|
+
# @param [Hash] opts the optional parameters
|
|
175
|
+
# @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
|
|
176
|
+
# server error without risk of executing that same action again. Retry tokens expire after 24
|
|
177
|
+
# hours, but can be invalidated before then due to conflicting operations (e.g., if a resource
|
|
178
|
+
# has been deleted and purged from the system, then a retry of the original creation request
|
|
179
|
+
# may be rejected).
|
|
180
|
+
#
|
|
181
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::CustomerSecretKey
|
|
182
|
+
def create_customer_secret_key(create_customer_secret_key_details, user_id, opts = {})
|
|
183
|
+
logger.debug "Calling operation IdentityClient#create_customer_secret_key." if logger
|
|
184
|
+
|
|
185
|
+
fail "Missing the required parameter 'create_customer_secret_key_details' when calling create_customer_secret_key." if create_customer_secret_key_details.nil?
|
|
186
|
+
fail "Missing the required parameter 'user_id' when calling create_customer_secret_key." if user_id.nil?
|
|
187
|
+
|
|
188
|
+
path = "/users/{userId}/customerSecretKeys/".sub('{userId}', user_id.to_s)
|
|
189
|
+
|
|
190
|
+
# Query Params
|
|
191
|
+
query_params = {}
|
|
192
|
+
|
|
193
|
+
# Header Params
|
|
194
|
+
header_params = {}
|
|
195
|
+
header_params['accept'] = 'application/json'
|
|
196
|
+
header_params['content-type'] = 'application/json'
|
|
197
|
+
header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
|
|
198
|
+
|
|
199
|
+
post_body = @api_client.object_to_http_body(create_customer_secret_key_details)
|
|
200
|
+
|
|
201
|
+
return @api_client.call_api(
|
|
202
|
+
:POST,
|
|
203
|
+
path,
|
|
204
|
+
endpoint,
|
|
205
|
+
:header_params => header_params,
|
|
206
|
+
:query_params => query_params,
|
|
207
|
+
:body => post_body,
|
|
208
|
+
:return_type => 'OCI::Identity::Models::CustomerSecretKey')
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Creates a new group in your tenancy.
|
|
212
|
+
#
|
|
213
|
+
# You must specify your tenancy's OCID as the compartment ID in the request object (remember that the tenancy
|
|
214
|
+
# is simply the root compartment). Notice that IAM resources (users, groups, compartments, and some policies)
|
|
215
|
+
# reside within the tenancy itself, unlike cloud resources such as compute instances, which typically
|
|
216
|
+
# reside within compartments inside the tenancy. For information about OCIDs, see
|
|
217
|
+
# [Resource Identifiers](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
|
|
218
|
+
#
|
|
219
|
+
# You must also specify a *name* for the group, which must be unique across all groups in your tenancy and
|
|
220
|
+
# cannot be changed. You can use this name or the OCID when writing policies that apply to the group. For more
|
|
221
|
+
# information about policies, see [How Policies Work](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policies.htm).
|
|
222
|
+
#
|
|
223
|
+
# You must also specify a *description* for the group (although it can be an empty string). It does not
|
|
224
|
+
# have to be unique, and you can change it anytime with {#update_group update_group}.
|
|
225
|
+
#
|
|
226
|
+
# After you send your request, the new object's `lifecycleState` will temporarily be CREATING. Before using the
|
|
227
|
+
# object, first make sure its `lifecycleState` has changed to ACTIVE.
|
|
228
|
+
#
|
|
229
|
+
# After creating the group, you need to put users in it and write policies for it.
|
|
230
|
+
# See {#add_user_to_group add_user_to_group} and
|
|
231
|
+
# {#create_policy create_policy}.
|
|
232
|
+
#
|
|
233
|
+
# @param [CreateGroupDetails] create_group_details Request object for creating a new group.
|
|
234
|
+
# @param [Hash] opts the optional parameters
|
|
235
|
+
# @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
|
|
236
|
+
# server error without risk of executing that same action again. Retry tokens expire after 24
|
|
237
|
+
# hours, but can be invalidated before then due to conflicting operations (e.g., if a resource
|
|
238
|
+
# has been deleted and purged from the system, then a retry of the original creation request
|
|
239
|
+
# may be rejected).
|
|
240
|
+
#
|
|
241
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::Group
|
|
242
|
+
def create_group(create_group_details, opts = {})
|
|
243
|
+
logger.debug "Calling operation IdentityClient#create_group." if logger
|
|
244
|
+
|
|
245
|
+
fail "Missing the required parameter 'create_group_details' when calling create_group." if create_group_details.nil?
|
|
246
|
+
|
|
247
|
+
path = "/groups/"
|
|
248
|
+
|
|
249
|
+
# Query Params
|
|
250
|
+
query_params = {}
|
|
251
|
+
|
|
252
|
+
# Header Params
|
|
253
|
+
header_params = {}
|
|
254
|
+
header_params['accept'] = 'application/json'
|
|
255
|
+
header_params['content-type'] = 'application/json'
|
|
256
|
+
header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
|
|
257
|
+
|
|
258
|
+
post_body = @api_client.object_to_http_body(create_group_details)
|
|
259
|
+
|
|
260
|
+
return @api_client.call_api(
|
|
261
|
+
:POST,
|
|
262
|
+
path,
|
|
263
|
+
endpoint,
|
|
264
|
+
:header_params => header_params,
|
|
265
|
+
:query_params => query_params,
|
|
266
|
+
:body => post_body,
|
|
267
|
+
:return_type => 'OCI::Identity::Models::Group')
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
# Creates a new identity provider in your tenancy. For more information, see
|
|
271
|
+
# [Identity Providers and Federation](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/federation.htm).
|
|
272
|
+
#
|
|
273
|
+
# You must specify your tenancy's OCID as the compartment ID in the request object.
|
|
274
|
+
# Remember that the tenancy is simply the root compartment. For information about
|
|
275
|
+
# OCIDs, see [Resource Identifiers](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
|
|
276
|
+
#
|
|
277
|
+
# You must also specify a *name* for the `IdentityProvider`, which must be unique
|
|
278
|
+
# across all `IdentityProvider` objects in your tenancy and cannot be changed.
|
|
279
|
+
#
|
|
280
|
+
# You must also specify a *description* for the `IdentityProvider` (although
|
|
281
|
+
# it can be an empty string). It does not have to be unique, and you can change
|
|
282
|
+
# it anytime with
|
|
283
|
+
# {#update_identity_provider update_identity_provider}.
|
|
284
|
+
#
|
|
285
|
+
# After you send your request, the new object's `lifecycleState` will temporarily
|
|
286
|
+
# be CREATING. Before using the object, first make sure its `lifecycleState` has
|
|
287
|
+
# changed to ACTIVE.
|
|
288
|
+
#
|
|
289
|
+
# @param [CreateIdentityProviderDetails] create_identity_provider_details Request object for creating a new SAML2 identity provider.
|
|
290
|
+
# @param [Hash] opts the optional parameters
|
|
291
|
+
# @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
|
|
292
|
+
# server error without risk of executing that same action again. Retry tokens expire after 24
|
|
293
|
+
# hours, but can be invalidated before then due to conflicting operations (e.g., if a resource
|
|
294
|
+
# has been deleted and purged from the system, then a retry of the original creation request
|
|
295
|
+
# may be rejected).
|
|
296
|
+
#
|
|
297
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::IdentityProvider
|
|
298
|
+
def create_identity_provider(create_identity_provider_details, opts = {})
|
|
299
|
+
logger.debug "Calling operation IdentityClient#create_identity_provider." if logger
|
|
300
|
+
|
|
301
|
+
fail "Missing the required parameter 'create_identity_provider_details' when calling create_identity_provider." if create_identity_provider_details.nil?
|
|
302
|
+
|
|
303
|
+
path = "/identityProviders/"
|
|
304
|
+
|
|
305
|
+
# Query Params
|
|
306
|
+
query_params = {}
|
|
307
|
+
|
|
308
|
+
# Header Params
|
|
309
|
+
header_params = {}
|
|
310
|
+
header_params['accept'] = 'application/json'
|
|
311
|
+
header_params['content-type'] = 'application/json'
|
|
312
|
+
header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
|
|
313
|
+
|
|
314
|
+
post_body = @api_client.object_to_http_body(create_identity_provider_details)
|
|
315
|
+
|
|
316
|
+
return @api_client.call_api(
|
|
317
|
+
:POST,
|
|
318
|
+
path,
|
|
319
|
+
endpoint,
|
|
320
|
+
:header_params => header_params,
|
|
321
|
+
:query_params => query_params,
|
|
322
|
+
:body => post_body,
|
|
323
|
+
:return_type => 'OCI::Identity::Models::IdentityProvider')
|
|
324
|
+
end
|
|
325
|
+
|
|
326
|
+
# Creates a single mapping between an IdP group and an IAM Service
|
|
327
|
+
# {Group}.
|
|
328
|
+
#
|
|
329
|
+
# @param [CreateIdpGroupMappingDetails] create_idp_group_mapping_details Add a mapping from an SAML2.0 identity provider group to a BMC group.
|
|
330
|
+
# @param [String] identity_provider_id The OCID of the identity provider.
|
|
331
|
+
# @param [Hash] opts the optional parameters
|
|
332
|
+
# @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
|
|
333
|
+
# server error without risk of executing that same action again. Retry tokens expire after 24
|
|
334
|
+
# hours, but can be invalidated before then due to conflicting operations (e.g., if a resource
|
|
335
|
+
# has been deleted and purged from the system, then a retry of the original creation request
|
|
336
|
+
# may be rejected).
|
|
337
|
+
#
|
|
338
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::IdpGroupMapping
|
|
339
|
+
def create_idp_group_mapping(create_idp_group_mapping_details, identity_provider_id, opts = {})
|
|
340
|
+
logger.debug "Calling operation IdentityClient#create_idp_group_mapping." if logger
|
|
341
|
+
|
|
342
|
+
fail "Missing the required parameter 'create_idp_group_mapping_details' when calling create_idp_group_mapping." if create_idp_group_mapping_details.nil?
|
|
343
|
+
fail "Missing the required parameter 'identity_provider_id' when calling create_idp_group_mapping." if identity_provider_id.nil?
|
|
344
|
+
|
|
345
|
+
path = "/identityProviders/{identityProviderId}/groupMappings/".sub('{identityProviderId}', identity_provider_id.to_s)
|
|
346
|
+
|
|
347
|
+
# Query Params
|
|
348
|
+
query_params = {}
|
|
349
|
+
|
|
350
|
+
# Header Params
|
|
351
|
+
header_params = {}
|
|
352
|
+
header_params['accept'] = 'application/json'
|
|
353
|
+
header_params['content-type'] = 'application/json'
|
|
354
|
+
header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
|
|
355
|
+
|
|
356
|
+
post_body = @api_client.object_to_http_body(create_idp_group_mapping_details)
|
|
357
|
+
|
|
358
|
+
return @api_client.call_api(
|
|
359
|
+
:POST,
|
|
360
|
+
path,
|
|
361
|
+
endpoint,
|
|
362
|
+
:header_params => header_params,
|
|
363
|
+
:query_params => query_params,
|
|
364
|
+
:body => post_body,
|
|
365
|
+
:return_type => 'OCI::Identity::Models::IdpGroupMapping')
|
|
366
|
+
end
|
|
367
|
+
|
|
368
|
+
# Creates a new Console one-time password for the specified user. For more information about user
|
|
369
|
+
# credentials, see [User Credentials](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/usercredentials.htm).
|
|
370
|
+
#
|
|
371
|
+
# Use this operation after creating a new user, or if a user forgets their password. The new one-time
|
|
372
|
+
# password is returned to you in the response, and you must securely deliver it to the user. They'll
|
|
373
|
+
# be prompted to change this password the next time they sign in to the Console. If they don't change
|
|
374
|
+
# it within 7 days, the password will expire and you'll need to create a new one-time password for the
|
|
375
|
+
# user.
|
|
376
|
+
#
|
|
377
|
+
# **Note:** The user's Console login is the unique name you specified when you created the user
|
|
378
|
+
# (see {#create_user create_user}).
|
|
379
|
+
#
|
|
380
|
+
# @param [String] user_id The OCID of the user.
|
|
381
|
+
# @param [Hash] opts the optional parameters
|
|
382
|
+
# @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
|
|
383
|
+
# server error without risk of executing that same action again. Retry tokens expire after 24
|
|
384
|
+
# hours, but can be invalidated before then due to conflicting operations (e.g., if a resource
|
|
385
|
+
# has been deleted and purged from the system, then a retry of the original creation request
|
|
386
|
+
# may be rejected).
|
|
387
|
+
#
|
|
388
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::UIPassword
|
|
389
|
+
def create_or_reset_ui_password(user_id, opts = {})
|
|
390
|
+
logger.debug "Calling operation IdentityClient#create_or_reset_ui_password." if logger
|
|
391
|
+
|
|
392
|
+
fail "Missing the required parameter 'user_id' when calling create_or_reset_ui_password." if user_id.nil?
|
|
393
|
+
|
|
394
|
+
path = "/users/{userId}/uiPassword".sub('{userId}', user_id.to_s)
|
|
395
|
+
|
|
396
|
+
# Query Params
|
|
397
|
+
query_params = {}
|
|
398
|
+
|
|
399
|
+
# Header Params
|
|
400
|
+
header_params = {}
|
|
401
|
+
header_params['accept'] = 'application/json'
|
|
402
|
+
header_params['content-type'] = 'application/json'
|
|
403
|
+
header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
|
|
404
|
+
|
|
405
|
+
post_body = nil
|
|
406
|
+
|
|
407
|
+
return @api_client.call_api(
|
|
408
|
+
:POST,
|
|
409
|
+
path,
|
|
410
|
+
endpoint,
|
|
411
|
+
:header_params => header_params,
|
|
412
|
+
:query_params => query_params,
|
|
413
|
+
:body => post_body,
|
|
414
|
+
:return_type => 'OCI::Identity::Models::UIPassword')
|
|
415
|
+
end
|
|
416
|
+
|
|
417
|
+
# Creates a new policy in the specified compartment (either the tenancy or another of your compartments).
|
|
418
|
+
# If you're new to policies, see [Getting Started with Policies](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policygetstarted.htm).
|
|
419
|
+
#
|
|
420
|
+
# You must specify a *name* for the policy, which must be unique across all policies in your tenancy
|
|
421
|
+
# and cannot be changed.
|
|
422
|
+
#
|
|
423
|
+
# You must also specify a *description* for the policy (although it can be an empty string). It does not
|
|
424
|
+
# have to be unique, and you can change it anytime with {#update_policy update_policy}.
|
|
425
|
+
#
|
|
426
|
+
# You must specify one or more policy statements in the statements array. For information about writing
|
|
427
|
+
# policies, see [How Policies Work](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/policies.htm) and
|
|
428
|
+
# [Common Policies](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/commonpolicies.htm).
|
|
429
|
+
#
|
|
430
|
+
# After you send your request, the new object's `lifecycleState` will temporarily be CREATING. Before using the
|
|
431
|
+
# object, first make sure its `lifecycleState` has changed to ACTIVE.
|
|
432
|
+
#
|
|
433
|
+
# New policies take effect typically within 10 seconds.
|
|
434
|
+
#
|
|
435
|
+
# @param [CreatePolicyDetails] create_policy_details Request object for creating a new policy.
|
|
436
|
+
# @param [Hash] opts the optional parameters
|
|
437
|
+
# @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
|
|
438
|
+
# server error without risk of executing that same action again. Retry tokens expire after 24
|
|
439
|
+
# hours, but can be invalidated before then due to conflicting operations (e.g., if a resource
|
|
440
|
+
# has been deleted and purged from the system, then a retry of the original creation request
|
|
441
|
+
# may be rejected).
|
|
442
|
+
#
|
|
443
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::Policy
|
|
444
|
+
def create_policy(create_policy_details, opts = {})
|
|
445
|
+
logger.debug "Calling operation IdentityClient#create_policy." if logger
|
|
446
|
+
|
|
447
|
+
fail "Missing the required parameter 'create_policy_details' when calling create_policy." if create_policy_details.nil?
|
|
448
|
+
|
|
449
|
+
path = "/policies/"
|
|
450
|
+
|
|
451
|
+
# Query Params
|
|
452
|
+
query_params = {}
|
|
453
|
+
|
|
454
|
+
# Header Params
|
|
455
|
+
header_params = {}
|
|
456
|
+
header_params['accept'] = 'application/json'
|
|
457
|
+
header_params['content-type'] = 'application/json'
|
|
458
|
+
header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
|
|
459
|
+
|
|
460
|
+
post_body = @api_client.object_to_http_body(create_policy_details)
|
|
461
|
+
|
|
462
|
+
return @api_client.call_api(
|
|
463
|
+
:POST,
|
|
464
|
+
path,
|
|
465
|
+
endpoint,
|
|
466
|
+
:header_params => header_params,
|
|
467
|
+
:query_params => query_params,
|
|
468
|
+
:body => post_body,
|
|
469
|
+
:return_type => 'OCI::Identity::Models::Policy')
|
|
470
|
+
end
|
|
471
|
+
|
|
472
|
+
# Creates a subscription to a region for a tenancy.
|
|
473
|
+
#
|
|
474
|
+
# @param [CreateRegionSubscriptionDetails] create_region_subscription_details Request object for activate a new region.
|
|
475
|
+
# @param [String] tenancy_id The OCID of the tenancy.
|
|
476
|
+
# @param [Hash] opts the optional parameters
|
|
477
|
+
# @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
|
|
478
|
+
# server error without risk of executing that same action again. Retry tokens expire after 24
|
|
479
|
+
# hours, but can be invalidated before then due to conflicting operations (e.g., if a resource
|
|
480
|
+
# has been deleted and purged from the system, then a retry of the original creation request
|
|
481
|
+
# may be rejected).
|
|
482
|
+
#
|
|
483
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::RegionSubscription
|
|
484
|
+
def create_region_subscription(create_region_subscription_details, tenancy_id, opts = {})
|
|
485
|
+
logger.debug "Calling operation IdentityClient#create_region_subscription." if logger
|
|
486
|
+
|
|
487
|
+
fail "Missing the required parameter 'create_region_subscription_details' when calling create_region_subscription." if create_region_subscription_details.nil?
|
|
488
|
+
fail "Missing the required parameter 'tenancy_id' when calling create_region_subscription." if tenancy_id.nil?
|
|
489
|
+
|
|
490
|
+
path = "/tenancies/{tenancyId}/regionSubscriptions".sub('{tenancyId}', tenancy_id.to_s)
|
|
491
|
+
|
|
492
|
+
# Query Params
|
|
493
|
+
query_params = {}
|
|
494
|
+
|
|
495
|
+
# Header Params
|
|
496
|
+
header_params = {}
|
|
497
|
+
header_params['accept'] = 'application/json'
|
|
498
|
+
header_params['content-type'] = 'application/json'
|
|
499
|
+
header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
|
|
500
|
+
|
|
501
|
+
post_body = @api_client.object_to_http_body(create_region_subscription_details)
|
|
502
|
+
|
|
503
|
+
return @api_client.call_api(
|
|
504
|
+
:POST,
|
|
505
|
+
path,
|
|
506
|
+
endpoint,
|
|
507
|
+
:header_params => header_params,
|
|
508
|
+
:query_params => query_params,
|
|
509
|
+
:body => post_body,
|
|
510
|
+
:return_type => 'OCI::Identity::Models::RegionSubscription')
|
|
511
|
+
end
|
|
512
|
+
|
|
513
|
+
# Creates a new Swift password for the specified user. For information about what Swift passwords are for, see
|
|
514
|
+
# [Managing User Credentials](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Tasks/managingcredentials.htm).
|
|
515
|
+
#
|
|
516
|
+
# You must specify a *description* for the Swift password (although it can be an empty string). It does not
|
|
517
|
+
# have to be unique, and you can change it anytime with
|
|
518
|
+
# {#update_swift_password update_swift_password}.
|
|
519
|
+
#
|
|
520
|
+
# Every user has permission to create a Swift password for *their own user ID*. An administrator in your organization
|
|
521
|
+
# does not need to write a policy to give users this ability. To compare, administrators who have permission to the
|
|
522
|
+
# tenancy can use this operation to create a Swift password for any user, including themselves.
|
|
523
|
+
#
|
|
524
|
+
# @param [CreateSwiftPasswordDetails] create_swift_password_details Request object for creating a new swift password.
|
|
525
|
+
# @param [String] user_id The OCID of the user.
|
|
526
|
+
# @param [Hash] opts the optional parameters
|
|
527
|
+
# @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
|
|
528
|
+
# server error without risk of executing that same action again. Retry tokens expire after 24
|
|
529
|
+
# hours, but can be invalidated before then due to conflicting operations (e.g., if a resource
|
|
530
|
+
# has been deleted and purged from the system, then a retry of the original creation request
|
|
531
|
+
# may be rejected).
|
|
532
|
+
#
|
|
533
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::SwiftPassword
|
|
534
|
+
def create_swift_password(create_swift_password_details, user_id, opts = {})
|
|
535
|
+
logger.debug "Calling operation IdentityClient#create_swift_password." if logger
|
|
536
|
+
|
|
537
|
+
fail "Missing the required parameter 'create_swift_password_details' when calling create_swift_password." if create_swift_password_details.nil?
|
|
538
|
+
fail "Missing the required parameter 'user_id' when calling create_swift_password." if user_id.nil?
|
|
539
|
+
|
|
540
|
+
path = "/users/{userId}/swiftPasswords/".sub('{userId}', user_id.to_s)
|
|
541
|
+
|
|
542
|
+
# Query Params
|
|
543
|
+
query_params = {}
|
|
544
|
+
|
|
545
|
+
# Header Params
|
|
546
|
+
header_params = {}
|
|
547
|
+
header_params['accept'] = 'application/json'
|
|
548
|
+
header_params['content-type'] = 'application/json'
|
|
549
|
+
header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
|
|
550
|
+
|
|
551
|
+
post_body = @api_client.object_to_http_body(create_swift_password_details)
|
|
552
|
+
|
|
553
|
+
return @api_client.call_api(
|
|
554
|
+
:POST,
|
|
555
|
+
path,
|
|
556
|
+
endpoint,
|
|
557
|
+
:header_params => header_params,
|
|
558
|
+
:query_params => query_params,
|
|
559
|
+
:body => post_body,
|
|
560
|
+
:return_type => 'OCI::Identity::Models::SwiftPassword')
|
|
561
|
+
end
|
|
562
|
+
|
|
563
|
+
# Creates a new user in your tenancy. For conceptual information about users, your tenancy, and other
|
|
564
|
+
# IAM Service components, see [Overview of the IAM Service](https://docs.us-phoenix-1.oraclecloud.com/Content/Identity/Concepts/overview.htm).
|
|
565
|
+
#
|
|
566
|
+
# You must specify your tenancy's OCID as the compartment ID in the request object (remember that the
|
|
567
|
+
# tenancy is simply the root compartment). Notice that IAM resources (users, groups, compartments, and
|
|
568
|
+
# some policies) reside within the tenancy itself, unlike cloud resources such as compute instances,
|
|
569
|
+
# which typically reside within compartments inside the tenancy. For information about OCIDs, see
|
|
570
|
+
# [Resource Identifiers](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
|
|
571
|
+
#
|
|
572
|
+
# You must also specify a *name* for the user, which must be unique across all users in your tenancy
|
|
573
|
+
# and cannot be changed. Allowed characters: No spaces. Only letters, numerals, hyphens, periods,
|
|
574
|
+
# underscores, +, and @. If you specify a name that's already in use, you'll get a 409 error.
|
|
575
|
+
# This name will be the user's login to the Console. You might want to pick a
|
|
576
|
+
# name that your company's own identity system (e.g., Active Directory, LDAP, etc.) already uses.
|
|
577
|
+
# If you delete a user and then create a new user with the same name, they'll be considered different
|
|
578
|
+
# users because they have different OCIDs.
|
|
579
|
+
#
|
|
580
|
+
# You must also specify a *description* for the user (although it can be an empty string).
|
|
581
|
+
# It does not have to be unique, and you can change it anytime with
|
|
582
|
+
# {#update_user update_user}. You can use the field to provide the user's
|
|
583
|
+
# full name, a description, a nickname, or other information to generally identify the user.
|
|
584
|
+
#
|
|
585
|
+
# After you send your request, the new object's `lifecycleState` will temporarily be CREATING. Before
|
|
586
|
+
# using the object, first make sure its `lifecycleState` has changed to ACTIVE.
|
|
587
|
+
#
|
|
588
|
+
# A new user has no permissions until you place the user in one or more groups (see
|
|
589
|
+
# {#add_user_to_group add_user_to_group}). If the user needs to
|
|
590
|
+
# access the Console, you need to provide the user a password (see
|
|
591
|
+
# {#create_or_reset_ui_password create_or_reset_ui_password}).
|
|
592
|
+
# If the user needs to access the Oracle Bare Metal Cloud Services REST API, you need to upload a
|
|
593
|
+
# public API signing key for that user (see
|
|
594
|
+
# [Required Keys and OCIDs](https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm) and also
|
|
595
|
+
# {#upload_api_key upload_api_key}).
|
|
596
|
+
#
|
|
597
|
+
# **Important:** Make sure to inform the new user which compartment(s) they have access to.
|
|
598
|
+
#
|
|
599
|
+
# @param [CreateUserDetails] create_user_details Request object for creating a new user.
|
|
600
|
+
# @param [Hash] opts the optional parameters
|
|
601
|
+
# @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
|
|
602
|
+
# server error without risk of executing that same action again. Retry tokens expire after 24
|
|
603
|
+
# hours, but can be invalidated before then due to conflicting operations (e.g., if a resource
|
|
604
|
+
# has been deleted and purged from the system, then a retry of the original creation request
|
|
605
|
+
# may be rejected).
|
|
606
|
+
#
|
|
607
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::User
|
|
608
|
+
def create_user(create_user_details, opts = {})
|
|
609
|
+
logger.debug "Calling operation IdentityClient#create_user." if logger
|
|
610
|
+
|
|
611
|
+
fail "Missing the required parameter 'create_user_details' when calling create_user." if create_user_details.nil?
|
|
612
|
+
|
|
613
|
+
path = "/users/"
|
|
614
|
+
|
|
615
|
+
# Query Params
|
|
616
|
+
query_params = {}
|
|
617
|
+
|
|
618
|
+
# Header Params
|
|
619
|
+
header_params = {}
|
|
620
|
+
header_params['accept'] = 'application/json'
|
|
621
|
+
header_params['content-type'] = 'application/json'
|
|
622
|
+
header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
|
|
623
|
+
|
|
624
|
+
post_body = @api_client.object_to_http_body(create_user_details)
|
|
625
|
+
|
|
626
|
+
return @api_client.call_api(
|
|
627
|
+
:POST,
|
|
628
|
+
path,
|
|
629
|
+
endpoint,
|
|
630
|
+
:header_params => header_params,
|
|
631
|
+
:query_params => query_params,
|
|
632
|
+
:body => post_body,
|
|
633
|
+
:return_type => 'OCI::Identity::Models::User')
|
|
634
|
+
end
|
|
635
|
+
|
|
636
|
+
# Deletes the specified API signing key for the specified user.
|
|
637
|
+
#
|
|
638
|
+
# Every user has permission to use this operation to delete a key for *their own user ID*. An
|
|
639
|
+
# administrator in your organization does not need to write a policy to give users this ability.
|
|
640
|
+
# To compare, administrators who have permission to the tenancy can use this operation to delete
|
|
641
|
+
# a key for any user, including themselves.
|
|
642
|
+
#
|
|
643
|
+
# @param [String] user_id The OCID of the user.
|
|
644
|
+
# @param [String] fingerprint The key's fingerprint.
|
|
645
|
+
# @param [Hash] opts the optional parameters
|
|
646
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
|
|
647
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
648
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
649
|
+
#
|
|
650
|
+
# @return [Response] A Response object with data of type nil
|
|
651
|
+
def delete_api_key(user_id, fingerprint, opts = {})
|
|
652
|
+
logger.debug "Calling operation IdentityClient#delete_api_key." if logger
|
|
653
|
+
|
|
654
|
+
fail "Missing the required parameter 'user_id' when calling delete_api_key." if user_id.nil?
|
|
655
|
+
fail "Missing the required parameter 'fingerprint' when calling delete_api_key." if fingerprint.nil?
|
|
656
|
+
|
|
657
|
+
path = "/users/{userId}/apiKeys/{fingerprint}".sub('{userId}', user_id.to_s).sub('{fingerprint}', fingerprint.to_s)
|
|
658
|
+
|
|
659
|
+
# Query Params
|
|
660
|
+
query_params = {}
|
|
661
|
+
|
|
662
|
+
# Header Params
|
|
663
|
+
header_params = {}
|
|
664
|
+
header_params['accept'] = 'application/json'
|
|
665
|
+
header_params['content-type'] = 'application/json'
|
|
666
|
+
header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
|
|
667
|
+
|
|
668
|
+
post_body = nil
|
|
669
|
+
|
|
670
|
+
return @api_client.call_api(
|
|
671
|
+
:DELETE,
|
|
672
|
+
path,
|
|
673
|
+
endpoint,
|
|
674
|
+
:header_params => header_params,
|
|
675
|
+
:query_params => query_params,
|
|
676
|
+
:body => post_body)
|
|
677
|
+
end
|
|
678
|
+
|
|
679
|
+
# Deletes the specified secret key for the specified user.
|
|
680
|
+
#
|
|
681
|
+
# @param [String] user_id The OCID of the user.
|
|
682
|
+
# @param [String] customer_secret_key_id The OCID of the secret key.
|
|
683
|
+
# @param [Hash] opts the optional parameters
|
|
684
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
|
|
685
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
686
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
687
|
+
#
|
|
688
|
+
# @return [Response] A Response object with data of type nil
|
|
689
|
+
def delete_customer_secret_key(user_id, customer_secret_key_id, opts = {})
|
|
690
|
+
logger.debug "Calling operation IdentityClient#delete_customer_secret_key." if logger
|
|
691
|
+
|
|
692
|
+
fail "Missing the required parameter 'user_id' when calling delete_customer_secret_key." if user_id.nil?
|
|
693
|
+
fail "Missing the required parameter 'customer_secret_key_id' when calling delete_customer_secret_key." if customer_secret_key_id.nil?
|
|
694
|
+
|
|
695
|
+
path = "/users/{userId}/customerSecretKeys/{customerSecretKeyId}".sub('{userId}', user_id.to_s).sub('{customerSecretKeyId}', customer_secret_key_id.to_s)
|
|
696
|
+
|
|
697
|
+
# Query Params
|
|
698
|
+
query_params = {}
|
|
699
|
+
|
|
700
|
+
# Header Params
|
|
701
|
+
header_params = {}
|
|
702
|
+
header_params['accept'] = 'application/json'
|
|
703
|
+
header_params['content-type'] = 'application/json'
|
|
704
|
+
header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
|
|
705
|
+
|
|
706
|
+
post_body = nil
|
|
707
|
+
|
|
708
|
+
return @api_client.call_api(
|
|
709
|
+
:DELETE,
|
|
710
|
+
path,
|
|
711
|
+
endpoint,
|
|
712
|
+
:header_params => header_params,
|
|
713
|
+
:query_params => query_params,
|
|
714
|
+
:body => post_body)
|
|
715
|
+
end
|
|
716
|
+
|
|
717
|
+
# Deletes the specified group. The group must be empty.
|
|
718
|
+
#
|
|
719
|
+
# @param [String] group_id The OCID of the group.
|
|
720
|
+
# @param [Hash] opts the optional parameters
|
|
721
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
|
|
722
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
723
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
724
|
+
#
|
|
725
|
+
# @return [Response] A Response object with data of type nil
|
|
726
|
+
def delete_group(group_id, opts = {})
|
|
727
|
+
logger.debug "Calling operation IdentityClient#delete_group." if logger
|
|
728
|
+
|
|
729
|
+
fail "Missing the required parameter 'group_id' when calling delete_group." if group_id.nil?
|
|
730
|
+
|
|
731
|
+
path = "/groups/{groupId}".sub('{groupId}', group_id.to_s)
|
|
732
|
+
|
|
733
|
+
# Query Params
|
|
734
|
+
query_params = {}
|
|
735
|
+
|
|
736
|
+
# Header Params
|
|
737
|
+
header_params = {}
|
|
738
|
+
header_params['accept'] = 'application/json'
|
|
739
|
+
header_params['content-type'] = 'application/json'
|
|
740
|
+
header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
|
|
741
|
+
|
|
742
|
+
post_body = nil
|
|
743
|
+
|
|
744
|
+
return @api_client.call_api(
|
|
745
|
+
:DELETE,
|
|
746
|
+
path,
|
|
747
|
+
endpoint,
|
|
748
|
+
:header_params => header_params,
|
|
749
|
+
:query_params => query_params,
|
|
750
|
+
:body => post_body)
|
|
751
|
+
end
|
|
752
|
+
|
|
753
|
+
# Deletes the specified identity provider. The identity provider must not have
|
|
754
|
+
# any group mappings (see {IdpGroupMapping}).
|
|
755
|
+
#
|
|
756
|
+
# @param [String] identity_provider_id The OCID of the identity provider.
|
|
757
|
+
# @param [Hash] opts the optional parameters
|
|
758
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
|
|
759
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
760
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
761
|
+
#
|
|
762
|
+
# @return [Response] A Response object with data of type nil
|
|
763
|
+
def delete_identity_provider(identity_provider_id, opts = {})
|
|
764
|
+
logger.debug "Calling operation IdentityClient#delete_identity_provider." if logger
|
|
765
|
+
|
|
766
|
+
fail "Missing the required parameter 'identity_provider_id' when calling delete_identity_provider." if identity_provider_id.nil?
|
|
767
|
+
|
|
768
|
+
path = "/identityProviders/{identityProviderId}".sub('{identityProviderId}', identity_provider_id.to_s)
|
|
769
|
+
|
|
770
|
+
# Query Params
|
|
771
|
+
query_params = {}
|
|
772
|
+
|
|
773
|
+
# Header Params
|
|
774
|
+
header_params = {}
|
|
775
|
+
header_params['accept'] = 'application/json'
|
|
776
|
+
header_params['content-type'] = 'application/json'
|
|
777
|
+
header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
|
|
778
|
+
|
|
779
|
+
post_body = nil
|
|
780
|
+
|
|
781
|
+
return @api_client.call_api(
|
|
782
|
+
:DELETE,
|
|
783
|
+
path,
|
|
784
|
+
endpoint,
|
|
785
|
+
:header_params => header_params,
|
|
786
|
+
:query_params => query_params,
|
|
787
|
+
:body => post_body)
|
|
788
|
+
end
|
|
789
|
+
|
|
790
|
+
# Deletes the specified group mapping.
|
|
791
|
+
# @param [String] identity_provider_id The OCID of the identity provider.
|
|
792
|
+
# @param [String] mapping_id The OCID of the group mapping.
|
|
793
|
+
# @param [Hash] opts the optional parameters
|
|
794
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
|
|
795
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
796
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
797
|
+
#
|
|
798
|
+
# @return [Response] A Response object with data of type nil
|
|
799
|
+
def delete_idp_group_mapping(identity_provider_id, mapping_id, opts = {})
|
|
800
|
+
logger.debug "Calling operation IdentityClient#delete_idp_group_mapping." if logger
|
|
801
|
+
|
|
802
|
+
fail "Missing the required parameter 'identity_provider_id' when calling delete_idp_group_mapping." if identity_provider_id.nil?
|
|
803
|
+
fail "Missing the required parameter 'mapping_id' when calling delete_idp_group_mapping." if mapping_id.nil?
|
|
804
|
+
|
|
805
|
+
path = "/identityProviders/{identityProviderId}/groupMappings/{mappingId}".sub('{identityProviderId}', identity_provider_id.to_s).sub('{mappingId}', mapping_id.to_s)
|
|
806
|
+
|
|
807
|
+
# Query Params
|
|
808
|
+
query_params = {}
|
|
809
|
+
|
|
810
|
+
# Header Params
|
|
811
|
+
header_params = {}
|
|
812
|
+
header_params['accept'] = 'application/json'
|
|
813
|
+
header_params['content-type'] = 'application/json'
|
|
814
|
+
header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
|
|
815
|
+
|
|
816
|
+
post_body = nil
|
|
817
|
+
|
|
818
|
+
return @api_client.call_api(
|
|
819
|
+
:DELETE,
|
|
820
|
+
path,
|
|
821
|
+
endpoint,
|
|
822
|
+
:header_params => header_params,
|
|
823
|
+
:query_params => query_params,
|
|
824
|
+
:body => post_body)
|
|
825
|
+
end
|
|
826
|
+
|
|
827
|
+
# Deletes the specified policy. The deletion takes effect typically within 10 seconds.
|
|
828
|
+
# @param [String] policy_id The OCID of the policy.
|
|
829
|
+
# @param [Hash] opts the optional parameters
|
|
830
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
|
|
831
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
832
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
833
|
+
#
|
|
834
|
+
# @return [Response] A Response object with data of type nil
|
|
835
|
+
def delete_policy(policy_id, opts = {})
|
|
836
|
+
logger.debug "Calling operation IdentityClient#delete_policy." if logger
|
|
837
|
+
|
|
838
|
+
fail "Missing the required parameter 'policy_id' when calling delete_policy." if policy_id.nil?
|
|
839
|
+
|
|
840
|
+
path = "/policies/{policyId}".sub('{policyId}', policy_id.to_s)
|
|
841
|
+
|
|
842
|
+
# Query Params
|
|
843
|
+
query_params = {}
|
|
844
|
+
|
|
845
|
+
# Header Params
|
|
846
|
+
header_params = {}
|
|
847
|
+
header_params['accept'] = 'application/json'
|
|
848
|
+
header_params['content-type'] = 'application/json'
|
|
849
|
+
header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
|
|
850
|
+
|
|
851
|
+
post_body = nil
|
|
852
|
+
|
|
853
|
+
return @api_client.call_api(
|
|
854
|
+
:DELETE,
|
|
855
|
+
path,
|
|
856
|
+
endpoint,
|
|
857
|
+
:header_params => header_params,
|
|
858
|
+
:query_params => query_params,
|
|
859
|
+
:body => post_body)
|
|
860
|
+
end
|
|
861
|
+
|
|
862
|
+
# Deletes the specified Swift password for the specified user.
|
|
863
|
+
#
|
|
864
|
+
# @param [String] user_id The OCID of the user.
|
|
865
|
+
# @param [String] swift_password_id The OCID of the Swift password.
|
|
866
|
+
# @param [Hash] opts the optional parameters
|
|
867
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
|
|
868
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
869
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
870
|
+
#
|
|
871
|
+
# @return [Response] A Response object with data of type nil
|
|
872
|
+
def delete_swift_password(user_id, swift_password_id, opts = {})
|
|
873
|
+
logger.debug "Calling operation IdentityClient#delete_swift_password." if logger
|
|
874
|
+
|
|
875
|
+
fail "Missing the required parameter 'user_id' when calling delete_swift_password." if user_id.nil?
|
|
876
|
+
fail "Missing the required parameter 'swift_password_id' when calling delete_swift_password." if swift_password_id.nil?
|
|
877
|
+
|
|
878
|
+
path = "/users/{userId}/swiftPasswords/{swiftPasswordId}".sub('{userId}', user_id.to_s).sub('{swiftPasswordId}', swift_password_id.to_s)
|
|
879
|
+
|
|
880
|
+
# Query Params
|
|
881
|
+
query_params = {}
|
|
882
|
+
|
|
883
|
+
# Header Params
|
|
884
|
+
header_params = {}
|
|
885
|
+
header_params['accept'] = 'application/json'
|
|
886
|
+
header_params['content-type'] = 'application/json'
|
|
887
|
+
header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
|
|
888
|
+
|
|
889
|
+
post_body = nil
|
|
890
|
+
|
|
891
|
+
return @api_client.call_api(
|
|
892
|
+
:DELETE,
|
|
893
|
+
path,
|
|
894
|
+
endpoint,
|
|
895
|
+
:header_params => header_params,
|
|
896
|
+
:query_params => query_params,
|
|
897
|
+
:body => post_body)
|
|
898
|
+
end
|
|
899
|
+
|
|
900
|
+
# Deletes the specified user. The user must not be in any groups.
|
|
901
|
+
# @param [String] user_id The OCID of the user.
|
|
902
|
+
# @param [Hash] opts the optional parameters
|
|
903
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
|
|
904
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
905
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
906
|
+
#
|
|
907
|
+
# @return [Response] A Response object with data of type nil
|
|
908
|
+
def delete_user(user_id, opts = {})
|
|
909
|
+
logger.debug "Calling operation IdentityClient#delete_user." if logger
|
|
910
|
+
|
|
911
|
+
fail "Missing the required parameter 'user_id' when calling delete_user." if user_id.nil?
|
|
912
|
+
|
|
913
|
+
path = "/users/{userId}".sub('{userId}', user_id.to_s)
|
|
914
|
+
|
|
915
|
+
# Query Params
|
|
916
|
+
query_params = {}
|
|
917
|
+
|
|
918
|
+
# Header Params
|
|
919
|
+
header_params = {}
|
|
920
|
+
header_params['accept'] = 'application/json'
|
|
921
|
+
header_params['content-type'] = 'application/json'
|
|
922
|
+
header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
|
|
923
|
+
|
|
924
|
+
post_body = nil
|
|
925
|
+
|
|
926
|
+
return @api_client.call_api(
|
|
927
|
+
:DELETE,
|
|
928
|
+
path,
|
|
929
|
+
endpoint,
|
|
930
|
+
:header_params => header_params,
|
|
931
|
+
:query_params => query_params,
|
|
932
|
+
:body => post_body)
|
|
933
|
+
end
|
|
934
|
+
|
|
935
|
+
# Gets the specified compartment's information.
|
|
936
|
+
#
|
|
937
|
+
# This operation does not return a list of all the resources inside the compartment. There is no single
|
|
938
|
+
# API operation that does that. Compartments can contain multiple types of resources (instances, block
|
|
939
|
+
# storage volumes, etc.). To find out what's in a compartment, you must call the \"List\" operation for
|
|
940
|
+
# each resource type and specify the compartment's OCID as a query parameter in the request. For example,
|
|
941
|
+
# call the {#list_instances list_instances} operation in the Cloud Compute
|
|
942
|
+
# Service or the {#list_volumes list_volumes} operation in Cloud Block Storage.
|
|
943
|
+
#
|
|
944
|
+
# @param [String] compartment_id The OCID of the compartment.
|
|
945
|
+
# @param [Hash] opts the optional parameters
|
|
946
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::Compartment
|
|
947
|
+
def get_compartment(compartment_id, opts = {})
|
|
948
|
+
logger.debug "Calling operation IdentityClient#get_compartment." if logger
|
|
949
|
+
|
|
950
|
+
fail "Missing the required parameter 'compartment_id' when calling get_compartment." if compartment_id.nil?
|
|
951
|
+
|
|
952
|
+
path = "/compartments/{compartmentId}".sub('{compartmentId}', compartment_id.to_s)
|
|
953
|
+
|
|
954
|
+
# Query Params
|
|
955
|
+
query_params = {}
|
|
956
|
+
|
|
957
|
+
# Header Params
|
|
958
|
+
header_params = {}
|
|
959
|
+
header_params['accept'] = 'application/json'
|
|
960
|
+
header_params['content-type'] = 'application/json'
|
|
961
|
+
|
|
962
|
+
post_body = nil
|
|
963
|
+
|
|
964
|
+
return @api_client.call_api(
|
|
965
|
+
:GET,
|
|
966
|
+
path,
|
|
967
|
+
endpoint,
|
|
968
|
+
:header_params => header_params,
|
|
969
|
+
:query_params => query_params,
|
|
970
|
+
:body => post_body,
|
|
971
|
+
:return_type => 'OCI::Identity::Models::Compartment')
|
|
972
|
+
end
|
|
973
|
+
|
|
974
|
+
# Gets the specified group's information.
|
|
975
|
+
#
|
|
976
|
+
# This operation does not return a list of all the users in the group. To do that, use
|
|
977
|
+
# {#list_user_group_memberships list_user_group_memberships} and
|
|
978
|
+
# provide the group's OCID as a query parameter in the request.
|
|
979
|
+
#
|
|
980
|
+
# @param [String] group_id The OCID of the group.
|
|
981
|
+
# @param [Hash] opts the optional parameters
|
|
982
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::Group
|
|
983
|
+
def get_group(group_id, opts = {})
|
|
984
|
+
logger.debug "Calling operation IdentityClient#get_group." if logger
|
|
985
|
+
|
|
986
|
+
fail "Missing the required parameter 'group_id' when calling get_group." if group_id.nil?
|
|
987
|
+
|
|
988
|
+
path = "/groups/{groupId}".sub('{groupId}', group_id.to_s)
|
|
989
|
+
|
|
990
|
+
# Query Params
|
|
991
|
+
query_params = {}
|
|
992
|
+
|
|
993
|
+
# Header Params
|
|
994
|
+
header_params = {}
|
|
995
|
+
header_params['accept'] = 'application/json'
|
|
996
|
+
header_params['content-type'] = 'application/json'
|
|
997
|
+
|
|
998
|
+
post_body = nil
|
|
999
|
+
|
|
1000
|
+
return @api_client.call_api(
|
|
1001
|
+
:GET,
|
|
1002
|
+
path,
|
|
1003
|
+
endpoint,
|
|
1004
|
+
:header_params => header_params,
|
|
1005
|
+
:query_params => query_params,
|
|
1006
|
+
:body => post_body,
|
|
1007
|
+
:return_type => 'OCI::Identity::Models::Group')
|
|
1008
|
+
end
|
|
1009
|
+
|
|
1010
|
+
# Gets the specified identity provider's information.
|
|
1011
|
+
# @param [String] identity_provider_id The OCID of the identity provider.
|
|
1012
|
+
# @param [Hash] opts the optional parameters
|
|
1013
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::IdentityProvider
|
|
1014
|
+
def get_identity_provider(identity_provider_id, opts = {})
|
|
1015
|
+
logger.debug "Calling operation IdentityClient#get_identity_provider." if logger
|
|
1016
|
+
|
|
1017
|
+
fail "Missing the required parameter 'identity_provider_id' when calling get_identity_provider." if identity_provider_id.nil?
|
|
1018
|
+
|
|
1019
|
+
path = "/identityProviders/{identityProviderId}".sub('{identityProviderId}', identity_provider_id.to_s)
|
|
1020
|
+
|
|
1021
|
+
# Query Params
|
|
1022
|
+
query_params = {}
|
|
1023
|
+
|
|
1024
|
+
# Header Params
|
|
1025
|
+
header_params = {}
|
|
1026
|
+
header_params['accept'] = 'application/json'
|
|
1027
|
+
header_params['content-type'] = 'application/json'
|
|
1028
|
+
|
|
1029
|
+
post_body = nil
|
|
1030
|
+
|
|
1031
|
+
return @api_client.call_api(
|
|
1032
|
+
:GET,
|
|
1033
|
+
path,
|
|
1034
|
+
endpoint,
|
|
1035
|
+
:header_params => header_params,
|
|
1036
|
+
:query_params => query_params,
|
|
1037
|
+
:body => post_body,
|
|
1038
|
+
:return_type => 'OCI::Identity::Models::IdentityProvider')
|
|
1039
|
+
end
|
|
1040
|
+
|
|
1041
|
+
# Gets the specified group mapping.
|
|
1042
|
+
# @param [String] identity_provider_id The OCID of the identity provider.
|
|
1043
|
+
# @param [String] mapping_id The OCID of the group mapping.
|
|
1044
|
+
# @param [Hash] opts the optional parameters
|
|
1045
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::IdpGroupMapping
|
|
1046
|
+
def get_idp_group_mapping(identity_provider_id, mapping_id, opts = {})
|
|
1047
|
+
logger.debug "Calling operation IdentityClient#get_idp_group_mapping." if logger
|
|
1048
|
+
|
|
1049
|
+
fail "Missing the required parameter 'identity_provider_id' when calling get_idp_group_mapping." if identity_provider_id.nil?
|
|
1050
|
+
fail "Missing the required parameter 'mapping_id' when calling get_idp_group_mapping." if mapping_id.nil?
|
|
1051
|
+
|
|
1052
|
+
path = "/identityProviders/{identityProviderId}/groupMappings/{mappingId}".sub('{identityProviderId}', identity_provider_id.to_s).sub('{mappingId}', mapping_id.to_s)
|
|
1053
|
+
|
|
1054
|
+
# Query Params
|
|
1055
|
+
query_params = {}
|
|
1056
|
+
|
|
1057
|
+
# Header Params
|
|
1058
|
+
header_params = {}
|
|
1059
|
+
header_params['accept'] = 'application/json'
|
|
1060
|
+
header_params['content-type'] = 'application/json'
|
|
1061
|
+
|
|
1062
|
+
post_body = nil
|
|
1063
|
+
|
|
1064
|
+
return @api_client.call_api(
|
|
1065
|
+
:GET,
|
|
1066
|
+
path,
|
|
1067
|
+
endpoint,
|
|
1068
|
+
:header_params => header_params,
|
|
1069
|
+
:query_params => query_params,
|
|
1070
|
+
:body => post_body,
|
|
1071
|
+
:return_type => 'OCI::Identity::Models::IdpGroupMapping')
|
|
1072
|
+
end
|
|
1073
|
+
|
|
1074
|
+
# Gets the specified policy's information.
|
|
1075
|
+
# @param [String] policy_id The OCID of the policy.
|
|
1076
|
+
# @param [Hash] opts the optional parameters
|
|
1077
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::Policy
|
|
1078
|
+
def get_policy(policy_id, opts = {})
|
|
1079
|
+
logger.debug "Calling operation IdentityClient#get_policy." if logger
|
|
1080
|
+
|
|
1081
|
+
fail "Missing the required parameter 'policy_id' when calling get_policy." if policy_id.nil?
|
|
1082
|
+
|
|
1083
|
+
path = "/policies/{policyId}".sub('{policyId}', policy_id.to_s)
|
|
1084
|
+
|
|
1085
|
+
# Query Params
|
|
1086
|
+
query_params = {}
|
|
1087
|
+
|
|
1088
|
+
# Header Params
|
|
1089
|
+
header_params = {}
|
|
1090
|
+
header_params['accept'] = 'application/json'
|
|
1091
|
+
header_params['content-type'] = 'application/json'
|
|
1092
|
+
|
|
1093
|
+
post_body = nil
|
|
1094
|
+
|
|
1095
|
+
return @api_client.call_api(
|
|
1096
|
+
:GET,
|
|
1097
|
+
path,
|
|
1098
|
+
endpoint,
|
|
1099
|
+
:header_params => header_params,
|
|
1100
|
+
:query_params => query_params,
|
|
1101
|
+
:body => post_body,
|
|
1102
|
+
:return_type => 'OCI::Identity::Models::Policy')
|
|
1103
|
+
end
|
|
1104
|
+
|
|
1105
|
+
# Get the specified tenancy's information.
|
|
1106
|
+
# @param [String] tenancy_id The OCID of the tenancy.
|
|
1107
|
+
# @param [Hash] opts the optional parameters
|
|
1108
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::Tenancy
|
|
1109
|
+
def get_tenancy(tenancy_id, opts = {})
|
|
1110
|
+
logger.debug "Calling operation IdentityClient#get_tenancy." if logger
|
|
1111
|
+
|
|
1112
|
+
fail "Missing the required parameter 'tenancy_id' when calling get_tenancy." if tenancy_id.nil?
|
|
1113
|
+
|
|
1114
|
+
path = "/tenancies/{tenancyId}".sub('{tenancyId}', tenancy_id.to_s)
|
|
1115
|
+
|
|
1116
|
+
# Query Params
|
|
1117
|
+
query_params = {}
|
|
1118
|
+
|
|
1119
|
+
# Header Params
|
|
1120
|
+
header_params = {}
|
|
1121
|
+
header_params['accept'] = 'application/json'
|
|
1122
|
+
header_params['content-type'] = 'application/json'
|
|
1123
|
+
|
|
1124
|
+
post_body = nil
|
|
1125
|
+
|
|
1126
|
+
return @api_client.call_api(
|
|
1127
|
+
:GET,
|
|
1128
|
+
path,
|
|
1129
|
+
endpoint,
|
|
1130
|
+
:header_params => header_params,
|
|
1131
|
+
:query_params => query_params,
|
|
1132
|
+
:body => post_body,
|
|
1133
|
+
:return_type => 'OCI::Identity::Models::Tenancy')
|
|
1134
|
+
end
|
|
1135
|
+
|
|
1136
|
+
# Gets the specified user's information.
|
|
1137
|
+
# @param [String] user_id The OCID of the user.
|
|
1138
|
+
# @param [Hash] opts the optional parameters
|
|
1139
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::User
|
|
1140
|
+
def get_user(user_id, opts = {})
|
|
1141
|
+
logger.debug "Calling operation IdentityClient#get_user." if logger
|
|
1142
|
+
|
|
1143
|
+
fail "Missing the required parameter 'user_id' when calling get_user." if user_id.nil?
|
|
1144
|
+
|
|
1145
|
+
path = "/users/{userId}".sub('{userId}', user_id.to_s)
|
|
1146
|
+
|
|
1147
|
+
# Query Params
|
|
1148
|
+
query_params = {}
|
|
1149
|
+
|
|
1150
|
+
# Header Params
|
|
1151
|
+
header_params = {}
|
|
1152
|
+
header_params['accept'] = 'application/json'
|
|
1153
|
+
header_params['content-type'] = 'application/json'
|
|
1154
|
+
|
|
1155
|
+
post_body = nil
|
|
1156
|
+
|
|
1157
|
+
return @api_client.call_api(
|
|
1158
|
+
:GET,
|
|
1159
|
+
path,
|
|
1160
|
+
endpoint,
|
|
1161
|
+
:header_params => header_params,
|
|
1162
|
+
:query_params => query_params,
|
|
1163
|
+
:body => post_body,
|
|
1164
|
+
:return_type => 'OCI::Identity::Models::User')
|
|
1165
|
+
end
|
|
1166
|
+
|
|
1167
|
+
# Gets the specified UserGroupMembership's information.
|
|
1168
|
+
# @param [String] user_group_membership_id The OCID of the userGroupMembership.
|
|
1169
|
+
# @param [Hash] opts the optional parameters
|
|
1170
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::UserGroupMembership
|
|
1171
|
+
def get_user_group_membership(user_group_membership_id, opts = {})
|
|
1172
|
+
logger.debug "Calling operation IdentityClient#get_user_group_membership." if logger
|
|
1173
|
+
|
|
1174
|
+
fail "Missing the required parameter 'user_group_membership_id' when calling get_user_group_membership." if user_group_membership_id.nil?
|
|
1175
|
+
|
|
1176
|
+
path = "/userGroupMemberships/{userGroupMembershipId}".sub('{userGroupMembershipId}', user_group_membership_id.to_s)
|
|
1177
|
+
|
|
1178
|
+
# Query Params
|
|
1179
|
+
query_params = {}
|
|
1180
|
+
|
|
1181
|
+
# Header Params
|
|
1182
|
+
header_params = {}
|
|
1183
|
+
header_params['accept'] = 'application/json'
|
|
1184
|
+
header_params['content-type'] = 'application/json'
|
|
1185
|
+
|
|
1186
|
+
post_body = nil
|
|
1187
|
+
|
|
1188
|
+
return @api_client.call_api(
|
|
1189
|
+
:GET,
|
|
1190
|
+
path,
|
|
1191
|
+
endpoint,
|
|
1192
|
+
:header_params => header_params,
|
|
1193
|
+
:query_params => query_params,
|
|
1194
|
+
:body => post_body,
|
|
1195
|
+
:return_type => 'OCI::Identity::Models::UserGroupMembership')
|
|
1196
|
+
end
|
|
1197
|
+
|
|
1198
|
+
# Lists the API signing keys for the specified user. A user can have a maximum of three keys.
|
|
1199
|
+
#
|
|
1200
|
+
# Every user has permission to use this API call for *their own user ID*. An administrator in your
|
|
1201
|
+
# organization does not need to write a policy to give users this ability.
|
|
1202
|
+
#
|
|
1203
|
+
# @param [String] user_id The OCID of the user.
|
|
1204
|
+
# @param [Hash] opts the optional parameters
|
|
1205
|
+
# @return [Response] A Response object with data of type Array<OCI::Identity::Models::ApiKey>
|
|
1206
|
+
def list_api_keys(user_id, opts = {})
|
|
1207
|
+
logger.debug "Calling operation IdentityClient#list_api_keys." if logger
|
|
1208
|
+
|
|
1209
|
+
fail "Missing the required parameter 'user_id' when calling list_api_keys." if user_id.nil?
|
|
1210
|
+
|
|
1211
|
+
path = "/users/{userId}/apiKeys/".sub('{userId}', user_id.to_s)
|
|
1212
|
+
|
|
1213
|
+
# Query Params
|
|
1214
|
+
query_params = {}
|
|
1215
|
+
|
|
1216
|
+
# Header Params
|
|
1217
|
+
header_params = {}
|
|
1218
|
+
header_params['accept'] = 'application/json'
|
|
1219
|
+
header_params['content-type'] = 'application/json'
|
|
1220
|
+
|
|
1221
|
+
post_body = nil
|
|
1222
|
+
|
|
1223
|
+
return @api_client.call_api(
|
|
1224
|
+
:GET,
|
|
1225
|
+
path,
|
|
1226
|
+
endpoint,
|
|
1227
|
+
:header_params => header_params,
|
|
1228
|
+
:query_params => query_params,
|
|
1229
|
+
:body => post_body,
|
|
1230
|
+
:return_type => 'Array<OCI::Identity::Models::ApiKey>')
|
|
1231
|
+
end
|
|
1232
|
+
|
|
1233
|
+
# Lists the Availability Domains in your tenancy. Specify the OCID of either the tenancy or another
|
|
1234
|
+
# of your compartments as the value for the compartment ID (remember that the tenancy is simply the root compartment).
|
|
1235
|
+
# See [Where to Get the Tenancy's OCID and User's OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five).
|
|
1236
|
+
#
|
|
1237
|
+
# @param [String] compartment_id The OCID of the compartment (remember that the tenancy is simply the root compartment).
|
|
1238
|
+
#
|
|
1239
|
+
# @param [Hash] opts the optional parameters
|
|
1240
|
+
# @return [Response] A Response object with data of type Array<OCI::Identity::Models::AvailabilityDomain>
|
|
1241
|
+
def list_availability_domains(compartment_id, opts = {})
|
|
1242
|
+
logger.debug "Calling operation IdentityClient#list_availability_domains." if logger
|
|
1243
|
+
|
|
1244
|
+
fail "Missing the required parameter 'compartment_id' when calling list_availability_domains." if compartment_id.nil?
|
|
1245
|
+
|
|
1246
|
+
path = "/availabilityDomains/"
|
|
1247
|
+
|
|
1248
|
+
# Query Params
|
|
1249
|
+
query_params = {}
|
|
1250
|
+
query_params[:'compartmentId'] = compartment_id
|
|
1251
|
+
|
|
1252
|
+
# Header Params
|
|
1253
|
+
header_params = {}
|
|
1254
|
+
header_params['accept'] = 'application/json'
|
|
1255
|
+
header_params['content-type'] = 'application/json'
|
|
1256
|
+
|
|
1257
|
+
post_body = nil
|
|
1258
|
+
|
|
1259
|
+
return @api_client.call_api(
|
|
1260
|
+
:GET,
|
|
1261
|
+
path,
|
|
1262
|
+
endpoint,
|
|
1263
|
+
:header_params => header_params,
|
|
1264
|
+
:query_params => query_params,
|
|
1265
|
+
:body => post_body,
|
|
1266
|
+
:return_type => 'Array<OCI::Identity::Models::AvailabilityDomain>')
|
|
1267
|
+
end
|
|
1268
|
+
|
|
1269
|
+
# Lists the compartments in your tenancy. You must specify your tenancy's OCID as the value
|
|
1270
|
+
# for the compartment ID (remember that the tenancy is simply the root compartment).
|
|
1271
|
+
# See [Where to Get the Tenancy's OCID and User's OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five).
|
|
1272
|
+
#
|
|
1273
|
+
# @param [String] compartment_id The OCID of the compartment (remember that the tenancy is simply the root compartment).
|
|
1274
|
+
#
|
|
1275
|
+
# @param [Hash] opts the optional parameters
|
|
1276
|
+
# @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
|
|
1277
|
+
#
|
|
1278
|
+
# @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
|
|
1279
|
+
#
|
|
1280
|
+
# @return [Response] A Response object with data of type Array<OCI::Identity::Models::Compartment>
|
|
1281
|
+
def list_compartments(compartment_id, opts = {})
|
|
1282
|
+
logger.debug "Calling operation IdentityClient#list_compartments." if logger
|
|
1283
|
+
|
|
1284
|
+
fail "Missing the required parameter 'compartment_id' when calling list_compartments." if compartment_id.nil?
|
|
1285
|
+
|
|
1286
|
+
path = "/compartments/"
|
|
1287
|
+
|
|
1288
|
+
# Query Params
|
|
1289
|
+
query_params = {}
|
|
1290
|
+
query_params[:'compartmentId'] = compartment_id
|
|
1291
|
+
query_params[:'page'] = opts[:'page'] if opts[:'page']
|
|
1292
|
+
query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
|
|
1293
|
+
|
|
1294
|
+
# Header Params
|
|
1295
|
+
header_params = {}
|
|
1296
|
+
header_params['accept'] = 'application/json'
|
|
1297
|
+
header_params['content-type'] = 'application/json'
|
|
1298
|
+
|
|
1299
|
+
post_body = nil
|
|
1300
|
+
|
|
1301
|
+
return @api_client.call_api(
|
|
1302
|
+
:GET,
|
|
1303
|
+
path,
|
|
1304
|
+
endpoint,
|
|
1305
|
+
:header_params => header_params,
|
|
1306
|
+
:query_params => query_params,
|
|
1307
|
+
:body => post_body,
|
|
1308
|
+
:return_type => 'Array<OCI::Identity::Models::Compartment>')
|
|
1309
|
+
end
|
|
1310
|
+
|
|
1311
|
+
# Lists the secret keys for the specified user. The returned object contains the secret key's OCID, but not
|
|
1312
|
+
# the secret key itself. The actual secret key is returned only upon creation.
|
|
1313
|
+
#
|
|
1314
|
+
# @param [String] user_id The OCID of the user.
|
|
1315
|
+
# @param [Hash] opts the optional parameters
|
|
1316
|
+
# @return [Response] A Response object with data of type Array<OCI::Identity::Models::CustomerSecretKeySummary>
|
|
1317
|
+
def list_customer_secret_keys(user_id, opts = {})
|
|
1318
|
+
logger.debug "Calling operation IdentityClient#list_customer_secret_keys." if logger
|
|
1319
|
+
|
|
1320
|
+
fail "Missing the required parameter 'user_id' when calling list_customer_secret_keys." if user_id.nil?
|
|
1321
|
+
|
|
1322
|
+
path = "/users/{userId}/customerSecretKeys/".sub('{userId}', user_id.to_s)
|
|
1323
|
+
|
|
1324
|
+
# Query Params
|
|
1325
|
+
query_params = {}
|
|
1326
|
+
|
|
1327
|
+
# Header Params
|
|
1328
|
+
header_params = {}
|
|
1329
|
+
header_params['accept'] = 'application/json'
|
|
1330
|
+
header_params['content-type'] = 'application/json'
|
|
1331
|
+
|
|
1332
|
+
post_body = nil
|
|
1333
|
+
|
|
1334
|
+
return @api_client.call_api(
|
|
1335
|
+
:GET,
|
|
1336
|
+
path,
|
|
1337
|
+
endpoint,
|
|
1338
|
+
:header_params => header_params,
|
|
1339
|
+
:query_params => query_params,
|
|
1340
|
+
:body => post_body,
|
|
1341
|
+
:return_type => 'Array<OCI::Identity::Models::CustomerSecretKeySummary>')
|
|
1342
|
+
end
|
|
1343
|
+
|
|
1344
|
+
# Lists the groups in your tenancy. You must specify your tenancy's OCID as the value for
|
|
1345
|
+
# the compartment ID (remember that the tenancy is simply the root compartment).
|
|
1346
|
+
# See [Where to Get the Tenancy's OCID and User's OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five).
|
|
1347
|
+
#
|
|
1348
|
+
# @param [String] compartment_id The OCID of the compartment (remember that the tenancy is simply the root compartment).
|
|
1349
|
+
#
|
|
1350
|
+
# @param [Hash] opts the optional parameters
|
|
1351
|
+
# @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
|
|
1352
|
+
#
|
|
1353
|
+
# @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
|
|
1354
|
+
#
|
|
1355
|
+
# @return [Response] A Response object with data of type Array<OCI::Identity::Models::Group>
|
|
1356
|
+
def list_groups(compartment_id, opts = {})
|
|
1357
|
+
logger.debug "Calling operation IdentityClient#list_groups." if logger
|
|
1358
|
+
|
|
1359
|
+
fail "Missing the required parameter 'compartment_id' when calling list_groups." if compartment_id.nil?
|
|
1360
|
+
|
|
1361
|
+
path = "/groups/"
|
|
1362
|
+
|
|
1363
|
+
# Query Params
|
|
1364
|
+
query_params = {}
|
|
1365
|
+
query_params[:'compartmentId'] = compartment_id
|
|
1366
|
+
query_params[:'page'] = opts[:'page'] if opts[:'page']
|
|
1367
|
+
query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
|
|
1368
|
+
|
|
1369
|
+
# Header Params
|
|
1370
|
+
header_params = {}
|
|
1371
|
+
header_params['accept'] = 'application/json'
|
|
1372
|
+
header_params['content-type'] = 'application/json'
|
|
1373
|
+
|
|
1374
|
+
post_body = nil
|
|
1375
|
+
|
|
1376
|
+
return @api_client.call_api(
|
|
1377
|
+
:GET,
|
|
1378
|
+
path,
|
|
1379
|
+
endpoint,
|
|
1380
|
+
:header_params => header_params,
|
|
1381
|
+
:query_params => query_params,
|
|
1382
|
+
:body => post_body,
|
|
1383
|
+
:return_type => 'Array<OCI::Identity::Models::Group>')
|
|
1384
|
+
end
|
|
1385
|
+
|
|
1386
|
+
# Lists all the identity providers in your tenancy. You must specify the identity provider type (e.g., `SAML2` for
|
|
1387
|
+
# identity providers using the SAML2.0 protocol). You must specify your tenancy's OCID as the value for the
|
|
1388
|
+
# compartment ID (remember that the tenancy is simply the root compartment).
|
|
1389
|
+
# See [Where to Get the Tenancy's OCID and User's OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five).
|
|
1390
|
+
#
|
|
1391
|
+
# @param [String] protocol The protocol used for federation.
|
|
1392
|
+
# @param [String] compartment_id The OCID of the compartment (remember that the tenancy is simply the root compartment).
|
|
1393
|
+
#
|
|
1394
|
+
# @param [Hash] opts the optional parameters
|
|
1395
|
+
# @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
|
|
1396
|
+
#
|
|
1397
|
+
# @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
|
|
1398
|
+
#
|
|
1399
|
+
# @return [Response] A Response object with data of type Array<OCI::Identity::Models::IdentityProvider>
|
|
1400
|
+
def list_identity_providers(protocol, compartment_id, opts = {})
|
|
1401
|
+
logger.debug "Calling operation IdentityClient#list_identity_providers." if logger
|
|
1402
|
+
|
|
1403
|
+
fail "Missing the required parameter 'protocol' when calling list_identity_providers." if protocol.nil?
|
|
1404
|
+
unless ['SAML2'].include?(protocol)
|
|
1405
|
+
fail "Invalid value for 'protocol', must be one of SAML2."
|
|
1406
|
+
end
|
|
1407
|
+
fail "Missing the required parameter 'compartment_id' when calling list_identity_providers." if compartment_id.nil?
|
|
1408
|
+
|
|
1409
|
+
path = "/identityProviders/"
|
|
1410
|
+
|
|
1411
|
+
# Query Params
|
|
1412
|
+
query_params = {}
|
|
1413
|
+
query_params[:'protocol'] = protocol
|
|
1414
|
+
query_params[:'compartmentId'] = compartment_id
|
|
1415
|
+
query_params[:'page'] = opts[:'page'] if opts[:'page']
|
|
1416
|
+
query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
|
|
1417
|
+
|
|
1418
|
+
# Header Params
|
|
1419
|
+
header_params = {}
|
|
1420
|
+
header_params['accept'] = 'application/json'
|
|
1421
|
+
header_params['content-type'] = 'application/json'
|
|
1422
|
+
|
|
1423
|
+
post_body = nil
|
|
1424
|
+
|
|
1425
|
+
return @api_client.call_api(
|
|
1426
|
+
:GET,
|
|
1427
|
+
path,
|
|
1428
|
+
endpoint,
|
|
1429
|
+
:header_params => header_params,
|
|
1430
|
+
:query_params => query_params,
|
|
1431
|
+
:body => post_body,
|
|
1432
|
+
:return_type => 'Array<OCI::Identity::Models::IdentityProvider>')
|
|
1433
|
+
end
|
|
1434
|
+
|
|
1435
|
+
# Lists the group mappings for the specified identity provider.
|
|
1436
|
+
#
|
|
1437
|
+
# @param [String] identity_provider_id The OCID of the identity provider.
|
|
1438
|
+
# @param [Hash] opts the optional parameters
|
|
1439
|
+
# @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
|
|
1440
|
+
#
|
|
1441
|
+
# @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
|
|
1442
|
+
#
|
|
1443
|
+
# @return [Response] A Response object with data of type Array<OCI::Identity::Models::IdpGroupMapping>
|
|
1444
|
+
def list_idp_group_mappings(identity_provider_id, opts = {})
|
|
1445
|
+
logger.debug "Calling operation IdentityClient#list_idp_group_mappings." if logger
|
|
1446
|
+
|
|
1447
|
+
fail "Missing the required parameter 'identity_provider_id' when calling list_idp_group_mappings." if identity_provider_id.nil?
|
|
1448
|
+
|
|
1449
|
+
path = "/identityProviders/{identityProviderId}/groupMappings/".sub('{identityProviderId}', identity_provider_id.to_s)
|
|
1450
|
+
|
|
1451
|
+
# Query Params
|
|
1452
|
+
query_params = {}
|
|
1453
|
+
query_params[:'page'] = opts[:'page'] if opts[:'page']
|
|
1454
|
+
query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
|
|
1455
|
+
|
|
1456
|
+
# Header Params
|
|
1457
|
+
header_params = {}
|
|
1458
|
+
header_params['accept'] = 'application/json'
|
|
1459
|
+
header_params['content-type'] = 'application/json'
|
|
1460
|
+
|
|
1461
|
+
post_body = nil
|
|
1462
|
+
|
|
1463
|
+
return @api_client.call_api(
|
|
1464
|
+
:GET,
|
|
1465
|
+
path,
|
|
1466
|
+
endpoint,
|
|
1467
|
+
:header_params => header_params,
|
|
1468
|
+
:query_params => query_params,
|
|
1469
|
+
:body => post_body,
|
|
1470
|
+
:return_type => 'Array<OCI::Identity::Models::IdpGroupMapping>')
|
|
1471
|
+
end
|
|
1472
|
+
|
|
1473
|
+
# Lists the policies in the specified compartment (either the tenancy or another of your compartments).
|
|
1474
|
+
# See [Where to Get the Tenancy's OCID and User's OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five).
|
|
1475
|
+
#
|
|
1476
|
+
# To determine which policies apply to a particular group or compartment, you must view the individual
|
|
1477
|
+
# statements inside all your policies. There isn't a way to automatically obtain that information via the API.
|
|
1478
|
+
#
|
|
1479
|
+
# @param [String] compartment_id The OCID of the compartment (remember that the tenancy is simply the root compartment).
|
|
1480
|
+
#
|
|
1481
|
+
# @param [Hash] opts the optional parameters
|
|
1482
|
+
# @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
|
|
1483
|
+
#
|
|
1484
|
+
# @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
|
|
1485
|
+
#
|
|
1486
|
+
# @return [Response] A Response object with data of type Array<OCI::Identity::Models::Policy>
|
|
1487
|
+
def list_policies(compartment_id, opts = {})
|
|
1488
|
+
logger.debug "Calling operation IdentityClient#list_policies." if logger
|
|
1489
|
+
|
|
1490
|
+
fail "Missing the required parameter 'compartment_id' when calling list_policies." if compartment_id.nil?
|
|
1491
|
+
|
|
1492
|
+
path = "/policies/"
|
|
1493
|
+
|
|
1494
|
+
# Query Params
|
|
1495
|
+
query_params = {}
|
|
1496
|
+
query_params[:'compartmentId'] = compartment_id
|
|
1497
|
+
query_params[:'page'] = opts[:'page'] if opts[:'page']
|
|
1498
|
+
query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
|
|
1499
|
+
|
|
1500
|
+
# Header Params
|
|
1501
|
+
header_params = {}
|
|
1502
|
+
header_params['accept'] = 'application/json'
|
|
1503
|
+
header_params['content-type'] = 'application/json'
|
|
1504
|
+
|
|
1505
|
+
post_body = nil
|
|
1506
|
+
|
|
1507
|
+
return @api_client.call_api(
|
|
1508
|
+
:GET,
|
|
1509
|
+
path,
|
|
1510
|
+
endpoint,
|
|
1511
|
+
:header_params => header_params,
|
|
1512
|
+
:query_params => query_params,
|
|
1513
|
+
:body => post_body,
|
|
1514
|
+
:return_type => 'Array<OCI::Identity::Models::Policy>')
|
|
1515
|
+
end
|
|
1516
|
+
|
|
1517
|
+
# Lists the region subscriptions for the specified tenancy.
|
|
1518
|
+
# @param [String] tenancy_id The OCID of the tenancy.
|
|
1519
|
+
# @param [Hash] opts the optional parameters
|
|
1520
|
+
# @return [Response] A Response object with data of type Array<OCI::Identity::Models::RegionSubscription>
|
|
1521
|
+
def list_region_subscriptions(tenancy_id, opts = {})
|
|
1522
|
+
logger.debug "Calling operation IdentityClient#list_region_subscriptions." if logger
|
|
1523
|
+
|
|
1524
|
+
fail "Missing the required parameter 'tenancy_id' when calling list_region_subscriptions." if tenancy_id.nil?
|
|
1525
|
+
|
|
1526
|
+
path = "/tenancies/{tenancyId}/regionSubscriptions".sub('{tenancyId}', tenancy_id.to_s)
|
|
1527
|
+
|
|
1528
|
+
# Query Params
|
|
1529
|
+
query_params = {}
|
|
1530
|
+
|
|
1531
|
+
# Header Params
|
|
1532
|
+
header_params = {}
|
|
1533
|
+
header_params['accept'] = 'application/json'
|
|
1534
|
+
header_params['content-type'] = 'application/json'
|
|
1535
|
+
|
|
1536
|
+
post_body = nil
|
|
1537
|
+
|
|
1538
|
+
return @api_client.call_api(
|
|
1539
|
+
:GET,
|
|
1540
|
+
path,
|
|
1541
|
+
endpoint,
|
|
1542
|
+
:header_params => header_params,
|
|
1543
|
+
:query_params => query_params,
|
|
1544
|
+
:body => post_body,
|
|
1545
|
+
:return_type => 'Array<OCI::Identity::Models::RegionSubscription>')
|
|
1546
|
+
end
|
|
1547
|
+
|
|
1548
|
+
# Lists all the regions offered by Oracle Bare Metal Cloud Services.
|
|
1549
|
+
# @param [Hash] opts the optional parameters
|
|
1550
|
+
# @return [Response] A Response object with data of type Array<OCI::Identity::Models::Region>
|
|
1551
|
+
def list_regions(opts = {})
|
|
1552
|
+
logger.debug "Calling operation IdentityClient#list_regions." if logger
|
|
1553
|
+
|
|
1554
|
+
|
|
1555
|
+
path = "/regions"
|
|
1556
|
+
|
|
1557
|
+
# Query Params
|
|
1558
|
+
query_params = {}
|
|
1559
|
+
|
|
1560
|
+
# Header Params
|
|
1561
|
+
header_params = {}
|
|
1562
|
+
header_params['accept'] = 'application/json'
|
|
1563
|
+
header_params['content-type'] = 'application/json'
|
|
1564
|
+
|
|
1565
|
+
post_body = nil
|
|
1566
|
+
|
|
1567
|
+
return @api_client.call_api(
|
|
1568
|
+
:GET,
|
|
1569
|
+
path,
|
|
1570
|
+
endpoint,
|
|
1571
|
+
:header_params => header_params,
|
|
1572
|
+
:query_params => query_params,
|
|
1573
|
+
:body => post_body,
|
|
1574
|
+
:return_type => 'Array<OCI::Identity::Models::Region>')
|
|
1575
|
+
end
|
|
1576
|
+
|
|
1577
|
+
# Lists the Swift passwords for the specified user. The returned object contains the password's OCID, but not
|
|
1578
|
+
# the password itself. The actual password is returned only upon creation.
|
|
1579
|
+
#
|
|
1580
|
+
# @param [String] user_id The OCID of the user.
|
|
1581
|
+
# @param [Hash] opts the optional parameters
|
|
1582
|
+
# @return [Response] A Response object with data of type Array<OCI::Identity::Models::SwiftPassword>
|
|
1583
|
+
def list_swift_passwords(user_id, opts = {})
|
|
1584
|
+
logger.debug "Calling operation IdentityClient#list_swift_passwords." if logger
|
|
1585
|
+
|
|
1586
|
+
fail "Missing the required parameter 'user_id' when calling list_swift_passwords." if user_id.nil?
|
|
1587
|
+
|
|
1588
|
+
path = "/users/{userId}/swiftPasswords/".sub('{userId}', user_id.to_s)
|
|
1589
|
+
|
|
1590
|
+
# Query Params
|
|
1591
|
+
query_params = {}
|
|
1592
|
+
|
|
1593
|
+
# Header Params
|
|
1594
|
+
header_params = {}
|
|
1595
|
+
header_params['accept'] = 'application/json'
|
|
1596
|
+
header_params['content-type'] = 'application/json'
|
|
1597
|
+
|
|
1598
|
+
post_body = nil
|
|
1599
|
+
|
|
1600
|
+
return @api_client.call_api(
|
|
1601
|
+
:GET,
|
|
1602
|
+
path,
|
|
1603
|
+
endpoint,
|
|
1604
|
+
:header_params => header_params,
|
|
1605
|
+
:query_params => query_params,
|
|
1606
|
+
:body => post_body,
|
|
1607
|
+
:return_type => 'Array<OCI::Identity::Models::SwiftPassword>')
|
|
1608
|
+
end
|
|
1609
|
+
|
|
1610
|
+
# Lists the `UserGroupMembership` objects in your tenancy. You must specify your tenancy's OCID
|
|
1611
|
+
# as the value for the compartment ID
|
|
1612
|
+
# (see [Where to Get the Tenancy's OCID and User's OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five)).
|
|
1613
|
+
# You must also then filter the list in one of these ways:
|
|
1614
|
+
#
|
|
1615
|
+
# - You can limit the results to just the memberships for a given user by specifying a `userId`.
|
|
1616
|
+
# - Similarly, you can limit the results to just the memberships for a given group by specifying a `groupId`.
|
|
1617
|
+
# - You can set both the `userId` and `groupId` to determine if the specified user is in the specified group.
|
|
1618
|
+
# If the answer is no, the response is an empty list.
|
|
1619
|
+
#
|
|
1620
|
+
# @param [String] compartment_id The OCID of the compartment (remember that the tenancy is simply the root compartment).
|
|
1621
|
+
#
|
|
1622
|
+
# @param [Hash] opts the optional parameters
|
|
1623
|
+
# @option opts [String] :user_id The OCID of the user.
|
|
1624
|
+
# @option opts [String] :group_id The OCID of the group.
|
|
1625
|
+
# @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
|
|
1626
|
+
#
|
|
1627
|
+
# @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
|
|
1628
|
+
#
|
|
1629
|
+
# @return [Response] A Response object with data of type Array<OCI::Identity::Models::UserGroupMembership>
|
|
1630
|
+
def list_user_group_memberships(compartment_id, opts = {})
|
|
1631
|
+
logger.debug "Calling operation IdentityClient#list_user_group_memberships." if logger
|
|
1632
|
+
|
|
1633
|
+
fail "Missing the required parameter 'compartment_id' when calling list_user_group_memberships." if compartment_id.nil?
|
|
1634
|
+
|
|
1635
|
+
path = "/userGroupMemberships/"
|
|
1636
|
+
|
|
1637
|
+
# Query Params
|
|
1638
|
+
query_params = {}
|
|
1639
|
+
query_params[:'compartmentId'] = compartment_id
|
|
1640
|
+
query_params[:'userId'] = opts[:'user_id'] if opts[:'user_id']
|
|
1641
|
+
query_params[:'groupId'] = opts[:'group_id'] if opts[:'group_id']
|
|
1642
|
+
query_params[:'page'] = opts[:'page'] if opts[:'page']
|
|
1643
|
+
query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
|
|
1644
|
+
|
|
1645
|
+
# Header Params
|
|
1646
|
+
header_params = {}
|
|
1647
|
+
header_params['accept'] = 'application/json'
|
|
1648
|
+
header_params['content-type'] = 'application/json'
|
|
1649
|
+
|
|
1650
|
+
post_body = nil
|
|
1651
|
+
|
|
1652
|
+
return @api_client.call_api(
|
|
1653
|
+
:GET,
|
|
1654
|
+
path,
|
|
1655
|
+
endpoint,
|
|
1656
|
+
:header_params => header_params,
|
|
1657
|
+
:query_params => query_params,
|
|
1658
|
+
:body => post_body,
|
|
1659
|
+
:return_type => 'Array<OCI::Identity::Models::UserGroupMembership>')
|
|
1660
|
+
end
|
|
1661
|
+
|
|
1662
|
+
# Lists the users in your tenancy. You must specify your tenancy's OCID as the value for the
|
|
1663
|
+
# compartment ID (remember that the tenancy is simply the root compartment).
|
|
1664
|
+
# See [Where to Get the Tenancy's OCID and User's OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm#five).
|
|
1665
|
+
#
|
|
1666
|
+
# @param [String] compartment_id The OCID of the compartment (remember that the tenancy is simply the root compartment).
|
|
1667
|
+
#
|
|
1668
|
+
# @param [Hash] opts the optional parameters
|
|
1669
|
+
# @option opts [String] :page The value of the `opc-next-page` response header from the previous \"List\" call.
|
|
1670
|
+
#
|
|
1671
|
+
# @option opts [Integer] :limit The maximum number of items to return in a paginated \"List\" call.
|
|
1672
|
+
#
|
|
1673
|
+
# @return [Response] A Response object with data of type Array<OCI::Identity::Models::User>
|
|
1674
|
+
def list_users(compartment_id, opts = {})
|
|
1675
|
+
logger.debug "Calling operation IdentityClient#list_users." if logger
|
|
1676
|
+
|
|
1677
|
+
fail "Missing the required parameter 'compartment_id' when calling list_users." if compartment_id.nil?
|
|
1678
|
+
|
|
1679
|
+
path = "/users/"
|
|
1680
|
+
|
|
1681
|
+
# Query Params
|
|
1682
|
+
query_params = {}
|
|
1683
|
+
query_params[:'compartmentId'] = compartment_id
|
|
1684
|
+
query_params[:'page'] = opts[:'page'] if opts[:'page']
|
|
1685
|
+
query_params[:'limit'] = opts[:'limit'] if opts[:'limit']
|
|
1686
|
+
|
|
1687
|
+
# Header Params
|
|
1688
|
+
header_params = {}
|
|
1689
|
+
header_params['accept'] = 'application/json'
|
|
1690
|
+
header_params['content-type'] = 'application/json'
|
|
1691
|
+
|
|
1692
|
+
post_body = nil
|
|
1693
|
+
|
|
1694
|
+
return @api_client.call_api(
|
|
1695
|
+
:GET,
|
|
1696
|
+
path,
|
|
1697
|
+
endpoint,
|
|
1698
|
+
:header_params => header_params,
|
|
1699
|
+
:query_params => query_params,
|
|
1700
|
+
:body => post_body,
|
|
1701
|
+
:return_type => 'Array<OCI::Identity::Models::User>')
|
|
1702
|
+
end
|
|
1703
|
+
|
|
1704
|
+
# Removes a user from a group by deleting the corresponding `UserGroupMembership`.
|
|
1705
|
+
# @param [String] user_group_membership_id The OCID of the userGroupMembership.
|
|
1706
|
+
# @param [Hash] opts the optional parameters
|
|
1707
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
|
|
1708
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
1709
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
1710
|
+
#
|
|
1711
|
+
# @return [Response] A Response object with data of type nil
|
|
1712
|
+
def remove_user_from_group(user_group_membership_id, opts = {})
|
|
1713
|
+
logger.debug "Calling operation IdentityClient#remove_user_from_group." if logger
|
|
1714
|
+
|
|
1715
|
+
fail "Missing the required parameter 'user_group_membership_id' when calling remove_user_from_group." if user_group_membership_id.nil?
|
|
1716
|
+
|
|
1717
|
+
path = "/userGroupMemberships/{userGroupMembershipId}".sub('{userGroupMembershipId}', user_group_membership_id.to_s)
|
|
1718
|
+
|
|
1719
|
+
# Query Params
|
|
1720
|
+
query_params = {}
|
|
1721
|
+
|
|
1722
|
+
# Header Params
|
|
1723
|
+
header_params = {}
|
|
1724
|
+
header_params['accept'] = 'application/json'
|
|
1725
|
+
header_params['content-type'] = 'application/json'
|
|
1726
|
+
header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
|
|
1727
|
+
|
|
1728
|
+
post_body = nil
|
|
1729
|
+
|
|
1730
|
+
return @api_client.call_api(
|
|
1731
|
+
:DELETE,
|
|
1732
|
+
path,
|
|
1733
|
+
endpoint,
|
|
1734
|
+
:header_params => header_params,
|
|
1735
|
+
:query_params => query_params,
|
|
1736
|
+
:body => post_body)
|
|
1737
|
+
end
|
|
1738
|
+
|
|
1739
|
+
# Updates the specified compartment's description.
|
|
1740
|
+
# @param [String] compartment_id The OCID of the compartment.
|
|
1741
|
+
# @param [UpdateCompartmentDetails] update_compartment_details Request object for updating a compartment.
|
|
1742
|
+
# @param [Hash] opts the optional parameters
|
|
1743
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
|
|
1744
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
1745
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
1746
|
+
#
|
|
1747
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::Compartment
|
|
1748
|
+
def update_compartment(compartment_id, update_compartment_details, opts = {})
|
|
1749
|
+
logger.debug "Calling operation IdentityClient#update_compartment." if logger
|
|
1750
|
+
|
|
1751
|
+
fail "Missing the required parameter 'compartment_id' when calling update_compartment." if compartment_id.nil?
|
|
1752
|
+
fail "Missing the required parameter 'update_compartment_details' when calling update_compartment." if update_compartment_details.nil?
|
|
1753
|
+
|
|
1754
|
+
path = "/compartments/{compartmentId}".sub('{compartmentId}', compartment_id.to_s)
|
|
1755
|
+
|
|
1756
|
+
# Query Params
|
|
1757
|
+
query_params = {}
|
|
1758
|
+
|
|
1759
|
+
# Header Params
|
|
1760
|
+
header_params = {}
|
|
1761
|
+
header_params['accept'] = 'application/json'
|
|
1762
|
+
header_params['content-type'] = 'application/json'
|
|
1763
|
+
header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
|
|
1764
|
+
|
|
1765
|
+
post_body = @api_client.object_to_http_body(update_compartment_details)
|
|
1766
|
+
|
|
1767
|
+
return @api_client.call_api(
|
|
1768
|
+
:PUT,
|
|
1769
|
+
path,
|
|
1770
|
+
endpoint,
|
|
1771
|
+
:header_params => header_params,
|
|
1772
|
+
:query_params => query_params,
|
|
1773
|
+
:body => post_body,
|
|
1774
|
+
:return_type => 'OCI::Identity::Models::Compartment')
|
|
1775
|
+
end
|
|
1776
|
+
|
|
1777
|
+
# Updates the specified secret key's description.
|
|
1778
|
+
#
|
|
1779
|
+
# @param [String] user_id The OCID of the user.
|
|
1780
|
+
# @param [String] customer_secret_key_id The OCID of the secret key.
|
|
1781
|
+
# @param [UpdateCustomerSecretKeyDetails] update_customer_secret_key_details Request object for updating a secret key.
|
|
1782
|
+
# @param [Hash] opts the optional parameters
|
|
1783
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
|
|
1784
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
1785
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
1786
|
+
#
|
|
1787
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::CustomerSecretKeySummary
|
|
1788
|
+
def update_customer_secret_key(user_id, customer_secret_key_id, update_customer_secret_key_details, opts = {})
|
|
1789
|
+
logger.debug "Calling operation IdentityClient#update_customer_secret_key." if logger
|
|
1790
|
+
|
|
1791
|
+
fail "Missing the required parameter 'user_id' when calling update_customer_secret_key." if user_id.nil?
|
|
1792
|
+
fail "Missing the required parameter 'customer_secret_key_id' when calling update_customer_secret_key." if customer_secret_key_id.nil?
|
|
1793
|
+
fail "Missing the required parameter 'update_customer_secret_key_details' when calling update_customer_secret_key." if update_customer_secret_key_details.nil?
|
|
1794
|
+
|
|
1795
|
+
path = "/users/{userId}/customerSecretKeys/{customerSecretKeyId}".sub('{userId}', user_id.to_s).sub('{customerSecretKeyId}', customer_secret_key_id.to_s)
|
|
1796
|
+
|
|
1797
|
+
# Query Params
|
|
1798
|
+
query_params = {}
|
|
1799
|
+
|
|
1800
|
+
# Header Params
|
|
1801
|
+
header_params = {}
|
|
1802
|
+
header_params['accept'] = 'application/json'
|
|
1803
|
+
header_params['content-type'] = 'application/json'
|
|
1804
|
+
header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
|
|
1805
|
+
|
|
1806
|
+
post_body = @api_client.object_to_http_body(update_customer_secret_key_details)
|
|
1807
|
+
|
|
1808
|
+
return @api_client.call_api(
|
|
1809
|
+
:PUT,
|
|
1810
|
+
path,
|
|
1811
|
+
endpoint,
|
|
1812
|
+
:header_params => header_params,
|
|
1813
|
+
:query_params => query_params,
|
|
1814
|
+
:body => post_body,
|
|
1815
|
+
:return_type => 'OCI::Identity::Models::CustomerSecretKeySummary')
|
|
1816
|
+
end
|
|
1817
|
+
|
|
1818
|
+
# Updates the specified group.
|
|
1819
|
+
# @param [String] group_id The OCID of the group.
|
|
1820
|
+
# @param [UpdateGroupDetails] update_group_details Request object for updating a group.
|
|
1821
|
+
# @param [Hash] opts the optional parameters
|
|
1822
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
|
|
1823
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
1824
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
1825
|
+
#
|
|
1826
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::Group
|
|
1827
|
+
def update_group(group_id, update_group_details, opts = {})
|
|
1828
|
+
logger.debug "Calling operation IdentityClient#update_group." if logger
|
|
1829
|
+
|
|
1830
|
+
fail "Missing the required parameter 'group_id' when calling update_group." if group_id.nil?
|
|
1831
|
+
fail "Missing the required parameter 'update_group_details' when calling update_group." if update_group_details.nil?
|
|
1832
|
+
|
|
1833
|
+
path = "/groups/{groupId}".sub('{groupId}', group_id.to_s)
|
|
1834
|
+
|
|
1835
|
+
# Query Params
|
|
1836
|
+
query_params = {}
|
|
1837
|
+
|
|
1838
|
+
# Header Params
|
|
1839
|
+
header_params = {}
|
|
1840
|
+
header_params['accept'] = 'application/json'
|
|
1841
|
+
header_params['content-type'] = 'application/json'
|
|
1842
|
+
header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
|
|
1843
|
+
|
|
1844
|
+
post_body = @api_client.object_to_http_body(update_group_details)
|
|
1845
|
+
|
|
1846
|
+
return @api_client.call_api(
|
|
1847
|
+
:PUT,
|
|
1848
|
+
path,
|
|
1849
|
+
endpoint,
|
|
1850
|
+
:header_params => header_params,
|
|
1851
|
+
:query_params => query_params,
|
|
1852
|
+
:body => post_body,
|
|
1853
|
+
:return_type => 'OCI::Identity::Models::Group')
|
|
1854
|
+
end
|
|
1855
|
+
|
|
1856
|
+
# Updates the specified identity provider.
|
|
1857
|
+
# @param [String] identity_provider_id The OCID of the identity provider.
|
|
1858
|
+
# @param [UpdateIdentityProviderDetails] update_identity_provider_details Request object for updating a identity provider.
|
|
1859
|
+
# @param [Hash] opts the optional parameters
|
|
1860
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
|
|
1861
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
1862
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
1863
|
+
#
|
|
1864
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::IdentityProvider
|
|
1865
|
+
def update_identity_provider(identity_provider_id, update_identity_provider_details, opts = {})
|
|
1866
|
+
logger.debug "Calling operation IdentityClient#update_identity_provider." if logger
|
|
1867
|
+
|
|
1868
|
+
fail "Missing the required parameter 'identity_provider_id' when calling update_identity_provider." if identity_provider_id.nil?
|
|
1869
|
+
fail "Missing the required parameter 'update_identity_provider_details' when calling update_identity_provider." if update_identity_provider_details.nil?
|
|
1870
|
+
|
|
1871
|
+
path = "/identityProviders/{identityProviderId}".sub('{identityProviderId}', identity_provider_id.to_s)
|
|
1872
|
+
|
|
1873
|
+
# Query Params
|
|
1874
|
+
query_params = {}
|
|
1875
|
+
|
|
1876
|
+
# Header Params
|
|
1877
|
+
header_params = {}
|
|
1878
|
+
header_params['accept'] = 'application/json'
|
|
1879
|
+
header_params['content-type'] = 'application/json'
|
|
1880
|
+
header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
|
|
1881
|
+
|
|
1882
|
+
post_body = @api_client.object_to_http_body(update_identity_provider_details)
|
|
1883
|
+
|
|
1884
|
+
return @api_client.call_api(
|
|
1885
|
+
:PUT,
|
|
1886
|
+
path,
|
|
1887
|
+
endpoint,
|
|
1888
|
+
:header_params => header_params,
|
|
1889
|
+
:query_params => query_params,
|
|
1890
|
+
:body => post_body,
|
|
1891
|
+
:return_type => 'OCI::Identity::Models::IdentityProvider')
|
|
1892
|
+
end
|
|
1893
|
+
|
|
1894
|
+
# Updates the specified group mapping.
|
|
1895
|
+
# @param [String] identity_provider_id The OCID of the identity provider.
|
|
1896
|
+
# @param [String] mapping_id The OCID of the group mapping.
|
|
1897
|
+
# @param [UpdateIdpGroupMappingDetails] update_idp_group_mapping_details Request object for updating an identity provider group mapping
|
|
1898
|
+
# @param [Hash] opts the optional parameters
|
|
1899
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
|
|
1900
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
1901
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
1902
|
+
#
|
|
1903
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::IdpGroupMapping
|
|
1904
|
+
def update_idp_group_mapping(identity_provider_id, mapping_id, update_idp_group_mapping_details, opts = {})
|
|
1905
|
+
logger.debug "Calling operation IdentityClient#update_idp_group_mapping." if logger
|
|
1906
|
+
|
|
1907
|
+
fail "Missing the required parameter 'identity_provider_id' when calling update_idp_group_mapping." if identity_provider_id.nil?
|
|
1908
|
+
fail "Missing the required parameter 'mapping_id' when calling update_idp_group_mapping." if mapping_id.nil?
|
|
1909
|
+
fail "Missing the required parameter 'update_idp_group_mapping_details' when calling update_idp_group_mapping." if update_idp_group_mapping_details.nil?
|
|
1910
|
+
|
|
1911
|
+
path = "/identityProviders/{identityProviderId}/groupMappings/{mappingId}".sub('{identityProviderId}', identity_provider_id.to_s).sub('{mappingId}', mapping_id.to_s)
|
|
1912
|
+
|
|
1913
|
+
# Query Params
|
|
1914
|
+
query_params = {}
|
|
1915
|
+
|
|
1916
|
+
# Header Params
|
|
1917
|
+
header_params = {}
|
|
1918
|
+
header_params['accept'] = 'application/json'
|
|
1919
|
+
header_params['content-type'] = 'application/json'
|
|
1920
|
+
header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
|
|
1921
|
+
|
|
1922
|
+
post_body = @api_client.object_to_http_body(update_idp_group_mapping_details)
|
|
1923
|
+
|
|
1924
|
+
return @api_client.call_api(
|
|
1925
|
+
:PUT,
|
|
1926
|
+
path,
|
|
1927
|
+
endpoint,
|
|
1928
|
+
:header_params => header_params,
|
|
1929
|
+
:query_params => query_params,
|
|
1930
|
+
:body => post_body,
|
|
1931
|
+
:return_type => 'OCI::Identity::Models::IdpGroupMapping')
|
|
1932
|
+
end
|
|
1933
|
+
|
|
1934
|
+
# Updates the specified policy. You can update the description or the policy statements themselves.
|
|
1935
|
+
#
|
|
1936
|
+
# Policy changes take effect typically within 10 seconds.
|
|
1937
|
+
#
|
|
1938
|
+
# @param [String] policy_id The OCID of the policy.
|
|
1939
|
+
# @param [UpdatePolicyDetails] update_policy_details Request object for updating a policy.
|
|
1940
|
+
# @param [Hash] opts the optional parameters
|
|
1941
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
|
|
1942
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
1943
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
1944
|
+
#
|
|
1945
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::Policy
|
|
1946
|
+
def update_policy(policy_id, update_policy_details, opts = {})
|
|
1947
|
+
logger.debug "Calling operation IdentityClient#update_policy." if logger
|
|
1948
|
+
|
|
1949
|
+
fail "Missing the required parameter 'policy_id' when calling update_policy." if policy_id.nil?
|
|
1950
|
+
fail "Missing the required parameter 'update_policy_details' when calling update_policy." if update_policy_details.nil?
|
|
1951
|
+
|
|
1952
|
+
path = "/policies/{policyId}".sub('{policyId}', policy_id.to_s)
|
|
1953
|
+
|
|
1954
|
+
# Query Params
|
|
1955
|
+
query_params = {}
|
|
1956
|
+
|
|
1957
|
+
# Header Params
|
|
1958
|
+
header_params = {}
|
|
1959
|
+
header_params['accept'] = 'application/json'
|
|
1960
|
+
header_params['content-type'] = 'application/json'
|
|
1961
|
+
header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
|
|
1962
|
+
|
|
1963
|
+
post_body = @api_client.object_to_http_body(update_policy_details)
|
|
1964
|
+
|
|
1965
|
+
return @api_client.call_api(
|
|
1966
|
+
:PUT,
|
|
1967
|
+
path,
|
|
1968
|
+
endpoint,
|
|
1969
|
+
:header_params => header_params,
|
|
1970
|
+
:query_params => query_params,
|
|
1971
|
+
:body => post_body,
|
|
1972
|
+
:return_type => 'OCI::Identity::Models::Policy')
|
|
1973
|
+
end
|
|
1974
|
+
|
|
1975
|
+
# Updates the specified Swift password's description.
|
|
1976
|
+
#
|
|
1977
|
+
# @param [String] user_id The OCID of the user.
|
|
1978
|
+
# @param [String] swift_password_id The OCID of the Swift password.
|
|
1979
|
+
# @param [UpdateSwiftPasswordDetails] update_swift_password_details Request object for updating a Swift password.
|
|
1980
|
+
# @param [Hash] opts the optional parameters
|
|
1981
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
|
|
1982
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
1983
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
1984
|
+
#
|
|
1985
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::SwiftPassword
|
|
1986
|
+
def update_swift_password(user_id, swift_password_id, update_swift_password_details, opts = {})
|
|
1987
|
+
logger.debug "Calling operation IdentityClient#update_swift_password." if logger
|
|
1988
|
+
|
|
1989
|
+
fail "Missing the required parameter 'user_id' when calling update_swift_password." if user_id.nil?
|
|
1990
|
+
fail "Missing the required parameter 'swift_password_id' when calling update_swift_password." if swift_password_id.nil?
|
|
1991
|
+
fail "Missing the required parameter 'update_swift_password_details' when calling update_swift_password." if update_swift_password_details.nil?
|
|
1992
|
+
|
|
1993
|
+
path = "/users/{userId}/swiftPasswords/{swiftPasswordId}".sub('{userId}', user_id.to_s).sub('{swiftPasswordId}', swift_password_id.to_s)
|
|
1994
|
+
|
|
1995
|
+
# Query Params
|
|
1996
|
+
query_params = {}
|
|
1997
|
+
|
|
1998
|
+
# Header Params
|
|
1999
|
+
header_params = {}
|
|
2000
|
+
header_params['accept'] = 'application/json'
|
|
2001
|
+
header_params['content-type'] = 'application/json'
|
|
2002
|
+
header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
|
|
2003
|
+
|
|
2004
|
+
post_body = @api_client.object_to_http_body(update_swift_password_details)
|
|
2005
|
+
|
|
2006
|
+
return @api_client.call_api(
|
|
2007
|
+
:PUT,
|
|
2008
|
+
path,
|
|
2009
|
+
endpoint,
|
|
2010
|
+
:header_params => header_params,
|
|
2011
|
+
:query_params => query_params,
|
|
2012
|
+
:body => post_body,
|
|
2013
|
+
:return_type => 'OCI::Identity::Models::SwiftPassword')
|
|
2014
|
+
end
|
|
2015
|
+
|
|
2016
|
+
# Updates the description of the specified user.
|
|
2017
|
+
# @param [String] user_id The OCID of the user.
|
|
2018
|
+
# @param [UpdateUserDetails] update_user_details Request object for updating a user.
|
|
2019
|
+
# @param [Hash] opts the optional parameters
|
|
2020
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
|
|
2021
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
2022
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
2023
|
+
#
|
|
2024
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::User
|
|
2025
|
+
def update_user(user_id, update_user_details, opts = {})
|
|
2026
|
+
logger.debug "Calling operation IdentityClient#update_user." if logger
|
|
2027
|
+
|
|
2028
|
+
fail "Missing the required parameter 'user_id' when calling update_user." if user_id.nil?
|
|
2029
|
+
fail "Missing the required parameter 'update_user_details' when calling update_user." if update_user_details.nil?
|
|
2030
|
+
|
|
2031
|
+
path = "/users/{userId}".sub('{userId}', user_id.to_s)
|
|
2032
|
+
|
|
2033
|
+
# Query Params
|
|
2034
|
+
query_params = {}
|
|
2035
|
+
|
|
2036
|
+
# Header Params
|
|
2037
|
+
header_params = {}
|
|
2038
|
+
header_params['accept'] = 'application/json'
|
|
2039
|
+
header_params['content-type'] = 'application/json'
|
|
2040
|
+
header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
|
|
2041
|
+
|
|
2042
|
+
post_body = @api_client.object_to_http_body(update_user_details)
|
|
2043
|
+
|
|
2044
|
+
return @api_client.call_api(
|
|
2045
|
+
:PUT,
|
|
2046
|
+
path,
|
|
2047
|
+
endpoint,
|
|
2048
|
+
:header_params => header_params,
|
|
2049
|
+
:query_params => query_params,
|
|
2050
|
+
:body => post_body,
|
|
2051
|
+
:return_type => 'OCI::Identity::Models::User')
|
|
2052
|
+
end
|
|
2053
|
+
|
|
2054
|
+
# Updates the state of the specified user.
|
|
2055
|
+
#
|
|
2056
|
+
# @param [String] user_id The OCID of the user.
|
|
2057
|
+
# @param [UpdateStateDetails] update_state_details Request object for updating a user state.
|
|
2058
|
+
# @param [Hash] opts the optional parameters
|
|
2059
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the `if-match`
|
|
2060
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
2061
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
2062
|
+
#
|
|
2063
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::User
|
|
2064
|
+
def update_user_state(user_id, update_state_details, opts = {})
|
|
2065
|
+
logger.debug "Calling operation IdentityClient#update_user_state." if logger
|
|
2066
|
+
|
|
2067
|
+
fail "Missing the required parameter 'user_id' when calling update_user_state." if user_id.nil?
|
|
2068
|
+
fail "Missing the required parameter 'update_state_details' when calling update_user_state." if update_state_details.nil?
|
|
2069
|
+
|
|
2070
|
+
path = "/users/{userId}/state/".sub('{userId}', user_id.to_s)
|
|
2071
|
+
|
|
2072
|
+
# Query Params
|
|
2073
|
+
query_params = {}
|
|
2074
|
+
|
|
2075
|
+
# Header Params
|
|
2076
|
+
header_params = {}
|
|
2077
|
+
header_params['accept'] = 'application/json'
|
|
2078
|
+
header_params['content-type'] = 'application/json'
|
|
2079
|
+
header_params[:'if-match'] = opts[:'if_match'] if opts[:'if_match']
|
|
2080
|
+
|
|
2081
|
+
post_body = @api_client.object_to_http_body(update_state_details)
|
|
2082
|
+
|
|
2083
|
+
return @api_client.call_api(
|
|
2084
|
+
:PUT,
|
|
2085
|
+
path,
|
|
2086
|
+
endpoint,
|
|
2087
|
+
:header_params => header_params,
|
|
2088
|
+
:query_params => query_params,
|
|
2089
|
+
:body => post_body,
|
|
2090
|
+
:return_type => 'OCI::Identity::Models::User')
|
|
2091
|
+
end
|
|
2092
|
+
|
|
2093
|
+
# Uploads an API signing key for the specified user.
|
|
2094
|
+
#
|
|
2095
|
+
# Every user has permission to use this operation to upload a key for *their own user ID*. An
|
|
2096
|
+
# administrator in your organization does not need to write a policy to give users this ability.
|
|
2097
|
+
# To compare, administrators who have permission to the tenancy can use this operation to upload a
|
|
2098
|
+
# key for any user, including themselves.
|
|
2099
|
+
#
|
|
2100
|
+
# **Important:** Even though you have permission to upload an API key, you might not yet
|
|
2101
|
+
# have permission to do much else. If you try calling an operation unrelated to your own credential
|
|
2102
|
+
# management (e.g., `ListUsers`, `LaunchInstance`) and receive an \"unauthorized\" error,
|
|
2103
|
+
# check with an administrator to confirm which IAM Service group(s) you're in and what access
|
|
2104
|
+
# you have. Also confirm you're working in the correct compartment.
|
|
2105
|
+
#
|
|
2106
|
+
# After you send your request, the new object's `lifecycleState` will temporarily be CREATING. Before using
|
|
2107
|
+
# the object, first make sure its `lifecycleState` has changed to ACTIVE.
|
|
2108
|
+
#
|
|
2109
|
+
# @param [String] user_id The OCID of the user.
|
|
2110
|
+
# @param [CreateApiKeyDetails] create_api_key_details Request object for uploading an API key for a user.
|
|
2111
|
+
# @param [Hash] opts the optional parameters
|
|
2112
|
+
# @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
|
|
2113
|
+
# server error without risk of executing that same action again. Retry tokens expire after 24
|
|
2114
|
+
# hours, but can be invalidated before then due to conflicting operations (e.g., if a resource
|
|
2115
|
+
# has been deleted and purged from the system, then a retry of the original creation request
|
|
2116
|
+
# may be rejected).
|
|
2117
|
+
#
|
|
2118
|
+
# @return [Response] A Response object with data of type OCI::Identity::Models::ApiKey
|
|
2119
|
+
def upload_api_key(user_id, create_api_key_details, opts = {})
|
|
2120
|
+
logger.debug "Calling operation IdentityClient#upload_api_key." if logger
|
|
2121
|
+
|
|
2122
|
+
fail "Missing the required parameter 'user_id' when calling upload_api_key." if user_id.nil?
|
|
2123
|
+
fail "Missing the required parameter 'create_api_key_details' when calling upload_api_key." if create_api_key_details.nil?
|
|
2124
|
+
|
|
2125
|
+
path = "/users/{userId}/apiKeys/".sub('{userId}', user_id.to_s)
|
|
2126
|
+
|
|
2127
|
+
# Query Params
|
|
2128
|
+
query_params = {}
|
|
2129
|
+
|
|
2130
|
+
# Header Params
|
|
2131
|
+
header_params = {}
|
|
2132
|
+
header_params['accept'] = 'application/json'
|
|
2133
|
+
header_params['content-type'] = 'application/json'
|
|
2134
|
+
header_params[:'opc-retry-token'] = opts[:'opc_retry_token'] if opts[:'opc_retry_token']
|
|
2135
|
+
|
|
2136
|
+
post_body = @api_client.object_to_http_body(create_api_key_details)
|
|
2137
|
+
|
|
2138
|
+
return @api_client.call_api(
|
|
2139
|
+
:POST,
|
|
2140
|
+
path,
|
|
2141
|
+
endpoint,
|
|
2142
|
+
:header_params => header_params,
|
|
2143
|
+
:query_params => query_params,
|
|
2144
|
+
:body => post_body,
|
|
2145
|
+
:return_type => 'OCI::Identity::Models::ApiKey')
|
|
2146
|
+
end
|
|
2147
|
+
end
|
|
2148
|
+
end
|