GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
NETWORK_PUBLIC-IP(1) OCI CLI Command Reference NETWORK_PUBLIC-IP(1)

network_public-ip -

A public IP is a conceptual term that refers to a public IP address and related properties. The publicIp object is the API representation of a public IP.

There are two types of public IPs: 1. Ephemeral 2. Reserved

For more information and comparison of the two types, see Public IP Addresses <https://docs.cloud.oracle.com/iaas/Content/Network/Tasks/managingpublicIPs.htm>.

  • change-compartment
  • create
  • delete
  • get
  • list
  • update

  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Global Parameters
  • Examples

Moves a public IP into a different compartment within the same tenancy. For information about moving resources between compartments, see Moving Resources to a Different Compartment <https://docs.cloud.oracle.com/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes>.

This operation applies only to reserved public IPs. Ephemeral public IPs always belong to the same compartment as their VNIC and move accordingly.

oci network public-ip change-compartment [OPTIONS]


--compartment-id, -c [text]

The OCID <https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm> of the compartment to move the public IP to.

--public-ip-id [text]

The OCID <https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm> of the public IP.

--from-json [text]

Provide input to this command as a JSON document from a file using the file://path-to/file syntax.

The --generate-full-command-json-input option can be used to generate a sample json file to be used with this command option. The key names are pre-populated and match the command option names (converted to camelCase format, e.g. compartment-id –> compartmentId), while the values of the keys need to be populated by the user before using the sample file as an input to this command. For any command option that accepts multiple values, the value of the key can be a JSON array.

Options can still be provided on the command line. If an option exists in both the JSON document and the command line then the command line specified value will be used.

For examples on usage of this option, please see our “using CLI with advanced JSON options” link: https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/cliusing.htm#AdvancedJSONOptions

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export compartment_id=<substitute-value-of-compartment_id> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/network/public-ip/create.html#cmdoption-compartment-id
    export lifetime=<substitute-value-of-lifetime> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/network/public-ip/create.html#cmdoption-lifetime
    public_ip_id=$(oci network public-ip create --compartment-id $compartment_id --lifetime $lifetime --query data.id --raw-output)
    oci network public-ip change-compartment --compartment-id $compartment_id --public-ip-id $public_ip_id


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Global Parameters
  • Examples

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 <https://docs.cloud.oracle.com/iaas/Content/Network/Tasks/managingpublicIPs.htm>.
  • For an ephemeral public IP assigned to a private IP: You must also specify a privateIpId with the OCID <https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm> 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 <https://docs.cloud.oracle.com/api/#/en/iaas/latest/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 <https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/network/public-ip/update.html>.

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.

oci network public-ip create [OPTIONS]


--compartment-id, -c [text]

The OCID <https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm> of the compartment to contain the public IP. For ephemeral public IPs, you must set this to the private IP’s compartment OCID <https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm>.

--lifetime [text]

Defines when the public IP is deleted and released back to the Oracle Cloud Infrastructure public IP pool. For more information, see Public IP Addresses <https://docs.cloud.oracle.com/iaas/Content/Network/Tasks/managingpublicIPs.htm>.

Accepted values are:

EPHEMERAL, RESERVED


--defined-tags [complex type]

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags <https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm>.

Example:

{"Operations": {"CostCenter": "42"}}


This is a complex type whose value must be valid JSON. The value can be provided as a string on the command line or passed in as a file using the file://path/to/file syntax.

The --generate-param-json-input option can be used to generate an example of the JSON which must be provided. We recommend storing this example in a file, modifying it as needed and then passing it back in via the file:// syntax.

--display-name [text]

A user-friendly name. Does not have to be unique, and it’s changeable. Avoid entering confidential information.

--freeform-tags [complex type]

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 <https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm>.

Example:

{"Department": "Finance"}


This is a complex type whose value must be valid JSON. The value can be provided as a string on the command line or passed in as a file using the file://path/to/file syntax.

The --generate-param-json-input option can be used to generate an example of the JSON which must be provided. We recommend storing this example in a file, modifying it as needed and then passing it back in via the file:// syntax.

--from-json [text]

Provide input to this command as a JSON document from a file using the file://path-to/file syntax.

The --generate-full-command-json-input option can be used to generate a sample json file to be used with this command option. The key names are pre-populated and match the command option names (converted to camelCase format, e.g. compartment-id –> compartmentId), while the values of the keys need to be populated by the user before using the sample file as an input to this command. For any command option that accepts multiple values, the value of the key can be a JSON array.

Options can still be provided on the command line. If an option exists in both the JSON document and the command line then the command line specified value will be used.

For examples on usage of this option, please see our “using CLI with advanced JSON options” link: https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/cliusing.htm#AdvancedJSONOptions

--max-wait-seconds [integer]

The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.

--private-ip-id [text]

The OCID <https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm> of the private IP to assign the public IP to.

Required for an ephemeral public IP because it must always be assigned to a private IP (specifically a primary private IP).

Optional for a reserved public IP. If you don’t provide it, the public IP is created but not assigned to a private IP. You can later assign the public IP with UpdatePublicIp <https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/network/public-ip/update.html>.

--public-ip-pool-id [text]

The OCID <https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm> of the public IP pool.

--wait-for-state [text]

This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.

Accepted values are:

ASSIGNED, ASSIGNING, AVAILABLE, PROVISIONING, TERMINATED, TERMINATING, UNASSIGNED, UNASSIGNING


--wait-interval-seconds [integer]

Check every --wait-interval-seconds to see whether the resource to see if it has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export compartment_id=<substitute-value-of-compartment_id> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/network/public-ip/create.html#cmdoption-compartment-id
    export lifetime=<substitute-value-of-lifetime> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/network/public-ip/create.html#cmdoption-lifetime
    oci network public-ip create --compartment-id $compartment_id --lifetime $lifetime


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Global Parameters
  • Examples

Unassigns and deletes the specified public IP (either ephemeral or reserved). You must specify the object’s OCID <https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm>. The public IP address is returned to the Oracle Cloud Infrastructure public IP pool.

Note: You cannot update, unassign, or delete the public IP that Oracle automatically assigned to an entity for you (such as a load balancer or NAT gateway). The public IP is automatically deleted if the assigned entity is terminated.

For an assigned reserved public IP, the initial unassignment portion of this operation is asynchronous. Poll the public IP’s lifecycleState to determine if the operation succeeded.

If you want to simply unassign a reserved public IP and return it to your pool of reserved public IPs, instead use UpdatePublicIp <https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/network/public-ip/update.html>.

oci network public-ip delete [OPTIONS]


--public-ip-id [text]

The OCID <https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm> of the public IP.

--force

Perform deletion without prompting for confirmation.

--from-json [text]

Provide input to this command as a JSON document from a file using the file://path-to/file syntax.

The --generate-full-command-json-input option can be used to generate a sample json file to be used with this command option. The key names are pre-populated and match the command option names (converted to camelCase format, e.g. compartment-id –> compartmentId), while the values of the keys need to be populated by the user before using the sample file as an input to this command. For any command option that accepts multiple values, the value of the key can be a JSON array.

Options can still be provided on the command line. If an option exists in both the JSON document and the command line then the command line specified value will be used.

For examples on usage of this option, please see our “using CLI with advanced JSON options” link: https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/cliusing.htm#AdvancedJSONOptions

--if-match [text]

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.

--max-wait-seconds [integer]

The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.

--wait-for-state [text]

This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.

Accepted values are:

ASSIGNED, ASSIGNING, AVAILABLE, PROVISIONING, TERMINATED, TERMINATING, UNASSIGNED, UNASSIGNING


--wait-interval-seconds [integer]

