Listing API Gateways and API Deployments

Find out how to list existing API gateways and deployments with the API Gateway service.

Having created API gateways, and deployed APIs on API gateways by creating API deployments, you might need to list the existing API gateways or API deployments. For example, you might want to see whether there are any API gateways that are no longer required, quickly locate an API gateway by its OCID, or obtain the OCID of an API deployment.

  • To list API gateways or API deployments using the Console:

    1. In the Console, open the navigation menu and click Developer Services. Under API Management, click Gateways.
    2. Choose a Compartment you have permission to work in.
    3. To see a list of all existing API gateways in the current region and compartment (including their OCIDs), use the Gateways page.
    4. To see more detail about an individual API gateway, click the name of the API gateway on the Gateways page to show the Gateway Details page.
    5. To see a list of API deployments on an API gateway (including their endpoint, state, and OCID), click the name of the API gateway on the Gateways page and select Deployments from the Resources list.
  • To list the API gateways and API deployments in a compartment using the CLI:

    1. Configure your client environment to use the CLI (Configuring Your Client Environment to use the CLI for API Gateway Development).
    2. 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
    3. To list all the API deployments in a compartment, open a command prompt and run oci api-gateway deployment list to list the API deployments:

      oci api-gateway deployment list --compartment-id <compartment-ocid>

      where:

      • <compartment-ocid> is the OCID of the compartment containing the API deployments.

      For example:

      oci api-gateway deployment list --compartment-id ocid1.compartment.oc1..aaaaaaaa7______ysq

      If you want to list just those API deployments with a status of Active, include the --lifecycle-state ACTIVE parameter in the request. For example:

      oci api-gateway deployment list --compartment-id ocid1.compartment.oc1..aaaaaaaa7______ysq --lifecycle-state ACTIVE

      If you want to list all the API deployments on a particular API gateway in a compartment, include the --gateway-id parameter in the request and specify the API gateway's OCID. For example:

      oci api-gateway deployment list --compartment-id ocid1.compartment.oc1..aaaaaaaa7______ysq --gateway-id ocid1.apigateway.oc1..aaaaaaaab______hga

    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: