Listing API Gateways
Find out how to list existing API gateways with the API Gateway service.
Having created API gateways, you might need to list the existing API gateways. For example, you might want to see whether there are any API gateways that are no longer required, or quickly locate an API gateway by its OCID.
To list the API gateways in a compartment using the CLI:
- Configure your client environment to use the CLI (Configuring Your Client Environment to use the CLI for API Gateway Development).
-
To list all the API gateways in a compartment, open a command prompt and run
oci api-gateway gateway list
to list the API gateways:oci api-gateway gateway list --compartment-id <compartment-ocid>
where:
<compartment-ocid>
is the OCID of the compartment containing the API gateway.
For example:
oci api-gateway gateway list --compartment-id ocid1.compartment.oc1..aaaaaaaa7______ysq
If you want to list just those API gateways with a status of Active, include the
--lifecycle-state ACTIVE
parameter in the request. For example:oci api-gateway gateway list --compartment-id ocid1.compartment.oc1..aaaaaaaa7______ysq --lifecycle-state ACTIVE
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 ListGateways operation to list API gateways.