Check every --wait-interval-seconds to see whether the resource to see if it has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export compartment_id=<substitute-value-of-compartment_id> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/network/public-ip/create.html#cmdoption-compartment-id
    export lifetime=<substitute-value-of-lifetime> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/network/public-ip/create.html#cmdoption-lifetime
    public_ip_id=$(oci network public-ip create --compartment-id $compartment_id --lifetime $lifetime --query data.id --raw-output)
    oci network public-ip delete --public-ip-id $public_ip_id


  • Description
  • Usage
  • Optional Parameters
  • Global Parameters
  • Examples

Gets the specified public IP object. The command needs at least one of the options to be used to be able to get the public IP object successfully.

oci network public-ip get [OPTIONS]


--from-json [text]

Provide input to this command as a JSON document from a file using the file://path-to/file syntax.

The --generate-full-command-json-input option can be used to generate a sample json file to be used with this command option. The key names are pre-populated and match the command option names (converted to camelCase format, e.g. compartment-id –> compartmentId), while the values of the keys need to be populated by the user before using the sample file as an input to this command. For any command option that accepts multiple values, the value of the key can be a JSON array.

Options can still be provided on the command line. If an option exists in both the JSON document and the command line then the command line specified value will be used.

For examples on usage of this option, please see our “using CLI with advanced JSON options” link: https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/cliusing.htm#AdvancedJSONOptions

--private-ip-id [text]

The private IP’s OCID.

--public-ip-address [text]

A public IP address. Example: 129.146.2.1

--public-ip-id [text]

The public IP’s OCID.

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export compartment_id=<substitute-value-of-compartment_id> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/network/public-ip/create.html#cmdoption-compartment-id
    export lifetime=<substitute-value-of-lifetime> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/network/public-ip/create.html#cmdoption-lifetime
    public_ip_id=$(oci network public-ip create --compartment-id $compartment_id --lifetime $lifetime --query data.id --raw-output)
    oci network public-ip get --public-ip-id $public_ip_id


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Global Parameters
  • Examples

Lists the PublicIp <https://docs.cloud.oracle.com/api/#/en/iaas/latest/PublicIp/> objects in the specified compartment. You can filter the list by using query parameters.

To list your reserved public IPs: * Set scope = REGION (required) * Leave the availabilityDomain parameter empty * Set lifetime = RESERVED

To list the ephemeral public IPs assigned to a regional entity such as a NAT gateway: * Set scope = REGION (required) * Leave the availabilityDomain parameter empty * Set lifetime = EPHEMERAL

To list the ephemeral public IPs assigned to private IPs: * Set scope = AVAILABILITY_DOMAIN (required) * Set the availabilityDomain parameter to the desired availability domain (required) * Set lifetime = EPHEMERAL

Note: An ephemeral public IP assigned to a private IP is always in the same availability domain and compartment as the private IP.

oci network public-ip list [OPTIONS]


--compartment-id, -c [text]

The OCID <https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm> of the compartment.

--scope [text]

