Update an IP Reservation
/ip/reservation/{name}
permanent
field of an IP reservation from false
to true
or vice versa.You can use this command when, for example, you want to delete an instance but retain its autoallocated public IP address as a permanent IP reservation for use later with another instance. In such a case, before deleting the instance, change the permanent field of the IP reservation from false
to true
.
Note that if you change the permanent field of an IP reservation tofalse
, and if the reservation is not associated with an instance, then the reservation will be deleted.
You can also update the tags that are used to identify the IP reservation.
Required Role: To complete this task, you must have the Compute_Operations
role. If this role isn't assigned to you or you're not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud My Services. See Modifying User Roles in Managing and Monitoring Oracle Cloud.
Request
- application/oracle-compute-v3+json
-
name: string
The three-part name of the object (
/Compute-identity_domain/user/object
).
-
Cookie: string
The Cookie: header must be included with every request to the service. It must be set to the value of the set-cookie header in the response received to the POST /authenticate/ call.
object
-
name:
string
The three-part name of the object (
/Compute-identity_domain/user/object
). -
parentpool:
string
/oracle/public/ippool
Pool of public IP addresses
-
permanent:
boolean
true
indicates that the IP reservation has a persistent public IP address. You can associate either a temporary or a persistent public IP address with an instance when you create the instance.Temporary public IP addresses are assigned dynamically from a pool of public IP addresses. When you associate a temporary public IP address with an instance, if the instance is restarted or is deleted and created again later, its public IP address might change.
-
tags(optional):
array tags
A comma-separated list of strings which helps you to identify IP reservations.
Response
- application/oracle-compute-v3+json
200 Response
-
set-cookie: string
The cookie value is returned if the session is extended
object
-
account(optional):
string
Shows the default account for your identity domain.
-
ip(optional):
string
Public IP address.
An IP reservation is a public IP address that you can attach to a Compute Classic instance that requires access to or from the Internet.
-
name(optional):
string
The three-part name of the object (
/Compute-identity_domain/user/object
). -
parentpool(optional):
string
/oracle/public/ippool
Pool of public IP addresses
-
permanent(optional):
boolean
true
indicates that the IP reservation has a persistent public IP address. You can associate either a temporary or a persistent public IP address with an instance when you create the instance.Temporary public IP addresses are assigned dynamically from a pool of public IP addresses. When you associate a temporary public IP address with an instance, if the instance is restarted or is deleted and created again later, its public IP address might change.
-
quota(optional):
string
Not used
-
tags(optional):
array tags
A comma-separated list of strings which helps you to identify IP reservation.
-
uri(optional):
string
Uniform Resource Identifier
-
used(optional):
boolean
true
indicates that the IP reservation is associated with an instance.
Examples
cURL Command
The following example shows how to update an IP reservation, /Compute-acme/jack.jones@example.com/c7588bef-dab7-4b0d-adb4-648ba462c2c1
, by submitting a PUT request on the REST resource using cURL. For more information about cURL, see Use cURL.
Enter the command on a single line. Line breaks are used in this example for readability.
curl -i -X PUT -H "Cookie: $COMPUTE_COOKIE" -H "Content-Type: application/oracle-compute-v3+json" -H "Accept: application/oracle-compute-v3+json" -d "@requestbody.json" https://api-z999.compute.us0.oraclecloud.com/ip/reservation/Compute-acme/jack.jones@example.com/c7588bef-dab7-4b0d-adb4-648ba462c2c1
-
COMPUTE_COOKIE
is the name of the variable in which you stored the authentication cookie earlier. For information about retrieving the authentication cookie and storing it in a variable, see Authentication. -
api-z999.compute.us0.oraclecloud.com
is an example REST endpoint URL. Change this value to the REST endpoint URL of your Compute Classic site. For information about finding out REST endpoint URL for your site, see Send Requests. -
acme
andjack.jones@example.com
are example values. Replaceacme
with the identity domain ID of your Compute Classic account, andjack.jones@example.com
with your user name.
Example of Request Body
The following shows an example of the request body content in the requestbody.json
file to update an IP reservation to change the value of permanent
to false
.
{ "parentpool": "/oracle/public/ippool", "permanent": false, "name": "/Compute-acme/jack.jones@example.com/c7588bef-dab7-4b0d-adb4-648ba462c2c1" }
Example of Response Body
The following example shows the response body in JSON format when you update an IP reservation. Note that if you change the permanent
field of an IP reservation to false
, and if the reservation is not associated with an instance, then the reservation will be deleted. As the IP reservation considered in this example is not associated with an instance ("used": false
), this IP reservation is updated, and then deleted.
{ "account": "/Compute-acme/default", "used": false, "name": "/Compute-acmeccs/jack.jones@example.com/c7588bef-dab7-4b0d-adb4-648ba462c2c1", "tags": [], "ip": "129.144.53.38", "uri": "https://api-z999.compute.us0.oraclecloud.com/ip/reservation/Compute-acmeccs/jack.jones@example.com/c7588bef-dab7-4b0d-adb4-648ba462c2c1", "quota": null, "parentpool": "/oracle/public/ippool", "permanent": false }