oci 2.5.10 → 2.5.11
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 +4 -1
- data/lib/oci.rb +3 -0
- data/lib/oci/budget/budget.rb +1 -0
- data/lib/oci/budget/budget_client.rb +21 -1
- data/lib/oci/budget/models/budget.rb +52 -2
- data/lib/oci/budget/models/budget_summary.rb +52 -2
- data/lib/oci/budget/models/create_budget_details.rb +55 -2
- data/lib/oci/budget/models/target_type.rb +10 -0
- data/lib/oci/core/blockstorage_client.rb +18 -6
- data/lib/oci/core/compute_client.rb +75 -0
- data/lib/oci/core/compute_management_client.rb +4 -1
- data/lib/oci/core/core.rb +12 -0
- data/lib/oci/core/models/add_security_rule_details.rb +2 -2
- data/lib/oci/core/models/boot_volume_backup.rb +19 -1
- data/lib/oci/core/models/change_boot_volume_backup_compartment_details.rb +2 -2
- data/lib/oci/core/models/change_boot_volume_compartment_details.rb +2 -2
- data/lib/oci/core/models/change_cpe_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_cross_connect_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_cross_connect_group_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_instance_compartment_details.rb +154 -0
- data/lib/oci/core/models/change_ip_sec_connection_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_remote_peering_connection_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_virtual_circuit_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_volume_backup_compartment_details.rb +2 -2
- data/lib/oci/core/models/change_volume_compartment_details.rb +2 -2
- data/lib/oci/core/models/change_volume_group_backup_compartment_details.rb +2 -2
- data/lib/oci/core/models/change_volume_group_compartment_details.rb +2 -2
- data/lib/oci/core/models/copy_volume_backup_details.rb +27 -4
- data/lib/oci/core/models/create_cross_connect_details.rb +37 -1
- data/lib/oci/core/models/create_cross_connect_group_details.rb +40 -4
- data/lib/oci/core/models/create_instance_configuration_base.rb +250 -0
- data/lib/oci/core/models/create_instance_configuration_details.rb +15 -57
- data/lib/oci/core/models/create_instance_configuration_from_instance_details.rb +179 -0
- data/lib/oci/core/models/create_ipv6_details.rb +249 -0
- data/lib/oci/core/models/create_remote_peering_connection_details.rb +40 -4
- data/lib/oci/core/models/create_service_gateway_details.rb +23 -1
- data/lib/oci/core/models/create_subnet_details.rb +24 -1
- data/lib/oci/core/models/create_vcn_details.rb +56 -4
- data/lib/oci/core/models/create_virtual_circuit_details.rb +38 -2
- data/lib/oci/core/models/cross_connect.rb +37 -1
- data/lib/oci/core/models/cross_connect_group.rb +37 -1
- data/lib/oci/core/models/cross_connect_mapping.rb +50 -1
- data/lib/oci/core/models/egress_security_rule.rb +10 -7
- data/lib/oci/core/models/ingress_security_rule.rb +10 -7
- data/lib/oci/core/models/instance.rb +1 -0
- data/lib/oci/core/models/ipv6.rb +375 -0
- data/lib/oci/core/models/private_ip.rb +1 -0
- data/lib/oci/core/models/remote_peering_connection.rb +37 -1
- data/lib/oci/core/models/route_rule.rb +4 -1
- data/lib/oci/core/models/security_rule.rb +2 -2
- data/lib/oci/core/models/service_gateway.rb +18 -1
- data/lib/oci/core/models/subnet.rb +56 -1
- data/lib/oci/core/models/update_cross_connect_details.rb +37 -1
- data/lib/oci/core/models/update_cross_connect_group_details.rb +40 -4
- data/lib/oci/core/models/update_ipv6_details.rb +229 -0
- data/lib/oci/core/models/update_remote_peering_connection_details.rb +40 -4
- data/lib/oci/core/models/update_security_rule_details.rb +2 -2
- data/lib/oci/core/models/update_service_gateway_details.rb +18 -1
- data/lib/oci/core/models/update_virtual_circuit_details.rb +37 -1
- data/lib/oci/core/models/vcn.rb +42 -1
- data/lib/oci/core/models/virtual_circuit.rb +37 -1
- data/lib/oci/core/models/volume_backup.rb +19 -1
- data/lib/oci/core/virtual_network_client.rb +744 -10
- data/lib/oci/core/virtual_network_client_composite_operations.rb +119 -0
- data/lib/oci/database/database.rb +3 -0
- data/lib/oci/database/database_client.rb +320 -36
- data/lib/oci/database/models/autonomous_data_warehouse.rb +1 -0
- data/lib/oci/database/models/autonomous_data_warehouse_console_token_details.rb +164 -0
- data/lib/oci/database/models/autonomous_data_warehouse_summary.rb +1 -0
- data/lib/oci/database/models/autonomous_database.rb +5 -3
- data/lib/oci/database/models/autonomous_database_connection_urls.rb +1 -1
- data/lib/oci/database/models/autonomous_database_console_token_details.rb +163 -0
- data/lib/oci/database/models/autonomous_database_summary.rb +5 -3
- data/lib/oci/database/models/autonomous_db_preview_version_summary.rb +1 -3
- data/lib/oci/database/models/change_compartment_details.rb +155 -0
- data/lib/oci/database/models/create_autonomous_database_base.rb +5 -4
- data/lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb +2 -5
- data/lib/oci/database/models/create_database_details.rb +1 -1
- data/lib/oci/database/models/create_db_home_with_db_system_id_details.rb +2 -1
- data/lib/oci/database/models/create_db_home_with_db_system_id_from_backup_details.rb +2 -1
- data/lib/oci/database/models/db_system.rb +2 -5
- data/lib/oci/database/models/db_system_summary.rb +2 -5
- data/lib/oci/database/models/launch_db_system_base.rb +3 -5
- data/lib/oci/database/models/maintenance_window.rb +2 -1
- data/lib/oci/database/models/update_autonomous_database_details.rb +5 -3
- data/lib/oci/database/models/update_db_system_details.rb +2 -5
- data/lib/oci/dns/dns.rb +2 -0
- data/lib/oci/dns/dns_client.rb +138 -1
- data/lib/oci/dns/models/change_steering_policy_compartment_details.rb +155 -0
- data/lib/oci/dns/models/change_zone_compartment_details.rb +155 -0
- data/lib/oci/events/events.rb +34 -0
- data/lib/oci/events/events_client.rb +537 -0
- data/lib/oci/events/events_client_composite_operations.rb +145 -0
- data/lib/oci/events/models/action.rb +275 -0
- data/lib/oci/events/models/action_details.rb +222 -0
- data/lib/oci/events/models/action_details_list.rb +150 -0
- data/lib/oci/events/models/action_list.rb +151 -0
- data/lib/oci/events/models/change_rule_compartment_details.rb +156 -0
- data/lib/oci/events/models/create_faa_s_action_details.rb +170 -0
- data/lib/oci/events/models/create_notification_service_action_details.rb +170 -0
- data/lib/oci/events/models/create_rule_details.rb +284 -0
- data/lib/oci/events/models/create_streaming_service_action_details.rb +170 -0
- data/lib/oci/events/models/faa_s_action.rb +178 -0
- data/lib/oci/events/models/notification_service_action.rb +179 -0
- data/lib/oci/events/models/rule.rb +372 -0
- data/lib/oci/events/models/rule_summary.rb +321 -0
- data/lib/oci/events/models/streaming_service_action.rb +178 -0
- data/lib/oci/events/models/update_rule_details.rb +266 -0
- data/lib/oci/events/util.rb +2 -0
- data/lib/oci/functions/functions.rb +29 -0
- data/lib/oci/functions/functions_invoke_client.rb +237 -0
- data/lib/oci/functions/functions_invoke_client_composite_operations.rb +24 -0
- data/lib/oci/functions/functions_management_client.rb +851 -0
- data/lib/oci/functions/functions_management_client_composite_operations.rb +266 -0
- data/lib/oci/functions/models/application.rb +322 -0
- data/lib/oci/functions/models/application_summary.rb +281 -0
- data/lib/oci/functions/models/change_application_compartment_details.rb +156 -0
- data/lib/oci/functions/models/create_application_details.rb +236 -0
- data/lib/oci/functions/models/create_function_details.rb +280 -0
- data/lib/oci/functions/models/function.rb +397 -0
- data/lib/oci/functions/models/function_summary.rb +381 -0
- data/lib/oci/functions/models/update_application_details.rb +191 -0
- data/lib/oci/functions/models/update_function_details.rb +250 -0
- data/lib/oci/functions/util.rb +2 -0
- data/lib/oci/healthchecks/health_checks_client.rb +147 -1
- data/lib/oci/healthchecks/healthchecks.rb +2 -0
- data/lib/oci/healthchecks/models/change_http_monitor_compartment_details.rb +155 -0
- data/lib/oci/healthchecks/models/change_ping_monitor_compartment_details.rb +155 -0
- data/lib/oci/healthchecks/models/create_http_monitor_details.rb +2 -1
- data/lib/oci/healthchecks/models/create_on_demand_http_probe_details.rb +2 -1
- data/lib/oci/healthchecks/models/create_on_demand_ping_probe_details.rb +2 -1
- data/lib/oci/healthchecks/models/create_ping_monitor_details.rb +2 -1
- data/lib/oci/healthchecks/models/http_monitor.rb +2 -0
- data/lib/oci/healthchecks/models/http_probe.rb +2 -0
- data/lib/oci/healthchecks/models/ping_monitor.rb +2 -0
- data/lib/oci/healthchecks/models/ping_probe.rb +2 -0
- data/lib/oci/healthchecks/models/update_http_monitor_details.rb +2 -0
- data/lib/oci/healthchecks/models/update_ping_monitor_details.rb +2 -0
- data/lib/oci/identity/identity.rb +1 -0
- data/lib/oci/identity/identity_client.rb +70 -0
- data/lib/oci/identity/identity_client_composite_operations.rb +50 -0
- data/lib/oci/identity/models/move_compartment_details.rb +155 -0
- data/lib/oci/key_management/key_management.rb +2 -0
- data/lib/oci/key_management/kms_management_client.rb +73 -0
- data/lib/oci/key_management/kms_vault_client.rb +73 -0
- data/lib/oci/key_management/models/change_key_compartment_details.rb +153 -0
- data/lib/oci/key_management/models/change_vault_compartment_details.rb +153 -0
- data/lib/oci/key_management/models/key.rb +1 -0
- data/lib/oci/key_management/models/key_summary.rb +1 -0
- data/lib/oci/key_management/models/vault.rb +1 -0
- data/lib/oci/key_management/models/vault_summary.rb +1 -0
- data/lib/oci/limits/limits.rb +23 -0
- data/lib/oci/limits/models/create_quota_details.rb +220 -0
- data/lib/oci/limits/models/quota.rb +287 -0
- data/lib/oci/limits/models/quota_summary.rb +273 -0
- data/lib/oci/limits/models/update_quota_details.rb +194 -0
- data/lib/oci/limits/quotas_client.rb +439 -0
- data/lib/oci/limits/quotas_client_composite_operations.rb +143 -0
- data/lib/oci/limits/util.rb +2 -0
- data/lib/oci/load_balancer/load_balancer.rb +9 -0
- data/lib/oci/load_balancer/load_balancer_client.rb +139 -0
- data/lib/oci/load_balancer/load_balancer_client_composite_operations.rb +50 -0
- data/lib/oci/load_balancer/models/allow_rule.rb +181 -0
- data/lib/oci/load_balancer/models/backend_set.rb +21 -4
- data/lib/oci/load_balancer/models/backend_set_details.rb +21 -4
- data/lib/oci/load_balancer/models/change_load_balancer_compartment_details.rb +156 -0
- data/lib/oci/load_balancer/models/control_access_using_http_methods_rule.rb +205 -0
- data/lib/oci/load_balancer/models/create_backend_set_details.rb +21 -4
- data/lib/oci/load_balancer/models/create_load_balancer_details.rb +37 -1
- data/lib/oci/load_balancer/models/lb_cookie_session_persistence_configuration_details.rb +334 -0
- data/lib/oci/load_balancer/models/listener_rule_summary.rb +166 -0
- data/lib/oci/load_balancer/models/rule.rb +4 -0
- data/lib/oci/load_balancer/models/rule_condition.rb +192 -0
- data/lib/oci/load_balancer/models/session_persistence_configuration_details.rb +6 -0
- data/lib/oci/load_balancer/models/source_ip_address_condition.rb +167 -0
- data/lib/oci/load_balancer/models/source_vcn_id_condition.rb +169 -0
- data/lib/oci/load_balancer/models/source_vcn_ip_address_condition.rb +171 -0
- data/lib/oci/load_balancer/models/update_backend_set_details.rb +21 -4
- data/lib/oci/monitoring/models/alarm.rb +4 -3
- data/lib/oci/monitoring/models/alarm_summary.rb +4 -3
- data/lib/oci/monitoring/models/change_alarm_compartment_details.rb +155 -0
- data/lib/oci/monitoring/models/create_alarm_details.rb +4 -3
- data/lib/oci/monitoring/models/datapoint.rb +1 -1
- data/lib/oci/monitoring/models/list_metrics_details.rb +4 -4
- data/lib/oci/monitoring/models/metric_data.rb +14 -0
- data/lib/oci/monitoring/models/metric_data_details.rb +6 -4
- data/lib/oci/monitoring/models/summarize_metrics_data_details.rb +3 -0
- data/lib/oci/monitoring/models/update_alarm_details.rb +4 -3
- data/lib/oci/monitoring/monitoring.rb +1 -0
- data/lib/oci/monitoring/monitoring_client.rb +140 -5
- data/lib/oci/ons/models/backoff_retry_policy.rb +2 -2
- data/lib/oci/ons/models/change_compartment_details.rb +156 -0
- data/lib/oci/ons/models/confirmation_result.rb +5 -6
- data/lib/oci/ons/models/create_topic_details.rb +1 -1
- data/lib/oci/ons/models/notification_topic.rb +2 -2
- data/lib/oci/ons/models/notification_topic_summary.rb +2 -2
- data/lib/oci/ons/models/subscription.rb +47 -4
- data/lib/oci/ons/models/subscription_summary.rb +19 -3
- data/lib/oci/ons/notification_control_plane_client.rb +95 -8
- data/lib/oci/ons/notification_data_plane_client.rb +109 -8
- data/lib/oci/ons/ons.rb +1 -0
- data/lib/oci/regions.rb +3 -0
- data/lib/oci/streaming/models/change_stream_compartment_details.rb +155 -0
- data/lib/oci/streaming/stream_admin_client.rb +58 -0
- data/lib/oci/streaming/streaming.rb +1 -0
- data/lib/oci/version.rb +1 -1
- data/lib/oci/waas/models/access_rule_criteria.rb +14 -2
- data/lib/oci/waas/models/change_certificate_compartment_details.rb +154 -0
- data/lib/oci/waas/models/change_waas_policy_compartment_details.rb +154 -0
- data/lib/oci/waas/models/create_certificate_details.rb +2 -2
- data/lib/oci/waas/models/protection_rule_exclusion.rb +16 -1
- data/lib/oci/waas/models/protection_settings.rb +9 -5
- data/lib/oci/waas/models/waas_policy.rb +1 -1
- data/lib/oci/waas/models/waf_config_details.rb +8 -8
- data/lib/oci/waas/models/waf_log.rb +40 -19
- data/lib/oci/waas/waas.rb +2 -0
- data/lib/oci/waas/waas_client.rb +155 -27
- data/lib/oci/work_requests/models/work_request.rb +14 -8
- data/lib/oci/work_requests/models/work_request_error.rb +3 -3
- data/lib/oci/work_requests/models/work_request_log_entry.rb +2 -2
- data/lib/oci/work_requests/models/work_request_resource.rb +9 -7
- data/lib/oci/work_requests/models/work_request_summary.rb +12 -6
- data/lib/oci/work_requests/work_request_client.rb +33 -16
- metadata +81 -2
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
require 'date'
|
|
4
|
+
|
|
5
|
+
# rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
|
|
6
|
+
module OCI
|
|
7
|
+
# ChangeZoneCompartmentDetails model.
|
|
8
|
+
class Dns::Models::ChangeZoneCompartmentDetails
|
|
9
|
+
# **[Required]** The [OCID](https://docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm) of the compartment
|
|
10
|
+
# into which the zone should be moved.
|
|
11
|
+
#
|
|
12
|
+
# @return [String]
|
|
13
|
+
attr_accessor :compartment_id
|
|
14
|
+
|
|
15
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
16
|
+
def self.attribute_map
|
|
17
|
+
{
|
|
18
|
+
# rubocop:disable Style/SymbolLiteral
|
|
19
|
+
'compartment_id': :'compartmentId'
|
|
20
|
+
# rubocop:enable Style/SymbolLiteral
|
|
21
|
+
}
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
# Attribute type mapping.
|
|
25
|
+
def self.swagger_types
|
|
26
|
+
{
|
|
27
|
+
# rubocop:disable Style/SymbolLiteral
|
|
28
|
+
'compartment_id': :'String'
|
|
29
|
+
# rubocop:enable Style/SymbolLiteral
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
34
|
+
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
# Initializes the object
|
|
38
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
39
|
+
# @option attributes [String] :compartment_id The value to assign to the {#compartment_id} property
|
|
40
|
+
def initialize(attributes = {})
|
|
41
|
+
return unless attributes.is_a?(Hash)
|
|
42
|
+
|
|
43
|
+
# convert string to symbol for hash key
|
|
44
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
45
|
+
|
|
46
|
+
self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']
|
|
47
|
+
|
|
48
|
+
raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')
|
|
49
|
+
|
|
50
|
+
self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']
|
|
51
|
+
end
|
|
52
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
53
|
+
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
|
54
|
+
|
|
55
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
# Checks equality by comparing each attribute.
|
|
59
|
+
# @param [Object] other the other object to be compared
|
|
60
|
+
def ==(other)
|
|
61
|
+
return true if equal?(other)
|
|
62
|
+
|
|
63
|
+
self.class == other.class &&
|
|
64
|
+
compartment_id == other.compartment_id
|
|
65
|
+
end
|
|
66
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
|
67
|
+
|
|
68
|
+
# @see the `==` method
|
|
69
|
+
# @param [Object] other the other object to be compared
|
|
70
|
+
def eql?(other)
|
|
71
|
+
self == other
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
# Calculates hash code according to all attributes.
|
|
78
|
+
# @return [Fixnum] Hash code
|
|
79
|
+
def hash
|
|
80
|
+
[compartment_id].hash
|
|
81
|
+
end
|
|
82
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
|
83
|
+
|
|
84
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
# Builds the object from hash
|
|
88
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
89
|
+
# @return [Object] Returns the model itself
|
|
90
|
+
def build_from_hash(attributes)
|
|
91
|
+
return nil unless attributes.is_a?(Hash)
|
|
92
|
+
|
|
93
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
94
|
+
if type =~ /^Array<(.*)>/i
|
|
95
|
+
# check to ensure the input is an array given that the the attribute
|
|
96
|
+
# is documented as an array but the input is not
|
|
97
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
98
|
+
public_method("#{key}=").call(
|
|
99
|
+
attributes[self.class.attribute_map[key]]
|
|
100
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
|
101
|
+
)
|
|
102
|
+
end
|
|
103
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
104
|
+
public_method("#{key}=").call(
|
|
105
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
|
106
|
+
)
|
|
107
|
+
end
|
|
108
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
self
|
|
112
|
+
end
|
|
113
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
|
114
|
+
|
|
115
|
+
# Returns the string representation of the object
|
|
116
|
+
# @return [String] String presentation of the object
|
|
117
|
+
def to_s
|
|
118
|
+
to_hash.to_s
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Returns the object in the form of hash
|
|
122
|
+
# @return [Hash] Returns the object in the form of hash
|
|
123
|
+
def to_hash
|
|
124
|
+
hash = {}
|
|
125
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
126
|
+
value = public_method(attr).call
|
|
127
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
|
128
|
+
|
|
129
|
+
hash[param] = _to_hash(value)
|
|
130
|
+
end
|
|
131
|
+
hash
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
private
|
|
135
|
+
|
|
136
|
+
# Outputs non-array value in the form of hash
|
|
137
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
138
|
+
# @param [Object] value Any valid value
|
|
139
|
+
# @return [Hash] Returns the value in the form of hash
|
|
140
|
+
def _to_hash(value)
|
|
141
|
+
if value.is_a?(Array)
|
|
142
|
+
value.compact.map { |v| _to_hash(v) }
|
|
143
|
+
elsif value.is_a?(Hash)
|
|
144
|
+
{}.tap do |hash|
|
|
145
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
146
|
+
end
|
|
147
|
+
elsif value.respond_to? :to_hash
|
|
148
|
+
value.to_hash
|
|
149
|
+
else
|
|
150
|
+
value
|
|
151
|
+
end
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
end
|
|
155
|
+
# rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
module OCI
|
|
4
|
+
module Events
|
|
5
|
+
# Module containing models for requests made to, and responses received from,
|
|
6
|
+
# OCI Events services
|
|
7
|
+
module Models
|
|
8
|
+
end
|
|
9
|
+
end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# Require models
|
|
13
|
+
require 'oci/events/models/action'
|
|
14
|
+
require 'oci/events/models/action_details'
|
|
15
|
+
require 'oci/events/models/action_details_list'
|
|
16
|
+
require 'oci/events/models/action_list'
|
|
17
|
+
require 'oci/events/models/change_rule_compartment_details'
|
|
18
|
+
require 'oci/events/models/create_faa_s_action_details'
|
|
19
|
+
require 'oci/events/models/create_notification_service_action_details'
|
|
20
|
+
require 'oci/events/models/create_rule_details'
|
|
21
|
+
require 'oci/events/models/create_streaming_service_action_details'
|
|
22
|
+
require 'oci/events/models/faa_s_action'
|
|
23
|
+
require 'oci/events/models/notification_service_action'
|
|
24
|
+
require 'oci/events/models/rule'
|
|
25
|
+
require 'oci/events/models/rule_summary'
|
|
26
|
+
require 'oci/events/models/streaming_service_action'
|
|
27
|
+
require 'oci/events/models/update_rule_details'
|
|
28
|
+
|
|
29
|
+
# Require generated clients
|
|
30
|
+
require 'oci/events/events_client'
|
|
31
|
+
require 'oci/events/events_client_composite_operations'
|
|
32
|
+
|
|
33
|
+
# Require service utilities
|
|
34
|
+
require 'oci/events/util'
|
|
@@ -0,0 +1,537 @@
|
|
|
1
|
+
# Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
require 'uri'
|
|
4
|
+
require 'logger'
|
|
5
|
+
|
|
6
|
+
# rubocop:disable Lint/UnneededCopDisableDirective, Metrics/LineLength
|
|
7
|
+
module OCI
|
|
8
|
+
# API for the Events Service. Use this API to manage rules and actions that create automation
|
|
9
|
+
# in your tenancy. For more information, see [Overview of Events](/iaas/Content/Events/Concepts/eventsoverview.htm).
|
|
10
|
+
class Events::EventsClient
|
|
11
|
+
# Client used to make HTTP requests.
|
|
12
|
+
# @return [OCI::ApiClient]
|
|
13
|
+
attr_reader :api_client
|
|
14
|
+
|
|
15
|
+
# Fully qualified endpoint URL
|
|
16
|
+
# @return [String]
|
|
17
|
+
attr_reader :endpoint
|
|
18
|
+
|
|
19
|
+
# The default retry configuration to apply to all operations in this service client. This can be overridden
|
|
20
|
+
# on a per-operation basis. The default retry configuration value is `nil`, which means that an operation
|
|
21
|
+
# will not perform any retries
|
|
22
|
+
# @return [OCI::Retry::RetryConfig]
|
|
23
|
+
attr_reader :retry_config
|
|
24
|
+
|
|
25
|
+
# The region, which will usually correspond to a value in {OCI::Regions::REGION_ENUM}.
|
|
26
|
+
# @return [String]
|
|
27
|
+
attr_reader :region
|
|
28
|
+
|
|
29
|
+
# rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
# Creates a new EventsClient.
|
|
33
|
+
# Notes:
|
|
34
|
+
# If a config is not specified, then the global OCI.config will be used.
|
|
35
|
+
#
|
|
36
|
+
# This client is not thread-safe
|
|
37
|
+
#
|
|
38
|
+
# Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the
|
|
39
|
+
# region. A region may be specified in the config or via or the region parameter. If specified in both, then the
|
|
40
|
+
# region parameter will be used.
|
|
41
|
+
# @param [Config] config A Config object.
|
|
42
|
+
# @param [String] region A region used to determine the service endpoint. This will usually
|
|
43
|
+
# correspond to a value in {OCI::Regions::REGION_ENUM}, but may be an arbitrary string.
|
|
44
|
+
# @param [String] endpoint The fully qualified endpoint URL
|
|
45
|
+
# @param [OCI::BaseSigner] signer A signer implementation which can be used by this client. If this is not provided then
|
|
46
|
+
# a signer will be constructed via the provided config. One use case of this parameter is instance principals authentication,
|
|
47
|
+
# so that the instance principals signer can be provided to the client
|
|
48
|
+
# @param [OCI::ApiClientProxySettings] proxy_settings If your environment requires you to use a proxy server for outgoing HTTP requests
|
|
49
|
+
# the details for the proxy can be provided in this parameter
|
|
50
|
+
# @param [OCI::Retry::RetryConfig] retry_config The retry configuration for this service client. This represents the default retry configuration to
|
|
51
|
+
# apply across all operations. This can be overridden on a per-operation basis. The default retry configuration value is `nil`, which means that an operation
|
|
52
|
+
# will not perform any retries
|
|
53
|
+
def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil)
|
|
54
|
+
# If the signer is an InstancePrincipalsSecurityTokenSigner and no config was supplied (which is valid for instance principals)
|
|
55
|
+
# then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals
|
|
56
|
+
# and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then
|
|
57
|
+
# pass it to this constructor.
|
|
58
|
+
#
|
|
59
|
+
# If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid
|
|
60
|
+
# so try and load the config from the default file.
|
|
61
|
+
config ||= OCI.config unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
|
|
62
|
+
config ||= OCI::Config.new if signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
|
|
63
|
+
config.validate unless signer.is_a?(OCI::Auth::Signers::InstancePrincipalsSecurityTokenSigner)
|
|
64
|
+
|
|
65
|
+
if signer.nil?
|
|
66
|
+
signer = OCI::Signer.new(
|
|
67
|
+
config.user,
|
|
68
|
+
config.fingerprint,
|
|
69
|
+
config.tenancy,
|
|
70
|
+
config.key_file,
|
|
71
|
+
pass_phrase: config.pass_phrase,
|
|
72
|
+
private_key_content: config.key_content
|
|
73
|
+
)
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
@api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings)
|
|
77
|
+
@retry_config = retry_config
|
|
78
|
+
|
|
79
|
+
if endpoint
|
|
80
|
+
@endpoint = endpoint + '/20181201'
|
|
81
|
+
else
|
|
82
|
+
region ||= config.region
|
|
83
|
+
region ||= signer.region if signer.respond_to?(:region)
|
|
84
|
+
self.region = region
|
|
85
|
+
end
|
|
86
|
+
logger.info "EventsClient endpoint set to '#{@endpoint}'." if logger
|
|
87
|
+
end
|
|
88
|
+
# rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Layout/EmptyLines, Metrics/PerceivedComplexity
|
|
89
|
+
|
|
90
|
+
# Set the region that will be used to determine the service endpoint.
|
|
91
|
+
# This will usually correspond to a value in {OCI::Regions::REGION_ENUM},
|
|
92
|
+
# but may be an arbitrary string.
|
|
93
|
+
def region=(new_region)
|
|
94
|
+
@region = new_region
|
|
95
|
+
|
|
96
|
+
raise 'A region must be specified.' unless @region
|
|
97
|
+
|
|
98
|
+
@endpoint = OCI::Regions.get_service_endpoint_for_template(@region, 'https://events.{region}.{secondLevelDomain}') + '/20181201'
|
|
99
|
+
logger.info "EventsClient endpoint set to '#{@endpoint} from region #{@region}'." if logger
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# @return [Logger] The logger for this client. May be nil.
|
|
103
|
+
def logger
|
|
104
|
+
@api_client.config.logger
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
108
|
+
# rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
|
|
109
|
+
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
# Moves a rule into a different compartment within the same tenancy. For information about moving
|
|
113
|
+
# resources between compartments, see [Moving Resources to a Different Compartment](https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).
|
|
114
|
+
#
|
|
115
|
+
# @param [String] rule_id The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this rule.
|
|
116
|
+
#
|
|
117
|
+
# @param [OCI::Events::Models::ChangeRuleCompartmentDetails] change_rule_compartment_details
|
|
118
|
+
# @param [Hash] opts the optional parameters
|
|
119
|
+
# @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
|
|
120
|
+
# retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
|
|
121
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match
|
|
122
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
123
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
124
|
+
#
|
|
125
|
+
# @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
|
|
126
|
+
# particular request, please provide the request ID.
|
|
127
|
+
#
|
|
128
|
+
# @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
|
|
129
|
+
# server error without risk of executing that same action again. Retry tokens expire after 24
|
|
130
|
+
# hours, but can be invalidated before then due to conflicting operations (for example, if a resource
|
|
131
|
+
# has been deleted and purged from the system, then a retry of the original creation request
|
|
132
|
+
# may be rejected).
|
|
133
|
+
#
|
|
134
|
+
# @return [Response] A Response object with data of type nil
|
|
135
|
+
def change_rule_compartment(rule_id, change_rule_compartment_details, opts = {})
|
|
136
|
+
logger.debug 'Calling operation EventsClient#change_rule_compartment.' if logger
|
|
137
|
+
|
|
138
|
+
raise "Missing the required parameter 'rule_id' when calling change_rule_compartment." if rule_id.nil?
|
|
139
|
+
raise "Missing the required parameter 'change_rule_compartment_details' when calling change_rule_compartment." if change_rule_compartment_details.nil?
|
|
140
|
+
raise "Parameter value for 'rule_id' must not be blank" if OCI::Internal::Util.blank_string?(rule_id)
|
|
141
|
+
|
|
142
|
+
path = '/rules/{ruleId}/actions/changeCompartment'.sub('{ruleId}', rule_id.to_s)
|
|
143
|
+
operation_signing_strategy = :standard
|
|
144
|
+
|
|
145
|
+
# rubocop:disable Style/NegatedIf
|
|
146
|
+
# Query Params
|
|
147
|
+
query_params = {}
|
|
148
|
+
|
|
149
|
+
# Header Params
|
|
150
|
+
header_params = {}
|
|
151
|
+
header_params[:accept] = 'application/json'
|
|
152
|
+
header_params[:'content-type'] = 'application/json'
|
|
153
|
+
header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
|
|
154
|
+
header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
|
|
155
|
+
header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
|
|
156
|
+
# rubocop:enable Style/NegatedIf
|
|
157
|
+
header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token
|
|
158
|
+
|
|
159
|
+
post_body = @api_client.object_to_http_body(change_rule_compartment_details)
|
|
160
|
+
|
|
161
|
+
# rubocop:disable Metrics/BlockLength
|
|
162
|
+
OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'EventsClient#change_rule_compartment') do
|
|
163
|
+
@api_client.call_api(
|
|
164
|
+
:POST,
|
|
165
|
+
path,
|
|
166
|
+
endpoint,
|
|
167
|
+
header_params: header_params,
|
|
168
|
+
query_params: query_params,
|
|
169
|
+
operation_signing_strategy: operation_signing_strategy,
|
|
170
|
+
body: post_body
|
|
171
|
+
)
|
|
172
|
+
end
|
|
173
|
+
# rubocop:enable Metrics/BlockLength
|
|
174
|
+
end
|
|
175
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
176
|
+
# rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
|
|
177
|
+
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines
|
|
178
|
+
|
|
179
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
180
|
+
# rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
|
|
181
|
+
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
# Creates a new rule.
|
|
185
|
+
#
|
|
186
|
+
# @param [OCI::Events::Models::CreateRuleDetails] create_rule_details Specification of the rule to create
|
|
187
|
+
# @param [Hash] opts the optional parameters
|
|
188
|
+
# @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
|
|
189
|
+
# retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
|
|
190
|
+
# @option opts [String] :opc_retry_token A token that uniquely identifies a request so it can be retried in case of a timeout or
|
|
191
|
+
# server error without risk of executing that same action again. Retry tokens expire after 24
|
|
192
|
+
# hours, but can be invalidated before then due to conflicting operations (for example, if a resource
|
|
193
|
+
# has been deleted and purged from the system, then a retry of the original creation request
|
|
194
|
+
# may be rejected).
|
|
195
|
+
#
|
|
196
|
+
# @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
|
|
197
|
+
# particular request, please provide the request ID.
|
|
198
|
+
#
|
|
199
|
+
# @return [Response] A Response object with data of type {OCI::Events::Models::Rule Rule}
|
|
200
|
+
def create_rule(create_rule_details, opts = {})
|
|
201
|
+
logger.debug 'Calling operation EventsClient#create_rule.' if logger
|
|
202
|
+
|
|
203
|
+
raise "Missing the required parameter 'create_rule_details' when calling create_rule." if create_rule_details.nil?
|
|
204
|
+
|
|
205
|
+
path = '/rules'
|
|
206
|
+
operation_signing_strategy = :standard
|
|
207
|
+
|
|
208
|
+
# rubocop:disable Style/NegatedIf
|
|
209
|
+
# Query Params
|
|
210
|
+
query_params = {}
|
|
211
|
+
|
|
212
|
+
# Header Params
|
|
213
|
+
header_params = {}
|
|
214
|
+
header_params[:accept] = 'application/json'
|
|
215
|
+
header_params[:'content-type'] = 'application/json'
|
|
216
|
+
header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token]
|
|
217
|
+
header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
|
|
218
|
+
# rubocop:enable Style/NegatedIf
|
|
219
|
+
header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token
|
|
220
|
+
|
|
221
|
+
post_body = @api_client.object_to_http_body(create_rule_details)
|
|
222
|
+
|
|
223
|
+
# rubocop:disable Metrics/BlockLength
|
|
224
|
+
OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'EventsClient#create_rule') do
|
|
225
|
+
@api_client.call_api(
|
|
226
|
+
:POST,
|
|
227
|
+
path,
|
|
228
|
+
endpoint,
|
|
229
|
+
header_params: header_params,
|
|
230
|
+
query_params: query_params,
|
|
231
|
+
operation_signing_strategy: operation_signing_strategy,
|
|
232
|
+
body: post_body,
|
|
233
|
+
return_type: 'OCI::Events::Models::Rule'
|
|
234
|
+
)
|
|
235
|
+
end
|
|
236
|
+
# rubocop:enable Metrics/BlockLength
|
|
237
|
+
end
|
|
238
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
239
|
+
# rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
|
|
240
|
+
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines
|
|
241
|
+
|
|
242
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
243
|
+
# rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
|
|
244
|
+
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
# Deletes a rule.
|
|
248
|
+
# @param [String] rule_id The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this rule.
|
|
249
|
+
#
|
|
250
|
+
# @param [Hash] opts the optional parameters
|
|
251
|
+
# @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
|
|
252
|
+
# retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
|
|
253
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match
|
|
254
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
255
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
256
|
+
#
|
|
257
|
+
# @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
|
|
258
|
+
# particular request, please provide the request ID.
|
|
259
|
+
#
|
|
260
|
+
# @return [Response] A Response object with data of type nil
|
|
261
|
+
def delete_rule(rule_id, opts = {})
|
|
262
|
+
logger.debug 'Calling operation EventsClient#delete_rule.' if logger
|
|
263
|
+
|
|
264
|
+
raise "Missing the required parameter 'rule_id' when calling delete_rule." if rule_id.nil?
|
|
265
|
+
raise "Parameter value for 'rule_id' must not be blank" if OCI::Internal::Util.blank_string?(rule_id)
|
|
266
|
+
|
|
267
|
+
path = '/rules/{ruleId}'.sub('{ruleId}', rule_id.to_s)
|
|
268
|
+
operation_signing_strategy = :standard
|
|
269
|
+
|
|
270
|
+
# rubocop:disable Style/NegatedIf
|
|
271
|
+
# Query Params
|
|
272
|
+
query_params = {}
|
|
273
|
+
|
|
274
|
+
# Header Params
|
|
275
|
+
header_params = {}
|
|
276
|
+
header_params[:accept] = 'application/json'
|
|
277
|
+
header_params[:'content-type'] = 'application/json'
|
|
278
|
+
header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
|
|
279
|
+
header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
|
|
280
|
+
# rubocop:enable Style/NegatedIf
|
|
281
|
+
|
|
282
|
+
post_body = nil
|
|
283
|
+
|
|
284
|
+
# rubocop:disable Metrics/BlockLength
|
|
285
|
+
OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'EventsClient#delete_rule') do
|
|
286
|
+
@api_client.call_api(
|
|
287
|
+
:DELETE,
|
|
288
|
+
path,
|
|
289
|
+
endpoint,
|
|
290
|
+
header_params: header_params,
|
|
291
|
+
query_params: query_params,
|
|
292
|
+
operation_signing_strategy: operation_signing_strategy,
|
|
293
|
+
body: post_body
|
|
294
|
+
)
|
|
295
|
+
end
|
|
296
|
+
# rubocop:enable Metrics/BlockLength
|
|
297
|
+
end
|
|
298
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
299
|
+
# rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
|
|
300
|
+
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines
|
|
301
|
+
|
|
302
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
303
|
+
# rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
|
|
304
|
+
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
# Retrieves a rule.
|
|
308
|
+
# @param [String] rule_id The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this rule.
|
|
309
|
+
#
|
|
310
|
+
# @param [Hash] opts the optional parameters
|
|
311
|
+
# @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
|
|
312
|
+
# retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
|
|
313
|
+
# @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
|
|
314
|
+
# particular request, please provide the request ID.
|
|
315
|
+
#
|
|
316
|
+
# @return [Response] A Response object with data of type {OCI::Events::Models::Rule Rule}
|
|
317
|
+
def get_rule(rule_id, opts = {})
|
|
318
|
+
logger.debug 'Calling operation EventsClient#get_rule.' if logger
|
|
319
|
+
|
|
320
|
+
raise "Missing the required parameter 'rule_id' when calling get_rule." if rule_id.nil?
|
|
321
|
+
raise "Parameter value for 'rule_id' must not be blank" if OCI::Internal::Util.blank_string?(rule_id)
|
|
322
|
+
|
|
323
|
+
path = '/rules/{ruleId}'.sub('{ruleId}', rule_id.to_s)
|
|
324
|
+
operation_signing_strategy = :standard
|
|
325
|
+
|
|
326
|
+
# rubocop:disable Style/NegatedIf
|
|
327
|
+
# Query Params
|
|
328
|
+
query_params = {}
|
|
329
|
+
|
|
330
|
+
# Header Params
|
|
331
|
+
header_params = {}
|
|
332
|
+
header_params[:accept] = 'application/json'
|
|
333
|
+
header_params[:'content-type'] = 'application/json'
|
|
334
|
+
header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
|
|
335
|
+
# rubocop:enable Style/NegatedIf
|
|
336
|
+
|
|
337
|
+
post_body = nil
|
|
338
|
+
|
|
339
|
+
# rubocop:disable Metrics/BlockLength
|
|
340
|
+
OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'EventsClient#get_rule') do
|
|
341
|
+
@api_client.call_api(
|
|
342
|
+
:GET,
|
|
343
|
+
path,
|
|
344
|
+
endpoint,
|
|
345
|
+
header_params: header_params,
|
|
346
|
+
query_params: query_params,
|
|
347
|
+
operation_signing_strategy: operation_signing_strategy,
|
|
348
|
+
body: post_body,
|
|
349
|
+
return_type: 'OCI::Events::Models::Rule'
|
|
350
|
+
)
|
|
351
|
+
end
|
|
352
|
+
# rubocop:enable Metrics/BlockLength
|
|
353
|
+
end
|
|
354
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
355
|
+
# rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
|
|
356
|
+
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines
|
|
357
|
+
|
|
358
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
359
|
+
# rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
|
|
360
|
+
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
# Lists rules for this compartment.
|
|
364
|
+
#
|
|
365
|
+
# @param [String] compartment_id The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment to which this rule belongs.
|
|
366
|
+
#
|
|
367
|
+
# @param [Hash] opts the optional parameters
|
|
368
|
+
# @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
|
|
369
|
+
# retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
|
|
370
|
+
# @option opts [Integer] :limit The maximum number of items to return. 1 is the minimum, 50 is the maximum.
|
|
371
|
+
# Default: 10
|
|
372
|
+
# (default to 5)
|
|
373
|
+
# @option opts [String] :page For list pagination. The value of the opc-next-page response header from the previous
|
|
374
|
+
# \"List\" call. For important details about how pagination works, see
|
|
375
|
+
# [List Pagination](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine).
|
|
376
|
+
#
|
|
377
|
+
# @option opts [String] :lifecycle_state A filter to return only rules that match the lifecycle state in this parameter.
|
|
378
|
+
#
|
|
379
|
+
# Example: `Creating`
|
|
380
|
+
#
|
|
381
|
+
# @option opts [String] :display_name A filter to return only rules with descriptions that match the displayName string
|
|
382
|
+
# in this parameter.
|
|
383
|
+
#
|
|
384
|
+
# Example: `\"This rule sends a notification upon completion of DbaaS backup.\"`
|
|
385
|
+
#
|
|
386
|
+
# @option opts [String] :sort_by Specifies the attribute with which to sort the rules.
|
|
387
|
+
#
|
|
388
|
+
# Default: `timeCreated`
|
|
389
|
+
#
|
|
390
|
+
# * **TIME_CREATED:** Sorts by timeCreated.
|
|
391
|
+
# * **DISPLAY_NAME:** Sorts by displayName.
|
|
392
|
+
# * **ID:** Sorts by id.
|
|
393
|
+
#
|
|
394
|
+
# Allowed values are: TIME_CREATED, ID, DISPLAY_NAME
|
|
395
|
+
# @option opts [String] :sort_order Specifies sort order.
|
|
396
|
+
#
|
|
397
|
+
# * **ASC:** Ascending sort order.
|
|
398
|
+
# * **DESC:** Descending sort order.
|
|
399
|
+
#
|
|
400
|
+
# Allowed values are: ASC, DESC
|
|
401
|
+
# @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
|
|
402
|
+
# particular request, please provide the request ID.
|
|
403
|
+
#
|
|
404
|
+
# @return [Response] A Response object with data of type Array<{OCI::Events::Models::RuleSummary RuleSummary}>
|
|
405
|
+
def list_rules(compartment_id, opts = {})
|
|
406
|
+
logger.debug 'Calling operation EventsClient#list_rules.' if logger
|
|
407
|
+
|
|
408
|
+
raise "Missing the required parameter 'compartment_id' when calling list_rules." if compartment_id.nil?
|
|
409
|
+
|
|
410
|
+
if opts[:lifecycle_state] && !OCI::Events::Models::Rule::LIFECYCLE_STATE_ENUM.include?(opts[:lifecycle_state])
|
|
411
|
+
raise 'Invalid value for "lifecycle_state", must be one of the values in OCI::Events::Models::Rule::LIFECYCLE_STATE_ENUM.'
|
|
412
|
+
end
|
|
413
|
+
|
|
414
|
+
if opts[:sort_by] && !%w[TIME_CREATED ID DISPLAY_NAME].include?(opts[:sort_by])
|
|
415
|
+
raise 'Invalid value for "sort_by", must be one of TIME_CREATED, ID, DISPLAY_NAME.'
|
|
416
|
+
end
|
|
417
|
+
|
|
418
|
+
if opts[:sort_order] && !%w[ASC DESC].include?(opts[:sort_order])
|
|
419
|
+
raise 'Invalid value for "sort_order", must be one of ASC, DESC.'
|
|
420
|
+
end
|
|
421
|
+
|
|
422
|
+
path = '/rules'
|
|
423
|
+
operation_signing_strategy = :standard
|
|
424
|
+
|
|
425
|
+
# rubocop:disable Style/NegatedIf
|
|
426
|
+
# Query Params
|
|
427
|
+
query_params = {}
|
|
428
|
+
query_params[:compartmentId] = compartment_id
|
|
429
|
+
query_params[:limit] = opts[:limit] if opts[:limit]
|
|
430
|
+
query_params[:page] = opts[:page] if opts[:page]
|
|
431
|
+
query_params[:lifecycleState] = opts[:lifecycle_state] if opts[:lifecycle_state]
|
|
432
|
+
query_params[:displayName] = opts[:display_name] if opts[:display_name]
|
|
433
|
+
query_params[:sortBy] = opts[:sort_by] if opts[:sort_by]
|
|
434
|
+
query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order]
|
|
435
|
+
|
|
436
|
+
# Header Params
|
|
437
|
+
header_params = {}
|
|
438
|
+
header_params[:accept] = 'application/json'
|
|
439
|
+
header_params[:'content-type'] = 'application/json'
|
|
440
|
+
header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
|
|
441
|
+
# rubocop:enable Style/NegatedIf
|
|
442
|
+
|
|
443
|
+
post_body = nil
|
|
444
|
+
|
|
445
|
+
# rubocop:disable Metrics/BlockLength
|
|
446
|
+
OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'EventsClient#list_rules') do
|
|
447
|
+
@api_client.call_api(
|
|
448
|
+
:GET,
|
|
449
|
+
path,
|
|
450
|
+
endpoint,
|
|
451
|
+
header_params: header_params,
|
|
452
|
+
query_params: query_params,
|
|
453
|
+
operation_signing_strategy: operation_signing_strategy,
|
|
454
|
+
body: post_body,
|
|
455
|
+
return_type: 'Array<OCI::Events::Models::RuleSummary>'
|
|
456
|
+
)
|
|
457
|
+
end
|
|
458
|
+
# rubocop:enable Metrics/BlockLength
|
|
459
|
+
end
|
|
460
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
461
|
+
# rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
|
|
462
|
+
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines
|
|
463
|
+
|
|
464
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
465
|
+
# rubocop:disable Style/IfUnlessModifier, Metrics/ParameterLists
|
|
466
|
+
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines
|
|
467
|
+
|
|
468
|
+
|
|
469
|
+
# Updates a rule.
|
|
470
|
+
#
|
|
471
|
+
# @param [String] rule_id The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of this rule.
|
|
472
|
+
#
|
|
473
|
+
# @param [OCI::Events::Models::UpdateRuleDetails] update_rule_details The new rule spec to apply
|
|
474
|
+
# @param [Hash] opts the optional parameters
|
|
475
|
+
# @option opts [OCI::Retry::RetryConfig] :retry_config The retry configuration to apply to this operation. If no key is provided then the service-level
|
|
476
|
+
# retry configuration defined by {#retry_config} will be used. If an explicit `nil` value is provided then the operation will not retry
|
|
477
|
+
# @option opts [String] :if_match For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match
|
|
478
|
+
# parameter to the value of the etag from a previous GET or POST response for that resource. The resource
|
|
479
|
+
# will be updated or deleted only if the etag you provide matches the resource's current etag value.
|
|
480
|
+
#
|
|
481
|
+
# @option opts [String] :opc_request_id The unique Oracle-assigned identifier for the request. If you need to contact Oracle about a
|
|
482
|
+
# particular request, please provide the request ID.
|
|
483
|
+
#
|
|
484
|
+
# @return [Response] A Response object with data of type {OCI::Events::Models::Rule Rule}
|
|
485
|
+
def update_rule(rule_id, update_rule_details, opts = {})
|
|
486
|
+
logger.debug 'Calling operation EventsClient#update_rule.' if logger
|
|
487
|
+
|
|
488
|
+
raise "Missing the required parameter 'rule_id' when calling update_rule." if rule_id.nil?
|
|
489
|
+
raise "Missing the required parameter 'update_rule_details' when calling update_rule." if update_rule_details.nil?
|
|
490
|
+
raise "Parameter value for 'rule_id' must not be blank" if OCI::Internal::Util.blank_string?(rule_id)
|
|
491
|
+
|
|
492
|
+
path = '/rules/{ruleId}'.sub('{ruleId}', rule_id.to_s)
|
|
493
|
+
operation_signing_strategy = :standard
|
|
494
|
+
|
|
495
|
+
# rubocop:disable Style/NegatedIf
|
|
496
|
+
# Query Params
|
|
497
|
+
query_params = {}
|
|
498
|
+
|
|
499
|
+
# Header Params
|
|
500
|
+
header_params = {}
|
|
501
|
+
header_params[:accept] = 'application/json'
|
|
502
|
+
header_params[:'content-type'] = 'application/json'
|
|
503
|
+
header_params[:'if-match'] = opts[:if_match] if opts[:if_match]
|
|
504
|
+
header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id]
|
|
505
|
+
# rubocop:enable Style/NegatedIf
|
|
506
|
+
|
|
507
|
+
post_body = @api_client.object_to_http_body(update_rule_details)
|
|
508
|
+
|
|
509
|
+
# rubocop:disable Metrics/BlockLength
|
|
510
|
+
OCI::Retry.make_retrying_call(applicable_retry_config(opts), call_name: 'EventsClient#update_rule') do
|
|
511
|
+
@api_client.call_api(
|
|
512
|
+
:PUT,
|
|
513
|
+
path,
|
|
514
|
+
endpoint,
|
|
515
|
+
header_params: header_params,
|
|
516
|
+
query_params: query_params,
|
|
517
|
+
operation_signing_strategy: operation_signing_strategy,
|
|
518
|
+
body: post_body,
|
|
519
|
+
return_type: 'OCI::Events::Models::Rule'
|
|
520
|
+
)
|
|
521
|
+
end
|
|
522
|
+
# rubocop:enable Metrics/BlockLength
|
|
523
|
+
end
|
|
524
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
|
525
|
+
# rubocop:enable Style/IfUnlessModifier, Metrics/ParameterLists
|
|
526
|
+
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines
|
|
527
|
+
|
|
528
|
+
private
|
|
529
|
+
|
|
530
|
+
def applicable_retry_config(opts = {})
|
|
531
|
+
return @retry_config unless opts.key?(:retry_config)
|
|
532
|
+
|
|
533
|
+
opts[:retry_config]
|
|
534
|
+
end
|
|
535
|
+
end
|
|
536
|
+
end
|
|
537
|
+
# rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
|