oci 2.5.9 → 2.5.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/oci/autoscaling/auto_scaling_client.rb +73 -0
- data/lib/oci/autoscaling/autoscaling.rb +1 -0
- data/lib/oci/autoscaling/models/change_auto_scaling_compartment_details.rb +154 -0
- data/lib/oci/autoscaling/models/create_auto_scaling_configuration_details.rb +0 -1
- data/lib/oci/container_engine/models/work_request_error.rb +0 -1
- data/lib/oci/core/blockstorage_client.rb +342 -0
- data/lib/oci/core/compute_client.rb +77 -5
- data/lib/oci/core/compute_client_composite_operations.rb +3 -3
- data/lib/oci/core/compute_management_client.rb +211 -0
- data/lib/oci/core/core.rb +27 -0
- data/lib/oci/core/models/add_network_security_group_security_rules_details.rb +153 -0
- data/lib/oci/core/models/add_security_rule_details.rb +388 -0
- data/lib/oci/core/models/added_network_security_group_security_rules.rb +153 -0
- data/lib/oci/core/models/change_boot_volume_backup_compartment_details.rb +153 -0
- data/lib/oci/core/models/change_boot_volume_compartment_details.rb +153 -0
- data/lib/oci/core/models/change_image_compartment_details.rb +154 -0
- data/lib/oci/core/models/change_instance_configuration_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_instance_pool_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_nat_gateway_compartment_details.rb +153 -0
- data/lib/oci/core/models/change_route_table_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_security_list_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_service_gateway_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_subnet_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_vcn_compartment_details.rb +155 -0
- data/lib/oci/core/models/change_volume_backup_compartment_details.rb +153 -0
- data/lib/oci/core/models/change_volume_compartment_details.rb +153 -0
- data/lib/oci/core/models/change_volume_group_backup_compartment_details.rb +153 -0
- data/lib/oci/core/models/change_volume_group_compartment_details.rb +153 -0
- data/lib/oci/core/models/create_network_security_group_details.rb +223 -0
- data/lib/oci/core/models/create_vnic_details.rb +18 -1
- data/lib/oci/core/models/image.rb +2 -1
- data/lib/oci/core/models/instance_configuration.rb +3 -1
- data/lib/oci/core/models/instance_configuration_create_vnic_details.rb +18 -1
- data/lib/oci/core/models/instance_configuration_instance_source_via_image_details.rb +15 -1
- data/lib/oci/core/models/instance_configuration_summary.rb +3 -3
- data/lib/oci/core/models/instance_pool.rb +4 -1
- data/lib/oci/core/models/instance_pool_summary.rb +3 -3
- data/lib/oci/core/models/network_security_group.rb +324 -0
- data/lib/oci/core/models/network_security_group_vnic.rb +188 -0
- data/lib/oci/core/models/remove_network_security_group_security_rules_details.rb +154 -0
- data/lib/oci/core/models/security_list.rb +5 -0
- data/lib/oci/core/models/security_rule.rb +455 -0
- data/lib/oci/core/models/update_network_security_group_details.rb +189 -0
- data/lib/oci/core/models/update_network_security_group_security_rules_details.rb +153 -0
- data/lib/oci/core/models/update_security_rule_details.rb +404 -0
- data/lib/oci/core/models/update_vnic_details.rb +20 -1
- data/lib/oci/core/models/updated_network_security_group_security_rules.rb +153 -0
- data/lib/oci/core/models/vnic.rb +18 -1
- data/lib/oci/core/virtual_network_client.rb +1228 -132
- data/lib/oci/core/virtual_network_client_composite_operations.rb +119 -0
- data/lib/oci/database/database.rb +19 -0
- data/lib/oci/database/database_client.rb +1066 -46
- data/lib/oci/database/database_client_composite_operations.rb +317 -0
- data/lib/oci/database/models/autonomous_container_database.rb +416 -0
- data/lib/oci/database/models/autonomous_container_database_backup_config.rb +157 -0
- data/lib/oci/database/models/autonomous_container_database_summary.rb +420 -0
- data/lib/oci/database/models/autonomous_database.rb +58 -1
- data/lib/oci/database/models/autonomous_database_backup.rb +16 -1
- data/lib/oci/database/models/autonomous_database_backup_summary.rb +16 -1
- data/lib/oci/database/models/autonomous_database_connection_strings.rb +11 -1
- data/lib/oci/database/models/autonomous_database_connection_urls.rb +170 -0
- data/lib/oci/database/models/autonomous_database_summary.rb +58 -1
- data/lib/oci/database/models/autonomous_db_preview_version_summary.rb +224 -0
- data/lib/oci/database/models/autonomous_exadata_infrastructure.rb +419 -0
- data/lib/oci/database/models/autonomous_exadata_infrastructure_maintenance_window.rb +186 -0
- data/lib/oci/database/models/autonomous_exadata_infrastructure_shape_summary.rb +224 -0
- data/lib/oci/database/models/autonomous_exadata_infrastructure_summary.rb +436 -0
- data/lib/oci/database/models/backup.rb +1 -0
- data/lib/oci/database/models/backup_summary.rb +1 -0
- data/lib/oci/database/models/create_autonomous_container_database_details.rb +284 -0
- data/lib/oci/database/models/create_autonomous_database_base.rb +46 -1
- data/lib/oci/database/models/create_autonomous_database_clone_details.rb +13 -1
- data/lib/oci/database/models/create_autonomous_database_details.rb +13 -1
- data/lib/oci/database/models/create_data_guard_association_with_new_db_system_details.rb +34 -1
- data/lib/oci/database/models/create_db_home_with_db_system_id_base.rb +1 -1
- data/lib/oci/database/models/day_of_week.rb +174 -0
- data/lib/oci/database/models/db_system.rb +34 -1
- data/lib/oci/database/models/db_system_summary.rb +34 -1
- data/lib/oci/database/models/launch_autonomous_exadata_infrastructure_details.rb +304 -0
- data/lib/oci/database/models/launch_db_system_base.rb +35 -2
- data/lib/oci/database/models/launch_db_system_details.rb +11 -2
- data/lib/oci/database/models/launch_db_system_from_backup_details.rb +11 -2
- data/lib/oci/database/models/maintenance_run.rb +392 -0
- data/lib/oci/database/models/maintenance_run_summary.rb +395 -0
- data/lib/oci/database/models/maintenance_window.rb +226 -0
- data/lib/oci/database/models/month.rb +179 -0
- data/lib/oci/database/models/restore_autonomous_database_details.rb +30 -4
- data/lib/oci/database/models/update_autonomous_container_database_details.rb +230 -0
- data/lib/oci/database/models/update_autonomous_database_details.rb +18 -1
- data/lib/oci/database/models/update_autonomous_exadata_infrastructure_details.rb +203 -0
- data/lib/oci/database/models/update_db_system_details.rb +37 -4
- data/lib/oci/database/models/update_maintenance_run_details.rb +154 -0
- data/lib/oci/email/email.rb +1 -0
- data/lib/oci/email/email_client.rb +62 -0
- data/lib/oci/email/models/change_sender_compartment_details.rb +157 -0
- data/lib/oci/key_management/key_management.rb +1 -0
- data/lib/oci/key_management/kms_crypto_client.rb +4 -4
- data/lib/oci/key_management/kms_management_client.rb +161 -10
- data/lib/oci/key_management/kms_management_client_composite_operations.rb +79 -0
- data/lib/oci/key_management/kms_vault_client.rb +16 -11
- data/lib/oci/key_management/models/key.rb +17 -1
- data/lib/oci/key_management/models/schedule_key_deletion_details.rb +156 -0
- data/lib/oci/load_balancer/load_balancer.rb +1 -0
- data/lib/oci/load_balancer/load_balancer_client.rb +64 -0
- data/lib/oci/load_balancer/load_balancer_client_composite_operations.rb +50 -0
- data/lib/oci/load_balancer/models/create_load_balancer_details.rb +16 -1
- data/lib/oci/load_balancer/models/load_balancer.rb +16 -1
- data/lib/oci/load_balancer/models/remove_http_request_header_rule.rb +1 -1
- data/lib/oci/load_balancer/models/remove_http_response_header_rule.rb +1 -1
- data/lib/oci/load_balancer/models/session_persistence_configuration_details.rb +9 -5
- data/lib/oci/load_balancer/models/update_backend_set_details.rb +2 -0
- data/lib/oci/load_balancer/models/update_network_security_groups_details.rb +154 -0
- data/lib/oci/monitoring/models/metric.rb +1 -0
- data/lib/oci/object_storage/models/work_request_error.rb +1 -0
- data/lib/oci/resource_manager/models/change_stack_compartment_details.rb +155 -0
- data/lib/oci/resource_manager/models/work_request.rb +293 -0
- data/lib/oci/resource_manager/models/work_request_error.rb +170 -0
- data/lib/oci/resource_manager/models/work_request_log_entry.rb +159 -0
- data/lib/oci/resource_manager/models/work_request_resource.rb +217 -0
- data/lib/oci/resource_manager/models/work_request_summary.rb +254 -0
- data/lib/oci/resource_manager/resource_manager.rb +6 -0
- data/lib/oci/resource_manager/resource_manager_client.rb +338 -0
- data/lib/oci/resource_manager/resource_manager_client_composite_operations.rb +50 -0
- data/lib/oci/streaming/stream_admin_client.rb +2 -2
- data/lib/oci/streaming/stream_client.rb +1 -1
- data/lib/oci/version.rb +1 -1
- metadata +58 -2
@@ -0,0 +1,153 @@
|
|
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
|
+
# AddNetworkSecurityGroupSecurityRulesDetails model.
|
8
|
+
class Core::Models::AddNetworkSecurityGroupSecurityRulesDetails
|
9
|
+
# The NSG security rules to add.
|
10
|
+
# @return [Array<OCI::Core::Models::AddSecurityRuleDetails>]
|
11
|
+
attr_accessor :security_rules
|
12
|
+
|
13
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
14
|
+
def self.attribute_map
|
15
|
+
{
|
16
|
+
# rubocop:disable Style/SymbolLiteral
|
17
|
+
'security_rules': :'securityRules'
|
18
|
+
# rubocop:enable Style/SymbolLiteral
|
19
|
+
}
|
20
|
+
end
|
21
|
+
|
22
|
+
# Attribute type mapping.
|
23
|
+
def self.swagger_types
|
24
|
+
{
|
25
|
+
# rubocop:disable Style/SymbolLiteral
|
26
|
+
'security_rules': :'Array<OCI::Core::Models::AddSecurityRuleDetails>'
|
27
|
+
# rubocop:enable Style/SymbolLiteral
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
32
|
+
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
33
|
+
|
34
|
+
|
35
|
+
# Initializes the object
|
36
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
37
|
+
# @option attributes [Array<OCI::Core::Models::AddSecurityRuleDetails>] :security_rules The value to assign to the {#security_rules} property
|
38
|
+
def initialize(attributes = {})
|
39
|
+
return unless attributes.is_a?(Hash)
|
40
|
+
|
41
|
+
# convert string to symbol for hash key
|
42
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
43
|
+
|
44
|
+
self.security_rules = attributes[:'securityRules'] if attributes[:'securityRules']
|
45
|
+
|
46
|
+
raise 'You cannot provide both :securityRules and :security_rules' if attributes.key?(:'securityRules') && attributes.key?(:'security_rules')
|
47
|
+
|
48
|
+
self.security_rules = attributes[:'security_rules'] if attributes[:'security_rules']
|
49
|
+
end
|
50
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
51
|
+
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
52
|
+
|
53
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
54
|
+
|
55
|
+
|
56
|
+
# Checks equality by comparing each attribute.
|
57
|
+
# @param [Object] other the other object to be compared
|
58
|
+
def ==(other)
|
59
|
+
return true if equal?(other)
|
60
|
+
|
61
|
+
self.class == other.class &&
|
62
|
+
security_rules == other.security_rules
|
63
|
+
end
|
64
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
65
|
+
|
66
|
+
# @see the `==` method
|
67
|
+
# @param [Object] other the other object to be compared
|
68
|
+
def eql?(other)
|
69
|
+
self == other
|
70
|
+
end
|
71
|
+
|
72
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
73
|
+
|
74
|
+
|
75
|
+
# Calculates hash code according to all attributes.
|
76
|
+
# @return [Fixnum] Hash code
|
77
|
+
def hash
|
78
|
+
[security_rules].hash
|
79
|
+
end
|
80
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
81
|
+
|
82
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
83
|
+
|
84
|
+
|
85
|
+
# Builds the object from hash
|
86
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
87
|
+
# @return [Object] Returns the model itself
|
88
|
+
def build_from_hash(attributes)
|
89
|
+
return nil unless attributes.is_a?(Hash)
|
90
|
+
|
91
|
+
self.class.swagger_types.each_pair do |key, type|
|
92
|
+
if type =~ /^Array<(.*)>/i
|
93
|
+
# check to ensure the input is an array given that the the attribute
|
94
|
+
# is documented as an array but the input is not
|
95
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
96
|
+
public_method("#{key}=").call(
|
97
|
+
attributes[self.class.attribute_map[key]]
|
98
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
99
|
+
)
|
100
|
+
end
|
101
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
102
|
+
public_method("#{key}=").call(
|
103
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
104
|
+
)
|
105
|
+
end
|
106
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
107
|
+
end
|
108
|
+
|
109
|
+
self
|
110
|
+
end
|
111
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
112
|
+
|
113
|
+
# Returns the string representation of the object
|
114
|
+
# @return [String] String presentation of the object
|
115
|
+
def to_s
|
116
|
+
to_hash.to_s
|
117
|
+
end
|
118
|
+
|
119
|
+
# Returns the object in the form of hash
|
120
|
+
# @return [Hash] Returns the object in the form of hash
|
121
|
+
def to_hash
|
122
|
+
hash = {}
|
123
|
+
self.class.attribute_map.each_pair do |attr, param|
|
124
|
+
value = public_method(attr).call
|
125
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
126
|
+
|
127
|
+
hash[param] = _to_hash(value)
|
128
|
+
end
|
129
|
+
hash
|
130
|
+
end
|
131
|
+
|
132
|
+
private
|
133
|
+
|
134
|
+
# Outputs non-array value in the form of hash
|
135
|
+
# For object, use to_hash. Otherwise, just return the value
|
136
|
+
# @param [Object] value Any valid value
|
137
|
+
# @return [Hash] Returns the value in the form of hash
|
138
|
+
def _to_hash(value)
|
139
|
+
if value.is_a?(Array)
|
140
|
+
value.compact.map { |v| _to_hash(v) }
|
141
|
+
elsif value.is_a?(Hash)
|
142
|
+
{}.tap do |hash|
|
143
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
144
|
+
end
|
145
|
+
elsif value.respond_to? :to_hash
|
146
|
+
value.to_hash
|
147
|
+
else
|
148
|
+
value
|
149
|
+
end
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
153
|
+
# rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
|
@@ -0,0 +1,388 @@
|
|
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
|
+
# A rule for allowing inbound (INGRESS) or outbound (EGRESS) IP packets.
|
8
|
+
class Core::Models::AddSecurityRuleDetails
|
9
|
+
DESTINATION_TYPE_ENUM = [
|
10
|
+
DESTINATION_TYPE_CIDR_BLOCK = 'CIDR_BLOCK'.freeze,
|
11
|
+
DESTINATION_TYPE_SERVICE_CIDR_BLOCK = 'SERVICE_CIDR_BLOCK'.freeze,
|
12
|
+
DESTINATION_TYPE_NETWORK_SECURITY_GROUP = 'NETWORK_SECURITY_GROUP'.freeze
|
13
|
+
].freeze
|
14
|
+
|
15
|
+
DIRECTION_ENUM = [
|
16
|
+
DIRECTION_EGRESS = 'EGRESS'.freeze,
|
17
|
+
DIRECTION_INGRESS = 'INGRESS'.freeze
|
18
|
+
].freeze
|
19
|
+
|
20
|
+
SOURCE_TYPE_ENUM = [
|
21
|
+
SOURCE_TYPE_CIDR_BLOCK = 'CIDR_BLOCK'.freeze,
|
22
|
+
SOURCE_TYPE_SERVICE_CIDR_BLOCK = 'SERVICE_CIDR_BLOCK'.freeze,
|
23
|
+
SOURCE_TYPE_NETWORK_SECURITY_GROUP = 'NETWORK_SECURITY_GROUP'.freeze
|
24
|
+
].freeze
|
25
|
+
|
26
|
+
# An optional description of your choice for the rule.
|
27
|
+
#
|
28
|
+
# @return [String]
|
29
|
+
attr_accessor :description
|
30
|
+
|
31
|
+
# Conceptually, this is the range of IP addresses that a packet originating from the instance
|
32
|
+
# can go to.
|
33
|
+
#
|
34
|
+
# Allowed values:
|
35
|
+
#
|
36
|
+
# * An IP address range in CIDR notation. For example: `192.168.1.0/24`
|
37
|
+
#
|
38
|
+
# * The `cidrBlock` value for a {Service}, if you're
|
39
|
+
# setting up a security rule for traffic destined for a particular `Service` through
|
40
|
+
# a service gateway. For example: `oci-phx-objectstorage`.
|
41
|
+
#
|
42
|
+
# * The OCID of a {NetworkSecurityGroup} in the same
|
43
|
+
# VCN. The value can be the NSG that the rule belongs to if the rule's intent is to control
|
44
|
+
# traffic between VNICs in the same NSG.
|
45
|
+
#
|
46
|
+
# @return [String]
|
47
|
+
attr_accessor :destination
|
48
|
+
|
49
|
+
# Type of destination for the rule. Required if `direction` = `EGRESS`.
|
50
|
+
#
|
51
|
+
# Allowed values:
|
52
|
+
#
|
53
|
+
# * `CIDR_BLOCK`: If the rule's `destination` is an IP address range in CIDR notation.
|
54
|
+
#
|
55
|
+
# * `SERVICE_CIDR_BLOCK`: If the rule's `destination` is the `cidrBlock` value for a
|
56
|
+
# {Service} (the rule is for traffic destined for a
|
57
|
+
# particular `Service` through a service gateway).
|
58
|
+
#
|
59
|
+
# * `NETWORK_SECURITY_GROUP`: If the rule's `destination` is the OCID of a
|
60
|
+
# {NetworkSecurityGroup}.
|
61
|
+
#
|
62
|
+
# @return [String]
|
63
|
+
attr_reader :destination_type
|
64
|
+
|
65
|
+
# **[Required]** Direction of the security rule. Set to `EGRESS` for rules to allow outbound IP packets, or `INGRESS` for rules to allow inbound IP packets.
|
66
|
+
# @return [String]
|
67
|
+
attr_reader :direction
|
68
|
+
|
69
|
+
# Optional and valid only for ICMP and ICMPv6. Use to specify a particular ICMP type and code
|
70
|
+
# as defined in:
|
71
|
+
# - [ICMP Parameters](http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml)
|
72
|
+
# - [ICMPv6 Parameters](https://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml)
|
73
|
+
#
|
74
|
+
# If you specify ICMP or ICMPv6 as the protocol but omit this object, then all ICMP types and
|
75
|
+
# codes are allowed. If you do provide this object, the type is required and the code is optional.
|
76
|
+
# To enable MTU negotiation for ingress internet traffic via IPv4, make sure to allow type 3 (\"Destination
|
77
|
+
# Unreachable\") code 4 (\"Fragmentation Needed and Don't Fragment was Set\"). If you need to specify
|
78
|
+
# multiple codes for a single type, create a separate security list rule for each.
|
79
|
+
#
|
80
|
+
# @return [OCI::Core::Models::IcmpOptions]
|
81
|
+
attr_accessor :icmp_options
|
82
|
+
|
83
|
+
# A stateless rule allows traffic in one direction. Remember to add a corresponding
|
84
|
+
# stateless rule in the other direction if you need to support bidirectional traffic. For
|
85
|
+
# example, if egress traffic allows TCP destination port 80, there should be an ingress
|
86
|
+
# rule to allow TCP source port 80. Defaults to false, which means the rule is stateful
|
87
|
+
# and a corresponding rule is not necessary for bidirectional traffic.
|
88
|
+
#
|
89
|
+
# @return [BOOLEAN]
|
90
|
+
attr_accessor :is_stateless
|
91
|
+
|
92
|
+
# **[Required]** The transport protocol. Specify either `all` or an IPv4 protocol number as
|
93
|
+
# defined in
|
94
|
+
# [Protocol Numbers](http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml).
|
95
|
+
# Options are supported only for ICMP (\"1\"), TCP (\"6\"), UDP (\"17\"), and ICMPv6 (\"58\").
|
96
|
+
#
|
97
|
+
# @return [String]
|
98
|
+
attr_accessor :protocol
|
99
|
+
|
100
|
+
# Conceptually, this is the range of IP addresses that a packet coming into the instance
|
101
|
+
# can come from.
|
102
|
+
#
|
103
|
+
# Allowed values:
|
104
|
+
#
|
105
|
+
# * An IP address range in CIDR notation. For example: `192.168.1.0/24`
|
106
|
+
#
|
107
|
+
# * The `cidrBlock` value for a {Service}, if you're
|
108
|
+
# setting up a security rule for traffic coming from a particular `Service` through
|
109
|
+
# a service gateway. For example: `oci-phx-objectstorage`.
|
110
|
+
#
|
111
|
+
# * The OCID of a {NetworkSecurityGroup} in the same
|
112
|
+
# VCN. The value can be the NSG that the rule belongs to if the rule's intent is to control
|
113
|
+
# traffic between VNICs in the same NSG.
|
114
|
+
#
|
115
|
+
# @return [String]
|
116
|
+
attr_accessor :source
|
117
|
+
|
118
|
+
# Type of source for the rule. Required if `direction` = `INGRESS`.
|
119
|
+
#
|
120
|
+
# * `CIDR_BLOCK`: If the rule's `source` is an IP address range in CIDR notation.
|
121
|
+
#
|
122
|
+
# * `SERVICE_CIDR_BLOCK`: If the rule's `source` is the `cidrBlock` value for a
|
123
|
+
# {Service} (the rule is for traffic coming from a
|
124
|
+
# particular `Service` through a service gateway).
|
125
|
+
#
|
126
|
+
# * `NETWORK_SECURITY_GROUP`: If the rule's `destination` is the OCID of a
|
127
|
+
# {NetworkSecurityGroup}.
|
128
|
+
#
|
129
|
+
# @return [String]
|
130
|
+
attr_reader :source_type
|
131
|
+
|
132
|
+
# Optional and valid only for TCP. Use to specify particular destination ports for TCP rules.
|
133
|
+
# If you specify TCP as the protocol but omit this object, then all destination ports are allowed.
|
134
|
+
#
|
135
|
+
# @return [OCI::Core::Models::TcpOptions]
|
136
|
+
attr_accessor :tcp_options
|
137
|
+
|
138
|
+
# Optional and valid only for UDP. Use to specify particular destination ports for UDP rules.
|
139
|
+
# If you specify UDP as the protocol but omit this object, then all destination ports are allowed.
|
140
|
+
#
|
141
|
+
# @return [OCI::Core::Models::UdpOptions]
|
142
|
+
attr_accessor :udp_options
|
143
|
+
|
144
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
145
|
+
def self.attribute_map
|
146
|
+
{
|
147
|
+
# rubocop:disable Style/SymbolLiteral
|
148
|
+
'description': :'description',
|
149
|
+
'destination': :'destination',
|
150
|
+
'destination_type': :'destinationType',
|
151
|
+
'direction': :'direction',
|
152
|
+
'icmp_options': :'icmpOptions',
|
153
|
+
'is_stateless': :'isStateless',
|
154
|
+
'protocol': :'protocol',
|
155
|
+
'source': :'source',
|
156
|
+
'source_type': :'sourceType',
|
157
|
+
'tcp_options': :'tcpOptions',
|
158
|
+
'udp_options': :'udpOptions'
|
159
|
+
# rubocop:enable Style/SymbolLiteral
|
160
|
+
}
|
161
|
+
end
|
162
|
+
|
163
|
+
# Attribute type mapping.
|
164
|
+
def self.swagger_types
|
165
|
+
{
|
166
|
+
# rubocop:disable Style/SymbolLiteral
|
167
|
+
'description': :'String',
|
168
|
+
'destination': :'String',
|
169
|
+
'destination_type': :'String',
|
170
|
+
'direction': :'String',
|
171
|
+
'icmp_options': :'OCI::Core::Models::IcmpOptions',
|
172
|
+
'is_stateless': :'BOOLEAN',
|
173
|
+
'protocol': :'String',
|
174
|
+
'source': :'String',
|
175
|
+
'source_type': :'String',
|
176
|
+
'tcp_options': :'OCI::Core::Models::TcpOptions',
|
177
|
+
'udp_options': :'OCI::Core::Models::UdpOptions'
|
178
|
+
# rubocop:enable Style/SymbolLiteral
|
179
|
+
}
|
180
|
+
end
|
181
|
+
|
182
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
183
|
+
# rubocop:disable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
184
|
+
|
185
|
+
|
186
|
+
# Initializes the object
|
187
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
188
|
+
# @option attributes [String] :description The value to assign to the {#description} property
|
189
|
+
# @option attributes [String] :destination The value to assign to the {#destination} property
|
190
|
+
# @option attributes [String] :destination_type The value to assign to the {#destination_type} property
|
191
|
+
# @option attributes [String] :direction The value to assign to the {#direction} property
|
192
|
+
# @option attributes [OCI::Core::Models::IcmpOptions] :icmp_options The value to assign to the {#icmp_options} property
|
193
|
+
# @option attributes [BOOLEAN] :is_stateless The value to assign to the {#is_stateless} property
|
194
|
+
# @option attributes [String] :protocol The value to assign to the {#protocol} property
|
195
|
+
# @option attributes [String] :source The value to assign to the {#source} property
|
196
|
+
# @option attributes [String] :source_type The value to assign to the {#source_type} property
|
197
|
+
# @option attributes [OCI::Core::Models::TcpOptions] :tcp_options The value to assign to the {#tcp_options} property
|
198
|
+
# @option attributes [OCI::Core::Models::UdpOptions] :udp_options The value to assign to the {#udp_options} property
|
199
|
+
def initialize(attributes = {})
|
200
|
+
return unless attributes.is_a?(Hash)
|
201
|
+
|
202
|
+
# convert string to symbol for hash key
|
203
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
204
|
+
|
205
|
+
self.description = attributes[:'description'] if attributes[:'description']
|
206
|
+
|
207
|
+
self.destination = attributes[:'destination'] if attributes[:'destination']
|
208
|
+
|
209
|
+
self.destination_type = attributes[:'destinationType'] if attributes[:'destinationType']
|
210
|
+
|
211
|
+
raise 'You cannot provide both :destinationType and :destination_type' if attributes.key?(:'destinationType') && attributes.key?(:'destination_type')
|
212
|
+
|
213
|
+
self.destination_type = attributes[:'destination_type'] if attributes[:'destination_type']
|
214
|
+
|
215
|
+
self.direction = attributes[:'direction'] if attributes[:'direction']
|
216
|
+
|
217
|
+
self.icmp_options = attributes[:'icmpOptions'] if attributes[:'icmpOptions']
|
218
|
+
|
219
|
+
raise 'You cannot provide both :icmpOptions and :icmp_options' if attributes.key?(:'icmpOptions') && attributes.key?(:'icmp_options')
|
220
|
+
|
221
|
+
self.icmp_options = attributes[:'icmp_options'] if attributes[:'icmp_options']
|
222
|
+
|
223
|
+
self.is_stateless = attributes[:'isStateless'] unless attributes[:'isStateless'].nil?
|
224
|
+
|
225
|
+
raise 'You cannot provide both :isStateless and :is_stateless' if attributes.key?(:'isStateless') && attributes.key?(:'is_stateless')
|
226
|
+
|
227
|
+
self.is_stateless = attributes[:'is_stateless'] unless attributes[:'is_stateless'].nil?
|
228
|
+
|
229
|
+
self.protocol = attributes[:'protocol'] if attributes[:'protocol']
|
230
|
+
|
231
|
+
self.source = attributes[:'source'] if attributes[:'source']
|
232
|
+
|
233
|
+
self.source_type = attributes[:'sourceType'] if attributes[:'sourceType']
|
234
|
+
|
235
|
+
raise 'You cannot provide both :sourceType and :source_type' if attributes.key?(:'sourceType') && attributes.key?(:'source_type')
|
236
|
+
|
237
|
+
self.source_type = attributes[:'source_type'] if attributes[:'source_type']
|
238
|
+
|
239
|
+
self.tcp_options = attributes[:'tcpOptions'] if attributes[:'tcpOptions']
|
240
|
+
|
241
|
+
raise 'You cannot provide both :tcpOptions and :tcp_options' if attributes.key?(:'tcpOptions') && attributes.key?(:'tcp_options')
|
242
|
+
|
243
|
+
self.tcp_options = attributes[:'tcp_options'] if attributes[:'tcp_options']
|
244
|
+
|
245
|
+
self.udp_options = attributes[:'udpOptions'] if attributes[:'udpOptions']
|
246
|
+
|
247
|
+
raise 'You cannot provide both :udpOptions and :udp_options' if attributes.key?(:'udpOptions') && attributes.key?(:'udp_options')
|
248
|
+
|
249
|
+
self.udp_options = attributes[:'udp_options'] if attributes[:'udp_options']
|
250
|
+
end
|
251
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
|
252
|
+
# rubocop:enable Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
|
253
|
+
|
254
|
+
# Custom attribute writer method checking allowed values (enum).
|
255
|
+
# @param [Object] destination_type Object to be assigned
|
256
|
+
def destination_type=(destination_type)
|
257
|
+
raise "Invalid value for 'destination_type': this must be one of the values in DESTINATION_TYPE_ENUM." if destination_type && !DESTINATION_TYPE_ENUM.include?(destination_type)
|
258
|
+
|
259
|
+
@destination_type = destination_type
|
260
|
+
end
|
261
|
+
|
262
|
+
# Custom attribute writer method checking allowed values (enum).
|
263
|
+
# @param [Object] direction Object to be assigned
|
264
|
+
def direction=(direction)
|
265
|
+
raise "Invalid value for 'direction': this must be one of the values in DIRECTION_ENUM." if direction && !DIRECTION_ENUM.include?(direction)
|
266
|
+
|
267
|
+
@direction = direction
|
268
|
+
end
|
269
|
+
|
270
|
+
# Custom attribute writer method checking allowed values (enum).
|
271
|
+
# @param [Object] source_type Object to be assigned
|
272
|
+
def source_type=(source_type)
|
273
|
+
raise "Invalid value for 'source_type': this must be one of the values in SOURCE_TYPE_ENUM." if source_type && !SOURCE_TYPE_ENUM.include?(source_type)
|
274
|
+
|
275
|
+
@source_type = source_type
|
276
|
+
end
|
277
|
+
|
278
|
+
# rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
279
|
+
|
280
|
+
|
281
|
+
# Checks equality by comparing each attribute.
|
282
|
+
# @param [Object] other the other object to be compared
|
283
|
+
def ==(other)
|
284
|
+
return true if equal?(other)
|
285
|
+
|
286
|
+
self.class == other.class &&
|
287
|
+
description == other.description &&
|
288
|
+
destination == other.destination &&
|
289
|
+
destination_type == other.destination_type &&
|
290
|
+
direction == other.direction &&
|
291
|
+
icmp_options == other.icmp_options &&
|
292
|
+
is_stateless == other.is_stateless &&
|
293
|
+
protocol == other.protocol &&
|
294
|
+
source == other.source &&
|
295
|
+
source_type == other.source_type &&
|
296
|
+
tcp_options == other.tcp_options &&
|
297
|
+
udp_options == other.udp_options
|
298
|
+
end
|
299
|
+
# rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
|
300
|
+
|
301
|
+
# @see the `==` method
|
302
|
+
# @param [Object] other the other object to be compared
|
303
|
+
def eql?(other)
|
304
|
+
self == other
|
305
|
+
end
|
306
|
+
|
307
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
308
|
+
|
309
|
+
|
310
|
+
# Calculates hash code according to all attributes.
|
311
|
+
# @return [Fixnum] Hash code
|
312
|
+
def hash
|
313
|
+
[description, destination, destination_type, direction, icmp_options, is_stateless, protocol, source, source_type, tcp_options, udp_options].hash
|
314
|
+
end
|
315
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
316
|
+
|
317
|
+
# rubocop:disable Metrics/AbcSize, Layout/EmptyLines
|
318
|
+
|
319
|
+
|
320
|
+
# Builds the object from hash
|
321
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
322
|
+
# @return [Object] Returns the model itself
|
323
|
+
def build_from_hash(attributes)
|
324
|
+
return nil unless attributes.is_a?(Hash)
|
325
|
+
|
326
|
+
self.class.swagger_types.each_pair do |key, type|
|
327
|
+
if type =~ /^Array<(.*)>/i
|
328
|
+
# check to ensure the input is an array given that the the attribute
|
329
|
+
# is documented as an array but the input is not
|
330
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
331
|
+
public_method("#{key}=").call(
|
332
|
+
attributes[self.class.attribute_map[key]]
|
333
|
+
.map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
|
334
|
+
)
|
335
|
+
end
|
336
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
337
|
+
public_method("#{key}=").call(
|
338
|
+
OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
|
339
|
+
)
|
340
|
+
end
|
341
|
+
# or else data not found in attributes(hash), not an issue as the data can be optional
|
342
|
+
end
|
343
|
+
|
344
|
+
self
|
345
|
+
end
|
346
|
+
# rubocop:enable Metrics/AbcSize, Layout/EmptyLines
|
347
|
+
|
348
|
+
# Returns the string representation of the object
|
349
|
+
# @return [String] String presentation of the object
|
350
|
+
def to_s
|
351
|
+
to_hash.to_s
|
352
|
+
end
|
353
|
+
|
354
|
+
# Returns the object in the form of hash
|
355
|
+
# @return [Hash] Returns the object in the form of hash
|
356
|
+
def to_hash
|
357
|
+
hash = {}
|
358
|
+
self.class.attribute_map.each_pair do |attr, param|
|
359
|
+
value = public_method(attr).call
|
360
|
+
next if value.nil? && !instance_variable_defined?("@#{attr}")
|
361
|
+
|
362
|
+
hash[param] = _to_hash(value)
|
363
|
+
end
|
364
|
+
hash
|
365
|
+
end
|
366
|
+
|
367
|
+
private
|
368
|
+
|
369
|
+
# Outputs non-array value in the form of hash
|
370
|
+
# For object, use to_hash. Otherwise, just return the value
|
371
|
+
# @param [Object] value Any valid value
|
372
|
+
# @return [Hash] Returns the value in the form of hash
|
373
|
+
def _to_hash(value)
|
374
|
+
if value.is_a?(Array)
|
375
|
+
value.compact.map { |v| _to_hash(v) }
|
376
|
+
elsif value.is_a?(Hash)
|
377
|
+
{}.tap do |hash|
|
378
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
379
|
+
end
|
380
|
+
elsif value.respond_to? :to_hash
|
381
|
+
value.to_hash
|
382
|
+
else
|
383
|
+
value
|
384
|
+
end
|
385
|
+
end
|
386
|
+
end
|
387
|
+
end
|
388
|
+
# rubocop:enable Lint/UnneededCopDisableDirective, Metrics/LineLength
|