Updating an API Gateway
Find out how to modify API gateways that you previously created with the API Gateway service.
After you have created an API gateway, you might decide to change the API gateway. For example, you might want to change the API gateway's name or the tags applied to it.
Note that there are some properties of API gateways for which you can't change the original values.
You can update API gateways by using the Console, the CLI, and the API.
- On the Gateways list page, find the API gateway that you want to update. If you need help finding the list page or the API gateway, see Listing API Gateways.
- From the
- Select Edit to change any of the following API gateway properties:
- Change the API gateway's name. Avoid entering confidential information.
- Enable or disable the use of network security groups (NSGs) to control access to and from the API gateway by using security rules defined for the NSGs that you specify (up to a maximum of five network security groups). You can use security rules defined for NSGs instead of, or in addition to, those defined for security lists. NSGs can belong to the same compartment as the API gateway, but don't have to. See Network Security Groups.
- Change the TLS certificate and domain name used by the API gateway. Note that API Gateway certificate resources and Certificates service certificate resources are shown only if they are available in the selected compartment. See Setting Up Custom Domains and TLS Certificates.
- Change response cache configuration settings. See Caching Responses to Improve Performance.
- Change the Certificate Authorities (CAs) and CA bundles included in the API gateway's trust store as custom CAs and custom CA bundles (in addition to the default CA bundle). See Customizing Trust Stores for TLS Certificate Verification.
- Select Move Resource to move the API gateway to a different compartment.
- Select the Tags tab to view and edit the tags applied to the API gateway, and select Add tags to apply more tags to the API gateway.
for the API gateway: - Select Edit to change any of the following API gateway properties:
To update existing API gateways using the CLI:
- Configure your client environment to use the CLI (Configuring Your Client Environment to use the CLI for API Gateway Development).
-
To update an existing API gateway:
-
Open a command prompt and run
oci api-gateway gateway update
to update the API gateway:oci api-gateway gateway update --gateway-id <gateway-ocid> --<property-to-update> <property-value>
where:
<gateway-ocid>
is the OCID of the API gateway to update. To find out the API gateway's OCID, see Listing API Gateways.<property-to-update>
is the property to update. Note that you can only change the values fordisplay-name
,--response-cache-details
,--network-security-group-ids
,--ca-bundles
,freeform-tags
anddefined-tags
(andcertificate-id>
if this was originally set for the API gateway). All other values must be identical to values in the original gateway definition.<property-value>
is the new value of the property you want to change.
For example:
oci api-gateway gateway update --gateway-id ocid1.apigateway.oc1..aaaaaaaab______hga --display-name "Hello World Gateway - version 2"
The response to the command includes:
- The lifecycle state (for example, ACTIVE, FAILED).
- The id of the work request to update the API gateway (details of work requests are available for seven days after completion, cancellation, or failure).
If you want the command to wait to return control until the API gateway is active (or the request has failed), include either or both the following parameters:
--wait-for-state ACTIVE
--wait-for-state FAILED
For example:
oci api-gateway gateway update --gateway-id ocid1.apigateway.oc1..aaaaaaaab______hga --display-name "Hello World Gateway - version 2" --wait-for-state ACTIVE
-
(Optional) To see the status of the work request that is updating the API gateway, enter:
oci api-gateway work-request get --work-request-id <work-request-ocid>
-
(Optional) To view the logs of the work request that is updating the API gateway, enter:
oci api-gateway work-request-log list --work-request-id <work-request-ocid>
-
(Optional) If the work request that is updating the API gateway fails and you want to review the error logs, enter:
oci api-gateway work-request-error --work-request-id <work-request-ocid>
-
(Optional) To verify that the API gateway has been updated, enter the following command and confirm that the API gateway's properties are as you expect:
oci api-gateway gateway get --gateway-id <gateway-ocid>
-
For more information about using the CLI, see Command Line Interface (CLI). For a complete list of flags and options available for CLI commands, see CLI Help.
Run the UpdateGateway operation to update an API gateway.