vnics
Creates, updates, deletes, gets or lists a vnics resource.
Overview​
| Name | vnics |
| Type | Resource |
| Id | oci.network.vnics |
Fields​
The following fields are returned by SELECT queries:
- get
The VNIC was retrieved.
| Name | Datatype | Description |
|---|---|---|
id | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the VNIC. |
availabilityDomain | string | The VNIC's availability domain. Example: Uocm:PHX-AD-1 |
compartmentId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment containing the VNIC. |
definedTags | object | Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/iaas/Content/General/Concepts/resourcetags.htm). Example: {"Operations": {"CostCenter": "42"}} |
displayName | string | A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. |
freeformTags | object | 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](/iaas/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"} |
hostnameLabel | string | The hostname for the VNIC's primary private IP. Used for DNS. The value is the hostname portion of the primary 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](https:​//tools.ietf.org/html/rfc952) and [RFC 1123](https:​//tools.ietf.org/html/rfc1123). For more information, see [DNS in Your Virtual Cloud Network](/iaas/Content/Network/Concepts/dns.htm). Example: bminstance1 |
ipv6Addresses | array | List of IPv6 addresses assigned to the VNIC. Example: 2001:DB8:: |
isPrimary | boolean | Whether the VNIC is the primary VNIC (the VNIC that is automatically created and attached during instance launch). |
lifecycleState | string | The current state of the VNIC. (PROVISIONING, AVAILABLE, TERMINATING, TERMINATED) |
macAddress | string | The MAC address of the VNIC. If the VNIC belongs to a VLAN as part of the Oracle Cloud VMware Solution, the MAC address is learned. If the VNIC belongs to a subnet, the MAC address is a static, Oracle-provided value. Example: 00:00:00:00:00:01 |
nsgIds | array | A list of the OCIDs of the network security groups that the VNIC belongs to. If the VNIC belongs to a VLAN as part of the Oracle Cloud VMware Solution (instead of belonging to a subnet), the value of the nsgIds attribute is ignored. Instead, the VNIC belongs to the NSGs that are associated with the VLAN itself. See [Vlan](#/en/iaas/latest/Vlan). For more information about NSGs, see [NetworkSecurityGroup](#/en/iaas/latest/NetworkSecurityGroup/). |
privateIp | string | The private IP address of the primary privateIp object on the VNIC. The address is within the CIDR of the VNIC's subnet. Example: 10.0.3.3 |
publicIp | string | The public IP address of the VNIC, if one is assigned. |
routeTableId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the route table the IP address or VNIC will use. For more information, see [Per-resource Routing](https:​//docs.oracle.com/iaas/Content/Network/Tasks/managingroutetables.htm#Overview_of_Routing_for_Your_VCN__source_routing). |
securityAttributes | object | [Security attributes](/iaas/Content/zero-trust-packet-routing/zpr-artifacts.htm#security-attributes) are labels for a resource that can be referenced in a [Zero Trust Packet Routing](/iaas/Content/zero-trust-packet-routing/overview.htm) (ZPR) policy to control access to ZPR-supported resources. Example: {"Oracle-DataSecurity-ZPR": {"MaxEgressCount": {"value":"42","mode":"audit"}}} |
skipSourceDestCheck | boolean | Whether the source/destination check is disabled on the VNIC. Defaults to false, which means the check is performed. For information about why you would skip the source/destination check, see [Using a Private IP as a Route Target](/iaas/Content/Network/Tasks/managingroutetables.htm#privateip). If the VNIC belongs to a VLAN as part of the Oracle Cloud VMware Solution (instead of belonging to a subnet), the skipSourceDestCheck attribute is true. This is because the source/destination check is always disabled for VNICs in a VLAN. Example: true |
subnetId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the subnet the VNIC is in. |
timeCreated | string (date-time) | The date and time the VNIC was created, in the format defined by [RFC3339](https:​//tools.ietf.org/html/rfc3339). Example: 2016-08-25T21:10:29.600Z |
vlanId | string | If the VNIC belongs to a VLAN as part of the Oracle Cloud VMware Solution (instead of belonging to a subnet), the vlanId is the [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the VLAN the VNIC is in. See [Vlan](#/en/iaas/latest/Vlan). If the VNIC is instead in a subnet, subnetId has a value. |
Methods​
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | vnicId, region | Gets the information for the specified virtual network interface card (VNIC).<br />You can get the VNIC [OCID](/iaas/Content/General/Concepts/identifiers.htm) from the<br />[ListVnicAttachments](#/en/iaas/latest/VnicAttachment/ListVnicAttachments)<br />operation.<br /> | |
update | update | vnicId, region | if-match | Updates the specified VNIC.<br /> |
Parameters​
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | OCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION) |
vnicId | string | The [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the VNIC. |
if-match | string | For optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value. |
SELECT examples​
- get
Gets the information for the specified virtual network interface card (VNIC).<br />You can get the VNIC [OCID](/iaas/Content/General/Concepts/identifiers.htm) from the<br />[ListVnicAttachments](#/en/iaas/latest/VnicAttachment/ListVnicAttachments)<br />operation.<br />
SELECT
id,
availabilityDomain,
compartmentId,
definedTags,
displayName,
freeformTags,
hostnameLabel,
ipv6Addresses,
isPrimary,
lifecycleState,
macAddress,
nsgIds,
privateIp,
publicIp,
routeTableId,
securityAttributes,
skipSourceDestCheck,
subnetId,
timeCreated,
vlanId
FROM oci.network.vnics
WHERE vnicId = '{{ vnicId }}' -- required
AND region = '{{ region }}' -- required
;
UPDATE examples​
- update
Updates the specified VNIC.<br />
UPDATE oci.network.vnics
SET
definedTags = '{{ definedTags }}',
displayName = '{{ displayName }}',
freeformTags = '{{ freeformTags }}',
hostnameLabel = '{{ hostnameLabel }}',
nsgIds = '{{ nsgIds }}',
routeTableId = '{{ routeTableId }}',
securityAttributes = '{{ securityAttributes }}',
skipSourceDestCheck = {{ skipSourceDestCheck }}
WHERE
vnicId = '{{ vnicId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match}}'
RETURNING
id,
availabilityDomain,
compartmentId,
definedTags,
displayName,
freeformTags,
hostnameLabel,
ipv6Addresses,
isPrimary,
lifecycleState,
macAddress,
nsgIds,
privateIp,
publicIp,
routeTableId,
securityAttributes,
skipSourceDestCheck,
subnetId,
timeCreated,
vlanId;