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,245 @@
|
|
1
|
+
# Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module OracleBMC
|
6
|
+
class LoadBalancer::Models::CreateCertificateDetails
|
7
|
+
# A passphrase for encrypted private keys. This is needed only if you created your certificate with a passphrase.
|
8
|
+
#
|
9
|
+
# Example: `Mysecretunlockingcode42!1!`
|
10
|
+
#
|
11
|
+
# @return [String]
|
12
|
+
attr_accessor :passphrase
|
13
|
+
|
14
|
+
# The SSL private key for your certificate, in PEM format.
|
15
|
+
#
|
16
|
+
# Example:
|
17
|
+
#
|
18
|
+
# -----BEGIN RSA PRIVATE KEY-----
|
19
|
+
# jO1O1v2ftXMsawM90tnXwc6xhOAT1gDBC9S8DKeca..JZNUgYYwNS0dP2UK
|
20
|
+
# tmyN+XqVcAKw4HqVmChXy5b5msu8eIq3uc2NqNVtR..2ksSLukP8pxXcHyb
|
21
|
+
# +sEwvM4uf8qbnHAqwnOnP9+KV9vds6BaH1eRA4CHz..n+NVZlzBsTxTlS16
|
22
|
+
# /Umr7wJzVrMqK5sDiSu4WuaaBdqMGfL5hLsTjcBFD..Da2iyQmSKuVD4lIZ
|
23
|
+
# ...
|
24
|
+
# -----END RSA PRIVATE KEY-----
|
25
|
+
#
|
26
|
+
# @return [String]
|
27
|
+
attr_accessor :private_key
|
28
|
+
|
29
|
+
# The public certificate, in PEM format, that you received from your SSL certificate provider.
|
30
|
+
#
|
31
|
+
# Example:
|
32
|
+
#
|
33
|
+
# -----BEGIN CERTIFICATE-----
|
34
|
+
# MIIC2jCCAkMCAg38MA0GCSqGSIb3DQEBBQUAMIGbMQswCQYDVQQGEwJKUDEOMAwG
|
35
|
+
# A1UECBMFVG9reW8xEDAOBgNVBAcTB0NodW8ta3UxETAPBgNVBAoTCEZyYW5rNERE
|
36
|
+
# MRgwFgYDVQQLEw9XZWJDZXJ0IFN1cHBvcnQxGDAWBgNVBAMTD0ZyYW5rNEREIFdl
|
37
|
+
# YiBDQTEjMCEGCSqGSIb3DQEJARYUc3VwcG9ydEBmcmFuazRkZC5jb20wHhcNMTIw
|
38
|
+
# ...
|
39
|
+
# -----END CERTIFICATE-----
|
40
|
+
#
|
41
|
+
# @return [String]
|
42
|
+
attr_accessor :public_certificate
|
43
|
+
|
44
|
+
# The Certificate Authority certificate, or any interim certificate, that you received from your SSL certificate provider.
|
45
|
+
#
|
46
|
+
# Example:
|
47
|
+
#
|
48
|
+
# -----BEGIN CERTIFICATE-----
|
49
|
+
# MIIEczCCA1ugAwIBAgIBADANBgkqhkiG9w0BAQQFAD..AkGA1UEBhMCR0Ix
|
50
|
+
# EzARBgNVBAgTClNvbWUtU3RhdGUxFDASBgNVBAoTC0..0EgTHRkMTcwNQYD
|
51
|
+
# VQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5IENlcn..XRpb24gQXV0aG9y
|
52
|
+
# aXR5MRQwEgYDVQQDEwtCZXN0IENBIEx0ZDAeFw0wMD..TUwMTZaFw0wMTAy
|
53
|
+
# ...
|
54
|
+
# -----END CERTIFICATE-----
|
55
|
+
#
|
56
|
+
# @return [String]
|
57
|
+
attr_accessor :ca_certificate
|
58
|
+
|
59
|
+
# A friendly name for the certificate bundle. It must be unique and it cannot be changed.
|
60
|
+
#
|
61
|
+
# Example: `My certificate bundle`
|
62
|
+
#
|
63
|
+
# @return [String]
|
64
|
+
attr_accessor :certificate_name
|
65
|
+
|
66
|
+
|
67
|
+
# Initializes the object
|
68
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
69
|
+
def initialize(attributes = {})
|
70
|
+
return unless attributes.is_a?(Hash)
|
71
|
+
|
72
|
+
# convert string to symbol for hash key
|
73
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
74
|
+
|
75
|
+
|
76
|
+
if attributes[:'passphrase']
|
77
|
+
self.passphrase = attributes[:'passphrase']
|
78
|
+
end
|
79
|
+
|
80
|
+
if attributes[:'privateKey']
|
81
|
+
self.private_key = attributes[:'privateKey']
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes[:'publicCertificate']
|
85
|
+
self.public_certificate = attributes[:'publicCertificate']
|
86
|
+
end
|
87
|
+
|
88
|
+
if attributes[:'caCertificate']
|
89
|
+
self.ca_certificate = attributes[:'caCertificate']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes[:'certificateName']
|
93
|
+
self.certificate_name = attributes[:'certificateName']
|
94
|
+
end
|
95
|
+
|
96
|
+
end
|
97
|
+
|
98
|
+
# Checks equality by comparing each attribute.
|
99
|
+
# @param [Object] other_object to be compared
|
100
|
+
def ==(other_object)
|
101
|
+
return true if self.equal?(other_object)
|
102
|
+
self.class == other_object.class &&
|
103
|
+
passphrase == other_object.passphrase &&
|
104
|
+
private_key == other_object.private_key &&
|
105
|
+
public_certificate == other_object.public_certificate &&
|
106
|
+
ca_certificate == other_object.ca_certificate &&
|
107
|
+
certificate_name == other_object.certificate_name
|
108
|
+
end
|
109
|
+
|
110
|
+
# @see the `==` method
|
111
|
+
# @param [Object] other_object to be compared
|
112
|
+
def eql?(other_object)
|
113
|
+
self == other_object
|
114
|
+
end
|
115
|
+
|
116
|
+
# Calculates hash code according to all attributes.
|
117
|
+
# @return [Fixnum] Hash code
|
118
|
+
def hash
|
119
|
+
[passphrase, private_key, public_certificate, ca_certificate, certificate_name].hash
|
120
|
+
end
|
121
|
+
|
122
|
+
# Builds the object from hash
|
123
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
124
|
+
# @return [Object] Returns the model itself
|
125
|
+
def build_from_hash(attributes)
|
126
|
+
return nil unless attributes.is_a?(Hash)
|
127
|
+
self.class.swagger_types.each_pair do |key, type|
|
128
|
+
if type =~ /^Array<(.*)>/i
|
129
|
+
# check to ensure the input is an array given that the the attribute
|
130
|
+
# is documented as an array but the input is not
|
131
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
132
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
133
|
+
end
|
134
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
135
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
136
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
137
|
+
end
|
138
|
+
|
139
|
+
self
|
140
|
+
end
|
141
|
+
|
142
|
+
# Returns the string representation of the object
|
143
|
+
# @return [String] String presentation of the object
|
144
|
+
def to_s
|
145
|
+
to_hash.to_s
|
146
|
+
end
|
147
|
+
|
148
|
+
# Returns the object in the form of hash
|
149
|
+
# @return [Hash] Returns the object in the form of hash
|
150
|
+
def to_hash
|
151
|
+
hash = {}
|
152
|
+
self.class.attribute_map.each_pair do |attr, param|
|
153
|
+
value = self.send(attr)
|
154
|
+
next if value.nil?
|
155
|
+
hash[param] = _to_hash(value)
|
156
|
+
end
|
157
|
+
hash
|
158
|
+
end
|
159
|
+
|
160
|
+
private
|
161
|
+
|
162
|
+
# Outputs non-array value in the form of hash
|
163
|
+
# For object, use to_hash. Otherwise, just return the value
|
164
|
+
# @param [Object] value Any valid value
|
165
|
+
# @return [Hash] Returns the value in the form of hash
|
166
|
+
def _to_hash(value)
|
167
|
+
if value.is_a?(Array)
|
168
|
+
value.compact.map{ |v| _to_hash(v) }
|
169
|
+
elsif value.is_a?(Hash)
|
170
|
+
{}.tap do |hash|
|
171
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
172
|
+
end
|
173
|
+
elsif value.respond_to? :to_hash
|
174
|
+
value.to_hash
|
175
|
+
else
|
176
|
+
value
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
# Deserializes the data based on type
|
181
|
+
# @param [String] type Data type
|
182
|
+
# @param [String] value Value to be deserialized
|
183
|
+
# @return [Object] Deserialized data
|
184
|
+
def _deserialize(type, value)
|
185
|
+
case type.to_sym
|
186
|
+
when :DateTime
|
187
|
+
DateTime.parse(value)
|
188
|
+
when :Date
|
189
|
+
Date.parse(value)
|
190
|
+
when :String
|
191
|
+
value.to_s
|
192
|
+
when :Integer
|
193
|
+
value.to_i
|
194
|
+
when :Float
|
195
|
+
value.to_f
|
196
|
+
when :BOOLEAN
|
197
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
198
|
+
true
|
199
|
+
else
|
200
|
+
false
|
201
|
+
end
|
202
|
+
when :Object
|
203
|
+
# generic object (usually a Hash), return directly
|
204
|
+
value
|
205
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
206
|
+
inner_type = Regexp.last_match[:inner_type]
|
207
|
+
value.map { |v| _deserialize(inner_type, v) }
|
208
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
209
|
+
k_type = Regexp.last_match[:k_type]
|
210
|
+
v_type = Regexp.last_match[:v_type]
|
211
|
+
{}.tap do |hash|
|
212
|
+
value.each do |k, v|
|
213
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
214
|
+
end
|
215
|
+
end
|
216
|
+
else # model
|
217
|
+
temp_model = OracleBMC.const_get(type.to_s).new
|
218
|
+
temp_model.build_from_hash(value)
|
219
|
+
end
|
220
|
+
end
|
221
|
+
|
222
|
+
|
223
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
224
|
+
def self.attribute_map
|
225
|
+
{
|
226
|
+
:'passphrase' => :'passphrase',
|
227
|
+
:'private_key' => :'privateKey',
|
228
|
+
:'public_certificate' => :'publicCertificate',
|
229
|
+
:'ca_certificate' => :'caCertificate',
|
230
|
+
:'certificate_name' => :'certificateName'
|
231
|
+
}
|
232
|
+
end
|
233
|
+
|
234
|
+
# Attribute type mapping.
|
235
|
+
def self.swagger_types
|
236
|
+
{
|
237
|
+
:'passphrase' => :'String',
|
238
|
+
:'private_key' => :'String',
|
239
|
+
:'public_certificate' => :'String',
|
240
|
+
:'ca_certificate' => :'String',
|
241
|
+
:'certificate_name' => :'String'
|
242
|
+
}
|
243
|
+
end
|
244
|
+
end
|
245
|
+
end
|
@@ -0,0 +1,216 @@
|
|
1
|
+
# Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module OracleBMC
|
6
|
+
class LoadBalancer::Models::CreateListenerDetails
|
7
|
+
# The name of the associated backend set.
|
8
|
+
# @return [String]
|
9
|
+
attr_accessor :default_backend_set_name
|
10
|
+
|
11
|
+
# The communication port for the listener.
|
12
|
+
#
|
13
|
+
# Example: `80`
|
14
|
+
#
|
15
|
+
# @return [Integer]
|
16
|
+
attr_accessor :port
|
17
|
+
|
18
|
+
# The protocol on which the listener accepts connection requests.
|
19
|
+
# To get a list of valid protocols, use the {#list_protocols list_protocols}
|
20
|
+
# operation.
|
21
|
+
#
|
22
|
+
# Example: `HTTP`
|
23
|
+
#
|
24
|
+
# @return [String]
|
25
|
+
attr_accessor :protocol
|
26
|
+
|
27
|
+
# @return [OracleBMC::LoadBalancer::Models::SSLConfigurationDetails]
|
28
|
+
attr_accessor :ssl_configuration
|
29
|
+
|
30
|
+
# A friendly name for the listener. It must be unique and it cannot be changed.
|
31
|
+
#
|
32
|
+
# Example: `My listener`
|
33
|
+
#
|
34
|
+
# @return [String]
|
35
|
+
attr_accessor :name
|
36
|
+
|
37
|
+
|
38
|
+
# Initializes the object
|
39
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
40
|
+
def initialize(attributes = {})
|
41
|
+
return unless attributes.is_a?(Hash)
|
42
|
+
|
43
|
+
# convert string to symbol for hash key
|
44
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
45
|
+
|
46
|
+
|
47
|
+
if attributes[:'defaultBackendSetName']
|
48
|
+
self.default_backend_set_name = attributes[:'defaultBackendSetName']
|
49
|
+
end
|
50
|
+
|
51
|
+
if attributes[:'port']
|
52
|
+
self.port = attributes[:'port']
|
53
|
+
end
|
54
|
+
|
55
|
+
if attributes[:'protocol']
|
56
|
+
self.protocol = attributes[:'protocol']
|
57
|
+
end
|
58
|
+
|
59
|
+
if attributes[:'sslConfiguration']
|
60
|
+
self.ssl_configuration = attributes[:'sslConfiguration']
|
61
|
+
end
|
62
|
+
|
63
|
+
if attributes[:'name']
|
64
|
+
self.name = attributes[:'name']
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
# Checks equality by comparing each attribute.
|
70
|
+
# @param [Object] other_object to be compared
|
71
|
+
def ==(other_object)
|
72
|
+
return true if self.equal?(other_object)
|
73
|
+
self.class == other_object.class &&
|
74
|
+
default_backend_set_name == other_object.default_backend_set_name &&
|
75
|
+
port == other_object.port &&
|
76
|
+
protocol == other_object.protocol &&
|
77
|
+
ssl_configuration == other_object.ssl_configuration &&
|
78
|
+
name == other_object.name
|
79
|
+
end
|
80
|
+
|
81
|
+
# @see the `==` method
|
82
|
+
# @param [Object] other_object to be compared
|
83
|
+
def eql?(other_object)
|
84
|
+
self == other_object
|
85
|
+
end
|
86
|
+
|
87
|
+
# Calculates hash code according to all attributes.
|
88
|
+
# @return [Fixnum] Hash code
|
89
|
+
def hash
|
90
|
+
[default_backend_set_name, port, protocol, ssl_configuration, name].hash
|
91
|
+
end
|
92
|
+
|
93
|
+
# Builds the object from hash
|
94
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
95
|
+
# @return [Object] Returns the model itself
|
96
|
+
def build_from_hash(attributes)
|
97
|
+
return nil unless attributes.is_a?(Hash)
|
98
|
+
self.class.swagger_types.each_pair do |key, type|
|
99
|
+
if type =~ /^Array<(.*)>/i
|
100
|
+
# check to ensure the input is an array given that the the attribute
|
101
|
+
# is documented as an array but the input is not
|
102
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
103
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
104
|
+
end
|
105
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
106
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
107
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
108
|
+
end
|
109
|
+
|
110
|
+
self
|
111
|
+
end
|
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 = self.send(attr)
|
125
|
+
next if value.nil?
|
126
|
+
hash[param] = _to_hash(value)
|
127
|
+
end
|
128
|
+
hash
|
129
|
+
end
|
130
|
+
|
131
|
+
private
|
132
|
+
|
133
|
+
# Outputs non-array value in the form of hash
|
134
|
+
# For object, use to_hash. Otherwise, just return the value
|
135
|
+
# @param [Object] value Any valid value
|
136
|
+
# @return [Hash] Returns the value in the form of hash
|
137
|
+
def _to_hash(value)
|
138
|
+
if value.is_a?(Array)
|
139
|
+
value.compact.map{ |v| _to_hash(v) }
|
140
|
+
elsif value.is_a?(Hash)
|
141
|
+
{}.tap do |hash|
|
142
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
143
|
+
end
|
144
|
+
elsif value.respond_to? :to_hash
|
145
|
+
value.to_hash
|
146
|
+
else
|
147
|
+
value
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
# Deserializes the data based on type
|
152
|
+
# @param [String] type Data type
|
153
|
+
# @param [String] value Value to be deserialized
|
154
|
+
# @return [Object] Deserialized data
|
155
|
+
def _deserialize(type, value)
|
156
|
+
case type.to_sym
|
157
|
+
when :DateTime
|
158
|
+
DateTime.parse(value)
|
159
|
+
when :Date
|
160
|
+
Date.parse(value)
|
161
|
+
when :String
|
162
|
+
value.to_s
|
163
|
+
when :Integer
|
164
|
+
value.to_i
|
165
|
+
when :Float
|
166
|
+
value.to_f
|
167
|
+
when :BOOLEAN
|
168
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
169
|
+
true
|
170
|
+
else
|
171
|
+
false
|
172
|
+
end
|
173
|
+
when :Object
|
174
|
+
# generic object (usually a Hash), return directly
|
175
|
+
value
|
176
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
177
|
+
inner_type = Regexp.last_match[:inner_type]
|
178
|
+
value.map { |v| _deserialize(inner_type, v) }
|
179
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
180
|
+
k_type = Regexp.last_match[:k_type]
|
181
|
+
v_type = Regexp.last_match[:v_type]
|
182
|
+
{}.tap do |hash|
|
183
|
+
value.each do |k, v|
|
184
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
185
|
+
end
|
186
|
+
end
|
187
|
+
else # model
|
188
|
+
temp_model = OracleBMC.const_get(type.to_s).new
|
189
|
+
temp_model.build_from_hash(value)
|
190
|
+
end
|
191
|
+
end
|
192
|
+
|
193
|
+
|
194
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
195
|
+
def self.attribute_map
|
196
|
+
{
|
197
|
+
:'default_backend_set_name' => :'defaultBackendSetName',
|
198
|
+
:'port' => :'port',
|
199
|
+
:'protocol' => :'protocol',
|
200
|
+
:'ssl_configuration' => :'sslConfiguration',
|
201
|
+
:'name' => :'name'
|
202
|
+
}
|
203
|
+
end
|
204
|
+
|
205
|
+
# Attribute type mapping.
|
206
|
+
def self.swagger_types
|
207
|
+
{
|
208
|
+
:'default_backend_set_name' => :'String',
|
209
|
+
:'port' => :'Integer',
|
210
|
+
:'protocol' => :'String',
|
211
|
+
:'ssl_configuration' => :'OracleBMC::LoadBalancer::Models::SSLConfigurationDetails',
|
212
|
+
:'name' => :'String'
|
213
|
+
}
|
214
|
+
end
|
215
|
+
end
|
216
|
+
end
|
@@ -0,0 +1,233 @@
|
|
1
|
+
# Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
|
2
|
+
|
3
|
+
require 'date'
|
4
|
+
|
5
|
+
module OracleBMC
|
6
|
+
class LoadBalancer::Models::CreateLoadBalancerDetails
|
7
|
+
# The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the compartment in which to create the load balancer.
|
8
|
+
# @return [String]
|
9
|
+
attr_accessor :compartment_id
|
10
|
+
|
11
|
+
# A user-friendly name. It does not have to be unique, and it is changeable.
|
12
|
+
#
|
13
|
+
# Example: `My load balancer`
|
14
|
+
#
|
15
|
+
# @return [String]
|
16
|
+
attr_accessor :display_name
|
17
|
+
|
18
|
+
# A template that determines the total pre-provisioned bandwidth (ingress plus egress).
|
19
|
+
# To get a list of available shapes, use the {#list_shapes list_shapes}
|
20
|
+
# operation.
|
21
|
+
#
|
22
|
+
# Example: `100Mbps`
|
23
|
+
#
|
24
|
+
# @return [String]
|
25
|
+
attr_accessor :shape_name
|
26
|
+
|
27
|
+
# @return [Hash<String, OracleBMC::LoadBalancer::Models::ListenerDetails>]
|
28
|
+
attr_accessor :listeners
|
29
|
+
|
30
|
+
# @return [Hash<String, OracleBMC::LoadBalancer::Models::BackendSetDetails>]
|
31
|
+
attr_accessor :backend_sets
|
32
|
+
|
33
|
+
# An array of subnet [OCIDs](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm).
|
34
|
+
# @return [Array<String>]
|
35
|
+
attr_accessor :subnet_ids
|
36
|
+
|
37
|
+
# @return [Hash<String, OracleBMC::LoadBalancer::Models::CertificateDetails>]
|
38
|
+
attr_accessor :certificates
|
39
|
+
|
40
|
+
|
41
|
+
# Initializes the object
|
42
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
43
|
+
def initialize(attributes = {})
|
44
|
+
return unless attributes.is_a?(Hash)
|
45
|
+
|
46
|
+
# convert string to symbol for hash key
|
47
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
48
|
+
|
49
|
+
|
50
|
+
if attributes[:'compartmentId']
|
51
|
+
self.compartment_id = attributes[:'compartmentId']
|
52
|
+
end
|
53
|
+
|
54
|
+
if attributes[:'displayName']
|
55
|
+
self.display_name = attributes[:'displayName']
|
56
|
+
end
|
57
|
+
|
58
|
+
if attributes[:'shapeName']
|
59
|
+
self.shape_name = attributes[:'shapeName']
|
60
|
+
end
|
61
|
+
|
62
|
+
if attributes[:'listeners']
|
63
|
+
self.listeners = attributes[:'listeners']
|
64
|
+
end
|
65
|
+
|
66
|
+
if attributes[:'backendSets']
|
67
|
+
self.backend_sets = attributes[:'backendSets']
|
68
|
+
end
|
69
|
+
|
70
|
+
if attributes[:'subnetIds']
|
71
|
+
self.subnet_ids = attributes[:'subnetIds']
|
72
|
+
end
|
73
|
+
|
74
|
+
if attributes[:'certificates']
|
75
|
+
self.certificates = attributes[:'certificates']
|
76
|
+
end
|
77
|
+
|
78
|
+
end
|
79
|
+
|
80
|
+
# Checks equality by comparing each attribute.
|
81
|
+
# @param [Object] other_object to be compared
|
82
|
+
def ==(other_object)
|
83
|
+
return true if self.equal?(other_object)
|
84
|
+
self.class == other_object.class &&
|
85
|
+
compartment_id == other_object.compartment_id &&
|
86
|
+
display_name == other_object.display_name &&
|
87
|
+
shape_name == other_object.shape_name &&
|
88
|
+
listeners == other_object.listeners &&
|
89
|
+
backend_sets == other_object.backend_sets &&
|
90
|
+
subnet_ids == other_object.subnet_ids &&
|
91
|
+
certificates == other_object.certificates
|
92
|
+
end
|
93
|
+
|
94
|
+
# @see the `==` method
|
95
|
+
# @param [Object] other_object to be compared
|
96
|
+
def eql?(other_object)
|
97
|
+
self == other_object
|
98
|
+
end
|
99
|
+
|
100
|
+
# Calculates hash code according to all attributes.
|
101
|
+
# @return [Fixnum] Hash code
|
102
|
+
def hash
|
103
|
+
[compartment_id, display_name, shape_name, listeners, backend_sets, subnet_ids, certificates].hash
|
104
|
+
end
|
105
|
+
|
106
|
+
# Builds the object from hash
|
107
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
108
|
+
# @return [Object] Returns the model itself
|
109
|
+
def build_from_hash(attributes)
|
110
|
+
return nil unless attributes.is_a?(Hash)
|
111
|
+
self.class.swagger_types.each_pair do |key, type|
|
112
|
+
if type =~ /^Array<(.*)>/i
|
113
|
+
# check to ensure the input is an array given that the the attribute
|
114
|
+
# is documented as an array but the input is not
|
115
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
116
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
117
|
+
end
|
118
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
119
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
120
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
121
|
+
end
|
122
|
+
|
123
|
+
self
|
124
|
+
end
|
125
|
+
|
126
|
+
# Returns the string representation of the object
|
127
|
+
# @return [String] String presentation of the object
|
128
|
+
def to_s
|
129
|
+
to_hash.to_s
|
130
|
+
end
|
131
|
+
|
132
|
+
# Returns the object in the form of hash
|
133
|
+
# @return [Hash] Returns the object in the form of hash
|
134
|
+
def to_hash
|
135
|
+
hash = {}
|
136
|
+
self.class.attribute_map.each_pair do |attr, param|
|
137
|
+
value = self.send(attr)
|
138
|
+
next if value.nil?
|
139
|
+
hash[param] = _to_hash(value)
|
140
|
+
end
|
141
|
+
hash
|
142
|
+
end
|
143
|
+
|
144
|
+
private
|
145
|
+
|
146
|
+
# Outputs non-array value in the form of hash
|
147
|
+
# For object, use to_hash. Otherwise, just return the value
|
148
|
+
# @param [Object] value Any valid value
|
149
|
+
# @return [Hash] Returns the value in the form of hash
|
150
|
+
def _to_hash(value)
|
151
|
+
if value.is_a?(Array)
|
152
|
+
value.compact.map{ |v| _to_hash(v) }
|
153
|
+
elsif value.is_a?(Hash)
|
154
|
+
{}.tap do |hash|
|
155
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
156
|
+
end
|
157
|
+
elsif value.respond_to? :to_hash
|
158
|
+
value.to_hash
|
159
|
+
else
|
160
|
+
value
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
# Deserializes the data based on type
|
165
|
+
# @param [String] type Data type
|
166
|
+
# @param [String] value Value to be deserialized
|
167
|
+
# @return [Object] Deserialized data
|
168
|
+
def _deserialize(type, value)
|
169
|
+
case type.to_sym
|
170
|
+
when :DateTime
|
171
|
+
DateTime.parse(value)
|
172
|
+
when :Date
|
173
|
+
Date.parse(value)
|
174
|
+
when :String
|
175
|
+
value.to_s
|
176
|
+
when :Integer
|
177
|
+
value.to_i
|
178
|
+
when :Float
|
179
|
+
value.to_f
|
180
|
+
when :BOOLEAN
|
181
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
182
|
+
true
|
183
|
+
else
|
184
|
+
false
|
185
|
+
end
|
186
|
+
when :Object
|
187
|
+
# generic object (usually a Hash), return directly
|
188
|
+
value
|
189
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
190
|
+
inner_type = Regexp.last_match[:inner_type]
|
191
|
+
value.map { |v| _deserialize(inner_type, v) }
|
192
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
193
|
+
k_type = Regexp.last_match[:k_type]
|
194
|
+
v_type = Regexp.last_match[:v_type]
|
195
|
+
{}.tap do |hash|
|
196
|
+
value.each do |k, v|
|
197
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
198
|
+
end
|
199
|
+
end
|
200
|
+
else # model
|
201
|
+
temp_model = OracleBMC.const_get(type.to_s).new
|
202
|
+
temp_model.build_from_hash(value)
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
206
|
+
|
207
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
208
|
+
def self.attribute_map
|
209
|
+
{
|
210
|
+
:'compartment_id' => :'compartmentId',
|
211
|
+
:'display_name' => :'displayName',
|
212
|
+
:'shape_name' => :'shapeName',
|
213
|
+
:'listeners' => :'listeners',
|
214
|
+
:'backend_sets' => :'backendSets',
|
215
|
+
:'subnet_ids' => :'subnetIds',
|
216
|
+
:'certificates' => :'certificates'
|
217
|
+
}
|
218
|
+
end
|
219
|
+
|
220
|
+
# Attribute type mapping.
|
221
|
+
def self.swagger_types
|
222
|
+
{
|
223
|
+
:'compartment_id' => :'String',
|
224
|
+
:'display_name' => :'String',
|
225
|
+
:'shape_name' => :'String',
|
226
|
+
:'listeners' => :'Hash<String, OracleBMC::LoadBalancer::Models::ListenerDetails>',
|
227
|
+
:'backend_sets' => :'Hash<String, OracleBMC::LoadBalancer::Models::BackendSetDetails>',
|
228
|
+
:'subnet_ids' => :'Array<String>',
|
229
|
+
:'certificates' => :'Hash<String, OracleBMC::LoadBalancer::Models::CertificateDetails>'
|
230
|
+
}
|
231
|
+
end
|
232
|
+
end
|
233
|
+
end
|