oci 2.0.1 → 2.0.2
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 +4 -4
- data/README.md +3 -2
- data/lib/oci.rb +2 -1
- data/lib/oci/audit/audit.rb +19 -0
- data/lib/oci/audit/audit_client.rb +176 -0
- data/lib/oci/audit/models/audit_event.rb +307 -0
- data/lib/oci/audit/models/configuration.rb +120 -0
- data/lib/oci/audit/models/update_configuration_details.rb +120 -0
- data/lib/oci/audit/util.rb +1 -0
- data/lib/oci/core/blockstorage_client.rb +69 -1
- data/lib/oci/core/compute_client.rb +106 -16
- data/lib/oci/core/core.rb +3 -0
- data/lib/oci/core/models/attach_i_scsi_volume_details.rb +2 -2
- data/lib/oci/core/models/attach_vnic_details.rb +2 -2
- data/lib/oci/core/models/attach_volume_details.rb +2 -2
- data/lib/oci/core/models/capture_console_history_details.rb +2 -2
- data/lib/oci/core/models/console_history.rb +2 -2
- data/lib/oci/core/models/cpe.rb +2 -2
- data/lib/oci/core/models/create_cpe_details.rb +2 -2
- data/lib/oci/core/models/create_cross_connect_details.rb +2 -2
- data/lib/oci/core/models/create_cross_connect_group_details.rb +2 -2
- data/lib/oci/core/models/create_dhcp_details.rb +2 -2
- data/lib/oci/core/models/create_drg_attachment_details.rb +2 -2
- data/lib/oci/core/models/create_drg_details.rb +2 -2
- data/lib/oci/core/models/create_image_details.rb +2 -2
- data/lib/oci/core/models/create_instance_console_connection_details.rb +2 -2
- data/lib/oci/core/models/create_internet_gateway_details.rb +2 -2
- data/lib/oci/core/models/create_ip_sec_connection_details.rb +2 -2
- data/lib/oci/core/models/create_private_ip_details.rb +2 -2
- data/lib/oci/core/models/create_route_table_details.rb +2 -2
- data/lib/oci/core/models/create_security_list_details.rb +2 -2
- data/lib/oci/core/models/create_subnet_details.rb +2 -2
- data/lib/oci/core/models/create_vcn_details.rb +2 -2
- data/lib/oci/core/models/create_virtual_circuit_details.rb +5 -6
- data/lib/oci/core/models/create_vnic_details.rb +2 -2
- data/lib/oci/core/models/create_volume_backup_details.rb +2 -2
- data/lib/oci/core/models/create_volume_details.rb +20 -4
- data/lib/oci/core/models/cross_connect.rb +2 -2
- data/lib/oci/core/models/cross_connect_group.rb +2 -2
- data/lib/oci/core/models/cross_connect_location.rb +2 -2
- data/lib/oci/core/models/cross_connect_mapping.rb +2 -2
- data/lib/oci/core/models/cross_connect_port_speed_shape.rb +2 -2
- data/lib/oci/core/models/cross_connect_status.rb +2 -2
- data/lib/oci/core/models/dhcp_dns_option.rb +2 -2
- data/lib/oci/core/models/dhcp_option.rb +2 -2
- data/lib/oci/core/models/dhcp_options.rb +2 -2
- data/lib/oci/core/models/dhcp_search_domain_option.rb +2 -2
- data/lib/oci/core/models/drg.rb +2 -2
- data/lib/oci/core/models/drg_attachment.rb +2 -2
- data/lib/oci/core/models/egress_security_rule.rb +2 -2
- data/lib/oci/core/models/export_image_details.rb +3 -3
- data/lib/oci/core/models/export_image_via_object_storage_tuple_details.rb +5 -5
- data/lib/oci/core/models/export_image_via_object_storage_uri_details.rb +3 -3
- data/lib/oci/core/models/fast_connect_provider_service.rb +2 -2
- data/lib/oci/core/models/i_scsi_volume_attachment.rb +2 -2
- data/lib/oci/core/models/icmp_options.rb +2 -2
- data/lib/oci/core/models/image.rb +2 -2
- data/lib/oci/core/models/image_source_details.rb +3 -3
- data/lib/oci/core/models/image_source_via_object_storage_tuple_details.rb +5 -5
- data/lib/oci/core/models/image_source_via_object_storage_uri_details.rb +3 -3
- data/lib/oci/core/models/ingress_security_rule.rb +2 -2
- data/lib/oci/core/models/instance.rb +4 -4
- data/lib/oci/core/models/instance_console_connection.rb +2 -2
- data/lib/oci/core/models/instance_credentials.rb +2 -2
- data/lib/oci/core/models/internet_gateway.rb +2 -2
- data/lib/oci/core/models/ip_sec_connection.rb +2 -2
- data/lib/oci/core/models/ip_sec_connection_device_config.rb +2 -2
- data/lib/oci/core/models/ip_sec_connection_device_status.rb +2 -2
- data/lib/oci/core/models/launch_instance_details.rb +4 -4
- data/lib/oci/core/models/letter_of_authority.rb +2 -2
- data/lib/oci/core/models/port_range.rb +2 -2
- data/lib/oci/core/models/private_ip.rb +2 -2
- data/lib/oci/core/models/route_rule.rb +2 -2
- data/lib/oci/core/models/route_table.rb +2 -2
- data/lib/oci/core/models/security_list.rb +2 -2
- data/lib/oci/core/models/shape.rb +2 -2
- data/lib/oci/core/models/subnet.rb +2 -2
- data/lib/oci/core/models/tcp_options.rb +2 -2
- data/lib/oci/core/models/tunnel_config.rb +2 -2
- data/lib/oci/core/models/tunnel_status.rb +2 -2
- data/lib/oci/core/models/udp_options.rb +2 -2
- data/lib/oci/core/models/update_console_history_details.rb +2 -2
- data/lib/oci/core/models/update_cpe_details.rb +2 -2
- data/lib/oci/core/models/update_cross_connect_details.rb +2 -2
- data/lib/oci/core/models/update_cross_connect_group_details.rb +2 -2
- data/lib/oci/core/models/update_dhcp_details.rb +2 -2
- data/lib/oci/core/models/update_drg_attachment_details.rb +2 -2
- data/lib/oci/core/models/update_drg_details.rb +2 -2
- data/lib/oci/core/models/update_image_details.rb +2 -2
- data/lib/oci/core/models/update_instance_details.rb +2 -2
- data/lib/oci/core/models/update_internet_gateway_details.rb +2 -2
- data/lib/oci/core/models/update_ip_sec_connection_details.rb +2 -2
- data/lib/oci/core/models/update_private_ip_details.rb +2 -2
- data/lib/oci/core/models/update_route_table_details.rb +2 -2
- data/lib/oci/core/models/update_security_list_details.rb +2 -2
- data/lib/oci/core/models/update_subnet_details.rb +2 -2
- data/lib/oci/core/models/update_vcn_details.rb +2 -2
- data/lib/oci/core/models/update_virtual_circuit_details.rb +2 -3
- data/lib/oci/core/models/update_vnic_details.rb +2 -2
- data/lib/oci/core/models/update_volume_backup_details.rb +2 -2
- data/lib/oci/core/models/update_volume_details.rb +2 -2
- data/lib/oci/core/models/vcn.rb +2 -2
- data/lib/oci/core/models/virtual_circuit.rb +5 -5
- data/lib/oci/core/models/virtual_circuit_bandwidth_shape.rb +2 -2
- data/lib/oci/core/models/vnic.rb +2 -2
- data/lib/oci/core/models/vnic_attachment.rb +2 -2
- data/lib/oci/core/models/volume.rb +29 -5
- data/lib/oci/core/models/volume_attachment.rb +2 -2
- data/lib/oci/core/models/volume_backup.rb +2 -2
- data/lib/oci/core/models/volume_source_details.rb +131 -0
- data/lib/oci/core/models/volume_source_from_volume_backup_details.rb +128 -0
- data/lib/oci/core/models/volume_source_from_volume_details.rb +128 -0
- data/lib/oci/core/virtual_network_client.rb +312 -10
- data/lib/oci/database/database.rb +7 -0
- data/lib/oci/database/database_client.rb +228 -4
- data/lib/oci/database/models/backup.rb +253 -0
- data/lib/oci/database/models/backup_summary.rb +253 -0
- data/lib/oci/database/models/create_backup_details.rb +131 -0
- data/lib/oci/database/models/create_data_guard_association_details.rb +2 -2
- data/lib/oci/database/models/create_data_guard_association_to_existing_db_system_details.rb +2 -2
- data/lib/oci/database/models/create_database_details.rb +13 -3
- data/lib/oci/database/models/create_db_home_details.rb +2 -2
- data/lib/oci/database/models/create_db_home_with_db_system_id_details.rb +2 -2
- data/lib/oci/database/models/data_guard_association.rb +2 -2
- data/lib/oci/database/models/data_guard_association_summary.rb +374 -0
- data/lib/oci/database/models/database.rb +15 -3
- data/lib/oci/database/models/database_summary.rb +15 -3
- data/lib/oci/database/models/db_backup_config.rb +120 -0
- data/lib/oci/database/models/db_home.rb +2 -2
- data/lib/oci/database/models/db_home_summary.rb +2 -2
- data/lib/oci/database/models/db_node.rb +2 -2
- data/lib/oci/database/models/db_node_summary.rb +2 -2
- data/lib/oci/database/models/db_system.rb +9 -9
- data/lib/oci/database/models/db_system_shape_summary.rb +2 -2
- data/lib/oci/database/models/db_system_summary.rb +9 -9
- data/lib/oci/database/models/db_version_summary.rb +2 -2
- data/lib/oci/database/models/failover_data_guard_association_details.rb +2 -2
- data/lib/oci/database/models/launch_db_system_details.rb +2 -2
- data/lib/oci/database/models/patch.rb +4 -2
- data/lib/oci/database/models/patch_details.rb +4 -3
- data/lib/oci/database/models/patch_history_entry.rb +3 -2
- data/lib/oci/database/models/patch_history_entry_summary.rb +3 -2
- data/lib/oci/database/models/patch_summary.rb +4 -2
- data/lib/oci/database/models/reinstate_data_guard_association_details.rb +2 -2
- data/lib/oci/database/models/restore_database_details.rb +145 -0
- data/lib/oci/database/models/switchover_data_guard_association_details.rb +2 -2
- data/lib/oci/database/models/update_database_details.rb +119 -0
- data/lib/oci/database/models/update_db_home_details.rb +2 -2
- data/lib/oci/database/models/update_db_system_details.rb +9 -9
- data/lib/oci/identity/identity_client.rb +6 -5
- data/lib/oci/identity/models/add_user_to_group_details.rb +2 -2
- data/lib/oci/identity/models/api_key.rb +2 -2
- data/lib/oci/identity/models/availability_domain.rb +2 -2
- data/lib/oci/identity/models/compartment.rb +3 -3
- data/lib/oci/identity/models/create_api_key_details.rb +2 -2
- data/lib/oci/identity/models/create_compartment_details.rb +2 -2
- data/lib/oci/identity/models/create_customer_secret_key_details.rb +2 -2
- data/lib/oci/identity/models/create_group_details.rb +2 -2
- data/lib/oci/identity/models/create_identity_provider_details.rb +2 -2
- data/lib/oci/identity/models/create_idp_group_mapping_details.rb +2 -2
- data/lib/oci/identity/models/create_policy_details.rb +2 -2
- data/lib/oci/identity/models/create_region_subscription_details.rb +2 -2
- data/lib/oci/identity/models/create_saml2_identity_provider_details.rb +2 -2
- data/lib/oci/identity/models/create_swift_password_details.rb +2 -2
- data/lib/oci/identity/models/create_user_details.rb +2 -2
- data/lib/oci/identity/models/customer_secret_key.rb +2 -2
- data/lib/oci/identity/models/customer_secret_key_summary.rb +2 -2
- data/lib/oci/identity/models/group.rb +2 -2
- data/lib/oci/identity/models/identity_provider.rb +4 -4
- data/lib/oci/identity/models/idp_group_mapping.rb +2 -2
- data/lib/oci/identity/models/policy.rb +2 -2
- data/lib/oci/identity/models/region.rb +4 -4
- data/lib/oci/identity/models/region_subscription.rb +4 -4
- data/lib/oci/identity/models/saml2_identity_provider.rb +2 -2
- data/lib/oci/identity/models/swift_password.rb +2 -2
- data/lib/oci/identity/models/tenancy.rb +2 -2
- data/lib/oci/identity/models/ui_password.rb +2 -2
- data/lib/oci/identity/models/update_compartment_details.rb +2 -2
- data/lib/oci/identity/models/update_customer_secret_key_details.rb +2 -2
- data/lib/oci/identity/models/update_group_details.rb +2 -2
- data/lib/oci/identity/models/update_identity_provider_details.rb +2 -2
- data/lib/oci/identity/models/update_idp_group_mapping_details.rb +2 -2
- data/lib/oci/identity/models/update_policy_details.rb +2 -2
- data/lib/oci/identity/models/update_saml2_identity_provider_details.rb +2 -2
- data/lib/oci/identity/models/update_state_details.rb +2 -2
- data/lib/oci/identity/models/update_swift_password_details.rb +2 -2
- data/lib/oci/identity/models/update_user_details.rb +2 -2
- data/lib/oci/identity/models/user.rb +2 -2
- data/lib/oci/identity/models/user_group_membership.rb +2 -2
- data/lib/oci/load_balancer/load_balancer_client.rb +1 -1
- data/lib/oci/load_balancer/models/backend.rb +2 -2
- data/lib/oci/load_balancer/models/backend_details.rb +2 -2
- data/lib/oci/load_balancer/models/backend_health.rb +2 -2
- data/lib/oci/load_balancer/models/backend_set.rb +2 -2
- data/lib/oci/load_balancer/models/backend_set_details.rb +2 -2
- data/lib/oci/load_balancer/models/backend_set_health.rb +2 -2
- data/lib/oci/load_balancer/models/certificate.rb +2 -2
- data/lib/oci/load_balancer/models/certificate_details.rb +2 -2
- data/lib/oci/load_balancer/models/create_backend_details.rb +2 -2
- data/lib/oci/load_balancer/models/create_backend_set_details.rb +2 -2
- data/lib/oci/load_balancer/models/create_certificate_details.rb +2 -2
- data/lib/oci/load_balancer/models/create_listener_details.rb +2 -2
- data/lib/oci/load_balancer/models/create_load_balancer_details.rb +2 -2
- data/lib/oci/load_balancer/models/health_check_result.rb +2 -2
- data/lib/oci/load_balancer/models/health_checker.rb +2 -2
- data/lib/oci/load_balancer/models/health_checker_details.rb +2 -2
- data/lib/oci/load_balancer/models/ip_address.rb +2 -2
- data/lib/oci/load_balancer/models/listener.rb +2 -2
- data/lib/oci/load_balancer/models/listener_details.rb +2 -2
- data/lib/oci/load_balancer/models/load_balancer.rb +2 -2
- data/lib/oci/load_balancer/models/load_balancer_health.rb +2 -2
- data/lib/oci/load_balancer/models/load_balancer_health_summary.rb +2 -2
- data/lib/oci/load_balancer/models/load_balancer_policy.rb +2 -2
- data/lib/oci/load_balancer/models/load_balancer_protocol.rb +2 -2
- data/lib/oci/load_balancer/models/load_balancer_shape.rb +2 -2
- data/lib/oci/load_balancer/models/session_persistence_configuration_details.rb +2 -2
- data/lib/oci/load_balancer/models/ssl_configuration.rb +2 -2
- data/lib/oci/load_balancer/models/ssl_configuration_details.rb +2 -2
- data/lib/oci/load_balancer/models/update_backend_details.rb +2 -2
- data/lib/oci/load_balancer/models/update_backend_set_details.rb +2 -2
- data/lib/oci/load_balancer/models/update_health_checker_details.rb +2 -2
- data/lib/oci/load_balancer/models/update_listener_details.rb +2 -2
- data/lib/oci/load_balancer/models/update_load_balancer_details.rb +2 -2
- data/lib/oci/load_balancer/models/work_request.rb +2 -2
- data/lib/oci/load_balancer/models/work_request_error.rb +2 -2
- data/lib/oci/object_storage/models/bucket.rb +44 -12
- data/lib/oci/object_storage/models/bucket_summary.rb +6 -4
- data/lib/oci/object_storage/models/commit_multipart_upload_details.rb +2 -2
- data/lib/oci/object_storage/models/commit_multipart_upload_part_details.rb +2 -2
- data/lib/oci/object_storage/models/create_bucket_details.rb +41 -11
- data/lib/oci/object_storage/models/create_multipart_upload_details.rb +9 -7
- data/lib/oci/object_storage/models/create_preauthenticated_request_details.rb +6 -7
- data/lib/oci/object_storage/models/list_objects.rb +4 -3
- data/lib/oci/object_storage/models/multipart_upload.rb +3 -3
- data/lib/oci/object_storage/models/multipart_upload_part_summary.rb +6 -6
- data/lib/oci/object_storage/models/namespace_metadata.rb +142 -0
- data/lib/oci/object_storage/models/object_summary.rb +6 -4
- data/lib/oci/object_storage/models/preauthenticated_request.rb +13 -11
- data/lib/oci/object_storage/models/preauthenticated_request_summary.rb +8 -10
- data/lib/oci/object_storage/models/rename_object_details.rb +164 -0
- data/lib/oci/object_storage/models/restore_objects_details.rb +120 -0
- data/lib/oci/object_storage/models/update_bucket_details.rb +20 -8
- data/lib/oci/object_storage/models/update_namespace_metadata_details.rb +131 -0
- data/lib/oci/object_storage/object_storage.rb +4 -0
- data/lib/oci/object_storage/object_storage_client.rb +206 -94
- data/lib/oci/regions.rb +2 -1
- data/lib/oci/version.rb +1 -1
- metadata +22 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a2547706fa1e10fb27e6c82edc90e6ee138f65d1
|
|
4
|
+
data.tar.gz: e2f85e45a41f48d2a92174468bed39ac1658804c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 537d4e1e3a4d61314e6d48f88c5f5a6f5450358c6d3bca3a3742a7ab9b1f2ca4ce7a2ff2ebddb9b0b4b023569f6d60190bb04887e50b6d8fbf9fadb85db6ecfe
|
|
7
|
+
data.tar.gz: d7862eed2f006296f3b9797d05a027cda94ceb4de85d0a867bf5dc36d7bd47b9addc47758efb928cba7228920731e8d01a564a452087d106efdb5e22df45dce3
|
data/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Oracle Cloud Infrastructure Ruby SDK
|
|
2
|
-
**Version 2.0.
|
|
2
|
+
**Version 2.0.2**
|
|
3
3
|
|
|
4
4
|
This topic describes how to install, configure, and use the Oracle Cloud Infrastructure Ruby SDK.
|
|
5
5
|
|
|
@@ -7,11 +7,12 @@ This topic describes how to install, configure, and use the Oracle Cloud Infrast
|
|
|
7
7
|
|
|
8
8
|
The Ruby SDK supports the following services:
|
|
9
9
|
|
|
10
|
+
* Audit
|
|
10
11
|
* Core Services (which includes Networking Service, Compute Service, and Block Volume Service)
|
|
12
|
+
* Database Service
|
|
11
13
|
* Identity and Access Management Service
|
|
12
14
|
* Load Balancing Service
|
|
13
15
|
* Object Storage Service
|
|
14
|
-
* Database Service
|
|
15
16
|
|
|
16
17
|
**Licensing:** This SDK and sample is dual licensed under the Universal Permissive License 1.0 and the Apache License.
|
|
17
18
|
|
data/lib/oci.rb
CHANGED
|
@@ -13,11 +13,12 @@ require 'oci/signer'
|
|
|
13
13
|
require 'oci/version'
|
|
14
14
|
require 'oci/waiter'
|
|
15
15
|
|
|
16
|
+
require 'oci/audit/audit'
|
|
16
17
|
require 'oci/core/core'
|
|
18
|
+
require 'oci/database/database'
|
|
17
19
|
require 'oci/identity/identity'
|
|
18
20
|
require 'oci/load_balancer/load_balancer'
|
|
19
21
|
require 'oci/object_storage/object_storage'
|
|
20
|
-
require 'oci/database/database'
|
|
21
22
|
|
|
22
23
|
# Top level module for the Oracle Cloud Infrastructure SDK
|
|
23
24
|
module OCI
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
module OCI
|
|
4
|
+
module Audit
|
|
5
|
+
module Models
|
|
6
|
+
end
|
|
7
|
+
end
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
# Require models
|
|
11
|
+
require 'oci/audit/models/audit_event'
|
|
12
|
+
require 'oci/audit/models/configuration'
|
|
13
|
+
require 'oci/audit/models/update_configuration_details'
|
|
14
|
+
|
|
15
|
+
# Require generated clients
|
|
16
|
+
require 'oci/audit/audit_client'
|
|
17
|
+
|
|
18
|
+
# Require service utilities
|
|
19
|
+
require 'oci/audit/util'
|
|
@@ -0,0 +1,176 @@
|
|
|
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 Audit::AuditClient
|
|
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 AuditClient.
|
|
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, signing_strategy: Signer::STANDARD)
|
|
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, :AuditClient) + '/20160918'
|
|
52
|
+
logger.info "AuditClient 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
|
+
# Get the configuration
|
|
62
|
+
# @param [String] compartment_id ID of the root compartment (tenancy)
|
|
63
|
+
# @param [Hash] opts the optional parameters
|
|
64
|
+
# @return [Response] A Response object with data of type OCI::Audit::Models::Configuration
|
|
65
|
+
def get_configuration(compartment_id, opts = {})
|
|
66
|
+
logger.debug "Calling operation AuditClient#get_configuration." if logger
|
|
67
|
+
|
|
68
|
+
fail "Missing the required parameter 'compartment_id' when calling get_configuration." if compartment_id.nil?
|
|
69
|
+
|
|
70
|
+
path = "/configuration"
|
|
71
|
+
|
|
72
|
+
# Query Params
|
|
73
|
+
query_params = {}
|
|
74
|
+
query_params[:'compartmentId'] = compartment_id
|
|
75
|
+
|
|
76
|
+
# Header Params
|
|
77
|
+
header_params = {}
|
|
78
|
+
header_params['accept'] = 'application/json'
|
|
79
|
+
header_params['content-type'] = 'application/json'
|
|
80
|
+
|
|
81
|
+
post_body = nil
|
|
82
|
+
|
|
83
|
+
return @api_client.call_api(
|
|
84
|
+
:GET,
|
|
85
|
+
path,
|
|
86
|
+
endpoint,
|
|
87
|
+
:header_params => header_params,
|
|
88
|
+
:query_params => query_params,
|
|
89
|
+
:body => post_body,
|
|
90
|
+
:return_type => 'OCI::Audit::Models::Configuration')
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Returns all audit events for the specified compartment that were processed within the specified time range.
|
|
94
|
+
# @param [String] compartment_id The OCID of the compartment.
|
|
95
|
+
# @param [DateTime] start_time Returns events that were processed at or after this start date and time, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format.
|
|
96
|
+
# For example, a start value of `2017-01-15T11:30:00Z` will retrieve a list of all events processed since 30 minutes after the 11th hour of January 15, 2017, in Coordinated Universal Time (UTC).
|
|
97
|
+
# You can specify a value with granularity to the minute. Seconds (and milliseconds, if included) must be set to `0`.
|
|
98
|
+
#
|
|
99
|
+
# @param [DateTime] end_time Returns events that were processed before this end date and time, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format. For example, a start value of `2017-01-01T00:00:00Z` and an end value of `2017-01-02T00:00:00Z` will retrieve a list of all events processed on January 1, 2017.
|
|
100
|
+
# Similarly, a start value of `2017-01-01T00:00:00Z` and an end value of `2017-02-01T00:00:00Z` will result in a list of all events processed between January 1, 2017 and January 31, 2017.
|
|
101
|
+
# You can specify a value with granularity to the minute. Seconds (and milliseconds, if included) must be set to `0`.
|
|
102
|
+
#
|
|
103
|
+
# @param [Hash] opts the optional parameters
|
|
104
|
+
# @option opts [String] :page The value of the `opc-next-page` response header from the previous list query.
|
|
105
|
+
# @option opts [String] :opc_request_id Unique Oracle-assigned identifier for the request.
|
|
106
|
+
# If you need to contact Oracle about a particular request, please provide the request ID.
|
|
107
|
+
#
|
|
108
|
+
# @return [Response] A Response object with data of type Array<OCI::Audit::Models::AuditEvent>
|
|
109
|
+
def list_events(compartment_id, start_time, end_time, opts = {})
|
|
110
|
+
logger.debug "Calling operation AuditClient#list_events." if logger
|
|
111
|
+
|
|
112
|
+
fail "Missing the required parameter 'compartment_id' when calling list_events." if compartment_id.nil?
|
|
113
|
+
fail "Missing the required parameter 'start_time' when calling list_events." if start_time.nil?
|
|
114
|
+
fail "Missing the required parameter 'end_time' when calling list_events." if end_time.nil?
|
|
115
|
+
|
|
116
|
+
path = "/auditEvents"
|
|
117
|
+
|
|
118
|
+
# Query Params
|
|
119
|
+
query_params = {}
|
|
120
|
+
query_params[:'compartmentId'] = compartment_id
|
|
121
|
+
query_params[:'startTime'] = start_time
|
|
122
|
+
query_params[:'endTime'] = end_time
|
|
123
|
+
query_params[:'page'] = opts[:'page'] if opts[:'page']
|
|
124
|
+
|
|
125
|
+
# Header Params
|
|
126
|
+
header_params = {}
|
|
127
|
+
header_params['accept'] = 'application/json'
|
|
128
|
+
header_params['content-type'] = 'application/json'
|
|
129
|
+
header_params[:'opc-request-id'] = opts[:'opc_request_id'] if opts[:'opc_request_id']
|
|
130
|
+
|
|
131
|
+
post_body = nil
|
|
132
|
+
|
|
133
|
+
return @api_client.call_api(
|
|
134
|
+
:GET,
|
|
135
|
+
path,
|
|
136
|
+
endpoint,
|
|
137
|
+
:header_params => header_params,
|
|
138
|
+
:query_params => query_params,
|
|
139
|
+
:body => post_body,
|
|
140
|
+
:return_type => 'Array<OCI::Audit::Models::AuditEvent>')
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Update the configuration
|
|
144
|
+
# @param [String] compartment_id ID of the root compartment (tenancy)
|
|
145
|
+
# @param [UpdateConfigurationDetails] update_configuration_details The configuration properties
|
|
146
|
+
# @param [Hash] opts the optional parameters
|
|
147
|
+
# @return [Response] A Response object with data of type nil
|
|
148
|
+
def update_configuration(compartment_id, update_configuration_details, opts = {})
|
|
149
|
+
logger.debug "Calling operation AuditClient#update_configuration." if logger
|
|
150
|
+
|
|
151
|
+
fail "Missing the required parameter 'compartment_id' when calling update_configuration." if compartment_id.nil?
|
|
152
|
+
fail "Missing the required parameter 'update_configuration_details' when calling update_configuration." if update_configuration_details.nil?
|
|
153
|
+
|
|
154
|
+
path = "/configuration"
|
|
155
|
+
|
|
156
|
+
# Query Params
|
|
157
|
+
query_params = {}
|
|
158
|
+
query_params[:'compartmentId'] = compartment_id
|
|
159
|
+
|
|
160
|
+
# Header Params
|
|
161
|
+
header_params = {}
|
|
162
|
+
header_params['accept'] = 'application/json'
|
|
163
|
+
header_params['content-type'] = 'application/json'
|
|
164
|
+
|
|
165
|
+
post_body = @api_client.object_to_http_body(update_configuration_details)
|
|
166
|
+
|
|
167
|
+
return @api_client.call_api(
|
|
168
|
+
:PUT,
|
|
169
|
+
path,
|
|
170
|
+
endpoint,
|
|
171
|
+
:header_params => header_params,
|
|
172
|
+
:query_params => query_params,
|
|
173
|
+
:body => post_body)
|
|
174
|
+
end
|
|
175
|
+
end
|
|
176
|
+
end
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
require 'date'
|
|
4
|
+
|
|
5
|
+
module OCI
|
|
6
|
+
class Audit::Models::AuditEvent
|
|
7
|
+
# The OCID of the tenant.
|
|
8
|
+
# @return [String]
|
|
9
|
+
attr_accessor :tenant_id
|
|
10
|
+
|
|
11
|
+
# The OCID of the compartment.
|
|
12
|
+
# @return [String]
|
|
13
|
+
attr_accessor :compartment_id
|
|
14
|
+
|
|
15
|
+
# The GUID of the event.
|
|
16
|
+
# @return [String]
|
|
17
|
+
attr_accessor :event_id
|
|
18
|
+
|
|
19
|
+
# The source of the event.
|
|
20
|
+
# @return [String]
|
|
21
|
+
attr_accessor :event_source
|
|
22
|
+
|
|
23
|
+
# The type of the event.
|
|
24
|
+
# @return [String]
|
|
25
|
+
attr_accessor :event_type
|
|
26
|
+
|
|
27
|
+
# The time the event occurred, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format.
|
|
28
|
+
# @return [DateTime]
|
|
29
|
+
attr_accessor :event_time
|
|
30
|
+
|
|
31
|
+
# The OCID of the user whose action triggered the event.
|
|
32
|
+
# @return [String]
|
|
33
|
+
attr_accessor :principal_id
|
|
34
|
+
|
|
35
|
+
# The credential ID of the user. This value is extracted from the HTTP 'Authorization' request header. It consists of the tenantId, userId, and user fingerprint, all delimited by a slash (/).
|
|
36
|
+
# @return [String]
|
|
37
|
+
attr_accessor :credential_id
|
|
38
|
+
|
|
39
|
+
# The HTTP method of the request.
|
|
40
|
+
# @return [String]
|
|
41
|
+
attr_accessor :request_action
|
|
42
|
+
|
|
43
|
+
# The opc-request-id of the request.
|
|
44
|
+
# @return [String]
|
|
45
|
+
attr_accessor :request_id
|
|
46
|
+
|
|
47
|
+
# The user agent of the client that made the request.
|
|
48
|
+
# @return [String]
|
|
49
|
+
attr_accessor :request_agent
|
|
50
|
+
|
|
51
|
+
# The HTTP header fields and values in the request.
|
|
52
|
+
# @return [Hash<String, Array<String>>]
|
|
53
|
+
attr_accessor :request_headers
|
|
54
|
+
|
|
55
|
+
# The IP address of the source of the request.
|
|
56
|
+
# @return [String]
|
|
57
|
+
attr_accessor :request_origin
|
|
58
|
+
|
|
59
|
+
# The query parameter fields and values for the request.
|
|
60
|
+
# @return [Hash<String, Array<String>>]
|
|
61
|
+
attr_accessor :request_parameters
|
|
62
|
+
|
|
63
|
+
# The resource targeted by the request.
|
|
64
|
+
# @return [String]
|
|
65
|
+
attr_accessor :request_resource
|
|
66
|
+
|
|
67
|
+
# The headers of the response.
|
|
68
|
+
# @return [Hash<String, Array<String>>]
|
|
69
|
+
attr_accessor :response_headers
|
|
70
|
+
|
|
71
|
+
# The status code of the response.
|
|
72
|
+
# @return [String]
|
|
73
|
+
attr_accessor :response_status
|
|
74
|
+
|
|
75
|
+
# The time of the response to the audited request, expressed in [RFC 3339](https://tools.ietf.org/html/rfc3339) timestamp format.
|
|
76
|
+
# @return [DateTime]
|
|
77
|
+
attr_accessor :response_time
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
# Initializes the object
|
|
81
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
82
|
+
def initialize(attributes = {})
|
|
83
|
+
return unless attributes.is_a?(Hash)
|
|
84
|
+
|
|
85
|
+
# convert string to symbol for hash key
|
|
86
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
87
|
+
|
|
88
|
+
if attributes[:'tenantId']
|
|
89
|
+
self.tenant_id = attributes[:'tenantId']
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes[:'compartmentId']
|
|
93
|
+
self.compartment_id = attributes[:'compartmentId']
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes[:'eventId']
|
|
97
|
+
self.event_id = attributes[:'eventId']
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes[:'eventSource']
|
|
101
|
+
self.event_source = attributes[:'eventSource']
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
if attributes[:'eventType']
|
|
105
|
+
self.event_type = attributes[:'eventType']
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if attributes[:'eventTime']
|
|
109
|
+
self.event_time = attributes[:'eventTime']
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes[:'principalId']
|
|
113
|
+
self.principal_id = attributes[:'principalId']
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if attributes[:'credentialId']
|
|
117
|
+
self.credential_id = attributes[:'credentialId']
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
if attributes[:'requestAction']
|
|
121
|
+
self.request_action = attributes[:'requestAction']
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
if attributes[:'requestId']
|
|
125
|
+
self.request_id = attributes[:'requestId']
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if attributes[:'requestAgent']
|
|
129
|
+
self.request_agent = attributes[:'requestAgent']
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if attributes[:'requestHeaders']
|
|
133
|
+
self.request_headers = attributes[:'requestHeaders']
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if attributes[:'requestOrigin']
|
|
137
|
+
self.request_origin = attributes[:'requestOrigin']
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
if attributes[:'requestParameters']
|
|
141
|
+
self.request_parameters = attributes[:'requestParameters']
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
if attributes[:'requestResource']
|
|
145
|
+
self.request_resource = attributes[:'requestResource']
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
if attributes[:'responseHeaders']
|
|
149
|
+
self.response_headers = attributes[:'responseHeaders']
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
if attributes[:'responseStatus']
|
|
153
|
+
self.response_status = attributes[:'responseStatus']
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
if attributes[:'responseTime']
|
|
157
|
+
self.response_time = attributes[:'responseTime']
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
# Checks equality by comparing each attribute.
|
|
163
|
+
# @param [Object] other_object to be compared
|
|
164
|
+
def ==(other_object)
|
|
165
|
+
return true if self.equal?(other_object)
|
|
166
|
+
self.class == other_object.class &&
|
|
167
|
+
tenant_id == other_object.tenant_id &&
|
|
168
|
+
compartment_id == other_object.compartment_id &&
|
|
169
|
+
event_id == other_object.event_id &&
|
|
170
|
+
event_source == other_object.event_source &&
|
|
171
|
+
event_type == other_object.event_type &&
|
|
172
|
+
event_time == other_object.event_time &&
|
|
173
|
+
principal_id == other_object.principal_id &&
|
|
174
|
+
credential_id == other_object.credential_id &&
|
|
175
|
+
request_action == other_object.request_action &&
|
|
176
|
+
request_id == other_object.request_id &&
|
|
177
|
+
request_agent == other_object.request_agent &&
|
|
178
|
+
request_headers == other_object.request_headers &&
|
|
179
|
+
request_origin == other_object.request_origin &&
|
|
180
|
+
request_parameters == other_object.request_parameters &&
|
|
181
|
+
request_resource == other_object.request_resource &&
|
|
182
|
+
response_headers == other_object.response_headers &&
|
|
183
|
+
response_status == other_object.response_status &&
|
|
184
|
+
response_time == other_object.response_time
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
# @see the `==` method
|
|
188
|
+
# @param [Object] other_object to be compared
|
|
189
|
+
def eql?(other_object)
|
|
190
|
+
self == other_object
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
# Calculates hash code according to all attributes.
|
|
194
|
+
# @return [Fixnum] Hash code
|
|
195
|
+
def hash
|
|
196
|
+
[tenant_id, compartment_id, event_id, event_source, event_type, event_time, principal_id, credential_id, request_action, request_id, request_agent, request_headers, request_origin, request_parameters, request_resource, response_headers, response_status, response_time].hash
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
# Builds the object from hash
|
|
200
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
201
|
+
# @return [Object] Returns the model itself
|
|
202
|
+
def build_from_hash(attributes)
|
|
203
|
+
return nil unless attributes.is_a?(Hash)
|
|
204
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
205
|
+
if type =~ /^Array<(.*)>/i
|
|
206
|
+
# check to ensure the input is an array given that the the attribute
|
|
207
|
+
# is documented as an array but the input is not
|
|
208
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
209
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
|
|
210
|
+
end
|
|
211
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
212
|
+
self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
|
213
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
self
|
|
217
|
+
end
|
|
218
|
+
|
|
219
|
+
# Returns the string representation of the object
|
|
220
|
+
# @return [String] String presentation of the object
|
|
221
|
+
def to_s
|
|
222
|
+
to_hash.to_s
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Returns the object in the form of hash
|
|
226
|
+
# @return [Hash] Returns the object in the form of hash
|
|
227
|
+
def to_hash
|
|
228
|
+
hash = {}
|
|
229
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
230
|
+
value = send(attr)
|
|
231
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
|
232
|
+
hash[param] = _to_hash(value)
|
|
233
|
+
end
|
|
234
|
+
hash
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
private
|
|
238
|
+
|
|
239
|
+
# Outputs non-array value in the form of hash
|
|
240
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
241
|
+
# @param [Object] value Any valid value
|
|
242
|
+
# @return [Hash] Returns the value in the form of hash
|
|
243
|
+
def _to_hash(value)
|
|
244
|
+
if value.is_a?(Array)
|
|
245
|
+
value.compact.map{ |v| _to_hash(v) }
|
|
246
|
+
elsif value.is_a?(Hash)
|
|
247
|
+
{}.tap do |hash|
|
|
248
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
249
|
+
end
|
|
250
|
+
elsif value.respond_to? :to_hash
|
|
251
|
+
value.to_hash
|
|
252
|
+
else
|
|
253
|
+
value
|
|
254
|
+
end
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
260
|
+
def self.attribute_map
|
|
261
|
+
{
|
|
262
|
+
:'tenant_id' => :'tenantId',
|
|
263
|
+
:'compartment_id' => :'compartmentId',
|
|
264
|
+
:'event_id' => :'eventId',
|
|
265
|
+
:'event_source' => :'eventSource',
|
|
266
|
+
:'event_type' => :'eventType',
|
|
267
|
+
:'event_time' => :'eventTime',
|
|
268
|
+
:'principal_id' => :'principalId',
|
|
269
|
+
:'credential_id' => :'credentialId',
|
|
270
|
+
:'request_action' => :'requestAction',
|
|
271
|
+
:'request_id' => :'requestId',
|
|
272
|
+
:'request_agent' => :'requestAgent',
|
|
273
|
+
:'request_headers' => :'requestHeaders',
|
|
274
|
+
:'request_origin' => :'requestOrigin',
|
|
275
|
+
:'request_parameters' => :'requestParameters',
|
|
276
|
+
:'request_resource' => :'requestResource',
|
|
277
|
+
:'response_headers' => :'responseHeaders',
|
|
278
|
+
:'response_status' => :'responseStatus',
|
|
279
|
+
:'response_time' => :'responseTime'
|
|
280
|
+
}
|
|
281
|
+
end
|
|
282
|
+
|
|
283
|
+
# Attribute type mapping.
|
|
284
|
+
def self.swagger_types
|
|
285
|
+
{
|
|
286
|
+
:'tenant_id' => :'String',
|
|
287
|
+
:'compartment_id' => :'String',
|
|
288
|
+
:'event_id' => :'String',
|
|
289
|
+
:'event_source' => :'String',
|
|
290
|
+
:'event_type' => :'String',
|
|
291
|
+
:'event_time' => :'DateTime',
|
|
292
|
+
:'principal_id' => :'String',
|
|
293
|
+
:'credential_id' => :'String',
|
|
294
|
+
:'request_action' => :'String',
|
|
295
|
+
:'request_id' => :'String',
|
|
296
|
+
:'request_agent' => :'String',
|
|
297
|
+
:'request_headers' => :'Hash<String, Array<String>>',
|
|
298
|
+
:'request_origin' => :'String',
|
|
299
|
+
:'request_parameters' => :'Hash<String, Array<String>>',
|
|
300
|
+
:'request_resource' => :'String',
|
|
301
|
+
:'response_headers' => :'Hash<String, Array<String>>',
|
|
302
|
+
:'response_status' => :'String',
|
|
303
|
+
:'response_time' => :'DateTime'
|
|
304
|
+
}
|
|
305
|
+
end
|
|
306
|
+
end
|
|
307
|
+
end
|