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,198 @@
|
|
1
|
+
# Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module OracleBMC
|
6
|
+
class Core::Models::IPSecConnectionDeviceStatus
|
7
|
+
# The OCID of the compartment containing the IPSec connection.
|
8
|
+
# @return [String]
|
9
|
+
attr_accessor :compartment_id
|
10
|
+
|
11
|
+
# The IPSec connection's Oracle ID (OCID).
|
12
|
+
# @return [String]
|
13
|
+
attr_accessor :id
|
14
|
+
|
15
|
+
# The date and time the IPSec connection was created, in the format defined by RFC3339.
|
16
|
+
#
|
17
|
+
# Example: `2016-08-25T21:10:29.600Z`
|
18
|
+
#
|
19
|
+
# @return [DateTime]
|
20
|
+
attr_accessor :time_created
|
21
|
+
|
22
|
+
# Two {TunnelStatus} objects.
|
23
|
+
# @return [Array<OracleBMC::Core::Models::TunnelStatus>]
|
24
|
+
attr_accessor :tunnels
|
25
|
+
|
26
|
+
|
27
|
+
# Initializes the object
|
28
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
29
|
+
def initialize(attributes = {})
|
30
|
+
return unless attributes.is_a?(Hash)
|
31
|
+
|
32
|
+
# convert string to symbol for hash key
|
33
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
34
|
+
|
35
|
+
|
36
|
+
if attributes[:'compartmentId']
|
37
|
+
self.compartment_id = attributes[:'compartmentId']
|
38
|
+
end
|
39
|
+
|
40
|
+
if attributes[:'id']
|
41
|
+
self.id = attributes[:'id']
|
42
|
+
end
|
43
|
+
|
44
|
+
if attributes[:'timeCreated']
|
45
|
+
self.time_created = attributes[:'timeCreated']
|
46
|
+
end
|
47
|
+
|
48
|
+
if attributes[:'tunnels']
|
49
|
+
self.tunnels = attributes[:'tunnels']
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
# Checks equality by comparing each attribute.
|
55
|
+
# @param [Object] other_object to be compared
|
56
|
+
def ==(other_object)
|
57
|
+
return true if self.equal?(other_object)
|
58
|
+
self.class == other_object.class &&
|
59
|
+
compartment_id == other_object.compartment_id &&
|
60
|
+
id == other_object.id &&
|
61
|
+
time_created == other_object.time_created &&
|
62
|
+
tunnels == other_object.tunnels
|
63
|
+
end
|
64
|
+
|
65
|
+
# @see the `==` method
|
66
|
+
# @param [Object] other_object to be compared
|
67
|
+
def eql?(other_object)
|
68
|
+
self == other_object
|
69
|
+
end
|
70
|
+
|
71
|
+
# Calculates hash code according to all attributes.
|
72
|
+
# @return [Fixnum] Hash code
|
73
|
+
def hash
|
74
|
+
[compartment_id, id, time_created, tunnels].hash
|
75
|
+
end
|
76
|
+
|
77
|
+
# Builds the object from hash
|
78
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
79
|
+
# @return [Object] Returns the model itself
|
80
|
+
def build_from_hash(attributes)
|
81
|
+
return nil unless attributes.is_a?(Hash)
|
82
|
+
self.class.swagger_types.each_pair do |key, type|
|
83
|
+
if type =~ /^Array<(.*)>/i
|
84
|
+
# check to ensure the input is an array given that the the attribute
|
85
|
+
# is documented as an array but the input is not
|
86
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
87
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
88
|
+
end
|
89
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
90
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
91
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
92
|
+
end
|
93
|
+
|
94
|
+
self
|
95
|
+
end
|
96
|
+
|
97
|
+
# Returns the string representation of the object
|
98
|
+
# @return [String] String presentation of the object
|
99
|
+
def to_s
|
100
|
+
to_hash.to_s
|
101
|
+
end
|
102
|
+
|
103
|
+
# Returns the object in the form of hash
|
104
|
+
# @return [Hash] Returns the object in the form of hash
|
105
|
+
def to_hash
|
106
|
+
hash = {}
|
107
|
+
self.class.attribute_map.each_pair do |attr, param|
|
108
|
+
value = self.send(attr)
|
109
|
+
next if value.nil?
|
110
|
+
hash[param] = _to_hash(value)
|
111
|
+
end
|
112
|
+
hash
|
113
|
+
end
|
114
|
+
|
115
|
+
private
|
116
|
+
|
117
|
+
# Outputs non-array value in the form of hash
|
118
|
+
# For object, use to_hash. Otherwise, just return the value
|
119
|
+
# @param [Object] value Any valid value
|
120
|
+
# @return [Hash] Returns the value in the form of hash
|
121
|
+
def _to_hash(value)
|
122
|
+
if value.is_a?(Array)
|
123
|
+
value.compact.map{ |v| _to_hash(v) }
|
124
|
+
elsif value.is_a?(Hash)
|
125
|
+
{}.tap do |hash|
|
126
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
127
|
+
end
|
128
|
+
elsif value.respond_to? :to_hash
|
129
|
+
value.to_hash
|
130
|
+
else
|
131
|
+
value
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
# Deserializes the data based on type
|
136
|
+
# @param [String] type Data type
|
137
|
+
# @param [String] value Value to be deserialized
|
138
|
+
# @return [Object] Deserialized data
|
139
|
+
def _deserialize(type, value)
|
140
|
+
case type.to_sym
|
141
|
+
when :DateTime
|
142
|
+
DateTime.parse(value)
|
143
|
+
when :Date
|
144
|
+
Date.parse(value)
|
145
|
+
when :String
|
146
|
+
value.to_s
|
147
|
+
when :Integer
|
148
|
+
value.to_i
|
149
|
+
when :Float
|
150
|
+
value.to_f
|
151
|
+
when :BOOLEAN
|
152
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
153
|
+
true
|
154
|
+
else
|
155
|
+
false
|
156
|
+
end
|
157
|
+
when :Object
|
158
|
+
# generic object (usually a Hash), return directly
|
159
|
+
value
|
160
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
161
|
+
inner_type = Regexp.last_match[:inner_type]
|
162
|
+
value.map { |v| _deserialize(inner_type, v) }
|
163
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
164
|
+
k_type = Regexp.last_match[:k_type]
|
165
|
+
v_type = Regexp.last_match[:v_type]
|
166
|
+
{}.tap do |hash|
|
167
|
+
value.each do |k, v|
|
168
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
169
|
+
end
|
170
|
+
end
|
171
|
+
else # model
|
172
|
+
temp_model = OracleBMC.const_get(type.to_s).new
|
173
|
+
temp_model.build_from_hash(value)
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
177
|
+
|
178
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
179
|
+
def self.attribute_map
|
180
|
+
{
|
181
|
+
:'compartment_id' => :'compartmentId',
|
182
|
+
:'id' => :'id',
|
183
|
+
:'time_created' => :'timeCreated',
|
184
|
+
:'tunnels' => :'tunnels'
|
185
|
+
}
|
186
|
+
end
|
187
|
+
|
188
|
+
# Attribute type mapping.
|
189
|
+
def self.swagger_types
|
190
|
+
{
|
191
|
+
:'compartment_id' => :'String',
|
192
|
+
:'id' => :'String',
|
193
|
+
:'time_created' => :'DateTime',
|
194
|
+
:'tunnels' => :'Array<OracleBMC::Core::Models::TunnelStatus>'
|
195
|
+
}
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
@@ -0,0 +1,327 @@
|
|
1
|
+
# Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module OracleBMC
|
6
|
+
class Core::Models::LaunchInstanceDetails
|
7
|
+
# The Availability Domain of the instance.
|
8
|
+
#
|
9
|
+
# Example: `Uocm:PHX-AD-1`
|
10
|
+
#
|
11
|
+
# @return [String]
|
12
|
+
attr_accessor :availability_domain
|
13
|
+
|
14
|
+
# The OCID of the compartment.
|
15
|
+
# @return [String]
|
16
|
+
attr_accessor :compartment_id
|
17
|
+
|
18
|
+
# A user-friendly name. Does not have to be unique, and it's changeable.
|
19
|
+
#
|
20
|
+
# Example: `My bare metal instance`
|
21
|
+
#
|
22
|
+
# @return [String]
|
23
|
+
attr_accessor :display_name
|
24
|
+
|
25
|
+
# The OCID of the image used to boot the instance.
|
26
|
+
# @return [String]
|
27
|
+
attr_accessor :image_id
|
28
|
+
|
29
|
+
# This is an advanced option.
|
30
|
+
#
|
31
|
+
# When an Oracle Bare Metal Cloud Services or virtual machine
|
32
|
+
# instance boots, the iPXE firmware that runs on the instance is
|
33
|
+
# configured to run an iPXE script to continue the boot process.
|
34
|
+
#
|
35
|
+
# If you want more control over the boot process, you can provide
|
36
|
+
# your own custom iPXE script that will run when the instance boots;
|
37
|
+
# however, you should be aware that the same iPXE script will run
|
38
|
+
# every time an instance boots; not only after the initial
|
39
|
+
# LaunchInstance call.
|
40
|
+
#
|
41
|
+
# The default iPXE script connects to the instance\u2019s local boot
|
42
|
+
# volume over iSCSI and performs a network boot. If you use a custom iPXE
|
43
|
+
# script and want to network-boot from the instance\u2019s local boot volume
|
44
|
+
# over iSCSI the same way as the default iPXE script, you should use the
|
45
|
+
# following iSCSI IP address: 169.254.0.2, and boot volume IQN:
|
46
|
+
# iqn.2015-02.oracle.boot.
|
47
|
+
#
|
48
|
+
# For more information about iPXE, see http://ipxe.org.
|
49
|
+
#
|
50
|
+
# @return [String]
|
51
|
+
attr_accessor :ipxe_script
|
52
|
+
|
53
|
+
# Custom metadata key/value pairs that you provide, such as the SSH public key
|
54
|
+
# required to connect to the instance.
|
55
|
+
#
|
56
|
+
# A metadata service runs on every launched instance. The service is an HTTP
|
57
|
+
# endpoint listening on 169.254.169.254. You can use the service to:
|
58
|
+
#
|
59
|
+
# * Provide information to [Cloud-Init](https://cloudinit.readthedocs.org/en/latest/)
|
60
|
+
# to be used for various system initialization tasks.
|
61
|
+
#
|
62
|
+
# * Get information about the instance, including the custom metadata that you
|
63
|
+
# provide when you launch the instance.
|
64
|
+
#
|
65
|
+
# __Providing Cloud-Init Metadata__
|
66
|
+
#
|
67
|
+
# You can use the following metadata key names to provide information to
|
68
|
+
# Cloud-Init:
|
69
|
+
#
|
70
|
+
# __\"ssh_authorized_keys\"__ - Provide one or more public SSH keys to be
|
71
|
+
# included in the `~/.ssh/authorized_keys` file for the default user on the
|
72
|
+
# instance. Use a newline character to separate multiple keys. The SSH
|
73
|
+
# keys must be in the format necessary for the `authorized_keys` file, as shown
|
74
|
+
# in the example below.
|
75
|
+
#
|
76
|
+
# __\"user_data\"__ - Provide your own base64-encoded data to be used by
|
77
|
+
# Cloud-Init to run custom scripts or provide custom Cloud-Init configuration. For
|
78
|
+
# information about how to take advantage of user data, see the
|
79
|
+
# [Cloud-Init Documentation](http://cloudinit.readthedocs.org/en/latest/topics/format.html).
|
80
|
+
#
|
81
|
+
# __Note:__ Cloud-Init does not pull this data from the `http://169.254.169.254/opc/v1/instance/metadata/`
|
82
|
+
# path. When the instance launches and either of these keys are provided, the key values are formatted as
|
83
|
+
# OpenStack metadata and copied to the following locations, which are recognized by Cloud-Init:
|
84
|
+
#
|
85
|
+
# `http://169.254.169.254/openstack/latest/meta_data.json` - This JSON blob
|
86
|
+
# contains, among other things, the SSH keys that you provided for
|
87
|
+
# __\"ssh_authorized_keys\"__.
|
88
|
+
#
|
89
|
+
# `http://169.254.169.254/openstack/latest/user_data` - Contains the
|
90
|
+
# base64-decoded data that you provided for __\"user_data\"__.
|
91
|
+
#
|
92
|
+
# __Metadata Example__
|
93
|
+
#
|
94
|
+
# \"metadata\" : {
|
95
|
+
# \"quake_bot_level\" : \"Severe\",
|
96
|
+
# \"ssh_authorized_keys\" : \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCZ06fccNTQfq+xubFlJ5ZR3kt+uzspdH9tXL+lAejSM1NXM+CFZev7MIxfEjas06y80ZBZ7DUTQO0GxJPeD8NCOb1VorF8M4xuLwrmzRtkoZzU16umt4y1W0Q4ifdp3IiiU0U8/WxczSXcUVZOLqkz5dc6oMHdMVpkimietWzGZ4LBBsH/LjEVY7E0V+a0sNchlVDIZcm7ErReBLcdTGDq0uLBiuChyl6RUkX1PNhusquTGwK7zc8OBXkRuubn5UKXhI3Ul9Nyk4XESkVWIGNKmw8mSpoJSjR8P9ZjRmcZVo8S+x4KVPMZKQEor== ryan.smith@company.com
|
97
|
+
# ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAzJSAtwEPoB3Jmr58IXrDGzLuDYkWAYg8AsLYlo6JZvKpjY1xednIcfEVQJm4T2DhVmdWhRrwQ8DmayVZvBkLt+zs2LdoAJEVimKwXcJFD/7wtH8Lnk17HiglbbbNXsemjDY0hea4JUE5CfvkIdZBITuMrfqSmA4n3VNoorXYdvtTMoGG8fxMub46RPtuxtqi9bG9Zqenordkg5FJt2mVNfQRqf83CWojcOkklUWq4CjyxaeLf5i9gv1fRoBo4QhiA8I6NCSppO8GnoV/6Ox6TNoh9BiifqGKC9VGYuC89RvUajRBTZSK2TK4DPfaT+2R+slPsFrwiT/oPEhhEK1S5Q== rsa-key-20160227\",
|
98
|
+
# \"user_data\" : \"SWYgeW91IGNhbiBzZWUgdGhpcywgdGhlbiBpdCB3b3JrZWQgbWF5YmUuCg==\"
|
99
|
+
# }
|
100
|
+
# __Getting Metadata on the Instance__
|
101
|
+
#
|
102
|
+
# To get information about your instance, connect to the instance using SSH and issue any of the
|
103
|
+
# following GET requests:
|
104
|
+
#
|
105
|
+
# curl http://169.254.169.254/opc/v1/instance/
|
106
|
+
# curl http://169.254.169.254/opc/v1/instance/metadata/
|
107
|
+
# curl http://169.254.169.254/opc/v1/instance/metadata/<any-key-name>
|
108
|
+
#
|
109
|
+
# You'll get back a response that includes all the instance information; only the metadata information; or
|
110
|
+
# the metadata information for the specified key name, respectively.
|
111
|
+
#
|
112
|
+
# @return [Hash<String, String>]
|
113
|
+
attr_accessor :metadata
|
114
|
+
|
115
|
+
# The shape of an instance. The shape determines the number of CPUs, amount of memory,
|
116
|
+
# and other resources allocated to the instance.
|
117
|
+
#
|
118
|
+
# You can enumerate all available shapes by calling {#list_shapes list_shapes}.
|
119
|
+
#
|
120
|
+
# @return [String]
|
121
|
+
attr_accessor :shape
|
122
|
+
|
123
|
+
# The OCID of the subnet.
|
124
|
+
# @return [String]
|
125
|
+
attr_accessor :subnet_id
|
126
|
+
|
127
|
+
|
128
|
+
# Initializes the object
|
129
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
130
|
+
def initialize(attributes = {})
|
131
|
+
return unless attributes.is_a?(Hash)
|
132
|
+
|
133
|
+
# convert string to symbol for hash key
|
134
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
135
|
+
|
136
|
+
|
137
|
+
if attributes[:'availabilityDomain']
|
138
|
+
self.availability_domain = attributes[:'availabilityDomain']
|
139
|
+
end
|
140
|
+
|
141
|
+
if attributes[:'compartmentId']
|
142
|
+
self.compartment_id = attributes[:'compartmentId']
|
143
|
+
end
|
144
|
+
|
145
|
+
if attributes[:'displayName']
|
146
|
+
self.display_name = attributes[:'displayName']
|
147
|
+
end
|
148
|
+
|
149
|
+
if attributes[:'imageId']
|
150
|
+
self.image_id = attributes[:'imageId']
|
151
|
+
end
|
152
|
+
|
153
|
+
if attributes[:'ipxeScript']
|
154
|
+
self.ipxe_script = attributes[:'ipxeScript']
|
155
|
+
end
|
156
|
+
|
157
|
+
if attributes[:'metadata']
|
158
|
+
self.metadata = attributes[:'metadata']
|
159
|
+
end
|
160
|
+
|
161
|
+
if attributes[:'shape']
|
162
|
+
self.shape = attributes[:'shape']
|
163
|
+
end
|
164
|
+
|
165
|
+
if attributes[:'subnetId']
|
166
|
+
self.subnet_id = attributes[:'subnetId']
|
167
|
+
end
|
168
|
+
|
169
|
+
end
|
170
|
+
|
171
|
+
# Checks equality by comparing each attribute.
|
172
|
+
# @param [Object] other_object to be compared
|
173
|
+
def ==(other_object)
|
174
|
+
return true if self.equal?(other_object)
|
175
|
+
self.class == other_object.class &&
|
176
|
+
availability_domain == other_object.availability_domain &&
|
177
|
+
compartment_id == other_object.compartment_id &&
|
178
|
+
display_name == other_object.display_name &&
|
179
|
+
image_id == other_object.image_id &&
|
180
|
+
ipxe_script == other_object.ipxe_script &&
|
181
|
+
metadata == other_object.metadata &&
|
182
|
+
shape == other_object.shape &&
|
183
|
+
subnet_id == other_object.subnet_id
|
184
|
+
end
|
185
|
+
|
186
|
+
# @see the `==` method
|
187
|
+
# @param [Object] other_object to be compared
|
188
|
+
def eql?(other_object)
|
189
|
+
self == other_object
|
190
|
+
end
|
191
|
+
|
192
|
+
# Calculates hash code according to all attributes.
|
193
|
+
# @return [Fixnum] Hash code
|
194
|
+
def hash
|
195
|
+
[availability_domain, compartment_id, display_name, image_id, ipxe_script, metadata, shape, subnet_id].hash
|
196
|
+
end
|
197
|
+
|
198
|
+
# Builds the object from hash
|
199
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
200
|
+
# @return [Object] Returns the model itself
|
201
|
+
def build_from_hash(attributes)
|
202
|
+
return nil unless attributes.is_a?(Hash)
|
203
|
+
self.class.swagger_types.each_pair do |key, type|
|
204
|
+
if type =~ /^Array<(.*)>/i
|
205
|
+
# check to ensure the input is an array given that the the attribute
|
206
|
+
# is documented as an array but the input is not
|
207
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
208
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
209
|
+
end
|
210
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
211
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
212
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
213
|
+
end
|
214
|
+
|
215
|
+
self
|
216
|
+
end
|
217
|
+
|
218
|
+
# Returns the string representation of the object
|
219
|
+
# @return [String] String presentation of the object
|
220
|
+
def to_s
|
221
|
+
to_hash.to_s
|
222
|
+
end
|
223
|
+
|
224
|
+
# Returns the object in the form of hash
|
225
|
+
# @return [Hash] Returns the object in the form of hash
|
226
|
+
def to_hash
|
227
|
+
hash = {}
|
228
|
+
self.class.attribute_map.each_pair do |attr, param|
|
229
|
+
value = self.send(attr)
|
230
|
+
next if value.nil?
|
231
|
+
hash[param] = _to_hash(value)
|
232
|
+
end
|
233
|
+
hash
|
234
|
+
end
|
235
|
+
|
236
|
+
private
|
237
|
+
|
238
|
+
# Outputs non-array value in the form of hash
|
239
|
+
# For object, use to_hash. Otherwise, just return the value
|
240
|
+
# @param [Object] value Any valid value
|
241
|
+
# @return [Hash] Returns the value in the form of hash
|
242
|
+
def _to_hash(value)
|
243
|
+
if value.is_a?(Array)
|
244
|
+
value.compact.map{ |v| _to_hash(v) }
|
245
|
+
elsif value.is_a?(Hash)
|
246
|
+
{}.tap do |hash|
|
247
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
248
|
+
end
|
249
|
+
elsif value.respond_to? :to_hash
|
250
|
+
value.to_hash
|
251
|
+
else
|
252
|
+
value
|
253
|
+
end
|
254
|
+
end
|
255
|
+
|
256
|
+
# Deserializes the data based on type
|
257
|
+
# @param [String] type Data type
|
258
|
+
# @param [String] value Value to be deserialized
|
259
|
+
# @return [Object] Deserialized data
|
260
|
+
def _deserialize(type, value)
|
261
|
+
case type.to_sym
|
262
|
+
when :DateTime
|
263
|
+
DateTime.parse(value)
|
264
|
+
when :Date
|
265
|
+
Date.parse(value)
|
266
|
+
when :String
|
267
|
+
value.to_s
|
268
|
+
when :Integer
|
269
|
+
value.to_i
|
270
|
+
when :Float
|
271
|
+
value.to_f
|
272
|
+
when :BOOLEAN
|
273
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
274
|
+
true
|
275
|
+
else
|
276
|
+
false
|
277
|
+
end
|
278
|
+
when :Object
|
279
|
+
# generic object (usually a Hash), return directly
|
280
|
+
value
|
281
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
282
|
+
inner_type = Regexp.last_match[:inner_type]
|
283
|
+
value.map { |v| _deserialize(inner_type, v) }
|
284
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
285
|
+
k_type = Regexp.last_match[:k_type]
|
286
|
+
v_type = Regexp.last_match[:v_type]
|
287
|
+
{}.tap do |hash|
|
288
|
+
value.each do |k, v|
|
289
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
290
|
+
end
|
291
|
+
end
|
292
|
+
else # model
|
293
|
+
temp_model = OracleBMC.const_get(type.to_s).new
|
294
|
+
temp_model.build_from_hash(value)
|
295
|
+
end
|
296
|
+
end
|
297
|
+
|
298
|
+
|
299
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
300
|
+
def self.attribute_map
|
301
|
+
{
|
302
|
+
:'availability_domain' => :'availabilityDomain',
|
303
|
+
:'compartment_id' => :'compartmentId',
|
304
|
+
:'display_name' => :'displayName',
|
305
|
+
:'image_id' => :'imageId',
|
306
|
+
:'ipxe_script' => :'ipxeScript',
|
307
|
+
:'metadata' => :'metadata',
|
308
|
+
:'shape' => :'shape',
|
309
|
+
:'subnet_id' => :'subnetId'
|
310
|
+
}
|
311
|
+
end
|
312
|
+
|
313
|
+
# Attribute type mapping.
|
314
|
+
def self.swagger_types
|
315
|
+
{
|
316
|
+
:'availability_domain' => :'String',
|
317
|
+
:'compartment_id' => :'String',
|
318
|
+
:'display_name' => :'String',
|
319
|
+
:'image_id' => :'String',
|
320
|
+
:'ipxe_script' => :'String',
|
321
|
+
:'metadata' => :'Hash<String, String>',
|
322
|
+
:'shape' => :'String',
|
323
|
+
:'subnet_id' => :'String'
|
324
|
+
}
|
325
|
+
end
|
326
|
+
end
|
327
|
+
end
|
@@ -0,0 +1,175 @@
|
|
1
|
+
# Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module OracleBMC
|
6
|
+
class Core::Models::PortRange
|
7
|
+
# The maximum port number. Must not be lower than the minimum port number. To specify
|
8
|
+
# a single port number, set both the min and max to the same value.
|
9
|
+
#
|
10
|
+
# @return [Integer]
|
11
|
+
attr_accessor :max
|
12
|
+
|
13
|
+
# The minimum port number. Must not be greater than the maximum port number.
|
14
|
+
# @return [Integer]
|
15
|
+
attr_accessor :min
|
16
|
+
|
17
|
+
|
18
|
+
# Initializes the object
|
19
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
20
|
+
def initialize(attributes = {})
|
21
|
+
return unless attributes.is_a?(Hash)
|
22
|
+
|
23
|
+
# convert string to symbol for hash key
|
24
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
25
|
+
|
26
|
+
|
27
|
+
if attributes[:'max']
|
28
|
+
self.max = attributes[:'max']
|
29
|
+
end
|
30
|
+
|
31
|
+
if attributes[:'min']
|
32
|
+
self.min = attributes[:'min']
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
# Checks equality by comparing each attribute.
|
38
|
+
# @param [Object] other_object to be compared
|
39
|
+
def ==(other_object)
|
40
|
+
return true if self.equal?(other_object)
|
41
|
+
self.class == other_object.class &&
|
42
|
+
max == other_object.max &&
|
43
|
+
min == other_object.min
|
44
|
+
end
|
45
|
+
|
46
|
+
# @see the `==` method
|
47
|
+
# @param [Object] other_object to be compared
|
48
|
+
def eql?(other_object)
|
49
|
+
self == other_object
|
50
|
+
end
|
51
|
+
|
52
|
+
# Calculates hash code according to all attributes.
|
53
|
+
# @return [Fixnum] Hash code
|
54
|
+
def hash
|
55
|
+
[max, min].hash
|
56
|
+
end
|
57
|
+
|
58
|
+
# Builds the object from hash
|
59
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
60
|
+
# @return [Object] Returns the model itself
|
61
|
+
def build_from_hash(attributes)
|
62
|
+
return nil unless attributes.is_a?(Hash)
|
63
|
+
self.class.swagger_types.each_pair do |key, type|
|
64
|
+
if type =~ /^Array<(.*)>/i
|
65
|
+
# check to ensure the input is an array given that the the attribute
|
66
|
+
# is documented as an array but the input is not
|
67
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
68
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
69
|
+
end
|
70
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
71
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
72
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
73
|
+
end
|
74
|
+
|
75
|
+
self
|
76
|
+
end
|
77
|
+
|
78
|
+
# Returns the string representation of the object
|
79
|
+
# @return [String] String presentation of the object
|
80
|
+
def to_s
|
81
|
+
to_hash.to_s
|
82
|
+
end
|
83
|
+
|
84
|
+
# Returns the object in the form of hash
|
85
|
+
# @return [Hash] Returns the object in the form of hash
|
86
|
+
def to_hash
|
87
|
+
hash = {}
|
88
|
+
self.class.attribute_map.each_pair do |attr, param|
|
89
|
+
value = self.send(attr)
|
90
|
+
next if value.nil?
|
91
|
+
hash[param] = _to_hash(value)
|
92
|
+
end
|
93
|
+
hash
|
94
|
+
end
|
95
|
+
|
96
|
+
private
|
97
|
+
|
98
|
+
# Outputs non-array value in the form of hash
|
99
|
+
# For object, use to_hash. Otherwise, just return the value
|
100
|
+
# @param [Object] value Any valid value
|
101
|
+
# @return [Hash] Returns the value in the form of hash
|
102
|
+
def _to_hash(value)
|
103
|
+
if value.is_a?(Array)
|
104
|
+
value.compact.map{ |v| _to_hash(v) }
|
105
|
+
elsif value.is_a?(Hash)
|
106
|
+
{}.tap do |hash|
|
107
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
108
|
+
end
|
109
|
+
elsif value.respond_to? :to_hash
|
110
|
+
value.to_hash
|
111
|
+
else
|
112
|
+
value
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
# Deserializes the data based on type
|
117
|
+
# @param [String] type Data type
|
118
|
+
# @param [String] value Value to be deserialized
|
119
|
+
# @return [Object] Deserialized data
|
120
|
+
def _deserialize(type, value)
|
121
|
+
case type.to_sym
|
122
|
+
when :DateTime
|
123
|
+
DateTime.parse(value)
|
124
|
+
when :Date
|
125
|
+
Date.parse(value)
|
126
|
+
when :String
|
127
|
+
value.to_s
|
128
|
+
when :Integer
|
129
|
+
value.to_i
|
130
|
+
when :Float
|
131
|
+
value.to_f
|
132
|
+
when :BOOLEAN
|
133
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
134
|
+
true
|
135
|
+
else
|
136
|
+
false
|
137
|
+
end
|
138
|
+
when :Object
|
139
|
+
# generic object (usually a Hash), return directly
|
140
|
+
value
|
141
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
142
|
+
inner_type = Regexp.last_match[:inner_type]
|
143
|
+
value.map { |v| _deserialize(inner_type, v) }
|
144
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
145
|
+
k_type = Regexp.last_match[:k_type]
|
146
|
+
v_type = Regexp.last_match[:v_type]
|
147
|
+
{}.tap do |hash|
|
148
|
+
value.each do |k, v|
|
149
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
150
|
+
end
|
151
|
+
end
|
152
|
+
else # model
|
153
|
+
temp_model = OracleBMC.const_get(type.to_s).new
|
154
|
+
temp_model.build_from_hash(value)
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
|
159
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
160
|
+
def self.attribute_map
|
161
|
+
{
|
162
|
+
:'max' => :'max',
|
163
|
+
:'min' => :'min'
|
164
|
+
}
|
165
|
+
end
|
166
|
+
|
167
|
+
# Attribute type mapping.
|
168
|
+
def self.swagger_types
|
169
|
+
{
|
170
|
+
:'max' => :'Integer',
|
171
|
+
:'min' => :'Integer'
|
172
|
+
}
|
173
|
+
end
|
174
|
+
end
|
175
|
+
end
|