PrivateIp¶
- class oci.core.models.PrivateIp(**kwargs)¶
Bases:
objectA 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()andget_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 inCreateVnicDetailswhen calling eitherlaunch_instance()orattach_vnic(). To update the hostname for a primary private IP, you useupdate_vnic().PrivateIp objects that are created for use with the Oracle Cloud VMware Solution are assigned to a VLAN and not a VNIC in a subnet. See the descriptions of the relevant attributes in the PrivateIp object. Also see
Vlan.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.
Attributes:
A constant which can be used with the ip_state property of a PrivateIp.
A constant which can be used with the ip_state property of a PrivateIp.
A constant which can be used with the lifetime property of a PrivateIp.
A constant which can be used with the lifetime property of a PrivateIp.
Gets the availability_domain of this PrivateIp.
Gets the cidr_prefix_length of this PrivateIp.
Gets the compartment_id of this PrivateIp.
Gets the defined_tags of this PrivateIp.
Gets the display_name of this PrivateIp.
Gets the freeform_tags of this PrivateIp.
Gets the hostname_label of this PrivateIp.
Gets the id of this PrivateIp.
Gets the ip_address of this PrivateIp.
Gets the ip_state of this PrivateIp.
Gets the ipv4_subnet_cidr_at_creation of this PrivateIp.
Gets the is_primary of this PrivateIp.
Gets the lifetime of this PrivateIp. Lifetime of the IP address. There are two types of IPs: - Ephemeral - Reserved.
Gets the route_table_id of this PrivateIp.
Gets the subnet_id of this PrivateIp.
Gets the time_created of this PrivateIp.
Gets the vlan_id of this PrivateIp.
Gets the vnic_id of this PrivateIp.
Methods:
__init__(**kwargs)Initializes a new PrivateIp object with values from keyword arguments.
- IP_STATE_ASSIGNED = 'ASSIGNED'¶
A constant which can be used with the ip_state property of a PrivateIp. This constant has a value of “ASSIGNED”
- IP_STATE_AVAILABLE = 'AVAILABLE'¶
A constant which can be used with the ip_state property of a PrivateIp. This constant has a value of “AVAILABLE”
- LIFETIME_EPHEMERAL = 'EPHEMERAL'¶
A constant which can be used with the lifetime property of a PrivateIp. This constant has a value of “EPHEMERAL”
- LIFETIME_RESERVED = 'RESERVED'¶
A constant which can be used with the lifetime property of a PrivateIp. This constant has a value of “RESERVED”
- __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.
cidr_prefix_length (int) – The value to assign to the cidr_prefix_length property of this PrivateIp.
is_primary (bool) – The value to assign to the is_primary property of this PrivateIp.
vlan_id (str) – The value to assign to the vlan_id 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.
ip_state (str) – The value to assign to the ip_state property of this PrivateIp. Allowed values for this property are: “ASSIGNED”, “AVAILABLE”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
lifetime (str) – The value to assign to the lifetime property of this PrivateIp. Allowed values for this property are: “EPHEMERAL”, “RESERVED”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
route_table_id (str) – The value to assign to the route_table_id property of this PrivateIp.
ipv4_subnet_cidr_at_creation (str) – The value to assign to the ipv4_subnet_cidr_at_creation property of this PrivateIp.
- property 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
- property cidr_prefix_length¶
Gets the cidr_prefix_length of this PrivateIp. The secondary IPv4 CIDR prefix length.
- Returns
The cidr_prefix_length of this PrivateIp.
- Return type
int
- property 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
- property 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))
- property 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
- property 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)
- property 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, bminstance1 in FQDN bminstance1.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: bminstance1
- Returns
The hostname_label of this PrivateIp.
- Return type
str
- property id¶
Gets the id of this PrivateIp. The private IP’s Oracle ID (OCID).
- Returns
The id of this PrivateIp.
- Return type
str
- property 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.
However, if the PrivateIp object is being used with a VLAN as part of the Oracle Cloud VMware Solution, the address is from the range specified by the cidrBlock attribute for the VLAN. See
Vlan.Example: 10.0.3.3
- Returns
The ip_address of this PrivateIp.
- Return type
str
- property ip_state¶
Gets the ip_state of this PrivateIp. State of the IP address. If an IP address is assigned to a VNIC it is ASSIGNED, otherwise it is AVAILABLE.
Allowed values for this property are: “ASSIGNED”, “AVAILABLE”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
- Returns
The ip_state of this PrivateIp.
- Return type
str
- property ipv4_subnet_cidr_at_creation¶
Gets the ipv4_subnet_cidr_at_creation of this PrivateIp. Ipv4 Subnet CIDR specified whn creating the PrivateIP.
- Returns
The ipv4_subnet_cidr_at_creation of this PrivateIp.
- Return type
str
- property 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
- property lifetime¶
Gets the lifetime of this PrivateIp. Lifetime of the IP address. There are two types of IPs:
Ephemeral
Reserved
Allowed values for this property are: “EPHEMERAL”, “RESERVED”, ‘UNKNOWN_ENUM_VALUE’. Any unrecognized values returned by a service will be mapped to ‘UNKNOWN_ENUM_VALUE’.
- Returns
The lifetime of this PrivateIp.
- Return type
str
- property route_table_id¶
Gets the route_table_id of this PrivateIp. The OCID of the route table the IP address or VNIC will use. For more information, see Per-resource Routing.
- Returns
The route_table_id of this PrivateIp.
- Return type
str
- property subnet_id¶
Gets the subnet_id of this PrivateIp. The OCID of the subnet the VNIC is in.
However, if the PrivateIp object is being used with a VLAN as part of the Oracle Cloud VMware Solution, the subnetId is null.
- Returns
The subnet_id of this PrivateIp.
- Return type
str
- property 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
- property vlan_id¶
Gets the vlan_id of this PrivateIp. Applicable only if the PrivateIp object is being used with a VLAN as part of the Oracle Cloud VMware Solution. The vlanId is the OCID of the VLAN. See
Vlan.- Returns
The vlan_id of this PrivateIp.
- Return type
str
- property 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. However, if the PrivateIp object is being used with a VLAN as part of the Oracle Cloud VMware Solution, the vnicId is null.
- Returns
The vnic_id of this PrivateIp.
- Return type
str