Whether the public IP is regional or specific to a particular availability domain.

  • REGION: The public IP exists within a region and is assigned to a regional entity (such as a NatGateway <https://docs.cloud.oracle.com/api/#/en/iaas/latest/NatGateway/>), or can be assigned to a private IP in any availability domain in the region. Reserved public IPs have scope = REGION, as do ephemeral public IPs assigned to a regional entity.
  • AVAILABILITY_DOMAIN: The public IP exists within the availability domain of the entity it’s assigned to, which is specified by the availabilityDomain property of the public IP object. Ephemeral public IPs that are assigned to private IPs have scope = AVAILABILITY_DOMAIN.

Accepted values are:

AVAILABILITY_DOMAIN, REGION


--all

Fetches all pages of results. If you provide this option, then you cannot provide the --limit option.

--availability-domain [text]

The name of the availability domain.

Example:

Uocm:PHX-AD-1


--from-json [text]

Provide input to this command as a JSON document from a file using the file://path-to/file syntax.

The --generate-full-command-json-input option can be used to generate a sample json file to be used with this command option. The key names are pre-populated and match the command option names (converted to camelCase format, e.g. compartment-id –> compartmentId), while the values of the keys need to be populated by the user before using the sample file as an input to this command. For any command option that accepts multiple values, the value of the key can be a JSON array.

Options can still be provided on the command line. If an option exists in both the JSON document and the command line then the command line specified value will be used.

For examples on usage of this option, please see our “using CLI with advanced JSON options” link: https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/cliusing.htm#AdvancedJSONOptions

--lifetime [text]

A filter to return only public IPs that match given lifetime.

Accepted values are:

EPHEMERAL, RESERVED


--limit [integer]

For list pagination. The maximum number of results per page, or items to return in a paginated “List” call. For important details about how pagination works, see List Pagination <https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine>.

Example:

50


--page [text]

For list pagination. The value of the opc-next-page response header from the previous “List” call. For important details about how pagination works, see List Pagination <https://docs.cloud.oracle.com/iaas/Content/API/Concepts/usingapi.htm#nine>.

--page-size [integer]

When fetching results, the number of results to fetch per call. Only valid when used with --all or --limit, and ignored otherwise.

--public-ip-pool-id [text]

A filter to return only resources that belong to the given public IP pool.

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export compartment_id=<substitute-value-of-compartment_id> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/network/public-ip/list.html#cmdoption-compartment-id
    export scope=<substitute-value-of-scope> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/network/public-ip/list.html#cmdoption-scope
    oci network public-ip list --compartment-id $compartment_id --scope $scope


  • Description
  • Usage
  • Required Parameters
  • Optional Parameters
  • Global Parameters
  • Examples

Updates the specified public IP. You must specify the object’s OCID <https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm>. Use this operation if you want to:
Assign a reserved public IP in your pool to a private IP. * Move a reserved public IP to a different private IP. * Unassign a reserved public IP from a private IP (which returns it to your pool of reserved public IPs). * Change the display name or tags for a public IP.

Assigning, moving, and unassigning a reserved public IP are asynchronous operations. Poll the public IP’s lifecycleState to determine if the operation succeeded.

Note: When moving a reserved public IP, the target private IP must not already have a public IP with lifecycleState = ASSIGNING or ASSIGNED. If it does, an error is returned. Also, the initial unassignment from the original private IP always succeeds, but the assignment to the target private IP is asynchronous and could fail silently (for example, if the target private IP is deleted or has a different public IP assigned to it in the interim). If that occurs, the public IP remains unassigned and its lifecycleState switches to AVAILABLE (it is not reassigned to its original private IP). You must poll the public IP’s lifecycleState to determine if the move succeeded.

Regarding ephemeral public IPs:

If you want to assign an ephemeral public IP to a primary private IP, use CreatePublicIp <https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/network/public-ip/create.html>. * You can’t move an ephemeral public IP to a different private IP. * If you want to unassign an ephemeral public IP from its private IP, use DeletePublicIp <https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/network/public-ip/delete.html>, which unassigns and deletes the ephemeral public IP.

Note: If a public IP is assigned to a secondary private IP (see PrivateIp <https://docs.cloud.oracle.com/api/#/en/iaas/latest/PrivateIp/>), and you move that secondary private IP to another VNIC, the public IP moves with it.

Note: There’s a limit to the number of public IPs <https://docs.cloud.oracle.com/api/#/en/iaas/latest/PublicIp/> a VNIC or instance can have. If you try to move a reserved public IP to a VNIC or instance that has already reached its public IP limit, an error is returned. For information about the public IP limits, see Public IP Addresses <https://docs.cloud.oracle.com/iaas/Content/Network/Tasks/managingpublicIPs.htm>.

oci network public-ip update [OPTIONS]


--public-ip-id [text]

The OCID <https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm> of the public IP.

--defined-tags [complex type]

Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags <https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm>.

Example:

{"Operations": {"CostCenter": "42"}}


This is a complex type whose value must be valid JSON. The value can be provided as a string on the command line or passed in as a file using the file://path/to/file syntax.

The --generate-param-json-input option can be used to generate an example of the JSON which must be provided. We recommend storing this example in a file, modifying it as needed and then passing it back in via the file:// syntax.

--display-name [text]

A user-friendly name. Does not have to be unique, and it’s changeable. Avoid entering confidential information.

--force

Perform update without prompting for confirmation.

--freeform-tags [complex type]

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 <https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm>.

Example:

{"Department": "Finance"}


This is a complex type whose value must be valid JSON. The value can be provided as a string on the command line or passed in as a file using the file://path/to/file syntax.

The --generate-param-json-input option can be used to generate an example of the JSON which must be provided. We recommend storing this example in a file, modifying it as needed and then passing it back in via the file:// syntax.

--from-json [text]

Provide input to this command as a JSON document from a file using the file://path-to/file syntax.

The --generate-full-command-json-input option can be used to generate a sample json file to be used with this command option. The key names are pre-populated and match the command option names (converted to camelCase format, e.g. compartment-id –> compartmentId), while the values of the keys need to be populated by the user before using the sample file as an input to this command. For any command option that accepts multiple values, the value of the key can be a JSON array.

Options can still be provided on the command line. If an option exists in both the JSON document and the command line then the command line specified value will be used.

For examples on usage of this option, please see our “using CLI with advanced JSON options” link: https://docs.cloud.oracle.com/iaas/Content/API/SDKDocs/cliusing.htm#AdvancedJSONOptions

--if-match [text]

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.

--max-wait-seconds [integer]

The maximum time to wait for the resource to reach the lifecycle state defined by --wait-for-state. Defaults to 1200 seconds.

--private-ip-id [text]

The OCID <https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm> of the private IP to assign the public IP to. * If the public IP is already assigned to a different private IP, it will be unassigned and then reassigned to the specified private IP. * If you set this field to an empty string, the public IP will be unassigned from the private IP it is currently assigned to.

--wait-for-state [text]

This operation creates, modifies or deletes a resource that has a defined lifecycle state. Specify this option to perform the action and then wait until the resource reaches a given lifecycle state. Multiple states can be specified, returning on the first state. For example, --wait-for-state SUCCEEDED --wait-for-state FAILED would return on whichever lifecycle state is reached first. If timeout is reached, a return code of 2 is returned. For any other error, a return code of 1 is returned.

Accepted values are:

ASSIGNED, ASSIGNING, AVAILABLE, PROVISIONING, TERMINATED, TERMINATING, UNASSIGNED, UNASSIGNING


--wait-interval-seconds [integer]

Check every --wait-interval-seconds to see whether the resource to see if it has reached the lifecycle state defined by --wait-for-state. Defaults to 30 seconds.

Use oci --help for help on global parameters.

--auth-purpose, --auth, --cert-bundle, --cli-auto-prompt, --cli-rc-file, --config-file, --debug, --defaults-file, --endpoint, --generate-full-command-json-input, --generate-param-json-input, --help, --latest-version, --max-retries, --no-retry, --opc-client-request-id, --opc-request-id, --output, --profile, --query, --raw-output, --region, --release-info, --request-id, --version, -?, -d, -h, -i, -v

Copy the following CLI commands into a file named example.sh. Run the command by typing “bash example.sh” and replacing the example parameters with your own.

Please note this sample will only work in the POSIX-compliant bash-like shell. You need to set up the OCI configuration <https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm#configfile> and appropriate security policies <https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/policygetstarted.htm> before trying the examples.

    export compartment_id=<substitute-value-of-compartment_id> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/network/public-ip/create.html#cmdoption-compartment-id
    export lifetime=<substitute-value-of-lifetime> # https://docs.cloud.oracle.com/en-us/iaas/tools/oci-cli/latest/oci_cli_docs/cmdref/network/public-ip/create.html#cmdoption-lifetime
    public_ip_id=$(oci network public-ip create --compartment-id $compartment_id --lifetime $lifetime --query data.id --raw-output)
    oci network public-ip update --public-ip-id $public_ip_id


Oracle

2016, 2022, Oracle
May 17, 2022 3.9.1

Search for    or go to Top of page |  Section 1 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.