oci 2.3.0 → 2.3.1

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.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/oci/core/blockstorage_client.rb +412 -13
  4. data/lib/oci/core/blockstorage_client_composite_operations.rb +158 -0
  5. data/lib/oci/core/compute_client.rb +6 -7
  6. data/lib/oci/core/core.rb +13 -0
  7. data/lib/oci/core/models/boot_volume.rb +68 -1
  8. data/lib/oci/core/models/boot_volume_backup.rb +435 -0
  9. data/lib/oci/core/models/boot_volume_source_details.rb +163 -0
  10. data/lib/oci/core/models/boot_volume_source_from_boot_volume_backup_details.rb +154 -0
  11. data/lib/oci/core/models/boot_volume_source_from_boot_volume_details.rb +154 -0
  12. data/lib/oci/core/models/create_boot_volume_backup_details.rb +227 -0
  13. data/lib/oci/core/models/create_boot_volume_details.rb +250 -0
  14. data/lib/oci/core/models/create_service_gateway_details.rb +228 -0
  15. data/lib/oci/core/models/egress_security_rule.rb +44 -3
  16. data/lib/oci/core/models/ingress_security_rule.rb +47 -3
  17. data/lib/oci/core/models/instance_source_via_image_details.rb +0 -1
  18. data/lib/oci/core/models/route_rule.rb +59 -2
  19. data/lib/oci/core/models/service.rb +185 -0
  20. data/lib/oci/core/models/service_gateway.rb +325 -0
  21. data/lib/oci/core/models/service_id_request_details.rb +151 -0
  22. data/lib/oci/core/models/service_id_response_details.rb +165 -0
  23. data/lib/oci/core/models/update_boot_volume_backup_details.rb +189 -0
  24. data/lib/oci/core/models/update_boot_volume_details.rb +41 -4
  25. data/lib/oci/core/models/update_service_gateway_details.rb +225 -0
  26. data/lib/oci/core/models/volume_group.rb +21 -7
  27. data/lib/oci/core/models/volume_group_backup.rb +39 -7
  28. data/lib/oci/core/models/volume_group_source_from_volumes_details.rb +1 -1
  29. data/lib/oci/core/virtual_network_client.rb +582 -1
  30. data/lib/oci/core/virtual_network_client_composite_operations.rb +119 -0
  31. data/lib/oci/version.rb +1 -1
  32. metadata +15 -2
