oraclebmc 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +82 -0
  3. data/README.md +220 -0
  4. data/lib/oraclebmc/api_client.rb +349 -0
  5. data/lib/oraclebmc/config.rb +80 -0
  6. data/lib/oraclebmc/config_file_loader.rb +85 -0
  7. data/lib/oraclebmc/core/blockstorage_client.rb +459 -0
  8. data/lib/oraclebmc/core/compute_client.rb +1053 -0
  9. data/lib/oraclebmc/core/core.rb +82 -0
  10. data/lib/oraclebmc/core/models/attach_i_scsi_volume_details.rb +179 -0
  11. data/lib/oraclebmc/core/models/attach_volume_details.rb +206 -0
  12. data/lib/oraclebmc/core/models/capture_console_history_details.rb +162 -0
  13. data/lib/oraclebmc/core/models/console_history.rb +252 -0
  14. data/lib/oraclebmc/core/models/cpe.rb +209 -0
  15. data/lib/oraclebmc/core/models/create_cpe_details.rb +187 -0
  16. data/lib/oraclebmc/core/models/create_dhcp_details.rb +195 -0
  17. data/lib/oraclebmc/core/models/create_drg_attachment_details.rb +184 -0
  18. data/lib/oraclebmc/core/models/create_drg_details.rb +173 -0
  19. data/lib/oraclebmc/core/models/create_image_details.rb +188 -0
  20. data/lib/oraclebmc/core/models/create_internet_gateway_details.rb +195 -0
  21. data/lib/oraclebmc/core/models/create_ip_sec_connection_details.rb +210 -0
  22. data/lib/oraclebmc/core/models/create_route_table_details.rb +195 -0
  23. data/lib/oraclebmc/core/models/create_security_list_details.rb +206 -0
  24. data/lib/oraclebmc/core/models/create_subnet_details.rb +253 -0
  25. data/lib/oraclebmc/core/models/create_vcn_details.rb +187 -0
  26. data/lib/oraclebmc/core/models/create_volume_backup_details.rb +173 -0
  27. data/lib/oraclebmc/core/models/create_volume_details.rb +211 -0
  28. data/lib/oraclebmc/core/models/dhcp_dns_option.rb +203 -0
  29. data/lib/oraclebmc/core/models/dhcp_option.rb +171 -0
  30. data/lib/oraclebmc/core/models/dhcp_options.rb +246 -0
  31. data/lib/oraclebmc/core/models/drg.rb +224 -0
  32. data/lib/oraclebmc/core/models/drg_attachment.rb +246 -0
  33. data/lib/oraclebmc/core/models/egress_security_rule.rb +240 -0
  34. data/lib/oraclebmc/core/models/i_scsi_volume_attachment.rb +254 -0
  35. data/lib/oraclebmc/core/models/icmp_options.rb +173 -0
  36. data/lib/oraclebmc/core/models/image.rb +282 -0
  37. data/lib/oraclebmc/core/models/ingress_security_rule.rb +240 -0
  38. data/lib/oraclebmc/core/models/instance.rb +326 -0
  39. data/lib/oraclebmc/core/models/internet_gateway.rb +248 -0
  40. data/lib/oraclebmc/core/models/ip_sec_connection.rb +261 -0
  41. data/lib/oraclebmc/core/models/ip_sec_connection_device_config.rb +195 -0
  42. data/lib/oraclebmc/core/models/ip_sec_connection_device_status.rb +198 -0
  43. data/lib/oraclebmc/core/models/launch_instance_details.rb +327 -0
  44. data/lib/oraclebmc/core/models/port_range.rb +175 -0
  45. data/lib/oraclebmc/core/models/route_rule.rb +177 -0
  46. data/lib/oraclebmc/core/models/route_table.rb +246 -0
  47. data/lib/oraclebmc/core/models/security_list.rb +257 -0
  48. data/lib/oraclebmc/core/models/shape.rb +164 -0
  49. data/lib/oraclebmc/core/models/subnet.rb +325 -0
  50. data/lib/oraclebmc/core/models/tcp_options.rb +177 -0
  51. data/lib/oraclebmc/core/models/tunnel_config.rb +193 -0
  52. data/lib/oraclebmc/core/models/tunnel_status.rb +218 -0
  53. data/lib/oraclebmc/core/models/udp_options.rb +177 -0
  54. data/lib/oraclebmc/core/models/update_cpe_details.rb +162 -0
  55. data/lib/oraclebmc/core/models/update_dhcp_details.rb +172 -0
  56. data/lib/oraclebmc/core/models/update_drg_attachment_details.rb +162 -0
  57. data/lib/oraclebmc/core/models/update_drg_details.rb +162 -0
  58. data/lib/oraclebmc/core/models/update_image_details.rb +165 -0
  59. data/lib/oraclebmc/core/models/update_instance_details.rb +165 -0
  60. data/lib/oraclebmc/core/models/update_internet_gateway_details.rb +173 -0
  61. data/lib/oraclebmc/core/models/update_ip_sec_connection_details.rb +162 -0
  62. data/lib/oraclebmc/core/models/update_route_table_details.rb +173 -0
  63. data/lib/oraclebmc/core/models/update_security_list_details.rb +184 -0
  64. data/lib/oraclebmc/core/models/update_subnet_details.rb +162 -0
  65. data/lib/oraclebmc/core/models/update_vcn_details.rb +162 -0
  66. data/lib/oraclebmc/core/models/update_volume_backup_details.rb +162 -0
  67. data/lib/oraclebmc/core/models/update_volume_details.rb +163 -0
  68. data/lib/oraclebmc/core/models/vcn.rb +272 -0
  69. data/lib/oraclebmc/core/models/vnic.rb +274 -0
  70. data/lib/oraclebmc/core/models/vnic_attachment.rb +271 -0
  71. data/lib/oraclebmc/core/models/volume.rb +249 -0
  72. data/lib/oraclebmc/core/models/volume_attachment.rb +284 -0
  73. data/lib/oraclebmc/core/models/volume_backup.rb +273 -0
  74. data/lib/oraclebmc/core/util.rb +1 -0
  75. data/lib/oraclebmc/core/virtual_network_client.rb +2263 -0
  76. data/lib/oraclebmc/errors.rb +62 -0
  77. data/lib/oraclebmc/global_context.rb +21 -0
  78. data/lib/oraclebmc/identity/identity.rb +38 -0
  79. data/lib/oraclebmc/identity/identity_client.rb +1462 -0
  80. data/lib/oraclebmc/identity/models/add_user_to_group_details.rb +173 -0
  81. data/lib/oraclebmc/identity/models/api_key.rb +251 -0
  82. data/lib/oraclebmc/identity/models/availability_domain.rb +173 -0
  83. data/lib/oraclebmc/identity/models/compartment.rb +251 -0
  84. data/lib/oraclebmc/identity/models/create_api_key_details.rb +162 -0
  85. data/lib/oraclebmc/identity/models/create_compartment_details.rb +187 -0
  86. data/lib/oraclebmc/identity/models/create_group_details.rb +186 -0
  87. data/lib/oraclebmc/identity/models/create_policy_details.rb +215 -0
  88. data/lib/oraclebmc/identity/models/create_swift_password_details.rb +163 -0
  89. data/lib/oraclebmc/identity/models/create_user_details.rb +186 -0
  90. data/lib/oraclebmc/identity/models/group.rb +251 -0
  91. data/lib/oraclebmc/identity/models/policy.rb +277 -0
  92. data/lib/oraclebmc/identity/models/swift_password.rb +266 -0
  93. data/lib/oraclebmc/identity/models/ui_password.rb +227 -0
  94. data/lib/oraclebmc/identity/models/update_compartment_details.rb +162 -0
  95. data/lib/oraclebmc/identity/models/update_group_details.rb +162 -0
  96. data/lib/oraclebmc/identity/models/update_policy_details.rb +190 -0
  97. data/lib/oraclebmc/identity/models/update_state_details.rb +163 -0
  98. data/lib/oraclebmc/identity/models/update_swift_password_details.rb +162 -0
  99. data/lib/oraclebmc/identity/models/update_user_details.rb +162 -0
  100. data/lib/oraclebmc/identity/models/user.rb +257 -0
  101. data/lib/oraclebmc/identity/models/user_group_membership.rb +249 -0
  102. data/lib/oraclebmc/identity/util.rb +1 -0
  103. data/lib/oraclebmc/load_balancer/load_balancer.rb +45 -0
  104. data/lib/oraclebmc/load_balancer/load_balancer_client.rb +1218 -0
  105. data/lib/oraclebmc/load_balancer/models/backend.rb +262 -0
  106. data/lib/oraclebmc/load_balancer/models/backend_details.rb +248 -0
  107. data/lib/oraclebmc/load_balancer/models/backend_set.rb +211 -0
  108. data/lib/oraclebmc/load_balancer/models/backend_set_details.rb +197 -0
  109. data/lib/oraclebmc/load_balancer/models/certificate.rb +209 -0
  110. data/lib/oraclebmc/load_balancer/models/certificate_details.rb +245 -0
  111. data/lib/oraclebmc/load_balancer/models/create_backend_details.rb +248 -0
  112. data/lib/oraclebmc/load_balancer/models/create_backend_set_details.rb +210 -0
  113. data/lib/oraclebmc/load_balancer/models/create_certificate_details.rb +245 -0
  114. data/lib/oraclebmc/load_balancer/models/create_listener_details.rb +216 -0
  115. data/lib/oraclebmc/load_balancer/models/create_load_balancer_details.rb +233 -0
  116. data/lib/oraclebmc/load_balancer/models/health_checker.rb +265 -0
  117. data/lib/oraclebmc/load_balancer/models/health_checker_details.rb +264 -0
  118. data/lib/oraclebmc/load_balancer/models/ip_address.rb +165 -0
  119. data/lib/oraclebmc/load_balancer/models/listener.rb +216 -0
  120. data/lib/oraclebmc/load_balancer/models/listener_details.rb +202 -0
  121. data/lib/oraclebmc/load_balancer/models/load_balancer.rb +296 -0
  122. data/lib/oraclebmc/load_balancer/models/load_balancer_policy.rb +162 -0
  123. data/lib/oraclebmc/load_balancer/models/load_balancer_protocol.rb +162 -0
  124. data/lib/oraclebmc/load_balancer/models/load_balancer_shape.rb +162 -0
  125. data/lib/oraclebmc/load_balancer/models/ssl_configuration.rb +195 -0
  126. data/lib/oraclebmc/load_balancer/models/ssl_configuration_details.rb +195 -0
  127. data/lib/oraclebmc/load_balancer/models/update_backend_details.rb +220 -0
  128. data/lib/oraclebmc/load_balancer/models/update_backend_set_details.rb +197 -0
  129. data/lib/oraclebmc/load_balancer/models/update_health_checker_details.rb +263 -0
  130. data/lib/oraclebmc/load_balancer/models/update_listener_details.rb +202 -0
  131. data/lib/oraclebmc/load_balancer/models/update_load_balancer_details.rb +165 -0
  132. data/lib/oraclebmc/load_balancer/models/work_request.rb +269 -0
  133. data/lib/oraclebmc/load_balancer/models/work_request_error.rb +185 -0
  134. data/lib/oraclebmc/load_balancer/util.rb +55 -0
  135. data/lib/oraclebmc/regions.rb +41 -0
  136. data/lib/oraclebmc/response.rb +86 -0
  137. data/lib/oraclebmc/signer.rb +119 -0
  138. data/lib/oraclebmc/version.rb +5 -0
  139. data/lib/oraclebmc/waiter.rb +111 -0
  140. data/lib/oraclebmc.rb +20 -0
  141. 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::CertificateDetails
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,248 @@
1
+ # Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OracleBMC
6
+ class LoadBalancer::Models::CreateBackendDetails
7
+ # The IP address of the backend server.
8
+ #
9
+ # Example: `10.10.10.4`
10
+ #
11
+ # @return [String]
12
+ attr_accessor :ip_address
13
+
14
+ # The communication port for the backend server.
15
+ #
16
+ # Example: `8080`
17
+ #
18
+ # @return [Integer]
19
+ attr_accessor :port
20
+
21
+ # The load balancing policy weight assigned to the server. Backend servers with a higher weight receive a larger
22
+ # proportion of incoming traffic. For example, a server weighted '3' receives 3 times the number of new connections
23
+ # as a server weighted '1'.
24
+ # For more information on load balancing policies, see
25
+ # [How Load Balancing Policies Work](https://docs.us-phoenix-1.oraclecloud.com/Content/Balance/Reference/lbpolicies.htm).
26
+ #
27
+ # Example: `3`
28
+ #
29
+ # @return [Integer]
30
+ attr_accessor :weight
31
+
32
+ # Whether the load balancer should treat this server as a backup unit. If `true`, the load balancer forwards no ingress
33
+ # traffic to this backend server unless all other backend servers not marked as \"backup\" fail the health check policy.
34
+ #
35
+ # Example: `true`
36
+ #
37
+ # @return [BOOLEAN]
38
+ attr_accessor :backup
39
+
40
+ # Whether the load balancer should drain this server. Servers marked \"drain\" receive no new
41
+ # incoming traffic.
42
+ #
43
+ # Example: `true`
44
+ #
45
+ # @return [BOOLEAN]
46
+ attr_accessor :drain
47
+
48
+ # Whether the load balancer should treat this server as offline. Offline servers receive no incoming
49
+ # traffic.
50
+ #
51
+ # Example: `true`
52
+ #
53
+ # @return [BOOLEAN]
54
+ attr_accessor :offline
55
+
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ return unless attributes.is_a?(Hash)
61
+
62
+ # convert string to symbol for hash key
63
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
64
+
65
+
66
+ if attributes[:'ipAddress']
67
+ self.ip_address = attributes[:'ipAddress']
68
+ end
69
+
70
+ if attributes[:'port']
71
+ self.port = attributes[:'port']
72
+ end
73
+
74
+ if attributes[:'weight']
75
+ self.weight = attributes[:'weight']
76
+ end
77
+
78
+ if attributes[:'backup']
79
+ self.backup = attributes[:'backup']
80
+ else
81
+ self.backup = false
82
+ end
83
+
84
+ if attributes[:'drain']
85
+ self.drain = attributes[:'drain']
86
+ else
87
+ self.drain = false
88
+ end
89
+
90
+ if attributes[:'offline']
91
+ self.offline = attributes[:'offline']
92
+ else
93
+ self.offline = false
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
+ ip_address == other_object.ip_address &&
104
+ port == other_object.port &&
105
+ weight == other_object.weight &&
106
+ backup == other_object.backup &&
107
+ drain == other_object.drain &&
108
+ offline == other_object.offline
109
+ end
110
+
111
+ # @see the `==` method
112
+ # @param [Object] other_object to be compared
113
+ def eql?(other_object)
114
+ self == other_object
115
+ end
116
+
117
+ # Calculates hash code according to all attributes.
118
+ # @return [Fixnum] Hash code
119
+ def hash
120
+ [ip_address, port, weight, backup, drain, offline].hash
121
+ end
122
+
123
+ # Builds the object from hash
124
+ # @param [Hash] attributes Model attributes in the form of hash
125
+ # @return [Object] Returns the model itself
126
+ def build_from_hash(attributes)
127
+ return nil unless attributes.is_a?(Hash)
128
+ self.class.swagger_types.each_pair do |key, type|
129
+ if type =~ /^Array<(.*)>/i
130
+ # check to ensure the input is an array given that the the attribute
131
+ # is documented as an array but the input is not
132
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
133
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
134
+ end
135
+ elsif !attributes[self.class.attribute_map[key]].nil?
136
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
137
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
138
+ end
139
+
140
+ self
141
+ end
142
+
143
+ # Returns the string representation of the object
144
+ # @return [String] String presentation of the object
145
+ def to_s
146
+ to_hash.to_s
147
+ end
148
+
149
+ # Returns the object in the form of hash
150
+ # @return [Hash] Returns the object in the form of hash
151
+ def to_hash
152
+ hash = {}
153
+ self.class.attribute_map.each_pair do |attr, param|
154
+ value = self.send(attr)
155
+ next if value.nil?
156
+ hash[param] = _to_hash(value)
157
+ end
158
+ hash
159
+ end
160
+
161
+ private
162
+
163
+ # Outputs non-array value in the form of hash
164
+ # For object, use to_hash. Otherwise, just return the value
165
+ # @param [Object] value Any valid value
166
+ # @return [Hash] Returns the value in the form of hash
167
+ def _to_hash(value)
168
+ if value.is_a?(Array)
169
+ value.compact.map{ |v| _to_hash(v) }
170
+ elsif value.is_a?(Hash)
171
+ {}.tap do |hash|
172
+ value.each { |k, v| hash[k] = _to_hash(v) }
173
+ end
174
+ elsif value.respond_to? :to_hash
175
+ value.to_hash
176
+ else
177
+ value
178
+ end
179
+ end
180
+
181
+ # Deserializes the data based on type
182
+ # @param [String] type Data type
183
+ # @param [String] value Value to be deserialized
184
+ # @return [Object] Deserialized data
185
+ def _deserialize(type, value)
186
+ case type.to_sym
187
+ when :DateTime
188
+ DateTime.parse(value)
189
+ when :Date
190
+ Date.parse(value)
191
+ when :String
192
+ value.to_s
193
+ when :Integer
194
+ value.to_i
195
+ when :Float
196
+ value.to_f
197
+ when :BOOLEAN
198
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
199
+ true
200
+ else
201
+ false
202
+ end
203
+ when :Object
204
+ # generic object (usually a Hash), return directly
205
+ value
206
+ when /\AArray<(?<inner_type>.+)>\z/
207
+ inner_type = Regexp.last_match[:inner_type]
208
+ value.map { |v| _deserialize(inner_type, v) }
209
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
210
+ k_type = Regexp.last_match[:k_type]
211
+ v_type = Regexp.last_match[:v_type]
212
+ {}.tap do |hash|
213
+ value.each do |k, v|
214
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
215
+ end
216
+ end
217
+ else # model
218
+ temp_model = OracleBMC.const_get(type.to_s).new
219
+ temp_model.build_from_hash(value)
220
+ end
221
+ end
222
+
223
+
224
+ # Attribute mapping from ruby-style variable name to JSON key.
225
+ def self.attribute_map
226
+ {
227
+ :'ip_address' => :'ipAddress',
228
+ :'port' => :'port',
229
+ :'weight' => :'weight',
230
+ :'backup' => :'backup',
231
+ :'drain' => :'drain',
232
+ :'offline' => :'offline'
233
+ }
234
+ end
235
+
236
+ # Attribute type mapping.
237
+ def self.swagger_types
238
+ {
239
+ :'ip_address' => :'String',
240
+ :'port' => :'Integer',
241
+ :'weight' => :'Integer',
242
+ :'backup' => :'BOOLEAN',
243
+ :'drain' => :'BOOLEAN',
244
+ :'offline' => :'BOOLEAN'
245
+ }
246
+ end
247
+ end
248
+ end
@@ -0,0 +1,210 @@
1
+ # Copyright (c) 2016 Oracle and/or its affiliates. All rights reserved.
2
+
3
+ require 'date'
4
+
5
+ module OracleBMC
6
+ class LoadBalancer::Models::CreateBackendSetDetails
7
+ # A friendly name for the backend set. It must be unique and it cannot be changed.
8
+ #
9
+ # Example: `My backend set`
10
+ #
11
+ # @return [String]
12
+ attr_accessor :name
13
+
14
+ # The load balancer policy for the backend set. The default load balancing policy is 'ROUND_ROBIN'
15
+ # To get a list of available policies, use the {#list_policies list_policies} operation.
16
+ #
17
+ # Example: `LEAST_CONNECTIONS`
18
+ #
19
+ # @return [String]
20
+ attr_accessor :policy
21
+
22
+ # @return [Array<OracleBMC::LoadBalancer::Models::BackendDetails>]
23
+ attr_accessor :backends
24
+
25
+ # @return [OracleBMC::LoadBalancer::Models::HealthCheckerDetails]
26
+ attr_accessor :health_checker
27
+
28
+ # @return [OracleBMC::LoadBalancer::Models::SSLConfigurationDetails]
29
+ attr_accessor :ssl_configuration
30
+
31
+
32
+ # Initializes the object
33
+ # @param [Hash] attributes Model attributes in the form of hash
34
+ def initialize(attributes = {})
35
+ return unless attributes.is_a?(Hash)
36
+
37
+ # convert string to symbol for hash key
38
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
39
+
40
+
41
+ if attributes[:'name']
42
+ self.name = attributes[:'name']
43
+ end
44
+
45
+ if attributes[:'policy']
46
+ self.policy = attributes[:'policy']
47
+ end
48
+
49
+ if attributes[:'backends']
50
+ self.backends = attributes[:'backends']
51
+ end
52
+
53
+ if attributes[:'healthChecker']
54
+ self.health_checker = attributes[:'healthChecker']
55
+ end
56
+
57
+ if attributes[:'sslConfiguration']
58
+ self.ssl_configuration = attributes[:'sslConfiguration']
59
+ end
60
+
61
+ end
62
+
63
+ # Checks equality by comparing each attribute.
64
+ # @param [Object] other_object to be compared
65
+ def ==(other_object)
66
+ return true if self.equal?(other_object)
67
+ self.class == other_object.class &&
68
+ name == other_object.name &&
69
+ policy == other_object.policy &&
70
+ backends == other_object.backends &&
71
+ health_checker == other_object.health_checker &&
72
+ ssl_configuration == other_object.ssl_configuration
73
+ end
74
+
75
+ # @see the `==` method
76
+ # @param [Object] other_object to be compared
77
+ def eql?(other_object)
78
+ self == other_object
79
+ end
80
+
81
+ # Calculates hash code according to all attributes.
82
+ # @return [Fixnum] Hash code
83
+ def hash
84
+ [name, policy, backends, health_checker, ssl_configuration].hash
85
+ end
86
+
87
+ # Builds the object from hash
88
+ # @param [Hash] attributes Model attributes in the form of hash
89
+ # @return [Object] Returns the model itself
90
+ def build_from_hash(attributes)
91
+ return nil unless attributes.is_a?(Hash)
92
+ self.class.swagger_types.each_pair do |key, type|
93
+ if type =~ /^Array<(.*)>/i
94
+ # check to ensure the input is an array given that the the attribute
95
+ # is documented as an array but the input is not
96
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
97
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
98
+ end
99
+ elsif !attributes[self.class.attribute_map[key]].nil?
100
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
101
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
102
+ end
103
+
104
+ self
105
+ end
106
+
107
+ # Returns the string representation of the object
108
+ # @return [String] String presentation of the object
109
+ def to_s
110
+ to_hash.to_s
111
+ end
112
+
113
+ # Returns the object in the form of hash
114
+ # @return [Hash] Returns the object in the form of hash
115
+ def to_hash
116
+ hash = {}
117
+ self.class.attribute_map.each_pair do |attr, param|
118
+ value = self.send(attr)
119
+ next if value.nil?
120
+ hash[param] = _to_hash(value)
121
+ end
122
+ hash
123
+ end
124
+
125
+ private
126
+
127
+ # Outputs non-array value in the form of hash
128
+ # For object, use to_hash. Otherwise, just return the value
129
+ # @param [Object] value Any valid value
130
+ # @return [Hash] Returns the value in the form of hash
131
+ def _to_hash(value)
132
+ if value.is_a?(Array)
133
+ value.compact.map{ |v| _to_hash(v) }
134
+ elsif value.is_a?(Hash)
135
+ {}.tap do |hash|
136
+ value.each { |k, v| hash[k] = _to_hash(v) }
137
+ end
138
+ elsif value.respond_to? :to_hash
139
+ value.to_hash
140
+ else
141
+ value
142
+ end
143
+ end
144
+
145
+ # Deserializes the data based on type
146
+ # @param [String] type Data type
147
+ # @param [String] value Value to be deserialized
148
+ # @return [Object] Deserialized data
149
+ def _deserialize(type, value)
150
+ case type.to_sym
151
+ when :DateTime
152
+ DateTime.parse(value)
153
+ when :Date
154
+ Date.parse(value)
155
+ when :String
156
+ value.to_s
157
+ when :Integer
158
+ value.to_i
159
+ when :Float
160
+ value.to_f
161
+ when :BOOLEAN
162
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
163
+ true
164
+ else
165
+ false
166
+ end
167
+ when :Object
168
+ # generic object (usually a Hash), return directly
169
+ value
170
+ when /\AArray<(?<inner_type>.+)>\z/
171
+ inner_type = Regexp.last_match[:inner_type]
172
+ value.map { |v| _deserialize(inner_type, v) }
173
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
174
+ k_type = Regexp.last_match[:k_type]
175
+ v_type = Regexp.last_match[:v_type]
176
+ {}.tap do |hash|
177
+ value.each do |k, v|
178
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
179
+ end
180
+ end
181
+ else # model
182
+ temp_model = OracleBMC.const_get(type.to_s).new
183
+ temp_model.build_from_hash(value)
184
+ end
185
+ end
186
+
187
+
188
+ # Attribute mapping from ruby-style variable name to JSON key.
189
+ def self.attribute_map
190
+ {
191
+ :'name' => :'name',
192
+ :'policy' => :'policy',
193
+ :'backends' => :'backends',
194
+ :'health_checker' => :'healthChecker',
195
+ :'ssl_configuration' => :'sslConfiguration'
196
+ }
197
+ end
198
+
199
+ # Attribute type mapping.
200
+ def self.swagger_types
201
+ {
202
+ :'name' => :'String',
203
+ :'policy' => :'String',
204
+ :'backends' => :'Array<OracleBMC::LoadBalancer::Models::BackendDetails>',
205
+ :'health_checker' => :'OracleBMC::LoadBalancer::Models::HealthCheckerDetails',
206
+ :'ssl_configuration' => :'OracleBMC::LoadBalancer::Models::SSLConfigurationDetails'
207
+ }
208
+ end
209
+ end
210
+ end