Attach VNIC
post
/20160918/vnicAttachments
Create a secondary VNIC and attach it to the specified instance.
Request
Supported Media Types
- application/json
Query Parameters
-
opc-mac-address: string
MacAddress provided for Exadata launches.
-
opc-vlan-tag: string
VlanTag specified for Exadata launches.
-
opc-vnic-id: string
For Oracle internal use only.
Header Parameters
-
opc-resource-pool-id: string
Networking resources in VCN among VMs. This will be provided by cvm team, and equal to containerVM ID.
-
opc-retry-token: string
Minimum Length:
1
Maximum Length:64
A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected). -
opc-vnic-shape: string
Size of the VNIC. This is a special hypervisor-only VNIC shape, and will be provided by cvm team and is calculated from OCPUs.
Attach VNIC details.
Root Schema : AttachVnicDetails
Type:
Show Source
object
-
createVnicDetails(required):
object CreateVnicDetails
Properties for a VNIC. Use this object when creating the primary VNIC during instance launch or when creating a secondary VNIC.
-
displayName:
string
Minimum Length:
1
Maximum Length:255
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. -
instanceId:
string
Minimum Length:
1
Maximum Length:255
The OCID of the instance. For the AttachVnic operation, this is a required field for the request. -
nicIndex:
integer(int32)
Minimum Value:
0
Maximum Value:31
Which physical network interface card (NIC) the VNIC will use. Defaults to 0. Certain bare metal instance shapes have two active physical NICs (0 and 1). If you add a secondary VNIC to one of these instances, you can specify which NIC the VNIC will use.
Nested Schema : CreateVnicDetails
Type:
object
Properties for a VNIC. Use this object when creating the primary VNIC during instance launch or when creating a secondary VNIC.
Show Source
-
assignIpv6Ip:
boolean
Default Value:
false
Whether to allocate an IPv6 address at instance and VNIC creation from an IPv6 enabled subnet. Default: False. When provided you may optionally provide an IPv6 prefix (`ipv6SubnetCidr`) of your choice to assign the IPv6 address from. If `ipv6SubnetCidr` is not provided then an IPv6 prefix is chosen for you. -
assignPrivateDnsRecord:
boolean
Whether the VNIC should be assigned a DNS record. If assignPrivateDnsRecord is set to false, there will be no DNS record registration for the VNIC. If assignPrivateDnsRecord is set to true, the DNS record will be registered. The default value is true. If you specify a hostnameLabel, then assignPrivateDnsRecord must be set to true.
-
assignPublicIp:
boolean
Whether the VNIC should be assigned a public IP address (true) or a private IP address (false). If assignPublicIp is not set and prohibitPublicIpOnVnic is true in the Subnet where the VNIC is being created, then no public IP address is assigned. If assignPublicIp is not set and prohibitPublicIpOnVnic is false, then a public IP address is assigned. This public IP address is associated with the primary private IP on the VNIC. If you specify a vlanId, then assignPublicIp must be set to false.
-
definedTags:
object definedTags
Additional Properties Allowed: additionalPropertiesDefined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"Operations": {"CostCenter": "42"}}
-
displayName:
string
Minimum Length:
1
Maximum Length:255
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information. -
freeformTags:
object freeformTags
Additional Properties Allowed: additionalPropertiesFree-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. Example: {"Department": "Finance"}
-
hostnameLabel:
string
Minimum Length:
1
Maximum Length:63
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, myinstance-1 in FQDN myinstance-1.subnet123.vcn1.example.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). The value appears in the Vnic object and also the PrivateIp object returned by ListPrivateIps and GetPrivateIp. When launching an instance, use this hostnameLabel instead of the deprecated hostnameLabel in LaunchInstanceDetails. If you provide both, the values must match. If you specify a vlanId, the hostnameLabel cannot be specified. VNICs on a VLAN cannot be assigned a hostname. -
ipv6AddressIpv6SubnetCidrPairDetails:
array ipv6AddressIpv6SubnetCidrPairDetails
A list of IPv6 prefix ranges from which the VNIC is assigned an IPv6 address. You can provide only the prefix ranges from which OCI selects an available address from the range. You can optionally choose to leave the prefix range empty and instead provide the specific IPv6 address within that range to use.
-
nsgIds:
array nsgIds
Maximum Number of Items:
5
Unique Items Required:true
A list of the OCIDs of the network security groups (NSGs) to add the VNIC to. If a vlanId is specified, the nsgIds cannot be specified. The vlanId indicates that the VNIC will belong to a VLAN instead of a subnet. With VLANs, all VNICs in the VLAN belong to the NSGs that are associated with the VLAN. -
privateIp:
string
Minimum Length:
1
Maximum Length:46
A private IP address of your choice to assign to the VNIC. Must be an available IP address within the subnet's CIDR. If you don't specify a value, a private IP address is automatically assigned from the subnet. This is the VNIC's primary private IP address. The value appears in the Vnic object and also the PrivateIp object returned by ListPrivateIps and GetPrivateIp. If you specify a vlanId, the privateIp cannot be specified. Example: 10.0.3.3 -
skipSourceDestCheck:
boolean
Whether the source/destination check is disabled on the VNIC. Defaults to false, which means the check is performed. If you specify a vlanId, the skipSourceDestCheck cannot be specified because the source/destination check is always disabled for VNICs in a VLAN. Example: true
-
subnetId:
string
Minimum Length:
1
Maximum Length:255
The OCID of the subnet to create the VNIC in. When launching an instance, use this subnetId instead of the deprecated subnetId in LaunchInstanceDetails. At least one of them is required; if you provide both, the values must match. If you are an Oracle Cloud VMware Solution customer and creating a secondary VNIC in a VLAN instead of a subnet, provide a vlanId instead of a subnetId. If you provide both a vlanId and subnetId, the request fails. -
vlanId:
string
Minimum Length:
1
Maximum Length:255
Provide this attribute only if you are an Oracle Cloud VMware Solution customer and creating a secondary VNIC in a VLAN. The value is the OCID of the VLAN. Provide a vlanId instead of a subnetId. If you provide both a vlanId and subnetId, the request fails.
Nested Schema : definedTags
Type:
object
Additional Properties Allowed
Show Source
-
object additionalProperties
Additional Properties Allowed: additionalPropertiesKey-value pair representing a defined tag key and value, scoped to a namespace. Example: `{"CostCenter": "42"}`
Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: {"Operations": {"CostCenter": "42"}}
Nested Schema : freeformTags
Type:
object
Additional Properties Allowed
Show Source
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. Example: {"Department": "Finance"}
Nested Schema : ipv6AddressIpv6SubnetCidrPairDetails
Type:
array
A list of IPv6 prefix ranges from which the VNIC is assigned an IPv6 address. You can provide only the prefix ranges from which OCI selects an available address from the range. You can optionally choose to leave the prefix range empty and instead provide the specific IPv6 address within that range to use.
Show Source
-
Array of:
object Ipv6AddressIpv6SubnetCidrPairDetails
Details to assign an IPv6 subnet prefix and IPv6 address on VNIC creation.
Nested Schema : nsgIds
Type:
array
Maximum Number of Items:
5
Unique Items Required:
true
A list of the OCIDs of the network security groups (NSGs) to add the VNIC to. If a vlanId is specified, the nsgIds cannot be specified. The vlanId indicates that the VNIC will belong to a VLAN instead of a subnet. With VLANs, all VNICs in the VLAN belong to the NSGs that are associated with the VLAN.
Show Source
-
Array of:
string
Minimum Length:
1
Maximum Length:255
Nested Schema : additionalProperties
Type:
object
Additional Properties Allowed
Show Source
-
object additionalProperties
The value of the tag. Only the String type is supported.
Key-value pair representing a defined tag key and value, scoped to a namespace. Example: `{"CostCenter": "42"}`
Nested Schema : additionalProperties
Type:
object
The value of the tag. Only the String type is supported.
Nested Schema : Ipv6AddressIpv6SubnetCidrPairDetails
Type:
object
Details to assign an IPv6 subnet prefix and IPv6 address on VNIC creation.
Show Source
-
ipv6Address:
string
Minimum Length:
1
Maximum Length:45
An IPv6 address of your choice. Must be an available IPv6 address within the subnet's prefix. If an IPv6 address is not provided: - Oracle will automatically assign an IPv6 address from the subnet's IPv6 prefix if and only if there is only one IPv6 prefix on the subnet. - Oracle will automatically assign an IPv6 address from the subnet's IPv6 Oracle GUA prefix if it exists on the subnet. -
ipv6SubnetCidr:
string
Minimum Length:
1
Maximum Length:45
The IPv6 prefix allocated to the subnet.
Response
Supported Media Types
- application/json
200 Response
The VNIC is being attached.
Headers
-
etag: string
For optimistic concurrency control. See `if-match`.
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : VnicAttachment
Type:
object
Represents an attachment between a VNIC and an instance. Avoid entering confidential information when you supply string values using the API.
Show Source
-
availabilityDomain(required):
string
Minimum Length:
1
Maximum Length:255
The availability domain of the instance. Example: AD-1 -
compartmentId(required):
string
Minimum Length:
1
Maximum Length:255
The OCID of the compartment the VNIC attachment is in, which is the same compartment the instance is in. -
displayName:
string
Minimum Length:
1
Maximum Length:255
A user-friendly name. Does not need to be unique, and it is changeable. Avoid entering confidential information. -
id(required):
string
Minimum Length:
1
Maximum Length:255
The OCID of the VNIC attachment. -
instanceId(required):
string
Minimum Length:
1
Maximum Length:255
The OCID of the instance. -
lifecycleState(required):
string
Allowed Values:
[ "ATTACHING", "ATTACHED", "DETACHING", "DETACHED" ]
The current state of the VNIC attachment. -
nicIndex:
integer(int32)
Minimum Value:
0
Maximum Value:31
Which physical network interface card (NIC) the VNIC uses. Certain bare metal instance shapes have two active physical NICs (0 and 1). If you add a secondary VNIC to one of these instances, you can specify which NIC the VNIC will use. -
subnetId:
string
Minimum Length:
1
Maximum Length:255
The OCID of the subnet to create the VNIC in. -
timeCreated(required):
string(date-time)
The date and time the VNIC attachment was created, in the format defined by [RFC3339](https://tools.ietf.org/html/rfc3339). Example: 2016-08-25T21:10:29.600Z
-
vlanId:
string
Minimum Length:
1
Maximum Length:255
The OCID of the VLAN to create the VNIC in. Creating the VNIC in a VLAN (instead of a subnet) is possible only if you are an Oracle Cloud VMware Solution customer. An error is returned if the instance already has a VNIC attached to it from this VLAN. -
vlanTag:
integer(int32)
The Oracle-assigned VLAN tag of the attached VNIC. Available after the attachment process is complete. However, if the VNIC belongs to a VLAN as part of the Oracle Cloud VMware Solution, the vlanTag value is instead the value of the vlanTag attribute for the VLAN.
-
vnicId:
string
Minimum Length:
1
Maximum Length:255
The OCID of the VNIC. Available after the attachment process is complete.
400 Response
Bad Request
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm).
-
message(required):
string
A human-readable error string.
401 Response
Unauthorized
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm).
-
message(required):
string
A human-readable error string.
404 Response
Not Found
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm).
-
message(required):
string
A human-readable error string.
409 Response
Conflict
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm).
-
message(required):
string
A human-readable error string.
500 Response
Internal Server Error
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm).
-
message(required):
string
A human-readable error string.
Default Response
An error has occurred.
Headers
-
opc-request-id: string
Unique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
Root Schema : Error
Type:
object
The properties that define an error.
Show Source
-
code(required):
string
A short error code that defines the error, meant for programmatic parsing. See [API Errors](https://docs.us-phoenix-1.oraclecloud.com/Content/API/References/apierrors.htm).
-
message(required):
string
A human-readable error string.