@@ -0,0 +1,163 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ # rubocop:disable Lint/UnneededCopDisableDirective
6
+ module OCI
7
+ # BootVolumeSourceDetails model.
8
+ # This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class
9
+ class Core::Models::BootVolumeSourceDetails # rubocop:disable Metrics/LineLength
10
+ # This attribute is required.
11
+ # @return [String]
12
+ attr_accessor :type
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ # rubocop:disable Style/SymbolLiteral
18
+ 'type': :'type'
19
+ # rubocop:enable Style/SymbolLiteral
20
+ }
21
+ end
22
+
23
+ # Attribute type mapping.
24
+ def self.swagger_types
25
+ {
26
+ # rubocop:disable Style/SymbolLiteral
27
+ 'type': :'String'
28
+ # rubocop:enable Style/SymbolLiteral
29
+ }
30
+ end
31
+
32
+ # rubocop:disable Metrics/CyclomaticComplexity, Layout/EmptyLines
33
+
34
+
35
+ # Given the hash representation of a subtype of this class,
36
+ # use the info in the hash to return the class of the subtype.
37
+ def self.get_subtype(object_hash)
38
+ type = object_hash[:'type'] # rubocop:disable Style/SymbolLiteral
39
+
40
+ return 'OCI::Core::Models::BootVolumeSourceFromBootVolumeBackupDetails' if type == 'bootVolumeBackup'
41
+ return 'OCI::Core::Models::BootVolumeSourceFromBootVolumeDetails' if type == 'bootVolume'
42
+
43
+ # TODO: Log a warning when the subtype is not found.
44
+ 'OCI::Core::Models::BootVolumeSourceDetails'
45
+ end
46
+ # rubocop:enable Metrics/CyclomaticComplexity, Layout/EmptyLines
47
+
48
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
49
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
50
+
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ # @option attributes [String] :type The value to assign to the {#type} property
55
+ def initialize(attributes = {})
56
+ return unless attributes.is_a?(Hash)
57
+
58
+ # convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
60
+
61
+ self.type = attributes[:'type'] if attributes[:'type']
62
+ end
63
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
64
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
65
+
66
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
67
+
68
+
69
+ # Checks equality by comparing each attribute.
70
+ # @param [Object] other the other object to be compared
71
+ def ==(other)
72
+ return true if equal?(other)
73
+ self.class == other.class &&
74
+ type == other.type
75
+ end
76
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
77
+
78
+ # @see the `==` method
79
+ # @param [Object] other the other object to be compared
80
+ def eql?(other)
81
+ self == other
82
+ end
83
+
84
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
85
+
86
+
87
+ # Calculates hash code according to all attributes.
88
+ # @return [Fixnum] Hash code
89
+ def hash
90
+ [type].hash
91
+ end
92
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
93
+
94
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
95
+
96
+
97
+ # Builds the object from hash
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ # @return [Object] Returns the model itself
100
+ def build_from_hash(attributes)
101
+ return nil unless attributes.is_a?(Hash)
102
+ self.class.swagger_types.each_pair do |key, type|
103
+ if type =~ /^Array<(.*)>/i
104
+ # check to ensure the input is an array given that the the attribute
105
+ # is documented as an array but the input is not
106
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
107
+ public_method("#{key}=").call(
108
+ attributes[self.class.attribute_map[key]]
109
+ .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
110
+ )
111
+ end
112
+ elsif !attributes[self.class.attribute_map[key]].nil?
113
+ public_method("#{key}=").call(
114
+ OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
115
+ )
116
+ end
117
+ # or else data not found in attributes(hash), not an issue as the data can be optional
118
+ end
119
+
120
+ self
121
+ end
122
+ # rubocop:enable Metrics/AbcSize, Layout/EmptyLines
123
+
124
+ # Returns the string representation of the object
125
+ # @return [String] String presentation of the object
126
+ def to_s
127
+ to_hash.to_s
128
+ end
129
+
130
+ # Returns the object in the form of hash
131
+ # @return [Hash] Returns the object in the form of hash
132
+ def to_hash
133
+ hash = {}
134
+ self.class.attribute_map.each_pair do |attr, param|
135
+ value = public_method(attr).call
136
+ next if value.nil? && !instance_variable_defined?("@#{attr}")
137
+ hash[param] = _to_hash(value)
138
+ end
139
+ hash
140
+ end
141
+
142
+ private
143
+
144
+ # Outputs non-array value in the form of hash
145
+ # For object, use to_hash. Otherwise, just return the value
146
+ # @param [Object] value Any valid value
147
+ # @return [Hash] Returns the value in the form of hash
148
+ def _to_hash(value)
149
+ if value.is_a?(Array)
150
+ value.compact.map { |v| _to_hash(v) }
151
+ elsif value.is_a?(Hash)
152
+ {}.tap do |hash|
153
+ value.each { |k, v| hash[k] = _to_hash(v) }
154
+ end
155
+ elsif value.respond_to? :to_hash
156
+ value.to_hash
157
+ else
158
+ value
159
+ end
160
+ end
161
+ end
162
+ end
163
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,154 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+ require_relative 'boot_volume_source_details'
5
+
6
+ # rubocop:disable Lint/UnneededCopDisableDirective
7
+ module OCI
8
+ # Specifies the boot volume backup.
9
+ class Core::Models::BootVolumeSourceFromBootVolumeBackupDetails < Core::Models::BootVolumeSourceDetails # rubocop:disable Metrics/LineLength
10
+ # **[Required]** The OCID of the boot volume backup.
11
+ # @return [String]
12
+ attr_accessor :id
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ # rubocop:disable Style/SymbolLiteral
18
+ 'type': :'type',
19
+ 'id': :'id'
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
+ 'type': :'String',
29
+ 'id': :'String'
30
+ # rubocop:enable Style/SymbolLiteral
31
+ }
32
+ end
33
+
34
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
35
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
36
+
37
+
38
+ # Initializes the object
39
+ # @param [Hash] attributes Model attributes in the form of hash
40
+ # @option attributes [String] :id The value to assign to the {#id} property
41
+ def initialize(attributes = {})
42
+ return unless attributes.is_a?(Hash)
43
+
44
+ attributes['type'] = 'bootVolumeBackup'
45
+
46
+ super(attributes)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
50
+
51
+ self.id = attributes[:'id'] if attributes[:'id']
52
+ end
53
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
54
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
55
+
56
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
57
+
58
+
59
+ # Checks equality by comparing each attribute.
60
+ # @param [Object] other the other object to be compared
61
+ def ==(other)
62
+ return true if equal?(other)
63
+ self.class == other.class &&
64
+ type == other.type &&
65
+ id == other.id
66
+ end
67
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
68
+
69
+ # @see the `==` method
70
+ # @param [Object] other the other object to be compared
71
+ def eql?(other)
72
+ self == other
73
+ end
74
+
75
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
76
+
77
+
78
+ # Calculates hash code according to all attributes.
79
+ # @return [Fixnum] Hash code
80
+ def hash
81
+ [type, id].hash
82
+ end
83
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
84
+
85
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
86
+
87
+
88
+ # Builds the object from hash
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ # @return [Object] Returns the model itself
91
+ def build_from_hash(attributes)
92
+ return nil unless attributes.is_a?(Hash)
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
+ hash[param] = _to_hash(value)
129
+ end
130
+ hash
131
+ end
132
+
133
+ private
134
+
135
+ # Outputs non-array value in the form of hash
136
+ # For object, use to_hash. Otherwise, just return the value
137
+ # @param [Object] value Any valid value
138
+ # @return [Hash] Returns the value in the form of hash
139
+ def _to_hash(value)
140
+ if value.is_a?(Array)
141
+ value.compact.map { |v| _to_hash(v) }
142
+ elsif value.is_a?(Hash)
143
+ {}.tap do |hash|
144
+ value.each { |k, v| hash[k] = _to_hash(v) }
145
+ end
146
+ elsif value.respond_to? :to_hash
147
+ value.to_hash
148
+ else
149
+ value
150
+ end
151
+ end
152
+ end
153
+ end
154
+ # rubocop:enable Lint/UnneededCopDisableDirective
@@ -0,0 +1,154 @@
1
+ # Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+ require_relative 'boot_volume_source_details'
5
+
6
+ # rubocop:disable Lint/UnneededCopDisableDirective
7
+ module OCI
8
+ # Specifies the source boot volume.
9
+ class Core::Models::BootVolumeSourceFromBootVolumeDetails < Core::Models::BootVolumeSourceDetails # rubocop:disable Metrics/LineLength
10
+ # **[Required]** The OCID of the boot volume.
11
+ # @return [String]
12
+ attr_accessor :id
13
+
14
+ # Attribute mapping from ruby-style variable name to JSON key.
15
+ def self.attribute_map
16
+ {
17
+ # rubocop:disable Style/SymbolLiteral
18
+ 'type': :'type',
19
+ 'id': :'id'
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
+ 'type': :'String',
29
+ 'id': :'String'
30
+ # rubocop:enable Style/SymbolLiteral
31
+ }
32
+ end
33
+
34
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
35
+ # rubocop:disable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
36
+
37
+
38
+ # Initializes the object
39
+ # @param [Hash] attributes Model attributes in the form of hash
40
+ # @option attributes [String] :id The value to assign to the {#id} property
41
+ def initialize(attributes = {})
42
+ return unless attributes.is_a?(Hash)
43
+
44
+ attributes['type'] = 'bootVolume'
45
+
46
+ super(attributes)
47
+
48
+ # convert string to symbol for hash key
49
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
50
+
51
+ self.id = attributes[:'id'] if attributes[:'id']
52
+ end
53
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity
54
+ # rubocop:enable Metrics/LineLength, Metrics/MethodLength, Layout/EmptyLines, Style/SymbolLiteral
55
+
56
+ # rubocop:disable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
57
+
58
+
59
+ # Checks equality by comparing each attribute.
60
+ # @param [Object] other the other object to be compared
61
+ def ==(other)
62
+ return true if equal?(other)
63
+ self.class == other.class &&
64
+ type == other.type &&
65
+ id == other.id
66
+ end
67
+ # rubocop:enable Metrics/CyclomaticComplexity, Metrics/AbcSize, Metrics/PerceivedComplexity, Layout/EmptyLines
68
+
69
+ # @see the `==` method
70
+ # @param [Object] other the other object to be compared
71
+ def eql?(other)
72
+ self == other
73
+ end
74
+
75
+ # rubocop:disable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
76
+
77
+
78
+ # Calculates hash code according to all attributes.
79
+ # @return [Fixnum] Hash code
80
+ def hash
81
+ [type, id].hash
82
+ end
83
+ # rubocop:enable Metrics/AbcSize, Metrics/LineLength, Layout/EmptyLines
84
+
85
+ # rubocop:disable Metrics/AbcSize, Layout/EmptyLines
86
+
87
+
88
+ # Builds the object from hash
89
+ # @param [Hash] attributes Model attributes in the form of hash
90
+ # @return [Object] Returns the model itself
91
+ def build_from_hash(attributes)
92
+ return nil unless attributes.is_a?(Hash)
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
+ hash[param] = _to_hash(value)
129
+ end
130
+ hash
131
+ end
132
+
133
+ private
134
+
135
+ # Outputs non-array value in the form of hash
136
+ # For object, use to_hash. Otherwise, just return the value
137
+ # @param [Object] value Any valid value
138
+ # @return [Hash] Returns the value in the form of hash
139
+ def _to_hash(value)
140
+ if value.is_a?(Array)
141
+ value.compact.map { |v| _to_hash(v) }
142
+ elsif value.is_a?(Hash)
143
+ {}.tap do |hash|
144
+ value.each { |k, v| hash[k] = _to_hash(v) }
145
+ end
146
+ elsif value.respond_to? :to_hash
147
+ value.to_hash
148
+ else
149
+ value
150
+ end
151
+ end
152
+ end
153
+ end
154
+ # rubocop:enable Lint/UnneededCopDisableDirective