oraclebmc 1.2.4 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/{README.md → README_BMCS.md} +21 -26
- data/lib/oraclebmc.rb +1 -19
- metadata +16 -259
- data/lib/oraclebmc/api_client.rb +0 -306
- data/lib/oraclebmc/config.rb +0 -80
- data/lib/oraclebmc/config_file_loader.rb +0 -85
- data/lib/oraclebmc/core/blockstorage_client.rb +0 -460
- data/lib/oraclebmc/core/compute_client.rb +0 -1267
- data/lib/oraclebmc/core/core.rb +0 -112
- data/lib/oraclebmc/core/models/attach_i_scsi_volume_details.rb +0 -137
- data/lib/oraclebmc/core/models/attach_vnic_details.rb +0 -144
- data/lib/oraclebmc/core/models/attach_volume_details.rb +0 -165
- data/lib/oraclebmc/core/models/capture_console_history_details.rb +0 -120
- data/lib/oraclebmc/core/models/console_history.rb +0 -213
- data/lib/oraclebmc/core/models/cpe.rb +0 -169
- data/lib/oraclebmc/core/models/create_cpe_details.rb +0 -145
- data/lib/oraclebmc/core/models/create_cross_connect_details.rb +0 -204
- data/lib/oraclebmc/core/models/create_cross_connect_group_details.rb +0 -133
- data/lib/oraclebmc/core/models/create_dhcp_details.rb +0 -153
- data/lib/oraclebmc/core/models/create_drg_attachment_details.rb +0 -142
- data/lib/oraclebmc/core/models/create_drg_details.rb +0 -131
- data/lib/oraclebmc/core/models/create_image_details.rb +0 -159
- data/lib/oraclebmc/core/models/create_internet_gateway_details.rb +0 -153
- data/lib/oraclebmc/core/models/create_ip_sec_connection_details.rb +0 -168
- data/lib/oraclebmc/core/models/create_private_ip_details.rb +0 -173
- data/lib/oraclebmc/core/models/create_route_table_details.rb +0 -153
- data/lib/oraclebmc/core/models/create_security_list_details.rb +0 -164
- data/lib/oraclebmc/core/models/create_subnet_details.rb +0 -257
- data/lib/oraclebmc/core/models/create_vcn_details.rb +0 -171
- data/lib/oraclebmc/core/models/create_virtual_circuit_details.rb +0 -260
- data/lib/oraclebmc/core/models/create_vnic_details.rb +0 -214
- data/lib/oraclebmc/core/models/create_volume_backup_details.rb +0 -133
- data/lib/oraclebmc/core/models/create_volume_details.rb +0 -170
- data/lib/oraclebmc/core/models/cross_connect.rb +0 -235
- data/lib/oraclebmc/core/models/cross_connect_group.rb +0 -187
- data/lib/oraclebmc/core/models/cross_connect_location.rb +0 -134
- data/lib/oraclebmc/core/models/cross_connect_mapping.rb +0 -190
- data/lib/oraclebmc/core/models/cross_connect_port_speed_shape.rb +0 -137
- data/lib/oraclebmc/core/models/cross_connect_status.rb +0 -200
- data/lib/oraclebmc/core/models/dhcp_dns_option.rb +0 -171
- data/lib/oraclebmc/core/models/dhcp_option.rb +0 -135
- data/lib/oraclebmc/core/models/dhcp_options.rb +0 -208
- data/lib/oraclebmc/core/models/dhcp_search_domain_option.rb +0 -141
- data/lib/oraclebmc/core/models/drg.rb +0 -186
- data/lib/oraclebmc/core/models/drg_attachment.rb +0 -208
- data/lib/oraclebmc/core/models/egress_security_rule.rb +0 -198
- data/lib/oraclebmc/core/models/export_image_details.rb +0 -134
- data/lib/oraclebmc/core/models/export_image_via_object_storage_tuple_details.rb +0 -150
- data/lib/oraclebmc/core/models/export_image_via_object_storage_uri_details.rb +0 -130
- data/lib/oraclebmc/core/models/fast_connect_provider_service.rb +0 -145
- data/lib/oraclebmc/core/models/i_scsi_volume_attachment.rb +0 -212
- data/lib/oraclebmc/core/models/icmp_options.rb +0 -131
- data/lib/oraclebmc/core/models/image.rb +0 -245
- data/lib/oraclebmc/core/models/image_source_details.rb +0 -134
- data/lib/oraclebmc/core/models/image_source_via_object_storage_tuple_details.rb +0 -150
- data/lib/oraclebmc/core/models/image_source_via_object_storage_uri_details.rb +0 -128
- data/lib/oraclebmc/core/models/ingress_security_rule.rb +0 -198
- data/lib/oraclebmc/core/models/instance.rb +0 -307
- data/lib/oraclebmc/core/models/instance_credentials.rb +0 -131
- data/lib/oraclebmc/core/models/internet_gateway.rb +0 -210
- data/lib/oraclebmc/core/models/ip_sec_connection.rb +0 -223
- data/lib/oraclebmc/core/models/ip_sec_connection_device_config.rb +0 -153
- data/lib/oraclebmc/core/models/ip_sec_connection_device_status.rb +0 -156
- data/lib/oraclebmc/core/models/launch_instance_details.rb +0 -336
- data/lib/oraclebmc/core/models/letter_of_authority.rb +0 -194
- data/lib/oraclebmc/core/models/port_range.rb +0 -133
- data/lib/oraclebmc/core/models/private_ip.rb +0 -248
- data/lib/oraclebmc/core/models/route_rule.rb +0 -135
- data/lib/oraclebmc/core/models/route_table.rb +0 -208
- data/lib/oraclebmc/core/models/security_list.rb +0 -219
- data/lib/oraclebmc/core/models/shape.rb +0 -122
- data/lib/oraclebmc/core/models/subnet.rb +0 -351
- data/lib/oraclebmc/core/models/tcp_options.rb +0 -135
- data/lib/oraclebmc/core/models/tunnel_config.rb +0 -151
- data/lib/oraclebmc/core/models/tunnel_status.rb +0 -178
- data/lib/oraclebmc/core/models/udp_options.rb +0 -135
- data/lib/oraclebmc/core/models/update_cpe_details.rb +0 -122
- data/lib/oraclebmc/core/models/update_cross_connect_details.rb +0 -138
- data/lib/oraclebmc/core/models/update_cross_connect_group_details.rb +0 -122
- data/lib/oraclebmc/core/models/update_dhcp_details.rb +0 -132
- data/lib/oraclebmc/core/models/update_drg_attachment_details.rb +0 -122
- data/lib/oraclebmc/core/models/update_drg_details.rb +0 -122
- data/lib/oraclebmc/core/models/update_image_details.rb +0 -124
- data/lib/oraclebmc/core/models/update_instance_details.rb +0 -124
- data/lib/oraclebmc/core/models/update_internet_gateway_details.rb +0 -133
- data/lib/oraclebmc/core/models/update_ip_sec_connection_details.rb +0 -122
- data/lib/oraclebmc/core/models/update_private_ip_details.rb +0 -157
- data/lib/oraclebmc/core/models/update_route_table_details.rb +0 -133
- data/lib/oraclebmc/core/models/update_security_list_details.rb +0 -144
- data/lib/oraclebmc/core/models/update_subnet_details.rb +0 -122
- data/lib/oraclebmc/core/models/update_vcn_details.rb +0 -122
- data/lib/oraclebmc/core/models/update_virtual_circuit_details.rb +0 -240
- data/lib/oraclebmc/core/models/update_vnic_details.rb +0 -144
- data/lib/oraclebmc/core/models/update_volume_backup_details.rb +0 -122
- data/lib/oraclebmc/core/models/update_volume_details.rb +0 -122
- data/lib/oraclebmc/core/models/vcn.rb +0 -276
- data/lib/oraclebmc/core/models/virtual_circuit.rb +0 -395
- data/lib/oraclebmc/core/models/virtual_circuit_bandwidth_shape.rb +0 -137
- data/lib/oraclebmc/core/models/vnic.rb +0 -287
- data/lib/oraclebmc/core/models/vnic_attachment.rb +0 -250
- data/lib/oraclebmc/core/models/volume.rb +0 -210
- data/lib/oraclebmc/core/models/volume_attachment.rb +0 -246
- data/lib/oraclebmc/core/models/volume_backup.rb +0 -235
- data/lib/oraclebmc/core/util.rb +0 -1
- data/lib/oraclebmc/core/virtual_network_client.rb +0 -3419
- data/lib/oraclebmc/errors.rb +0 -80
- data/lib/oraclebmc/global_context.rb +0 -21
- data/lib/oraclebmc/identity/identity.rb +0 -51
- data/lib/oraclebmc/identity/identity_client.rb +0 -1983
- data/lib/oraclebmc/identity/models/add_user_to_group_details.rb +0 -131
- data/lib/oraclebmc/identity/models/api_key.rb +0 -211
- data/lib/oraclebmc/identity/models/availability_domain.rb +0 -131
- data/lib/oraclebmc/identity/models/compartment.rb +0 -211
- data/lib/oraclebmc/identity/models/create_api_key_details.rb +0 -120
- data/lib/oraclebmc/identity/models/create_compartment_details.rb +0 -145
- data/lib/oraclebmc/identity/models/create_group_details.rb +0 -144
- data/lib/oraclebmc/identity/models/create_identity_provider_details.rb +0 -212
- data/lib/oraclebmc/identity/models/create_idp_group_mapping_details.rb +0 -133
- data/lib/oraclebmc/identity/models/create_policy_details.rb +0 -173
- data/lib/oraclebmc/identity/models/create_region_subscription_details.rb +0 -127
- data/lib/oraclebmc/identity/models/create_saml2_identity_provider_details.rb +0 -154
- data/lib/oraclebmc/identity/models/create_swift_password_details.rb +0 -121
- data/lib/oraclebmc/identity/models/create_user_details.rb +0 -144
- data/lib/oraclebmc/identity/models/group.rb +0 -211
- data/lib/oraclebmc/identity/models/identity_provider.rb +0 -256
- data/lib/oraclebmc/identity/models/idp_group_mapping.rb +0 -220
- data/lib/oraclebmc/identity/models/policy.rb +0 -237
- data/lib/oraclebmc/identity/models/region.rb +0 -141
- data/lib/oraclebmc/identity/models/region_subscription.rb +0 -178
- data/lib/oraclebmc/identity/models/saml2_identity_provider.rb +0 -180
- data/lib/oraclebmc/identity/models/swift_password.rb +0 -226
- data/lib/oraclebmc/identity/models/tenancy.rb +0 -158
- data/lib/oraclebmc/identity/models/ui_password.rb +0 -187
- data/lib/oraclebmc/identity/models/update_compartment_details.rb +0 -120
- data/lib/oraclebmc/identity/models/update_group_details.rb +0 -120
- data/lib/oraclebmc/identity/models/update_identity_provider_details.rb +0 -160
- data/lib/oraclebmc/identity/models/update_idp_group_mapping_details.rb +0 -131
- data/lib/oraclebmc/identity/models/update_policy_details.rb +0 -148
- data/lib/oraclebmc/identity/models/update_saml2_identity_provider_details.rb +0 -145
- data/lib/oraclebmc/identity/models/update_state_details.rb +0 -121
- data/lib/oraclebmc/identity/models/update_swift_password_details.rb +0 -120
- data/lib/oraclebmc/identity/models/update_user_details.rb +0 -120
- data/lib/oraclebmc/identity/models/user.rb +0 -217
- data/lib/oraclebmc/identity/models/user_group_membership.rb +0 -209
- data/lib/oraclebmc/identity/util.rb +0 -1
- data/lib/oraclebmc/internal/internal.rb +0 -11
- data/lib/oraclebmc/internal/util.rb +0 -69
- data/lib/oraclebmc/load_balancer/load_balancer.rb +0 -46
- data/lib/oraclebmc/load_balancer/load_balancer_client.rb +0 -1281
- data/lib/oraclebmc/load_balancer/models/backend.rb +0 -220
- data/lib/oraclebmc/load_balancer/models/backend_details.rb +0 -206
- data/lib/oraclebmc/load_balancer/models/backend_set.rb +0 -179
- data/lib/oraclebmc/load_balancer/models/backend_set_details.rb +0 -165
- data/lib/oraclebmc/load_balancer/models/certificate.rb +0 -167
- data/lib/oraclebmc/load_balancer/models/certificate_details.rb +0 -203
- data/lib/oraclebmc/load_balancer/models/create_backend_details.rb +0 -206
- data/lib/oraclebmc/load_balancer/models/create_backend_set_details.rb +0 -178
- data/lib/oraclebmc/load_balancer/models/create_certificate_details.rb +0 -203
- data/lib/oraclebmc/load_balancer/models/create_listener_details.rb +0 -174
- data/lib/oraclebmc/load_balancer/models/create_load_balancer_details.rb +0 -219
- data/lib/oraclebmc/load_balancer/models/health_checker.rb +0 -223
- data/lib/oraclebmc/load_balancer/models/health_checker_details.rb +0 -222
- data/lib/oraclebmc/load_balancer/models/ip_address.rb +0 -139
- data/lib/oraclebmc/load_balancer/models/listener.rb +0 -174
- data/lib/oraclebmc/load_balancer/models/listener_details.rb +0 -160
- data/lib/oraclebmc/load_balancer/models/load_balancer.rb +0 -280
- data/lib/oraclebmc/load_balancer/models/load_balancer_policy.rb +0 -120
- data/lib/oraclebmc/load_balancer/models/load_balancer_protocol.rb +0 -120
- data/lib/oraclebmc/load_balancer/models/load_balancer_shape.rb +0 -120
- data/lib/oraclebmc/load_balancer/models/session_persistence_configuration_details.rb +0 -141
- data/lib/oraclebmc/load_balancer/models/ssl_configuration.rb +0 -153
- data/lib/oraclebmc/load_balancer/models/ssl_configuration_details.rb +0 -153
- data/lib/oraclebmc/load_balancer/models/update_backend_details.rb +0 -178
- data/lib/oraclebmc/load_balancer/models/update_backend_set_details.rb +0 -165
- data/lib/oraclebmc/load_balancer/models/update_health_checker_details.rb +0 -221
- data/lib/oraclebmc/load_balancer/models/update_listener_details.rb +0 -160
- data/lib/oraclebmc/load_balancer/models/update_load_balancer_details.rb +0 -123
- data/lib/oraclebmc/load_balancer/models/work_request.rb +0 -229
- data/lib/oraclebmc/load_balancer/models/work_request_error.rb +0 -145
- data/lib/oraclebmc/load_balancer/util.rb +0 -55
- data/lib/oraclebmc/regions.rb +0 -41
- data/lib/oraclebmc/response.rb +0 -86
- data/lib/oraclebmc/signer.rb +0 -119
- data/lib/oraclebmc/version.rb +0 -5
- data/lib/oraclebmc/waiter.rb +0 -111
@@ -1,229 +0,0 @@
|
|
1
|
-
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
2
|
-
|
3
|
-
require 'date'
|
4
|
-
|
5
|
-
module OracleBMC
|
6
|
-
class LoadBalancer::Models::WorkRequest
|
7
|
-
|
8
|
-
LIFECYCLE_STATE_ENUM = [LIFECYCLE_STATE_ACCEPTED = 'ACCEPTED',
|
9
|
-
LIFECYCLE_STATE_IN_PROGRESS = 'IN_PROGRESS',
|
10
|
-
LIFECYCLE_STATE_FAILED = 'FAILED',
|
11
|
-
LIFECYCLE_STATE_SUCCEEDED = 'SUCCEEDED',
|
12
|
-
LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
|
13
|
-
|
14
|
-
# @return [Array<OracleBMC::LoadBalancer::Models::WorkRequestError>]
|
15
|
-
attr_accessor :error_details
|
16
|
-
|
17
|
-
# The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the work request.
|
18
|
-
# @return [String]
|
19
|
-
attr_accessor :id
|
20
|
-
|
21
|
-
# @return [String]
|
22
|
-
attr_accessor :lifecycle_state
|
23
|
-
|
24
|
-
# The [OCID](https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/identifiers.htm) of the load balancer with which the work request
|
25
|
-
# is associated.
|
26
|
-
#
|
27
|
-
# @return [String]
|
28
|
-
attr_accessor :load_balancer_id
|
29
|
-
|
30
|
-
# A collection of data, related to the load balancer provisioning process, that helps with debugging in the event of failure.
|
31
|
-
# Possible data elements include:
|
32
|
-
#
|
33
|
-
# - workflow name
|
34
|
-
# - event ID
|
35
|
-
# - work request ID
|
36
|
-
# - load balancer ID
|
37
|
-
# - workflow completion message
|
38
|
-
#
|
39
|
-
# @return [String]
|
40
|
-
attr_accessor :message
|
41
|
-
|
42
|
-
# The date and time the work request was created, in the format defined by RFC3339.
|
43
|
-
#
|
44
|
-
# Example: `2016-08-25T21:10:29.600Z`
|
45
|
-
#
|
46
|
-
# @return [DateTime]
|
47
|
-
attr_accessor :time_accepted
|
48
|
-
|
49
|
-
# The date and time the work request was completed, in the format defined by RFC3339.
|
50
|
-
#
|
51
|
-
# Example: `2016-08-25T21:10:29.600Z`
|
52
|
-
#
|
53
|
-
# @return [DateTime]
|
54
|
-
attr_accessor :time_finished
|
55
|
-
|
56
|
-
# The type of action the work request represents.
|
57
|
-
#
|
58
|
-
# @return [String]
|
59
|
-
attr_accessor :type
|
60
|
-
|
61
|
-
|
62
|
-
# Initializes the object
|
63
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
64
|
-
def initialize(attributes = {})
|
65
|
-
return unless attributes.is_a?(Hash)
|
66
|
-
|
67
|
-
# convert string to symbol for hash key
|
68
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
69
|
-
|
70
|
-
if attributes[:'errorDetails']
|
71
|
-
self.error_details = attributes[:'errorDetails']
|
72
|
-
end
|
73
|
-
|
74
|
-
if attributes[:'id']
|
75
|
-
self.id = attributes[:'id']
|
76
|
-
end
|
77
|
-
|
78
|
-
if attributes[:'lifecycleState']
|
79
|
-
self.lifecycle_state = attributes[:'lifecycleState']
|
80
|
-
end
|
81
|
-
|
82
|
-
if attributes[:'loadBalancerId']
|
83
|
-
self.load_balancer_id = attributes[:'loadBalancerId']
|
84
|
-
end
|
85
|
-
|
86
|
-
if attributes[:'message']
|
87
|
-
self.message = attributes[:'message']
|
88
|
-
end
|
89
|
-
|
90
|
-
if attributes[:'timeAccepted']
|
91
|
-
self.time_accepted = attributes[:'timeAccepted']
|
92
|
-
end
|
93
|
-
|
94
|
-
if attributes[:'timeFinished']
|
95
|
-
self.time_finished = attributes[:'timeFinished']
|
96
|
-
end
|
97
|
-
|
98
|
-
if attributes[:'type']
|
99
|
-
self.type = attributes[:'type']
|
100
|
-
end
|
101
|
-
|
102
|
-
end
|
103
|
-
|
104
|
-
# Custom attribute writer method checking allowed values (enum).
|
105
|
-
# @param [Object] lifecycle_state Object to be assigned
|
106
|
-
def lifecycle_state=(lifecycle_state)
|
107
|
-
if lifecycle_state && !LIFECYCLE_STATE_ENUM.include?(lifecycle_state)
|
108
|
-
@lifecycle_state = LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE
|
109
|
-
else
|
110
|
-
@lifecycle_state = lifecycle_state
|
111
|
-
end
|
112
|
-
end
|
113
|
-
|
114
|
-
# Checks equality by comparing each attribute.
|
115
|
-
# @param [Object] other_object to be compared
|
116
|
-
def ==(other_object)
|
117
|
-
return true if self.equal?(other_object)
|
118
|
-
self.class == other_object.class &&
|
119
|
-
error_details == other_object.error_details &&
|
120
|
-
id == other_object.id &&
|
121
|
-
lifecycle_state == other_object.lifecycle_state &&
|
122
|
-
load_balancer_id == other_object.load_balancer_id &&
|
123
|
-
message == other_object.message &&
|
124
|
-
time_accepted == other_object.time_accepted &&
|
125
|
-
time_finished == other_object.time_finished &&
|
126
|
-
type == other_object.type
|
127
|
-
end
|
128
|
-
|
129
|
-
# @see the `==` method
|
130
|
-
# @param [Object] other_object to be compared
|
131
|
-
def eql?(other_object)
|
132
|
-
self == other_object
|
133
|
-
end
|
134
|
-
|
135
|
-
# Calculates hash code according to all attributes.
|
136
|
-
# @return [Fixnum] Hash code
|
137
|
-
def hash
|
138
|
-
[error_details, id, lifecycle_state, load_balancer_id, message, time_accepted, time_finished, type].hash
|
139
|
-
end
|
140
|
-
|
141
|
-
# Builds the object from hash
|
142
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
143
|
-
# @return [Object] Returns the model itself
|
144
|
-
def build_from_hash(attributes)
|
145
|
-
return nil unless attributes.is_a?(Hash)
|
146
|
-
self.class.swagger_types.each_pair do |key, type|
|
147
|
-
if type =~ /^Array<(.*)>/i
|
148
|
-
# check to ensure the input is an array given that the the attribute
|
149
|
-
# is documented as an array but the input is not
|
150
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
151
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
|
152
|
-
end
|
153
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
154
|
-
self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
155
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
156
|
-
end
|
157
|
-
|
158
|
-
self
|
159
|
-
end
|
160
|
-
|
161
|
-
# Returns the string representation of the object
|
162
|
-
# @return [String] String presentation of the object
|
163
|
-
def to_s
|
164
|
-
to_hash.to_s
|
165
|
-
end
|
166
|
-
|
167
|
-
# Returns the object in the form of hash
|
168
|
-
# @return [Hash] Returns the object in the form of hash
|
169
|
-
def to_hash
|
170
|
-
hash = {}
|
171
|
-
self.class.attribute_map.each_pair do |attr, param|
|
172
|
-
value = self.send(attr)
|
173
|
-
next if value.nil?
|
174
|
-
hash[param] = _to_hash(value)
|
175
|
-
end
|
176
|
-
hash
|
177
|
-
end
|
178
|
-
|
179
|
-
private
|
180
|
-
|
181
|
-
# Outputs non-array value in the form of hash
|
182
|
-
# For object, use to_hash. Otherwise, just return the value
|
183
|
-
# @param [Object] value Any valid value
|
184
|
-
# @return [Hash] Returns the value in the form of hash
|
185
|
-
def _to_hash(value)
|
186
|
-
if value.is_a?(Array)
|
187
|
-
value.compact.map{ |v| _to_hash(v) }
|
188
|
-
elsif value.is_a?(Hash)
|
189
|
-
{}.tap do |hash|
|
190
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
191
|
-
end
|
192
|
-
elsif value.respond_to? :to_hash
|
193
|
-
value.to_hash
|
194
|
-
else
|
195
|
-
value
|
196
|
-
end
|
197
|
-
end
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
202
|
-
def self.attribute_map
|
203
|
-
{
|
204
|
-
:'error_details' => :'errorDetails',
|
205
|
-
:'id' => :'id',
|
206
|
-
:'lifecycle_state' => :'lifecycleState',
|
207
|
-
:'load_balancer_id' => :'loadBalancerId',
|
208
|
-
:'message' => :'message',
|
209
|
-
:'time_accepted' => :'timeAccepted',
|
210
|
-
:'time_finished' => :'timeFinished',
|
211
|
-
:'type' => :'type'
|
212
|
-
}
|
213
|
-
end
|
214
|
-
|
215
|
-
# Attribute type mapping.
|
216
|
-
def self.swagger_types
|
217
|
-
{
|
218
|
-
:'error_details' => :'Array<OracleBMC::LoadBalancer::Models::WorkRequestError>',
|
219
|
-
:'id' => :'String',
|
220
|
-
:'lifecycle_state' => :'String',
|
221
|
-
:'load_balancer_id' => :'String',
|
222
|
-
:'message' => :'String',
|
223
|
-
:'time_accepted' => :'DateTime',
|
224
|
-
:'time_finished' => :'DateTime',
|
225
|
-
:'type' => :'String'
|
226
|
-
}
|
227
|
-
end
|
228
|
-
end
|
229
|
-
end
|
@@ -1,145 +0,0 @@
|
|
1
|
-
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
2
|
-
|
3
|
-
require 'date'
|
4
|
-
|
5
|
-
module OracleBMC
|
6
|
-
class LoadBalancer::Models::WorkRequestError
|
7
|
-
|
8
|
-
ERROR_CODE_ENUM = [ERROR_CODE_BAD_INPUT = 'BAD_INPUT',
|
9
|
-
ERROR_CODE_INTERNAL_ERROR = 'INTERNAL_ERROR',
|
10
|
-
ERROR_CODE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
|
11
|
-
|
12
|
-
# @return [String]
|
13
|
-
attr_accessor :error_code
|
14
|
-
|
15
|
-
# A human-readable error string.
|
16
|
-
# @return [String]
|
17
|
-
attr_accessor :message
|
18
|
-
|
19
|
-
|
20
|
-
# Initializes the object
|
21
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
22
|
-
def initialize(attributes = {})
|
23
|
-
return unless attributes.is_a?(Hash)
|
24
|
-
|
25
|
-
# convert string to symbol for hash key
|
26
|
-
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
27
|
-
|
28
|
-
if attributes[:'errorCode']
|
29
|
-
self.error_code = attributes[:'errorCode']
|
30
|
-
end
|
31
|
-
|
32
|
-
if attributes[:'message']
|
33
|
-
self.message = attributes[:'message']
|
34
|
-
end
|
35
|
-
|
36
|
-
end
|
37
|
-
|
38
|
-
# Custom attribute writer method checking allowed values (enum).
|
39
|
-
# @param [Object] error_code Object to be assigned
|
40
|
-
def error_code=(error_code)
|
41
|
-
if error_code && !ERROR_CODE_ENUM.include?(error_code)
|
42
|
-
@error_code = ERROR_CODE_UNKNOWN_ENUM_VALUE
|
43
|
-
else
|
44
|
-
@error_code = error_code
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
# Checks equality by comparing each attribute.
|
49
|
-
# @param [Object] other_object to be compared
|
50
|
-
def ==(other_object)
|
51
|
-
return true if self.equal?(other_object)
|
52
|
-
self.class == other_object.class &&
|
53
|
-
error_code == other_object.error_code &&
|
54
|
-
message == other_object.message
|
55
|
-
end
|
56
|
-
|
57
|
-
# @see the `==` method
|
58
|
-
# @param [Object] other_object to be compared
|
59
|
-
def eql?(other_object)
|
60
|
-
self == other_object
|
61
|
-
end
|
62
|
-
|
63
|
-
# Calculates hash code according to all attributes.
|
64
|
-
# @return [Fixnum] Hash code
|
65
|
-
def hash
|
66
|
-
[error_code, message].hash
|
67
|
-
end
|
68
|
-
|
69
|
-
# Builds the object from hash
|
70
|
-
# @param [Hash] attributes Model attributes in the form of hash
|
71
|
-
# @return [Object] Returns the model itself
|
72
|
-
def build_from_hash(attributes)
|
73
|
-
return nil unless attributes.is_a?(Hash)
|
74
|
-
self.class.swagger_types.each_pair do |key, type|
|
75
|
-
if type =~ /^Array<(.*)>/i
|
76
|
-
# check to ensure the input is an array given that the the attribute
|
77
|
-
# is documented as an array but the input is not
|
78
|
-
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
79
|
-
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } )
|
80
|
-
end
|
81
|
-
elsif !attributes[self.class.attribute_map[key]].nil?
|
82
|
-
self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
83
|
-
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
84
|
-
end
|
85
|
-
|
86
|
-
self
|
87
|
-
end
|
88
|
-
|
89
|
-
# Returns the string representation of the object
|
90
|
-
# @return [String] String presentation of the object
|
91
|
-
def to_s
|
92
|
-
to_hash.to_s
|
93
|
-
end
|
94
|
-
|
95
|
-
# Returns the object in the form of hash
|
96
|
-
# @return [Hash] Returns the object in the form of hash
|
97
|
-
def to_hash
|
98
|
-
hash = {}
|
99
|
-
self.class.attribute_map.each_pair do |attr, param|
|
100
|
-
value = self.send(attr)
|
101
|
-
next if value.nil?
|
102
|
-
hash[param] = _to_hash(value)
|
103
|
-
end
|
104
|
-
hash
|
105
|
-
end
|
106
|
-
|
107
|
-
private
|
108
|
-
|
109
|
-
# Outputs non-array value in the form of hash
|
110
|
-
# For object, use to_hash. Otherwise, just return the value
|
111
|
-
# @param [Object] value Any valid value
|
112
|
-
# @return [Hash] Returns the value in the form of hash
|
113
|
-
def _to_hash(value)
|
114
|
-
if value.is_a?(Array)
|
115
|
-
value.compact.map{ |v| _to_hash(v) }
|
116
|
-
elsif value.is_a?(Hash)
|
117
|
-
{}.tap do |hash|
|
118
|
-
value.each { |k, v| hash[k] = _to_hash(v) }
|
119
|
-
end
|
120
|
-
elsif value.respond_to? :to_hash
|
121
|
-
value.to_hash
|
122
|
-
else
|
123
|
-
value
|
124
|
-
end
|
125
|
-
end
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
# Attribute mapping from ruby-style variable name to JSON key.
|
130
|
-
def self.attribute_map
|
131
|
-
{
|
132
|
-
:'error_code' => :'errorCode',
|
133
|
-
:'message' => :'message'
|
134
|
-
}
|
135
|
-
end
|
136
|
-
|
137
|
-
# Attribute type mapping.
|
138
|
-
def self.swagger_types
|
139
|
-
{
|
140
|
-
:'error_code' => :'String',
|
141
|
-
:'message' => :'String'
|
142
|
-
}
|
143
|
-
end
|
144
|
-
end
|
145
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
2
|
-
|
3
|
-
module OracleBMC::LoadBalancer
|
4
|
-
|
5
|
-
# Load balancer utility methods
|
6
|
-
module Util
|
7
|
-
|
8
|
-
# Wait until the work request succeeds or fails, or max_wait_seconds is reached.
|
9
|
-
# The work request will be polled at an increasing rate, with a maximum of
|
10
|
-
# max_interval_seconds between requests.
|
11
|
-
#
|
12
|
-
# @param [LoadBalancerClient] client A load balancer client
|
13
|
-
# @param [Integer] max_interval_seconds The maximum interval between queries, in seconds.
|
14
|
-
# @param [Integer] max_wait_seconds The maximum total time to wait, in seconds.
|
15
|
-
# @param [Boolean] raise_error_on_failure If true, then a WorkRequestFailedError will be raised if the work request is in a failed state.
|
16
|
-
# @return [WorkRequest] The final work request
|
17
|
-
def self.wait_on_work_request(client, work_request_id, max_interval_seconds: 30, max_wait_seconds: 1200, raise_error_on_failure:true)
|
18
|
-
fail "Work request ID not specified." unless work_request_id
|
19
|
-
|
20
|
-
interval_seconds = 1
|
21
|
-
start_time = Time.now
|
22
|
-
|
23
|
-
while true
|
24
|
-
response = client.get_work_request(work_request_id)
|
25
|
-
if response.data.lifecycle_state == OracleBMC::LoadBalancer::Models::WorkRequest::LIFECYCLE_STATE_SUCCEEDED
|
26
|
-
return response.data
|
27
|
-
elsif response.data.lifecycle_state == OracleBMC::LoadBalancer::Models::WorkRequest::LIFECYCLE_STATE_FAILED
|
28
|
-
if raise_error_on_failure
|
29
|
-
raise OracleBMC::Errors::WorkRequestFailedError.new(response.data)
|
30
|
-
else
|
31
|
-
return response.data
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
elapsed_seconds = (Time.now - start_time).to_i
|
36
|
-
|
37
|
-
if elapsed_seconds + interval_seconds > max_wait_seconds
|
38
|
-
if max_wait_seconds > elapsed_seconds
|
39
|
-
# Make one last request right at the maximum wait time.
|
40
|
-
interval_seconds = max_wait_seconds - elapsed_seconds
|
41
|
-
else
|
42
|
-
raise OracleBMC::Errors::MaximumWaitTimeExceededError.new('Maximum wait time has been exceeded.')
|
43
|
-
end
|
44
|
-
end
|
45
|
-
|
46
|
-
sleep(interval_seconds)
|
47
|
-
|
48
|
-
interval_seconds *= 2
|
49
|
-
if interval_seconds > max_interval_seconds
|
50
|
-
interval_seconds = max_interval_seconds
|
51
|
-
end
|
52
|
-
end
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
data/lib/oraclebmc/regions.rb
DELETED
@@ -1,41 +0,0 @@
|
|
1
|
-
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
2
|
-
|
3
|
-
module OracleBMC
|
4
|
-
module Regions
|
5
|
-
|
6
|
-
REGION_ENUM = [REGION_US_PHOENIX_1 = 'us-phoenix-1', REGION_US_ASHBURN_1 = 'us-ashburn-1']
|
7
|
-
|
8
|
-
# Returns an endpoint for the given region and service.
|
9
|
-
#
|
10
|
-
# @param [String] region A region used to determine the service endpoint. This will usually
|
11
|
-
# correspond to a value in {OracleBMC::Regions::REGION_ENUM}, but may be an arbitrary string.
|
12
|
-
# @param [Symbol] service A symbol representing a service client class (e.g. :IdentityClient)
|
13
|
-
#
|
14
|
-
# @return [String] A fully qualified endpoint
|
15
|
-
def self.get_service_endpoint(region, service)
|
16
|
-
prefix = SERVICE_ENDPOINT_PREFIX_MAPPING[service]
|
17
|
-
fail "Service '#{service}' is not supported." unless prefix
|
18
|
-
format_endpoint(prefix, region)
|
19
|
-
end
|
20
|
-
|
21
|
-
# @return [Boolean] Returns true if the given string corresponds to a known region, as defined in {OracleBMC::Regions::REGION_ENUM}.
|
22
|
-
def self.valid_region? region
|
23
|
-
return REGION_ENUM.include? region
|
24
|
-
end
|
25
|
-
|
26
|
-
private
|
27
|
-
|
28
|
-
SERVICE_ENDPOINT_PREFIX_MAPPING = {
|
29
|
-
:BlockstorageClient => 'iaas',
|
30
|
-
:ComputeClient => 'iaas',
|
31
|
-
:VirtualNetworkClient => 'iaas',
|
32
|
-
:IdentityClient => 'identity',
|
33
|
-
:LoadBalancerClient => 'iaas',
|
34
|
-
}
|
35
|
-
|
36
|
-
def self.format_endpoint(prefix, region)
|
37
|
-
"https://#{prefix}.#{region}.oraclecloud.com"
|
38
|
-
end
|
39
|
-
|
40
|
-
end
|
41
|
-
end
|