oci 2.0.0
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.
- checksums.yaml +7 -0
- data/LICENSE.txt +82 -0
- data/README.md +262 -0
- data/lib/oci.rb +25 -0
- data/lib/oci/api_client.rb +389 -0
- data/lib/oci/config.rb +118 -0
- data/lib/oci/config_file_loader.rb +96 -0
- data/lib/oci/core/blockstorage_client.rb +462 -0
- data/lib/oci/core/compute_client.rb +1415 -0
- data/lib/oci/core/core.rb +114 -0
- data/lib/oci/core/models/attach_i_scsi_volume_details.rb +137 -0
- data/lib/oci/core/models/attach_vnic_details.rb +144 -0
- data/lib/oci/core/models/attach_volume_details.rb +165 -0
- data/lib/oci/core/models/capture_console_history_details.rb +120 -0
- data/lib/oci/core/models/console_history.rb +213 -0
- data/lib/oci/core/models/cpe.rb +169 -0
- data/lib/oci/core/models/create_cpe_details.rb +145 -0
- data/lib/oci/core/models/create_cross_connect_details.rb +204 -0
- data/lib/oci/core/models/create_cross_connect_group_details.rb +133 -0
- data/lib/oci/core/models/create_dhcp_details.rb +153 -0
- data/lib/oci/core/models/create_drg_attachment_details.rb +142 -0
- data/lib/oci/core/models/create_drg_details.rb +131 -0
- data/lib/oci/core/models/create_image_details.rb +159 -0
- data/lib/oci/core/models/create_instance_console_connection_details.rb +131 -0
- data/lib/oci/core/models/create_internet_gateway_details.rb +153 -0
- data/lib/oci/core/models/create_ip_sec_connection_details.rb +168 -0
- data/lib/oci/core/models/create_private_ip_details.rb +173 -0
- data/lib/oci/core/models/create_route_table_details.rb +153 -0
- data/lib/oci/core/models/create_security_list_details.rb +164 -0
- data/lib/oci/core/models/create_subnet_details.rb +257 -0
- data/lib/oci/core/models/create_vcn_details.rb +171 -0
- data/lib/oci/core/models/create_virtual_circuit_details.rb +260 -0
- data/lib/oci/core/models/create_vnic_details.rb +214 -0
- data/lib/oci/core/models/create_volume_backup_details.rb +133 -0
- data/lib/oci/core/models/create_volume_details.rb +170 -0
- data/lib/oci/core/models/cross_connect.rb +235 -0
- data/lib/oci/core/models/cross_connect_group.rb +187 -0
- data/lib/oci/core/models/cross_connect_location.rb +134 -0
- data/lib/oci/core/models/cross_connect_mapping.rb +190 -0
- data/lib/oci/core/models/cross_connect_port_speed_shape.rb +137 -0
- data/lib/oci/core/models/cross_connect_status.rb +200 -0
- data/lib/oci/core/models/dhcp_dns_option.rb +171 -0
- data/lib/oci/core/models/dhcp_option.rb +135 -0
- data/lib/oci/core/models/dhcp_options.rb +208 -0
- data/lib/oci/core/models/dhcp_search_domain_option.rb +141 -0
- data/lib/oci/core/models/drg.rb +186 -0
- data/lib/oci/core/models/drg_attachment.rb +208 -0
- data/lib/oci/core/models/egress_security_rule.rb +198 -0
- data/lib/oci/core/models/export_image_details.rb +134 -0
- data/lib/oci/core/models/export_image_via_object_storage_tuple_details.rb +150 -0
- data/lib/oci/core/models/export_image_via_object_storage_uri_details.rb +130 -0
- data/lib/oci/core/models/fast_connect_provider_service.rb +145 -0
- data/lib/oci/core/models/i_scsi_volume_attachment.rb +212 -0
- data/lib/oci/core/models/icmp_options.rb +131 -0
- data/lib/oci/core/models/image.rb +245 -0
- data/lib/oci/core/models/image_source_details.rb +134 -0
- data/lib/oci/core/models/image_source_via_object_storage_tuple_details.rb +150 -0
- data/lib/oci/core/models/image_source_via_object_storage_uri_details.rb +128 -0
- data/lib/oci/core/models/ingress_security_rule.rb +198 -0
- data/lib/oci/core/models/instance.rb +307 -0
- data/lib/oci/core/models/instance_console_connection.rb +193 -0
- data/lib/oci/core/models/instance_credentials.rb +131 -0
- data/lib/oci/core/models/internet_gateway.rb +210 -0
- data/lib/oci/core/models/ip_sec_connection.rb +223 -0
- data/lib/oci/core/models/ip_sec_connection_device_config.rb +153 -0
- data/lib/oci/core/models/ip_sec_connection_device_status.rb +156 -0
- data/lib/oci/core/models/launch_instance_details.rb +336 -0
- data/lib/oci/core/models/letter_of_authority.rb +194 -0
- data/lib/oci/core/models/port_range.rb +133 -0
- data/lib/oci/core/models/private_ip.rb +248 -0
- data/lib/oci/core/models/route_rule.rb +135 -0
- data/lib/oci/core/models/route_table.rb +208 -0
- data/lib/oci/core/models/security_list.rb +219 -0
- data/lib/oci/core/models/shape.rb +122 -0
- data/lib/oci/core/models/subnet.rb +351 -0
- data/lib/oci/core/models/tcp_options.rb +135 -0
- data/lib/oci/core/models/tunnel_config.rb +151 -0
- data/lib/oci/core/models/tunnel_status.rb +178 -0
- data/lib/oci/core/models/udp_options.rb +135 -0
- data/lib/oci/core/models/update_cpe_details.rb +122 -0
- data/lib/oci/core/models/update_cross_connect_details.rb +138 -0
- data/lib/oci/core/models/update_cross_connect_group_details.rb +122 -0
- data/lib/oci/core/models/update_dhcp_details.rb +132 -0
- data/lib/oci/core/models/update_drg_attachment_details.rb +122 -0
- data/lib/oci/core/models/update_drg_details.rb +122 -0
- data/lib/oci/core/models/update_image_details.rb +124 -0
- data/lib/oci/core/models/update_instance_details.rb +124 -0
- data/lib/oci/core/models/update_internet_gateway_details.rb +133 -0
- data/lib/oci/core/models/update_ip_sec_connection_details.rb +122 -0
- data/lib/oci/core/models/update_private_ip_details.rb +157 -0
- data/lib/oci/core/models/update_route_table_details.rb +133 -0
- data/lib/oci/core/models/update_security_list_details.rb +144 -0
- data/lib/oci/core/models/update_subnet_details.rb +122 -0
- data/lib/oci/core/models/update_vcn_details.rb +122 -0
- data/lib/oci/core/models/update_virtual_circuit_details.rb +240 -0
- data/lib/oci/core/models/update_vnic_details.rb +144 -0
- data/lib/oci/core/models/update_volume_backup_details.rb +122 -0
- data/lib/oci/core/models/update_volume_details.rb +122 -0
- data/lib/oci/core/models/vcn.rb +276 -0
- data/lib/oci/core/models/virtual_circuit.rb +395 -0
- data/lib/oci/core/models/virtual_circuit_bandwidth_shape.rb +137 -0
- data/lib/oci/core/models/vnic.rb +287 -0
- data/lib/oci/core/models/vnic_attachment.rb +250 -0
- data/lib/oci/core/models/volume.rb +210 -0
- data/lib/oci/core/models/volume_attachment.rb +246 -0
- data/lib/oci/core/models/volume_backup.rb +235 -0
- data/lib/oci/core/util.rb +1 -0
- data/lib/oci/core/virtual_network_client.rb +3421 -0
- data/lib/oci/errors.rb +78 -0
- data/lib/oci/global_context.rb +20 -0
- data/lib/oci/identity/identity.rb +55 -0
- data/lib/oci/identity/identity_client.rb +2148 -0
- data/lib/oci/identity/models/add_user_to_group_details.rb +131 -0
- data/lib/oci/identity/models/api_key.rb +211 -0
- data/lib/oci/identity/models/availability_domain.rb +131 -0
- data/lib/oci/identity/models/compartment.rb +211 -0
- data/lib/oci/identity/models/create_api_key_details.rb +120 -0
- data/lib/oci/identity/models/create_compartment_details.rb +145 -0
- data/lib/oci/identity/models/create_customer_secret_key_details.rb +121 -0
- data/lib/oci/identity/models/create_group_details.rb +144 -0
- data/lib/oci/identity/models/create_identity_provider_details.rb +215 -0
- data/lib/oci/identity/models/create_idp_group_mapping_details.rb +133 -0
- data/lib/oci/identity/models/create_policy_details.rb +173 -0
- data/lib/oci/identity/models/create_region_subscription_details.rb +128 -0
- data/lib/oci/identity/models/create_saml2_identity_provider_details.rb +154 -0
- data/lib/oci/identity/models/create_swift_password_details.rb +121 -0
- data/lib/oci/identity/models/create_user_details.rb +144 -0
- data/lib/oci/identity/models/customer_secret_key.rb +225 -0
- data/lib/oci/identity/models/customer_secret_key_summary.rb +213 -0
- data/lib/oci/identity/models/group.rb +211 -0
- data/lib/oci/identity/models/identity_provider.rb +261 -0
- data/lib/oci/identity/models/idp_group_mapping.rb +220 -0
- data/lib/oci/identity/models/policy.rb +237 -0
- data/lib/oci/identity/models/region.rb +143 -0
- data/lib/oci/identity/models/region_subscription.rb +180 -0
- data/lib/oci/identity/models/saml2_identity_provider.rb +180 -0
- data/lib/oci/identity/models/swift_password.rb +226 -0
- data/lib/oci/identity/models/tenancy.rb +159 -0
- data/lib/oci/identity/models/ui_password.rb +187 -0
- data/lib/oci/identity/models/update_compartment_details.rb +132 -0
- data/lib/oci/identity/models/update_customer_secret_key_details.rb +120 -0
- data/lib/oci/identity/models/update_group_details.rb +120 -0
- data/lib/oci/identity/models/update_identity_provider_details.rb +160 -0
- data/lib/oci/identity/models/update_idp_group_mapping_details.rb +131 -0
- data/lib/oci/identity/models/update_policy_details.rb +148 -0
- data/lib/oci/identity/models/update_saml2_identity_provider_details.rb +145 -0
- data/lib/oci/identity/models/update_state_details.rb +121 -0
- data/lib/oci/identity/models/update_swift_password_details.rb +120 -0
- data/lib/oci/identity/models/update_user_details.rb +120 -0
- data/lib/oci/identity/models/user.rb +217 -0
- data/lib/oci/identity/models/user_group_membership.rb +209 -0
- data/lib/oci/identity/util.rb +1 -0
- data/lib/oci/internal/internal.rb +10 -0
- data/lib/oci/internal/util.rb +69 -0
- data/lib/oci/load_balancer/load_balancer.rb +51 -0
- data/lib/oci/load_balancer/load_balancer_client.rb +1449 -0
- data/lib/oci/load_balancer/models/backend.rb +220 -0
- data/lib/oci/load_balancer/models/backend_details.rb +206 -0
- data/lib/oci/load_balancer/models/backend_health.rb +158 -0
- data/lib/oci/load_balancer/models/backend_set.rb +182 -0
- data/lib/oci/load_balancer/models/backend_set_details.rb +165 -0
- data/lib/oci/load_balancer/models/backend_set_health.rb +207 -0
- data/lib/oci/load_balancer/models/certificate.rb +169 -0
- data/lib/oci/load_balancer/models/certificate_details.rb +205 -0
- data/lib/oci/load_balancer/models/create_backend_details.rb +206 -0
- data/lib/oci/load_balancer/models/create_backend_set_details.rb +181 -0
- data/lib/oci/load_balancer/models/create_certificate_details.rb +205 -0
- data/lib/oci/load_balancer/models/create_listener_details.rb +175 -0
- data/lib/oci/load_balancer/models/create_load_balancer_details.rb +220 -0
- data/lib/oci/load_balancer/models/health_check_result.rb +183 -0
- data/lib/oci/load_balancer/models/health_checker.rb +224 -0
- data/lib/oci/load_balancer/models/health_checker_details.rb +223 -0
- data/lib/oci/load_balancer/models/ip_address.rb +139 -0
- data/lib/oci/load_balancer/models/listener.rb +174 -0
- data/lib/oci/load_balancer/models/listener_details.rb +160 -0
- data/lib/oci/load_balancer/models/load_balancer.rb +280 -0
- data/lib/oci/load_balancer/models/load_balancer_health.rb +215 -0
- data/lib/oci/load_balancer/models/load_balancer_health_summary.rb +168 -0
- data/lib/oci/load_balancer/models/load_balancer_policy.rb +120 -0
- data/lib/oci/load_balancer/models/load_balancer_protocol.rb +120 -0
- data/lib/oci/load_balancer/models/load_balancer_shape.rb +120 -0
- data/lib/oci/load_balancer/models/session_persistence_configuration_details.rb +141 -0
- data/lib/oci/load_balancer/models/ssl_configuration.rb +155 -0
- data/lib/oci/load_balancer/models/ssl_configuration_details.rb +155 -0
- data/lib/oci/load_balancer/models/update_backend_details.rb +178 -0
- data/lib/oci/load_balancer/models/update_backend_set_details.rb +165 -0
- data/lib/oci/load_balancer/models/update_health_checker_details.rb +222 -0
- data/lib/oci/load_balancer/models/update_listener_details.rb +160 -0
- data/lib/oci/load_balancer/models/update_load_balancer_details.rb +124 -0
- data/lib/oci/load_balancer/models/work_request.rb +229 -0
- data/lib/oci/load_balancer/models/work_request_error.rb +145 -0
- data/lib/oci/load_balancer/util.rb +58 -0
- data/lib/oci/object_storage/models/bucket.rb +216 -0
- data/lib/oci/object_storage/models/bucket_summary.rb +175 -0
- data/lib/oci/object_storage/models/commit_multipart_upload_details.rb +133 -0
- data/lib/oci/object_storage/models/commit_multipart_upload_part_details.rb +131 -0
- data/lib/oci/object_storage/models/create_bucket_details.rb +173 -0
- data/lib/oci/object_storage/models/create_multipart_upload_details.rb +166 -0
- data/lib/oci/object_storage/models/create_preauthenticated_request_details.rb +171 -0
- data/lib/oci/object_storage/models/list_objects.rb +146 -0
- data/lib/oci/object_storage/models/multipart_upload.rb +164 -0
- data/lib/oci/object_storage/models/multipart_upload_part_summary.rb +153 -0
- data/lib/oci/object_storage/models/object_summary.rb +153 -0
- data/lib/oci/object_storage/models/preauthenticated_request.rb +207 -0
- data/lib/oci/object_storage/models/preauthenticated_request_summary.rb +196 -0
- data/lib/oci/object_storage/models/update_bucket_details.rb +171 -0
- data/lib/oci/object_storage/object_storage.rb +30 -0
- data/lib/oci/object_storage/object_storage_client.rb +1185 -0
- data/lib/oci/object_storage/util.rb +1 -0
- data/lib/oci/regions.rb +43 -0
- data/lib/oci/response.rb +80 -0
- data/lib/oci/response_headers.rb +144 -0
- data/lib/oci/signer.rb +157 -0
- data/lib/oci/version.rb +5 -0
- data/lib/oci/waiter.rb +101 -0
- data/lib/oraclebmc.rb +3 -0
- metadata +375 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
require 'date'
|
|
4
|
+
|
|
5
|
+
module OCI
|
|
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| OCI::Internal::Util.convert_to_type($1, v) } )
|
|
80
|
+
end
|
|
81
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
82
|
+
self.send("#{key}=", OCI::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
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
module OCI
|
|
4
|
+
module LoadBalancer
|
|
5
|
+
# Load balancer utility methods
|
|
6
|
+
module Util
|
|
7
|
+
# Wait until the work request succeeds or fails, or max_wait_seconds is reached.
|
|
8
|
+
# The work request will be polled at an increasing rate, with a maximum of
|
|
9
|
+
# max_interval_seconds between requests.
|
|
10
|
+
#
|
|
11
|
+
# @param [LoadBalancerClient] client A load balancer client
|
|
12
|
+
# @param [Integer] max_interval_seconds The maximum interval between queries, in seconds.
|
|
13
|
+
# @param [Integer] max_wait_seconds The maximum total time to wait, in seconds.
|
|
14
|
+
# @param [Boolean] raise_error_on_failure If true, then a WorkRequestFailedError will be
|
|
15
|
+
# 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,
|
|
18
|
+
work_request_id,
|
|
19
|
+
max_interval_seconds: 30,
|
|
20
|
+
max_wait_seconds: 1200,
|
|
21
|
+
raise_error_on_failure: true)
|
|
22
|
+
raise 'Work request ID not specified.' unless work_request_id
|
|
23
|
+
|
|
24
|
+
interval_seconds = 1
|
|
25
|
+
start_time = Time.now
|
|
26
|
+
|
|
27
|
+
loop do
|
|
28
|
+
response = client.get_work_request(work_request_id)
|
|
29
|
+
lifecycle_state = response.data.lifecycle_state
|
|
30
|
+
|
|
31
|
+
return response.data if lifecycle_state == OCI::LoadBalancer::Models::WorkRequest::LIFECYCLE_STATE_SUCCEEDED
|
|
32
|
+
|
|
33
|
+
if response.data.lifecycle_state == OCI::LoadBalancer::Models::WorkRequest::LIFECYCLE_STATE_FAILED
|
|
34
|
+
raise OCI::Errors::WorkRequestFailedError, response.data if raise_error_on_failure
|
|
35
|
+
return response.data
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
elapsed_seconds = (Time.now - start_time).to_i
|
|
39
|
+
|
|
40
|
+
if elapsed_seconds + interval_seconds > max_wait_seconds
|
|
41
|
+
raise OCI::Errors::MaximumWaitTimeExceededError, 'Maximum wait time has been exceeded.' \
|
|
42
|
+
unless max_wait_seconds > elapsed_seconds
|
|
43
|
+
|
|
44
|
+
# Make one last request right at the maximum wait time.
|
|
45
|
+
interval_seconds = max_wait_seconds - elapsed_seconds
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
sleep(interval_seconds)
|
|
49
|
+
|
|
50
|
+
interval_seconds *= 2
|
|
51
|
+
if interval_seconds > max_interval_seconds
|
|
52
|
+
interval_seconds = max_interval_seconds
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
require 'date'
|
|
4
|
+
|
|
5
|
+
module OCI
|
|
6
|
+
class ObjectStorage::Models::Bucket
|
|
7
|
+
|
|
8
|
+
PUBLIC_ACCESS_TYPE_ENUM = [PUBLIC_ACCESS_TYPE_NO_PUBLIC_ACCESS = 'NoPublicAccess',
|
|
9
|
+
PUBLIC_ACCESS_TYPE_OBJECT_READ = 'ObjectRead',
|
|
10
|
+
PUBLIC_ACCESS_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE']
|
|
11
|
+
|
|
12
|
+
# The namespace in which the bucket lives.
|
|
13
|
+
# @return [String]
|
|
14
|
+
attr_accessor :namespace
|
|
15
|
+
|
|
16
|
+
# The name of the bucket.
|
|
17
|
+
# @return [String]
|
|
18
|
+
attr_accessor :name
|
|
19
|
+
|
|
20
|
+
# The compartment ID in which the bucket is authorized.
|
|
21
|
+
# @return [String]
|
|
22
|
+
attr_accessor :compartment_id
|
|
23
|
+
|
|
24
|
+
# Arbitrary string keys and values for user-defined metadata.
|
|
25
|
+
# @return [Hash<String, String>]
|
|
26
|
+
attr_accessor :metadata
|
|
27
|
+
|
|
28
|
+
# The OCID of the user who created the bucket.
|
|
29
|
+
# @return [String]
|
|
30
|
+
attr_accessor :created_by
|
|
31
|
+
|
|
32
|
+
# The date and time at which the bucket was created.
|
|
33
|
+
# @return [DateTime]
|
|
34
|
+
attr_accessor :time_created
|
|
35
|
+
|
|
36
|
+
# The entity tag for the bucket.
|
|
37
|
+
# @return [String]
|
|
38
|
+
attr_accessor :etag
|
|
39
|
+
|
|
40
|
+
# The type of public access available on this bucket. Allows authenticated caller to access the bucket or
|
|
41
|
+
# contents of this bucket. By default a bucket is set to NoPublicAccess. It is treated as NoPublicAccess
|
|
42
|
+
# when this value is not specified. When the type is NoPublicAccess the bucket does not allow any public access.
|
|
43
|
+
# When the type is ObjectRead the bucket allows public access to the GetObject, HeadObject, ListObjects.
|
|
44
|
+
#
|
|
45
|
+
# @return [String]
|
|
46
|
+
attr_accessor :public_access_type
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
# Initializes the object
|
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
51
|
+
def initialize(attributes = {})
|
|
52
|
+
return unless attributes.is_a?(Hash)
|
|
53
|
+
|
|
54
|
+
# convert string to symbol for hash key
|
|
55
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
|
56
|
+
|
|
57
|
+
if attributes[:'namespace']
|
|
58
|
+
self.namespace = attributes[:'namespace']
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
if attributes[:'name']
|
|
62
|
+
self.name = attributes[:'name']
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
if attributes[:'compartmentId']
|
|
66
|
+
self.compartment_id = attributes[:'compartmentId']
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
if attributes[:'metadata']
|
|
70
|
+
self.metadata = attributes[:'metadata']
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
if attributes[:'createdBy']
|
|
74
|
+
self.created_by = attributes[:'createdBy']
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
if attributes[:'timeCreated']
|
|
78
|
+
self.time_created = attributes[:'timeCreated']
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
if attributes[:'etag']
|
|
82
|
+
self.etag = attributes[:'etag']
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if attributes[:'publicAccessType']
|
|
86
|
+
self.public_access_type = attributes[:'publicAccessType']
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
92
|
+
# @param [Object] public_access_type Object to be assigned
|
|
93
|
+
def public_access_type=(public_access_type)
|
|
94
|
+
if public_access_type && !PUBLIC_ACCESS_TYPE_ENUM.include?(public_access_type)
|
|
95
|
+
@public_access_type = PUBLIC_ACCESS_TYPE_UNKNOWN_ENUM_VALUE
|
|
96
|
+
else
|
|
97
|
+
@public_access_type = public_access_type
|
|
98
|
+
end
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
# Checks equality by comparing each attribute.
|
|
102
|
+
# @param [Object] other_object to be compared
|
|
103
|
+
def ==(other_object)
|
|
104
|
+
return true if self.equal?(other_object)
|
|
105
|
+
self.class == other_object.class &&
|
|
106
|
+
namespace == other_object.namespace &&
|
|
107
|
+
name == other_object.name &&
|
|
108
|
+
compartment_id == other_object.compartment_id &&
|
|
109
|
+
metadata == other_object.metadata &&
|
|
110
|
+
created_by == other_object.created_by &&
|
|
111
|
+
time_created == other_object.time_created &&
|
|
112
|
+
etag == other_object.etag &&
|
|
113
|
+
public_access_type == other_object.public_access_type
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# @see the `==` method
|
|
117
|
+
# @param [Object] other_object to be compared
|
|
118
|
+
def eql?(other_object)
|
|
119
|
+
self == other_object
|
|
120
|
+
end
|
|
121
|
+
|
|
122
|
+
# Calculates hash code according to all attributes.
|
|
123
|
+
# @return [Fixnum] Hash code
|
|
124
|
+
def hash
|
|
125
|
+
[namespace, name, compartment_id, metadata, created_by, time_created, etag, public_access_type].hash
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Builds the object from hash
|
|
129
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
130
|
+
# @return [Object] Returns the model itself
|
|
131
|
+
def build_from_hash(attributes)
|
|
132
|
+
return nil unless attributes.is_a?(Hash)
|
|
133
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
134
|
+
if type =~ /^Array<(.*)>/i
|
|
135
|
+
# check to ensure the input is an array given that the the attribute
|
|
136
|
+
# is documented as an array but the input is not
|
|
137
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
138
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
|
|
139
|
+
end
|
|
140
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
141
|
+
self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
|
142
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
self
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Returns the string representation of the object
|
|
149
|
+
# @return [String] String presentation of the object
|
|
150
|
+
def to_s
|
|
151
|
+
to_hash.to_s
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Returns the object in the form of hash
|
|
155
|
+
# @return [Hash] Returns the object in the form of hash
|
|
156
|
+
def to_hash
|
|
157
|
+
hash = {}
|
|
158
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
159
|
+
value = self.send(attr)
|
|
160
|
+
next if value.nil?
|
|
161
|
+
hash[param] = _to_hash(value)
|
|
162
|
+
end
|
|
163
|
+
hash
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
private
|
|
167
|
+
|
|
168
|
+
# Outputs non-array value in the form of hash
|
|
169
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
170
|
+
# @param [Object] value Any valid value
|
|
171
|
+
# @return [Hash] Returns the value in the form of hash
|
|
172
|
+
def _to_hash(value)
|
|
173
|
+
if value.is_a?(Array)
|
|
174
|
+
value.compact.map{ |v| _to_hash(v) }
|
|
175
|
+
elsif value.is_a?(Hash)
|
|
176
|
+
{}.tap do |hash|
|
|
177
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
178
|
+
end
|
|
179
|
+
elsif value.respond_to? :to_hash
|
|
180
|
+
value.to_hash
|
|
181
|
+
else
|
|
182
|
+
value
|
|
183
|
+
end
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
189
|
+
def self.attribute_map
|
|
190
|
+
{
|
|
191
|
+
:'namespace' => :'namespace',
|
|
192
|
+
:'name' => :'name',
|
|
193
|
+
:'compartment_id' => :'compartmentId',
|
|
194
|
+
:'metadata' => :'metadata',
|
|
195
|
+
:'created_by' => :'createdBy',
|
|
196
|
+
:'time_created' => :'timeCreated',
|
|
197
|
+
:'etag' => :'etag',
|
|
198
|
+
:'public_access_type' => :'publicAccessType'
|
|
199
|
+
}
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Attribute type mapping.
|
|
203
|
+
def self.swagger_types
|
|
204
|
+
{
|
|
205
|
+
:'namespace' => :'String',
|
|
206
|
+
:'name' => :'String',
|
|
207
|
+
:'compartment_id' => :'String',
|
|
208
|
+
:'metadata' => :'Hash<String, String>',
|
|
209
|
+
:'created_by' => :'String',
|
|
210
|
+
:'time_created' => :'DateTime',
|
|
211
|
+
:'etag' => :'String',
|
|
212
|
+
:'public_access_type' => :'String'
|
|
213
|
+
}
|
|
214
|
+
end
|
|
215
|
+
end
|
|
216
|
+
end
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
|
|
2
|
+
|
|
3
|
+
require 'date'
|
|
4
|
+
|
|
5
|
+
module OCI
|
|
6
|
+
class ObjectStorage::Models::BucketSummary
|
|
7
|
+
# The namespace in which the bucket lives.
|
|
8
|
+
# @return [String]
|
|
9
|
+
attr_accessor :namespace
|
|
10
|
+
|
|
11
|
+
# The name of the bucket.
|
|
12
|
+
# @return [String]
|
|
13
|
+
attr_accessor :name
|
|
14
|
+
|
|
15
|
+
# The compartment ID in which the bucket is authorized.
|
|
16
|
+
# @return [String]
|
|
17
|
+
attr_accessor :compartment_id
|
|
18
|
+
|
|
19
|
+
# The OCID of the user who created the bucket.
|
|
20
|
+
# @return [String]
|
|
21
|
+
attr_accessor :created_by
|
|
22
|
+
|
|
23
|
+
# The date and time at which the bucket was created.
|
|
24
|
+
# @return [DateTime]
|
|
25
|
+
attr_accessor :time_created
|
|
26
|
+
|
|
27
|
+
# The entity tag for the bucket.
|
|
28
|
+
# @return [String]
|
|
29
|
+
attr_accessor :etag
|
|
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
|
+
if attributes[:'namespace']
|
|
41
|
+
self.namespace = attributes[:'namespace']
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
if attributes[:'name']
|
|
45
|
+
self.name = attributes[:'name']
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
if attributes[:'compartmentId']
|
|
49
|
+
self.compartment_id = attributes[:'compartmentId']
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
if attributes[:'createdBy']
|
|
53
|
+
self.created_by = attributes[:'createdBy']
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
if attributes[:'timeCreated']
|
|
57
|
+
self.time_created = attributes[:'timeCreated']
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
if attributes[:'etag']
|
|
61
|
+
self.etag = attributes[:'etag']
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
# Checks equality by comparing each attribute.
|
|
67
|
+
# @param [Object] other_object to be compared
|
|
68
|
+
def ==(other_object)
|
|
69
|
+
return true if self.equal?(other_object)
|
|
70
|
+
self.class == other_object.class &&
|
|
71
|
+
namespace == other_object.namespace &&
|
|
72
|
+
name == other_object.name &&
|
|
73
|
+
compartment_id == other_object.compartment_id &&
|
|
74
|
+
created_by == other_object.created_by &&
|
|
75
|
+
time_created == other_object.time_created &&
|
|
76
|
+
etag == other_object.etag
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# @see the `==` method
|
|
80
|
+
# @param [Object] other_object to be compared
|
|
81
|
+
def eql?(other_object)
|
|
82
|
+
self == other_object
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Calculates hash code according to all attributes.
|
|
86
|
+
# @return [Fixnum] Hash code
|
|
87
|
+
def hash
|
|
88
|
+
[namespace, name, compartment_id, created_by, time_created, etag].hash
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
# Builds the object from hash
|
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
93
|
+
# @return [Object] Returns the model itself
|
|
94
|
+
def build_from_hash(attributes)
|
|
95
|
+
return nil unless attributes.is_a?(Hash)
|
|
96
|
+
self.class.swagger_types.each_pair do |key, type|
|
|
97
|
+
if type =~ /^Array<(.*)>/i
|
|
98
|
+
# check to ensure the input is an array given that the the attribute
|
|
99
|
+
# is documented as an array but the input is not
|
|
100
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
101
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OCI::Internal::Util.convert_to_type($1, v) } )
|
|
102
|
+
end
|
|
103
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
104
|
+
self.send("#{key}=", OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]))
|
|
105
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
self
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Returns the string representation of the object
|
|
112
|
+
# @return [String] String presentation of the object
|
|
113
|
+
def to_s
|
|
114
|
+
to_hash.to_s
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Returns the object in the form of hash
|
|
118
|
+
# @return [Hash] Returns the object in the form of hash
|
|
119
|
+
def to_hash
|
|
120
|
+
hash = {}
|
|
121
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
122
|
+
value = self.send(attr)
|
|
123
|
+
next if value.nil?
|
|
124
|
+
hash[param] = _to_hash(value)
|
|
125
|
+
end
|
|
126
|
+
hash
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
private
|
|
130
|
+
|
|
131
|
+
# Outputs non-array value in the form of hash
|
|
132
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
133
|
+
# @param [Object] value Any valid value
|
|
134
|
+
# @return [Hash] Returns the value in the form of hash
|
|
135
|
+
def _to_hash(value)
|
|
136
|
+
if value.is_a?(Array)
|
|
137
|
+
value.compact.map{ |v| _to_hash(v) }
|
|
138
|
+
elsif value.is_a?(Hash)
|
|
139
|
+
{}.tap do |hash|
|
|
140
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
|
141
|
+
end
|
|
142
|
+
elsif value.respond_to? :to_hash
|
|
143
|
+
value.to_hash
|
|
144
|
+
else
|
|
145
|
+
value
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
152
|
+
def self.attribute_map
|
|
153
|
+
{
|
|
154
|
+
:'namespace' => :'namespace',
|
|
155
|
+
:'name' => :'name',
|
|
156
|
+
:'compartment_id' => :'compartmentId',
|
|
157
|
+
:'created_by' => :'createdBy',
|
|
158
|
+
:'time_created' => :'timeCreated',
|
|
159
|
+
:'etag' => :'etag'
|
|
160
|
+
}
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# Attribute type mapping.
|
|
164
|
+
def self.swagger_types
|
|
165
|
+
{
|
|
166
|
+
:'namespace' => :'String',
|
|
167
|
+
:'name' => :'String',
|
|
168
|
+
:'compartment_id' => :'String',
|
|
169
|
+
:'created_by' => :'String',
|
|
170
|
+
:'time_created' => :'DateTime',
|
|
171
|
+
:'etag' => :'String'
|
|
172
|
+
}
|
|
173
|
+
end
|
|
174
|
+
end
|
|
175
|
+
end
|