PrivateIp

class oci.core.models.PrivateIp(**kwargs)

Bases: object

A private IP is a conceptual term that refers to an IPv4 private IP address and related properties. The privateIp object is the API representation of a private IP.

Note: For information about IPv6 addresses, see Ipv6.

Each instance has a primary private IP that is automatically created and assigned to the primary VNIC during instance launch. If you add a secondary VNIC to the instance, it also automatically gets a primary private IP. You can't remove a primary private IP from its VNIC. The primary private IP is automatically deleted when the VNIC is terminated.

You can add secondary private IPs to a VNIC after it's created. For more information, see the privateIp operations and also IP Addresses.

Note: Only list_private_ips() and get_private_ip() work with primary private IPs. To create and update primary private IPs, you instead work with instance and VNIC operations. For example, a primary private IP's properties come from the values you specify in CreateVnicDetails when calling either launch_instance() or attach_vnic(). To update the hostname for a primary private IP, you use update_vnic().

To use any of the API operations, you must be authorized in an IAM policy. If you're not authorized, talk to an administrator. If you're an administrator who needs to write policies to give users access, see Getting Started with Policies.

Warning: Oracle recommends that you avoid using any confidential information when you supply string values using the API.

__init__(**kwargs)

Initializes a new PrivateIp object with values from keyword arguments. The following keyword arguments are supported (corresponding to the getters/setters of this class):

Parameters:
  • availability_domain (str) -- The value to assign to the availability_domain property of this PrivateIp.
  • compartment_id (str) -- The value to assign to the compartment_id property of this PrivateIp.
  • defined_tags (dict(str, dict(str, object))) -- The value to assign to the defined_tags property of this PrivateIp.
  • display_name (str) -- The value to assign to the display_name property of this PrivateIp.
  • freeform_tags (dict(str, str)) -- The value to assign to the freeform_tags property of this PrivateIp.
  • hostname_label (str) -- The value to assign to the hostname_label property of this PrivateIp.
  • id (str) -- The value to assign to the id property of this PrivateIp.
  • ip_address (str) -- The value to assign to the ip_address property of this PrivateIp.
  • is_primary (bool) -- The value to assign to the is_primary property of this PrivateIp.
  • subnet_id (str) -- The value to assign to the subnet_id property of this PrivateIp.
  • time_created (datetime) -- The value to assign to the time_created property of this PrivateIp.
  • vnic_id (str) -- The value to assign to the vnic_id property of this PrivateIp.
availability_domain

Gets the availability_domain of this PrivateIp. The private IP's availability domain. This attribute will be null if this is a secondary private IP assigned to a VNIC that is in a regional subnet.

Example: Uocm:PHX-AD-1

Returns:The availability_domain of this PrivateIp.
Return type:str
compartment_id

Gets the compartment_id of this PrivateIp. The OCID of the compartment containing the private IP.

Returns:The compartment_id of this PrivateIp.
Return type:str
defined_tags

Gets the defined_tags of this PrivateIp. 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:The defined_tags of this PrivateIp.
Return type:dict(str, dict(str, object))
display_name

Gets the display_name of this PrivateIp. A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

Returns:The display_name of this PrivateIp.
Return type:str
freeform_tags

Gets the freeform_tags of this PrivateIp. 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:The freeform_tags of this PrivateIp.
Return type:dict(str, str)
hostname_label

Gets the hostname_label of this PrivateIp. The hostname for the private IP. Used for DNS. The value is the hostname portion of the private IP's fully qualified domain name (FQDN) (for example, bminstance-1 in FQDN bminstance-1.subnet123.vcn1.oraclevcn.com). Must be unique across all VNICs in the subnet and comply with RFC 952 and RFC 1123.

For more information, see DNS in Your Virtual Cloud Network.

Example: bminstance-1

Returns:The hostname_label of this PrivateIp.
Return type:str
id

Gets the id of this PrivateIp. The private IP's Oracle ID (OCID).

Returns:The id of this PrivateIp.
Return type:str
ip_address

Gets the ip_address of this PrivateIp. The private IP address of the privateIp object. The address is within the CIDR of the VNIC's subnet.

Example: 10.0.3.3

Returns:The ip_address of this PrivateIp.
Return type:str
is_primary

Gets the is_primary of this PrivateIp. Whether this private IP is the primary one on the VNIC. Primary private IPs are unassigned and deleted automatically when the VNIC is terminated.

Example: true

Returns:The is_primary of this PrivateIp.
Return type:bool
subnet_id

Gets the subnet_id of this PrivateIp. The OCID of the subnet the VNIC is in.

Returns:The subnet_id of this PrivateIp.
Return type:str
time_created

Gets the time_created of this PrivateIp. The date and time the private IP was created, in the format defined by RFC3339.

Example: 2016-08-25T21:10:29.600Z

Returns:The time_created of this PrivateIp.
Return type:datetime
vnic_id

Gets the vnic_id of this PrivateIp. The OCID of the VNIC the private IP is assigned to. The VNIC and private IP must be in the same subnet.

Returns:The vnic_id of this PrivateIp.
Return type:str