oraclebmc 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +82 -0
- data/README.md +220 -0
- data/lib/oraclebmc/api_client.rb +349 -0
- data/lib/oraclebmc/config.rb +80 -0
- data/lib/oraclebmc/config_file_loader.rb +85 -0
- data/lib/oraclebmc/core/blockstorage_client.rb +459 -0
- data/lib/oraclebmc/core/compute_client.rb +1053 -0
- data/lib/oraclebmc/core/core.rb +82 -0
- data/lib/oraclebmc/core/models/attach_i_scsi_volume_details.rb +179 -0
- data/lib/oraclebmc/core/models/attach_volume_details.rb +206 -0
- data/lib/oraclebmc/core/models/capture_console_history_details.rb +162 -0
- data/lib/oraclebmc/core/models/console_history.rb +252 -0
- data/lib/oraclebmc/core/models/cpe.rb +209 -0
- data/lib/oraclebmc/core/models/create_cpe_details.rb +187 -0
- data/lib/oraclebmc/core/models/create_dhcp_details.rb +195 -0
- data/lib/oraclebmc/core/models/create_drg_attachment_details.rb +184 -0
- data/lib/oraclebmc/core/models/create_drg_details.rb +173 -0
- data/lib/oraclebmc/core/models/create_image_details.rb +188 -0
- data/lib/oraclebmc/core/models/create_internet_gateway_details.rb +195 -0
- data/lib/oraclebmc/core/models/create_ip_sec_connection_details.rb +210 -0
- data/lib/oraclebmc/core/models/create_route_table_details.rb +195 -0
- data/lib/oraclebmc/core/models/create_security_list_details.rb +206 -0
- data/lib/oraclebmc/core/models/create_subnet_details.rb +253 -0
- data/lib/oraclebmc/core/models/create_vcn_details.rb +187 -0
- data/lib/oraclebmc/core/models/create_volume_backup_details.rb +173 -0
- data/lib/oraclebmc/core/models/create_volume_details.rb +211 -0
- data/lib/oraclebmc/core/models/dhcp_dns_option.rb +203 -0
- data/lib/oraclebmc/core/models/dhcp_option.rb +171 -0
- data/lib/oraclebmc/core/models/dhcp_options.rb +246 -0
- data/lib/oraclebmc/core/models/drg.rb +224 -0
- data/lib/oraclebmc/core/models/drg_attachment.rb +246 -0
- data/lib/oraclebmc/core/models/egress_security_rule.rb +240 -0
- data/lib/oraclebmc/core/models/i_scsi_volume_attachment.rb +254 -0
- data/lib/oraclebmc/core/models/icmp_options.rb +173 -0
- data/lib/oraclebmc/core/models/image.rb +282 -0
- data/lib/oraclebmc/core/models/ingress_security_rule.rb +240 -0
- data/lib/oraclebmc/core/models/instance.rb +326 -0
- data/lib/oraclebmc/core/models/internet_gateway.rb +248 -0
- data/lib/oraclebmc/core/models/ip_sec_connection.rb +261 -0
- data/lib/oraclebmc/core/models/ip_sec_connection_device_config.rb +195 -0
- data/lib/oraclebmc/core/models/ip_sec_connection_device_status.rb +198 -0
- data/lib/oraclebmc/core/models/launch_instance_details.rb +327 -0
- data/lib/oraclebmc/core/models/port_range.rb +175 -0
- data/lib/oraclebmc/core/models/route_rule.rb +177 -0
- data/lib/oraclebmc/core/models/route_table.rb +246 -0
- data/lib/oraclebmc/core/models/security_list.rb +257 -0
- data/lib/oraclebmc/core/models/shape.rb +164 -0
- data/lib/oraclebmc/core/models/subnet.rb +325 -0
- data/lib/oraclebmc/core/models/tcp_options.rb +177 -0
- data/lib/oraclebmc/core/models/tunnel_config.rb +193 -0
- data/lib/oraclebmc/core/models/tunnel_status.rb +218 -0
- data/lib/oraclebmc/core/models/udp_options.rb +177 -0
- data/lib/oraclebmc/core/models/update_cpe_details.rb +162 -0
- data/lib/oraclebmc/core/models/update_dhcp_details.rb +172 -0
- data/lib/oraclebmc/core/models/update_drg_attachment_details.rb +162 -0
- data/lib/oraclebmc/core/models/update_drg_details.rb +162 -0
- data/lib/oraclebmc/core/models/update_image_details.rb +165 -0
- data/lib/oraclebmc/core/models/update_instance_details.rb +165 -0
- data/lib/oraclebmc/core/models/update_internet_gateway_details.rb +173 -0
- data/lib/oraclebmc/core/models/update_ip_sec_connection_details.rb +162 -0
- data/lib/oraclebmc/core/models/update_route_table_details.rb +173 -0
- data/lib/oraclebmc/core/models/update_security_list_details.rb +184 -0
- data/lib/oraclebmc/core/models/update_subnet_details.rb +162 -0
- data/lib/oraclebmc/core/models/update_vcn_details.rb +162 -0
- data/lib/oraclebmc/core/models/update_volume_backup_details.rb +162 -0
- data/lib/oraclebmc/core/models/update_volume_details.rb +163 -0
- data/lib/oraclebmc/core/models/vcn.rb +272 -0
- data/lib/oraclebmc/core/models/vnic.rb +274 -0
- data/lib/oraclebmc/core/models/vnic_attachment.rb +271 -0
- data/lib/oraclebmc/core/models/volume.rb +249 -0
- data/lib/oraclebmc/core/models/volume_attachment.rb +284 -0
- data/lib/oraclebmc/core/models/volume_backup.rb +273 -0
- data/lib/oraclebmc/core/util.rb +1 -0
- data/lib/oraclebmc/core/virtual_network_client.rb +2263 -0
- data/lib/oraclebmc/errors.rb +62 -0
- data/lib/oraclebmc/global_context.rb +21 -0
- data/lib/oraclebmc/identity/identity.rb +38 -0
- data/lib/oraclebmc/identity/identity_client.rb +1462 -0
- data/lib/oraclebmc/identity/models/add_user_to_group_details.rb +173 -0
- data/lib/oraclebmc/identity/models/api_key.rb +251 -0
- data/lib/oraclebmc/identity/models/availability_domain.rb +173 -0
- data/lib/oraclebmc/identity/models/compartment.rb +251 -0
- data/lib/oraclebmc/identity/models/create_api_key_details.rb +162 -0
- data/lib/oraclebmc/identity/models/create_compartment_details.rb +187 -0
- data/lib/oraclebmc/identity/models/create_group_details.rb +186 -0
- data/lib/oraclebmc/identity/models/create_policy_details.rb +215 -0
- data/lib/oraclebmc/identity/models/create_swift_password_details.rb +163 -0
- data/lib/oraclebmc/identity/models/create_user_details.rb +186 -0
- data/lib/oraclebmc/identity/models/group.rb +251 -0
- data/lib/oraclebmc/identity/models/policy.rb +277 -0
- data/lib/oraclebmc/identity/models/swift_password.rb +266 -0
- data/lib/oraclebmc/identity/models/ui_password.rb +227 -0
- data/lib/oraclebmc/identity/models/update_compartment_details.rb +162 -0
- data/lib/oraclebmc/identity/models/update_group_details.rb +162 -0
- data/lib/oraclebmc/identity/models/update_policy_details.rb +190 -0
- data/lib/oraclebmc/identity/models/update_state_details.rb +163 -0
- data/lib/oraclebmc/identity/models/update_swift_password_details.rb +162 -0
- data/lib/oraclebmc/identity/models/update_user_details.rb +162 -0
- data/lib/oraclebmc/identity/models/user.rb +257 -0
- data/lib/oraclebmc/identity/models/user_group_membership.rb +249 -0
- data/lib/oraclebmc/identity/util.rb +1 -0
- data/lib/oraclebmc/load_balancer/load_balancer.rb +45 -0
- data/lib/oraclebmc/load_balancer/load_balancer_client.rb +1218 -0
- data/lib/oraclebmc/load_balancer/models/backend.rb +262 -0
- data/lib/oraclebmc/load_balancer/models/backend_details.rb +248 -0
- data/lib/oraclebmc/load_balancer/models/backend_set.rb +211 -0
- data/lib/oraclebmc/load_balancer/models/backend_set_details.rb +197 -0
- data/lib/oraclebmc/load_balancer/models/certificate.rb +209 -0
- data/lib/oraclebmc/load_balancer/models/certificate_details.rb +245 -0
- data/lib/oraclebmc/load_balancer/models/create_backend_details.rb +248 -0
- data/lib/oraclebmc/load_balancer/models/create_backend_set_details.rb +210 -0
- data/lib/oraclebmc/load_balancer/models/create_certificate_details.rb +245 -0
- data/lib/oraclebmc/load_balancer/models/create_listener_details.rb +216 -0
- data/lib/oraclebmc/load_balancer/models/create_load_balancer_details.rb +233 -0
- data/lib/oraclebmc/load_balancer/models/health_checker.rb +265 -0
- data/lib/oraclebmc/load_balancer/models/health_checker_details.rb +264 -0
- data/lib/oraclebmc/load_balancer/models/ip_address.rb +165 -0
- data/lib/oraclebmc/load_balancer/models/listener.rb +216 -0
- data/lib/oraclebmc/load_balancer/models/listener_details.rb +202 -0
- data/lib/oraclebmc/load_balancer/models/load_balancer.rb +296 -0
- data/lib/oraclebmc/load_balancer/models/load_balancer_policy.rb +162 -0
- data/lib/oraclebmc/load_balancer/models/load_balancer_protocol.rb +162 -0
- data/lib/oraclebmc/load_balancer/models/load_balancer_shape.rb +162 -0
- data/lib/oraclebmc/load_balancer/models/ssl_configuration.rb +195 -0
- data/lib/oraclebmc/load_balancer/models/ssl_configuration_details.rb +195 -0
- data/lib/oraclebmc/load_balancer/models/update_backend_details.rb +220 -0
- data/lib/oraclebmc/load_balancer/models/update_backend_set_details.rb +197 -0
- data/lib/oraclebmc/load_balancer/models/update_health_checker_details.rb +263 -0
- data/lib/oraclebmc/load_balancer/models/update_listener_details.rb +202 -0
- data/lib/oraclebmc/load_balancer/models/update_load_balancer_details.rb +165 -0
- data/lib/oraclebmc/load_balancer/models/work_request.rb +269 -0
- data/lib/oraclebmc/load_balancer/models/work_request_error.rb +185 -0
- data/lib/oraclebmc/load_balancer/util.rb +55 -0
- data/lib/oraclebmc/regions.rb +41 -0
- data/lib/oraclebmc/response.rb +86 -0
- data/lib/oraclebmc/signer.rb +119 -0
- data/lib/oraclebmc/version.rb +5 -0
- data/lib/oraclebmc/waiter.rb +111 -0
- data/lib/oraclebmc.rb +20 -0
- metadata +265 -0
@@ -0,0 +1,240 @@
|
|
1
|
+
# Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module OracleBMC
|
6
|
+
class Core::Models::IngressSecurityRule
|
7
|
+
# Optional and valid only for ICMP. Use to specify a particular ICMP type and code
|
8
|
+
# as defined in
|
9
|
+
# [ICMP Parameters](http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml).
|
10
|
+
# If you specify ICMP as the protocol but omit this object, then all ICMP types and
|
11
|
+
# codes are allowed. If you do provide this object, the type is required and the code is optional.
|
12
|
+
# To enable MTU negotiation for ingress internet traffic, make sure to allow type 3 (\"Destination
|
13
|
+
# Unreachable\") code 4 (\"Fragmentation Needed and Don't Fragment was Set\"). If you need to specify
|
14
|
+
# multiple codes for a single type, create a separate security list rule for each.
|
15
|
+
#
|
16
|
+
# @return [OracleBMC::Core::Models::IcmpOptions]
|
17
|
+
attr_accessor :icmp_options
|
18
|
+
|
19
|
+
# A stateless rule allows traffic in one direction. Remember to add a corresponding
|
20
|
+
# stateless rule in the other direction if you need to support bidirectional traffic. For
|
21
|
+
# example, if ingress traffic allows TCP destination port 80, there should be an egress
|
22
|
+
# rule to allow TCP source port 80. Defaults to false, which means the rule is stateful
|
23
|
+
# and a corresponding rule is not necessary for bidirectional traffic.
|
24
|
+
#
|
25
|
+
# @return [BOOLEAN]
|
26
|
+
attr_accessor :is_stateless
|
27
|
+
|
28
|
+
# The transport protocol. Specify either `all` or an IPv4 protocol number as
|
29
|
+
# defined in
|
30
|
+
# [Protocol Numbers](http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml).
|
31
|
+
# Options are supported only for ICMP (\"1\"), TCP (\"6\"), and UDP (\"17\").
|
32
|
+
#
|
33
|
+
# @return [String]
|
34
|
+
attr_accessor :protocol
|
35
|
+
|
36
|
+
# The source CIDR block for the ingress rule. This is the range of IP addresses that a
|
37
|
+
# packet coming into the instance can come from.
|
38
|
+
#
|
39
|
+
# @return [String]
|
40
|
+
attr_accessor :source
|
41
|
+
|
42
|
+
# Optional and valid only for TCP. Use to specify particular destination ports for TCP rules.
|
43
|
+
# If you specify TCP as the protocol but omit this object, then all destination ports are allowed.
|
44
|
+
#
|
45
|
+
# @return [OracleBMC::Core::Models::TcpOptions]
|
46
|
+
attr_accessor :tcp_options
|
47
|
+
|
48
|
+
# Optional and valid only for UDP. Use to specify particular destination ports for UDP rules.
|
49
|
+
# If you specify UDP as the protocol but omit this object, then all destination ports are allowed.
|
50
|
+
#
|
51
|
+
# @return [OracleBMC::Core::Models::UdpOptions]
|
52
|
+
attr_accessor :udp_options
|
53
|
+
|
54
|
+
|
55
|
+
# Initializes the object
|
56
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
57
|
+
def initialize(attributes = {})
|
58
|
+
return unless attributes.is_a?(Hash)
|
59
|
+
|
60
|
+
# convert string to symbol for hash key
|
61
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
62
|
+
|
63
|
+
|
64
|
+
if attributes[:'icmpOptions']
|
65
|
+
self.icmp_options = attributes[:'icmpOptions']
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes[:'isStateless']
|
69
|
+
self.is_stateless = attributes[:'isStateless']
|
70
|
+
end
|
71
|
+
|
72
|
+
if attributes[:'protocol']
|
73
|
+
self.protocol = attributes[:'protocol']
|
74
|
+
end
|
75
|
+
|
76
|
+
if attributes[:'source']
|
77
|
+
self.source = attributes[:'source']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes[:'tcpOptions']
|
81
|
+
self.tcp_options = attributes[:'tcpOptions']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes[:'udpOptions']
|
85
|
+
self.udp_options = attributes[:'udpOptions']
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
|
90
|
+
# Checks equality by comparing each attribute.
|
91
|
+
# @param [Object] other_object to be compared
|
92
|
+
def ==(other_object)
|
93
|
+
return true if self.equal?(other_object)
|
94
|
+
self.class == other_object.class &&
|
95
|
+
icmp_options == other_object.icmp_options &&
|
96
|
+
is_stateless == other_object.is_stateless &&
|
97
|
+
protocol == other_object.protocol &&
|
98
|
+
source == other_object.source &&
|
99
|
+
tcp_options == other_object.tcp_options &&
|
100
|
+
udp_options == other_object.udp_options
|
101
|
+
end
|
102
|
+
|
103
|
+
# @see the `==` method
|
104
|
+
# @param [Object] other_object to be compared
|
105
|
+
def eql?(other_object)
|
106
|
+
self == other_object
|
107
|
+
end
|
108
|
+
|
109
|
+
# Calculates hash code according to all attributes.
|
110
|
+
# @return [Fixnum] Hash code
|
111
|
+
def hash
|
112
|
+
[icmp_options, is_stateless, protocol, source, tcp_options, udp_options].hash
|
113
|
+
end
|
114
|
+
|
115
|
+
# Builds the object from hash
|
116
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
117
|
+
# @return [Object] Returns the model itself
|
118
|
+
def build_from_hash(attributes)
|
119
|
+
return nil unless attributes.is_a?(Hash)
|
120
|
+
self.class.swagger_types.each_pair do |key, type|
|
121
|
+
if type =~ /^Array<(.*)>/i
|
122
|
+
# check to ensure the input is an array given that the the attribute
|
123
|
+
# is documented as an array but the input is not
|
124
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
125
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
126
|
+
end
|
127
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
128
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
129
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
130
|
+
end
|
131
|
+
|
132
|
+
self
|
133
|
+
end
|
134
|
+
|
135
|
+
# Returns the string representation of the object
|
136
|
+
# @return [String] String presentation of the object
|
137
|
+
def to_s
|
138
|
+
to_hash.to_s
|
139
|
+
end
|
140
|
+
|
141
|
+
# Returns the object in the form of hash
|
142
|
+
# @return [Hash] Returns the object in the form of hash
|
143
|
+
def to_hash
|
144
|
+
hash = {}
|
145
|
+
self.class.attribute_map.each_pair do |attr, param|
|
146
|
+
value = self.send(attr)
|
147
|
+
next if value.nil?
|
148
|
+
hash[param] = _to_hash(value)
|
149
|
+
end
|
150
|
+
hash
|
151
|
+
end
|
152
|
+
|
153
|
+
private
|
154
|
+
|
155
|
+
# Outputs non-array value in the form of hash
|
156
|
+
# For object, use to_hash. Otherwise, just return the value
|
157
|
+
# @param [Object] value Any valid value
|
158
|
+
# @return [Hash] Returns the value in the form of hash
|
159
|
+
def _to_hash(value)
|
160
|
+
if value.is_a?(Array)
|
161
|
+
value.compact.map{ |v| _to_hash(v) }
|
162
|
+
elsif value.is_a?(Hash)
|
163
|
+
{}.tap do |hash|
|
164
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
165
|
+
end
|
166
|
+
elsif value.respond_to? :to_hash
|
167
|
+
value.to_hash
|
168
|
+
else
|
169
|
+
value
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
# Deserializes the data based on type
|
174
|
+
# @param [String] type Data type
|
175
|
+
# @param [String] value Value to be deserialized
|
176
|
+
# @return [Object] Deserialized data
|
177
|
+
def _deserialize(type, value)
|
178
|
+
case type.to_sym
|
179
|
+
when :DateTime
|
180
|
+
DateTime.parse(value)
|
181
|
+
when :Date
|
182
|
+
Date.parse(value)
|
183
|
+
when :String
|
184
|
+
value.to_s
|
185
|
+
when :Integer
|
186
|
+
value.to_i
|
187
|
+
when :Float
|
188
|
+
value.to_f
|
189
|
+
when :BOOLEAN
|
190
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
191
|
+
true
|
192
|
+
else
|
193
|
+
false
|
194
|
+
end
|
195
|
+
when :Object
|
196
|
+
# generic object (usually a Hash), return directly
|
197
|
+
value
|
198
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
199
|
+
inner_type = Regexp.last_match[:inner_type]
|
200
|
+
value.map { |v| _deserialize(inner_type, v) }
|
201
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
202
|
+
k_type = Regexp.last_match[:k_type]
|
203
|
+
v_type = Regexp.last_match[:v_type]
|
204
|
+
{}.tap do |hash|
|
205
|
+
value.each do |k, v|
|
206
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
207
|
+
end
|
208
|
+
end
|
209
|
+
else # model
|
210
|
+
temp_model = OracleBMC.const_get(type.to_s).new
|
211
|
+
temp_model.build_from_hash(value)
|
212
|
+
end
|
213
|
+
end
|
214
|
+
|
215
|
+
|
216
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
217
|
+
def self.attribute_map
|
218
|
+
{
|
219
|
+
:'icmp_options' => :'icmpOptions',
|
220
|
+
:'is_stateless' => :'isStateless',
|
221
|
+
:'protocol' => :'protocol',
|
222
|
+
:'source' => :'source',
|
223
|
+
:'tcp_options' => :'tcpOptions',
|
224
|
+
:'udp_options' => :'udpOptions'
|
225
|
+
}
|
226
|
+
end
|
227
|
+
|
228
|
+
# Attribute type mapping.
|
229
|
+
def self.swagger_types
|
230
|
+
{
|
231
|
+
:'icmp_options' => :'OracleBMC::Core::Models::IcmpOptions',
|
232
|
+
:'is_stateless' => :'BOOLEAN',
|
233
|
+
:'protocol' => :'String',
|
234
|
+
:'source' => :'String',
|
235
|
+
:'tcp_options' => :'OracleBMC::Core::Models::TcpOptions',
|
236
|
+
:'udp_options' => :'OracleBMC::Core::Models::UdpOptions'
|
237
|
+
}
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
@@ -0,0 +1,326 @@
|
|
1
|
+
# Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module OracleBMC
|
6
|
+
class Core::Models::Instance
|
7
|
+
|
8
|
+
LIFECYCLE_STATE_ENUM = [LIFECYCLE_STATE_PROVISIONING = 'PROVISIONING',
|
9
|
+
LIFECYCLE_STATE_RUNNING = 'RUNNING',
|
10
|
+
LIFECYCLE_STATE_STARTING = 'STARTING',
|
11
|
+
LIFECYCLE_STATE_STOPPING = 'STOPPING',
|
12
|
+
LIFECYCLE_STATE_STOPPED = 'STOPPED',
|
13
|
+
LIFECYCLE_STATE_CREATING_IMAGE = 'CREATING_IMAGE',
|
14
|
+
LIFECYCLE_STATE_TERMINATING = 'TERMINATING',
|
15
|
+
LIFECYCLE_STATE_TERMINATED = 'TERMINATED']
|
16
|
+
|
17
|
+
# The Availability Domain the instance is running in.
|
18
|
+
#
|
19
|
+
# Example: `Uocm:PHX-AD-1`
|
20
|
+
#
|
21
|
+
# @return [String]
|
22
|
+
attr_accessor :availability_domain
|
23
|
+
|
24
|
+
# The OCID of the compartment that contains the instance.
|
25
|
+
# @return [String]
|
26
|
+
attr_accessor :compartment_id
|
27
|
+
|
28
|
+
# A user-friendly name. Does not have to be unique, and it's changeable.
|
29
|
+
#
|
30
|
+
# Example: `My bare metal instance`
|
31
|
+
#
|
32
|
+
# @return [String]
|
33
|
+
attr_accessor :display_name
|
34
|
+
|
35
|
+
# The OCID of the instance.
|
36
|
+
# @return [String]
|
37
|
+
attr_accessor :id
|
38
|
+
|
39
|
+
# The image used to boot the instance. You can enumerate all available images by calling
|
40
|
+
# {#list_images list_images}.
|
41
|
+
#
|
42
|
+
# @return [String]
|
43
|
+
attr_accessor :image_id
|
44
|
+
|
45
|
+
# When an Oracle Bare Metal Cloud Services or virtual machine
|
46
|
+
# instance boots, the iPXE firmware that runs on the instance is
|
47
|
+
# configured to run an iPXE script to continue the boot process.
|
48
|
+
#
|
49
|
+
# If you want more control over the boot process, you can provide
|
50
|
+
# your own custom iPXE script that will run when the instance boots;
|
51
|
+
# however, you should be aware that the same iPXE script will run
|
52
|
+
# every time an instance boots; not only after the initial
|
53
|
+
# LaunchInstance call.
|
54
|
+
#
|
55
|
+
# The default iPXE script connects to the instance\u2019s local boot
|
56
|
+
# volume over iSCSI and performs a network boot. If you use a custom iPXE
|
57
|
+
# script and want to network-boot from the instance\u2019s local boot volume
|
58
|
+
# over iSCSI the same way as the default iPXE script, you should use the
|
59
|
+
# following iSCSI IP address: 169.254.0.2, and boot volume IQN:
|
60
|
+
# iqn.2015-02.oracle.boot.
|
61
|
+
#
|
62
|
+
# For more information about iPXE, see http://ipxe.org.
|
63
|
+
#
|
64
|
+
# @return [String]
|
65
|
+
attr_accessor :ipxe_script
|
66
|
+
|
67
|
+
# The current state of the instance.
|
68
|
+
# @return [String]
|
69
|
+
attr_accessor :lifecycle_state
|
70
|
+
|
71
|
+
# Custom metadata that you provide.
|
72
|
+
# @return [Hash<String, String>]
|
73
|
+
attr_accessor :metadata
|
74
|
+
|
75
|
+
# The region that contains the Availability Domain the instance is running in.
|
76
|
+
#
|
77
|
+
# Example: `phx`
|
78
|
+
#
|
79
|
+
# @return [String]
|
80
|
+
attr_accessor :region
|
81
|
+
|
82
|
+
# The shape of the instance. The shape determines the number of CPUs and the amount of memory
|
83
|
+
# allocated to the instance. You can enumerate all available shapes by calling
|
84
|
+
# {#list_shapes list_shapes}.
|
85
|
+
#
|
86
|
+
# @return [String]
|
87
|
+
attr_accessor :shape
|
88
|
+
|
89
|
+
# The date and time the instance was created, in the format defined by RFC3339.
|
90
|
+
#
|
91
|
+
# Example: `2016-08-25T21:10:29.600Z`
|
92
|
+
#
|
93
|
+
# @return [DateTime]
|
94
|
+
attr_accessor :time_created
|
95
|
+
|
96
|
+
|
97
|
+
# Initializes the object
|
98
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
99
|
+
def initialize(attributes = {})
|
100
|
+
return unless attributes.is_a?(Hash)
|
101
|
+
|
102
|
+
# convert string to symbol for hash key
|
103
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
104
|
+
|
105
|
+
|
106
|
+
if attributes[:'availabilityDomain']
|
107
|
+
self.availability_domain = attributes[:'availabilityDomain']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes[:'compartmentId']
|
111
|
+
self.compartment_id = attributes[:'compartmentId']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes[:'displayName']
|
115
|
+
self.display_name = attributes[:'displayName']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes[:'id']
|
119
|
+
self.id = attributes[:'id']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes[:'imageId']
|
123
|
+
self.image_id = attributes[:'imageId']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes[:'ipxeScript']
|
127
|
+
self.ipxe_script = attributes[:'ipxeScript']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes[:'lifecycleState']
|
131
|
+
self.lifecycle_state = attributes[:'lifecycleState']
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes[:'metadata']
|
135
|
+
self.metadata = attributes[:'metadata']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes[:'region']
|
139
|
+
self.region = attributes[:'region']
|
140
|
+
end
|
141
|
+
|
142
|
+
if attributes[:'shape']
|
143
|
+
self.shape = attributes[:'shape']
|
144
|
+
end
|
145
|
+
|
146
|
+
if attributes[:'timeCreated']
|
147
|
+
self.time_created = attributes[:'timeCreated']
|
148
|
+
end
|
149
|
+
|
150
|
+
end
|
151
|
+
|
152
|
+
# Custom attribute writer method checking allowed values (enum).
|
153
|
+
# @param [Object] lifecycle_state Object to be assigned
|
154
|
+
def lifecycle_state=(lifecycle_state)
|
155
|
+
if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
|
156
|
+
fail "Invalid value for 'lifecycle_state': this must be one of the values in LIFECYCLE_STATE_ENUM."
|
157
|
+
end
|
158
|
+
@lifecycle_state = lifecycle_state
|
159
|
+
end
|
160
|
+
|
161
|
+
# Checks equality by comparing each attribute.
|
162
|
+
# @param [Object] other_object to be compared
|
163
|
+
def ==(other_object)
|
164
|
+
return true if self.equal?(other_object)
|
165
|
+
self.class == other_object.class &&
|
166
|
+
availability_domain == other_object.availability_domain &&
|
167
|
+
compartment_id == other_object.compartment_id &&
|
168
|
+
display_name == other_object.display_name &&
|
169
|
+
id == other_object.id &&
|
170
|
+
image_id == other_object.image_id &&
|
171
|
+
ipxe_script == other_object.ipxe_script &&
|
172
|
+
lifecycle_state == other_object.lifecycle_state &&
|
173
|
+
metadata == other_object.metadata &&
|
174
|
+
region == other_object.region &&
|
175
|
+
shape == other_object.shape &&
|
176
|
+
time_created == other_object.time_created
|
177
|
+
end
|
178
|
+
|
179
|
+
# @see the `==` method
|
180
|
+
# @param [Object] other_object to be compared
|
181
|
+
def eql?(other_object)
|
182
|
+
self == other_object
|
183
|
+
end
|
184
|
+
|
185
|
+
# Calculates hash code according to all attributes.
|
186
|
+
# @return [Fixnum] Hash code
|
187
|
+
def hash
|
188
|
+
[availability_domain, compartment_id, display_name, id, image_id, ipxe_script, lifecycle_state, metadata, region, shape, time_created].hash
|
189
|
+
end
|
190
|
+
|
191
|
+
# Builds the object from hash
|
192
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
193
|
+
# @return [Object] Returns the model itself
|
194
|
+
def build_from_hash(attributes)
|
195
|
+
return nil unless attributes.is_a?(Hash)
|
196
|
+
self.class.swagger_types.each_pair do |key, type|
|
197
|
+
if type =~ /^Array<(.*)>/i
|
198
|
+
# check to ensure the input is an array given that the the attribute
|
199
|
+
# is documented as an array but the input is not
|
200
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
201
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
202
|
+
end
|
203
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
204
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
205
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
206
|
+
end
|
207
|
+
|
208
|
+
self
|
209
|
+
end
|
210
|
+
|
211
|
+
# Returns the string representation of the object
|
212
|
+
# @return [String] String presentation of the object
|
213
|
+
def to_s
|
214
|
+
to_hash.to_s
|
215
|
+
end
|
216
|
+
|
217
|
+
# Returns the object in the form of hash
|
218
|
+
# @return [Hash] Returns the object in the form of hash
|
219
|
+
def to_hash
|
220
|
+
hash = {}
|
221
|
+
self.class.attribute_map.each_pair do |attr, param|
|
222
|
+
value = self.send(attr)
|
223
|
+
next if value.nil?
|
224
|
+
hash[param] = _to_hash(value)
|
225
|
+
end
|
226
|
+
hash
|
227
|
+
end
|
228
|
+
|
229
|
+
private
|
230
|
+
|
231
|
+
# Outputs non-array value in the form of hash
|
232
|
+
# For object, use to_hash. Otherwise, just return the value
|
233
|
+
# @param [Object] value Any valid value
|
234
|
+
# @return [Hash] Returns the value in the form of hash
|
235
|
+
def _to_hash(value)
|
236
|
+
if value.is_a?(Array)
|
237
|
+
value.compact.map{ |v| _to_hash(v) }
|
238
|
+
elsif value.is_a?(Hash)
|
239
|
+
{}.tap do |hash|
|
240
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
241
|
+
end
|
242
|
+
elsif value.respond_to? :to_hash
|
243
|
+
value.to_hash
|
244
|
+
else
|
245
|
+
value
|
246
|
+
end
|
247
|
+
end
|
248
|
+
|
249
|
+
# Deserializes the data based on type
|
250
|
+
# @param [String] type Data type
|
251
|
+
# @param [String] value Value to be deserialized
|
252
|
+
# @return [Object] Deserialized data
|
253
|
+
def _deserialize(type, value)
|
254
|
+
case type.to_sym
|
255
|
+
when :DateTime
|
256
|
+
DateTime.parse(value)
|
257
|
+
when :Date
|
258
|
+
Date.parse(value)
|
259
|
+
when :String
|
260
|
+
value.to_s
|
261
|
+
when :Integer
|
262
|
+
value.to_i
|
263
|
+
when :Float
|
264
|
+
value.to_f
|
265
|
+
when :BOOLEAN
|
266
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
267
|
+
true
|
268
|
+
else
|
269
|
+
false
|
270
|
+
end
|
271
|
+
when :Object
|
272
|
+
# generic object (usually a Hash), return directly
|
273
|
+
value
|
274
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
275
|
+
inner_type = Regexp.last_match[:inner_type]
|
276
|
+
value.map { |v| _deserialize(inner_type, v) }
|
277
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
278
|
+
k_type = Regexp.last_match[:k_type]
|
279
|
+
v_type = Regexp.last_match[:v_type]
|
280
|
+
{}.tap do |hash|
|
281
|
+
value.each do |k, v|
|
282
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
283
|
+
end
|
284
|
+
end
|
285
|
+
else # model
|
286
|
+
temp_model = OracleBMC.const_get(type.to_s).new
|
287
|
+
temp_model.build_from_hash(value)
|
288
|
+
end
|
289
|
+
end
|
290
|
+
|
291
|
+
|
292
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
293
|
+
def self.attribute_map
|
294
|
+
{
|
295
|
+
:'availability_domain' => :'availabilityDomain',
|
296
|
+
:'compartment_id' => :'compartmentId',
|
297
|
+
:'display_name' => :'displayName',
|
298
|
+
:'id' => :'id',
|
299
|
+
:'image_id' => :'imageId',
|
300
|
+
:'ipxe_script' => :'ipxeScript',
|
301
|
+
:'lifecycle_state' => :'lifecycleState',
|
302
|
+
:'metadata' => :'metadata',
|
303
|
+
:'region' => :'region',
|
304
|
+
:'shape' => :'shape',
|
305
|
+
:'time_created' => :'timeCreated'
|
306
|
+
}
|
307
|
+
end
|
308
|
+
|
309
|
+
# Attribute type mapping.
|
310
|
+
def self.swagger_types
|
311
|
+
{
|
312
|
+
:'availability_domain' => :'String',
|
313
|
+
:'compartment_id' => :'String',
|
314
|
+
:'display_name' => :'String',
|
315
|
+
:'id' => :'String',
|
316
|
+
:'image_id' => :'String',
|
317
|
+
:'ipxe_script' => :'String',
|
318
|
+
:'lifecycle_state' => :'String',
|
319
|
+
:'metadata' => :'Hash<String, String>',
|
320
|
+
:'region' => :'String',
|
321
|
+
:'shape' => :'String',
|
322
|
+
:'time_created' => :'DateTime'
|
323
|
+
}
|
324
|
+
end
|
325
|
+
end
|
326
|
+
end
|