CreatePublicIp

POST {{baseUrl}}/publicIps

Creates a public IP. Use the lifetime property to specify whether it's an ephemeral or reserved public IP. For information about limits on how many you can create, see Public IP Addresses.

  • For an ephemeral public IP assigned to a private IP: You must also specify a privateIpId with the OCID of the primary private IP you want to assign the public IP to. The public IP is created in the same availability domain as the private IP. An ephemeral public IP must always be assigned to a private IP, and only to the primary private IP on a VNIC, not a secondary private IP. Exception: If you create a NatGateway, Oracle automatically assigns the NAT gateway a regional ephemeral public IP that you cannot remove.

  • For a reserved public IP: You may also optionally assign the public IP to a private IP by specifying privateIpId. Or you can later assign the public IP with UpdatePublicIp.

Note: When assigning a public IP to a private IP, the private IP must not already have a public IP with lifecycleState = ASSIGNING or ASSIGNED. If it does, an error is returned.

Also, for reserved public IPs, the optional assignment part of this operation is asynchronous. Poll the public IP's lifecycleState to determine if the assignment succeeded.

Request Body

{"compartmentId"=>"{{compartment_ocid}}", "lifetime"=>"RESERVED", "displayName"=>"Excepteur cupidatat culpa et esse", "privateIpId"=>"sunt nostrud Ut ex officia", "publicIpPoolId"=>"veniam proident aliquip Duis"}

HEADERS

KeyDatatypeRequiredDescription
opc-retry-tokenstringA 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).
Content-Typestring
Datestring(Required) Current Date
Authorizationstring(Required) Signature Authentication on Authorization header
x-content-sha256string(Required) Content sha256 for POST, PUT and PATCH operations

RESPONSES

status: OK

{"assignedEntityId":"eu reprehenderit aliquip nulla","assignedEntityType":"NAT_GATEWAY","availabilityDomain":"irure commodo","compartmentId":"est dolor proident","definedTags":{},"displayName":"ipsum quis dolore","freeformTags":{},"id":"sint commodo dolor culpa","ipAddress":"dolore quis esse aliqua","lifecycleState":"UNASSIGNED","lifetime":"EPHEMERAL","privateIpId":"non in consectetur laborum nostrud","publicIpPoolId":"quis aliquip anim","scope":"REGION","timeCreated":"1986-03-06T20:25:38.760Z"}