Class: OCI::ObjectStorage::Models::PrivateEndpoint

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/object_storage/models/private_endpoint.rb

Overview

A private endpoint makes your service accessible through a private IP in the customer's private network. A private endpoint has a name and is associated with a namespace and a single compartment.

Constant Summary collapse

LIFECYCLE_STATE_ENUM =
[
  LIFECYCLE_STATE_CREATING = 'CREATING'.freeze,
  LIFECYCLE_STATE_ACTIVE = 'ACTIVE'.freeze,
  LIFECYCLE_STATE_INACTIVE = 'INACTIVE'.freeze,
  LIFECYCLE_STATE_UPDATING = 'UPDATING'.freeze,
  LIFECYCLE_STATE_DELETING = 'DELETING'.freeze,
  LIFECYCLE_STATE_DELETED = 'DELETED'.freeze,
  LIFECYCLE_STATE_FAILED = 'FAILED'.freeze,
  LIFECYCLE_STATE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ PrivateEndpoint

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :name (String)

    The value to assign to the #name property

  • :namespace (String)

    The value to assign to the #namespace property

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :created_by (String)

    The value to assign to the #created_by property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :time_modified (DateTime)

    The value to assign to the #time_modified property

  • :subnet_id (String)

    The value to assign to the #subnet_id property

  • :private_endpoint_ip (String)

    The value to assign to the #private_endpoint_ip property

  • :prefix (String)

    The value to assign to the #prefix property

  • :additional_prefixes (Array<String>)

    The value to assign to the #additional_prefixes property

  • :nsg_ids (Array<String>)

    The value to assign to the #nsg_ids property

  • :fqdns (OCI::ObjectStorage::Models::Fqdns)

    The value to assign to the #fqdns property

  • :etag (String)

    The value to assign to the #etag property

  • :lifecycle_state (String)

    The value to assign to the #lifecycle_state property

  • :access_targets (Array<OCI::ObjectStorage::Models::AccessTargetDetails>)

    The value to assign to the #access_targets property

  • :freeform_tags (Hash<String, String>)

    The value to assign to the #freeform_tags property

  • :defined_tags (Hash<String, Hash<String, Object>>)

    The value to assign to the #defined_tags property

  • :id (String)

    The value to assign to the #id property



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 197

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.name = attributes[:'name'] if attributes[:'name']

  self.namespace = attributes[:'namespace'] if attributes[:'namespace']

  self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId']

  raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id')

  self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id']

  self.created_by = attributes[:'createdBy'] if attributes[:'createdBy']

  raise 'You cannot provide both :createdBy and :created_by' if attributes.key?(:'createdBy') && attributes.key?(:'created_by')

  self.created_by = attributes[:'created_by'] if attributes[:'created_by']

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

  raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')

  self.time_created = attributes[:'time_created'] if attributes[:'time_created']

  self.time_modified = attributes[:'timeModified'] if attributes[:'timeModified']

  raise 'You cannot provide both :timeModified and :time_modified' if attributes.key?(:'timeModified') && attributes.key?(:'time_modified')

  self.time_modified = attributes[:'time_modified'] if attributes[:'time_modified']

  self.subnet_id = attributes[:'subnetId'] if attributes[:'subnetId']

  raise 'You cannot provide both :subnetId and :subnet_id' if attributes.key?(:'subnetId') && attributes.key?(:'subnet_id')

  self.subnet_id = attributes[:'subnet_id'] if attributes[:'subnet_id']

  self.private_endpoint_ip = attributes[:'privateEndpointIp'] if attributes[:'privateEndpointIp']

  raise 'You cannot provide both :privateEndpointIp and :private_endpoint_ip' if attributes.key?(:'privateEndpointIp') && attributes.key?(:'private_endpoint_ip')

  self.private_endpoint_ip = attributes[:'private_endpoint_ip'] if attributes[:'private_endpoint_ip']

  self.prefix = attributes[:'prefix'] if attributes[:'prefix']

  self.additional_prefixes = attributes[:'additionalPrefixes'] if attributes[:'additionalPrefixes']

  raise 'You cannot provide both :additionalPrefixes and :additional_prefixes' if attributes.key?(:'additionalPrefixes') && attributes.key?(:'additional_prefixes')

  self.additional_prefixes = attributes[:'additional_prefixes'] if attributes[:'additional_prefixes']

  self.nsg_ids = attributes[:'nsgIds'] if attributes[:'nsgIds']

  raise 'You cannot provide both :nsgIds and :nsg_ids' if attributes.key?(:'nsgIds') && attributes.key?(:'nsg_ids')

  self.nsg_ids = attributes[:'nsg_ids'] if attributes[:'nsg_ids']

  self.fqdns = attributes[:'fqdns'] if attributes[:'fqdns']

  self.etag = attributes[:'etag'] if attributes[:'etag']

  self.lifecycle_state = attributes[:'lifecycleState'] if attributes[:'lifecycleState']

  raise 'You cannot provide both :lifecycleState and :lifecycle_state' if attributes.key?(:'lifecycleState') && attributes.key?(:'lifecycle_state')

  self.lifecycle_state = attributes[:'lifecycle_state'] if attributes[:'lifecycle_state']

  self.access_targets = attributes[:'accessTargets'] if attributes[:'accessTargets']

  raise 'You cannot provide both :accessTargets and :access_targets' if attributes.key?(:'accessTargets') && attributes.key?(:'access_targets')

  self.access_targets = attributes[:'access_targets'] if attributes[:'access_targets']

  self.freeform_tags = attributes[:'freeformTags'] if attributes[:'freeformTags']

  raise 'You cannot provide both :freeformTags and :freeform_tags' if attributes.key?(:'freeformTags') && attributes.key?(:'freeform_tags')

  self.freeform_tags = attributes[:'freeform_tags'] if attributes[:'freeform_tags']

  self.defined_tags = attributes[:'definedTags'] if attributes[:'definedTags']

  raise 'You cannot provide both :definedTags and :defined_tags' if attributes.key?(:'definedTags') && attributes.key?(:'defined_tags')

  self.defined_tags = attributes[:'defined_tags'] if attributes[:'defined_tags']

  self.id = attributes[:'id'] if attributes[:'id']
end

Instance Attribute Details

#access_targetsArray<OCI::ObjectStorage::Models::AccessTargetDetails>

[Required] A list of targets that can be accessed by the private endpoint. At least one or more access targets is required for a private endpoint.



100
101
102
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 100

def access_targets
  @access_targets
end

#additional_prefixesArray<String>

A list of additional prefix that you can provide along with any other prefix. These resulting endpointFqdn's are added to the customer VCN's DNS record.

Returns:

  • (Array<String>)


76
77
78
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 76

def additional_prefixes
  @additional_prefixes
end

#compartment_idString

[Required] The compartment which is associated with the Private Endpoint.

Returns:

  • (String)


37
38
39
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 37

def compartment_id
  @compartment_id
end

#created_byString

[Required] The OCID of the user who created the Private Endpoint.

Returns:

  • (String)


41
42
43
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 41

def created_by
  @created_by
end

#defined_tagsHash<String, Hash<String, Object>>

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {\"Operations\": {\"CostCenter\": \"42\"}}

Returns:

  • (Hash<String, Hash<String, Object>>)


114
115
116
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 114

def defined_tags
  @defined_tags
end

#etagString

[Required] The entity tag (ETag) for the Private Endpoint.

Returns:

  • (String)


91
92
93
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 91

def etag
  @etag
end

#fqdnsOCI::ObjectStorage::Models::Fqdns

This attribute is required.



87
88
89
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 87

def fqdns
  @fqdns
end

#freeform_tagsHash<String, String>

Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {\"Department\": \"Finance\"}

Returns:

  • (Hash<String, String>)


107
108
109
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 107

def freeform_tags
  @freeform_tags
end

#idString

The OCID of the PrivateEndpoint.

Returns:

  • (String)


119
120
121
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 119

def id
  @id
end

#lifecycle_stateString

The Private Endpoint's lifecycle state.

Returns:

  • (String)


95
96
97
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 95

def lifecycle_state
  @lifecycle_state
end

#nameString

[Required] This name associated with the endpoint. Valid characters are uppercase or lowercase letters, numbers, hyphens, underscores, and periods. Example: my-new-private-endpoint1

Returns:

  • (String)


29
30
31
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 29

def name
  @name
end

#namespaceString

[Required] The Object Storage namespace associated with the private enpoint.

Returns:

  • (String)


33
34
35
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 33

def namespace
  @namespace
end

#nsg_idsArray<String>

A list of the OCIDs of the network security groups (NSGs) to add the private endpoint's VNIC to. For more information about NSGs, see NetworkSecurityGroup.

Returns:

  • (Array<String>)


83
84
85
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 83

def nsg_ids
  @nsg_ids
end

#prefixString

[Required] A prefix to use for the private endpoint. The customer VCN's DNS records are updated with this prefix. The prefix input from the customer will be the first sub-domain in the endpointFqdn. Example: If the prefix chosen is "abc", then the endpointFqdn will be 'abc.private.objectstorage.<region>.oraclecloud.com'

Returns:

  • (String)


70
71
72
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 70

def prefix
  @prefix
end

#private_endpoint_ipString

[Required] The private IP address to assign to this private endpoint. If you provide a value, it must be an available IP address in the customer's subnet. If it's not available, an error is returned.

If you do not provide a value, an available IP address in the subnet is automatically chosen.

Returns:

  • (String)


63
64
65
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 63

def private_endpoint_ip
  @private_endpoint_ip
end

#subnet_idString

[Required] The OCID of the customer's subnet where the private endpoint VNIC will reside.

Returns:

  • (String)


54
55
56
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 54

def subnet_id
  @subnet_id
end

#time_createdDateTime

[Required] The date and time the Private Endpoint was created, as described in RFC 2616.

Returns:

  • (DateTime)


45
46
47
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 45

def time_created
  @time_created
end

#time_modifiedDateTime

[Required] The date and time the Private Endpoint was updated, as described in RFC 2616.

Returns:

  • (DateTime)


49
50
51
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 49

def time_modified
  @time_modified
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 122

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'namespace': :'namespace',
    'compartment_id': :'compartmentId',
    'created_by': :'createdBy',
    'time_created': :'timeCreated',
    'time_modified': :'timeModified',
    'subnet_id': :'subnetId',
    'private_endpoint_ip': :'privateEndpointIp',
    'prefix': :'prefix',
    'additional_prefixes': :'additionalPrefixes',
    'nsg_ids': :'nsgIds',
    'fqdns': :'fqdns',
    'etag': :'etag',
    'lifecycle_state': :'lifecycleState',
    'access_targets': :'accessTargets',
    'freeform_tags': :'freeformTags',
    'defined_tags': :'definedTags',
    'id': :'id'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 148

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'namespace': :'String',
    'compartment_id': :'String',
    'created_by': :'String',
    'time_created': :'DateTime',
    'time_modified': :'DateTime',
    'subnet_id': :'String',
    'private_endpoint_ip': :'String',
    'prefix': :'String',
    'additional_prefixes': :'Array<String>',
    'nsg_ids': :'Array<String>',
    'fqdns': :'OCI::ObjectStorage::Models::Fqdns',
    'etag': :'String',
    'lifecycle_state': :'String',
    'access_targets': :'Array<OCI::ObjectStorage::Models::AccessTargetDetails>',
    'freeform_tags': :'Hash<String, String>',
    'defined_tags': :'Hash<String, Hash<String, Object>>',
    'id': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 308

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    name == other.name &&
    namespace == other.namespace &&
    compartment_id == other.compartment_id &&
    created_by == other.created_by &&
    time_created == other.time_created &&
    time_modified == other.time_modified &&
    subnet_id == other.subnet_id &&
    private_endpoint_ip == other.private_endpoint_ip &&
    prefix == other.prefix &&
    additional_prefixes == other.additional_prefixes &&
    nsg_ids == other.nsg_ids &&
    fqdns == other.fqdns &&
    etag == other.etag &&
    lifecycle_state == other.lifecycle_state &&
    access_targets == other.access_targets &&
    freeform_tags == other.freeform_tags &&
    defined_tags == other.defined_tags &&
    id == other.id
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 355

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


335
336
337
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 335

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



344
345
346
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 344

def hash
  [name, namespace, compartment_id, created_by, time_created, time_modified, subnet_id, private_endpoint_ip, prefix, additional_prefixes, nsg_ids, fqdns, etag, lifecycle_state, access_targets, freeform_tags, defined_tags, id].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



388
389
390
391
392
393
394
395
396
397
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 388

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



382
383
384
# File 'lib/oci/object_storage/models/private_endpoint.rb', line 382

def to_s
  to_hash.to_s
end