DataPower API Gateway
only

Reviewing processing status and downloading gateway logs

View and download the processing status information for the Gateway services that are enabled in your API Connect.

About this task

Check the status of API events processed by the gateway, and download gateway logs as needed. For example, you might want to check whether a Product was published and is available on the gateway before using one of its APIs. Or you might notice that API events are processing slowly and want to see if all events for a specific gateway service are affected.

You can review or download a gateway's processing status in the Cloud Manager user interface, or by using the toolkit CLI to retrieve the information.

Notes: You can only obtain processing status information for the DataPower® API Gateway. This feature is not supported for the DataPower Gateway (v5 compatible) service or the Event Gateway service.

Using the UI to view the gateway processing status

About this task

Use the Cloud Manager user interface to view or download the processing status information for all the DataPower API Gateway.

Procedure

To check the status of API events processed by the gateway and download gateway logs, complete the following steps:
  1. Log in to Cloud Manager.
  2. In the navigation pane, click Topology icon Configure topology.
  3. On the topology page, you can view the processing status and download the gateway logs.
    • To view the processing status, complete the following steps:
      • Click Options menu next to the gateway service and select View status.

        The View status page displays a list of the events that were sent to the gateway.

        A status icon displays for each service name to provide a quick indication of that service's status:

        • Normal status iconNormal: Between 0 and 10 events are waiting to be processed
        • Increased status icon Increased: Between 10 and 20 events are waiting to be processed
        • High status icon High: More than 20 events are waiting to be processed

        In addition, for each event, you can see the following information:

        • Event type: The action performed by the event; for example, subscribing to a product, deleting an application, or creating a new consumer organization.
        • Category: The feature area affected by the event; for example, subscriptions, applications, or consumer organizations.
        • Time: The time when the event was processed by the gateway service.
        • Status: The current event's processing status; for example, Queued (not yet sent for processing), Sent (but not processed yet), or Processed (complete).

          The number of events in the Queued and Sent states determine the status level for the service.

        The display includes events that were not processed yet, as well as the last event processed. If a particular event is not listed as Sent or Queued, then that event was already processed.

    • To download gateway logs, complete the following steps:
      • Click Options menu next to the gateway service and select Download logs.
      • Downloads a compressed file to your computer with a name that uses the format <gateway-name>.zip for example v6gw.zip.

Using the CLI to obtain a gateway's processing status

About this task

You can use the developer toolkit CLI to obtain information about the processing status for the Gateway services that are enabled in your Catalogs and Spaces.

The processing status information is returned in the following fields:
Field Description
service_up_to_date If true then all outstanding events have been processed by the Gateway service.
service_state An overall status summary of the various states of events and processing by the Gateway service:
  • green indicates normal status with between 0 and 10 events waiting to be processed
  • orange indicates that between 10 and 20 events are waiting to be processed
  • red indicates that more than 20 events are waiting to be processed
last_processed_event Details of the last event that was processed by the Gateway service, helping to provide a timeline of when the last event was processed, and some statistics about how long ago it was and how long the processing took.
last_sent_event Details of the last event that was sent to the gateway service
number_of_outstanding_sent_events The number of events that have been sent but not yet processed by the Gateway service.
number_of_outstanding_queued_events The number of events that have been queued but not yet sent to the Gateway service.
first_failed_event This is the first event for which the gateway sent a failed status.
The following example shows a "green" response that includes the status information and the list of sent events:
gateway_processing_status:
  service_up_to_date: false
  service_state: green
  last_processed_event:
    event_id: 40e1a564-2aea-429b-9d35-f588218688a1
    title: None provided
    processed_at: '2020-06-02 22:40:04.671+00'
    generated_at: '2020-06-02 22:39:33.856769+00'
    filter: product_replace
    event_processing_time: 24526
    elapsed_time_since_last_processed_event: 13682
  last_sent_event:
    event_id: 3bb52860-29f8-41a9-93d0-c9465a0a30e0
    title: None provided
    sent_at: '2020-06-02T22:40:15.820Z'
    generated_at: '2020-06-02 22:40:12.980079+00'
  number_of_outstanding_sent_events: 9
  number_of_outstanding_queued_events: 0
events:
  sent_events:
    - title: >-
        Update Product (name-version:lts-cat0-product-14:1.0.0, id:
        0df5bf4b-6706-4c36-aa0c-9c8ba2f15254) by user shavon0
      filter: product_update
      generated_at: '2020-06-02 22:39:45.430744+00'
    - title: >-
        Update Product (name-version:lts-cat0-product-64:1.0.0, id:
        4795106e-787d-41e6-bb94-9e6506719529) by user shavon0
      filter: product_lifecycle
      generated_at: '2020-06-02 22:39:46.11499+00'
    - title: None provided
      filter: product_replace
      generated_at: '2020-06-02 22:39:46.862433+00'
    - title: >-
        Update Product (name-version:lts-cat0-product-15:1.0.0, id:
        6c7bf5ef-dca4-4b63-8060-2cc3c4d91d3b) by user shavon0
      filter: product_update
      generated_at: '2020-06-02 22:39:58.397278+00'
    - title: >-
        Update Product (name-version:lts-cat0-product-65:1.0.0, id:
        4019df05-27a6-4ac2-83c8-6dd5da100105) by user shavon0
      filter: product_lifecycle
      generated_at: '2020-06-02 22:39:59.02833+00'
    - title: None provided
      filter: product_replace
      generated_at: '2020-06-02 22:39:59.740152+00'
    - title: >-
        Update Product (name-version:lts-cat0-product-16:1.0.0, id:
        4435a953-3c8d-4814-ada8-c71409cabcaf) by user shavon0
      filter: product_update
      generated_at: '2020-06-02 22:40:11.571056+00'
    - title: >-
        Update Product (name-version:lts-cat0-product-66:1.0.0, id:
        fb9239d5-6064-4500-9a7b-63b841f5321a) by user shavon0
      filter: product_lifecycle
      generated_at: '2020-06-02 22:40:12.199838+00'
    - title: None provided
      filter: product_replace
      generated_at: '2020-06-02 22:40:12.980079+00'
  queued_events: []

The following example shows a "red" response:

gateway_processing_status:
  service_up_to_date: false
  service_state: red
  last_processed_event:
    event_id: 07387d98-dbfc-494b-af12-d7db91208e4c
    title: >-
      Update Product (name-version:lts-cat0-product-49:1.0.0, id:
      25eba540-0cb1-4808-be3d-f22f65540cb2) by user shavon0
    processed_at: '2020-06-02 22:32:10.838+00'
    generated_at: '2020-06-02 22:31:43.38615+00'
    filter: product_del
    event_processing_time: 22597
    elapsed_time_since_last_processed_event: 18427
  last_sent_event:
    event_id: 93d0bf8f-ebfb-4a8b-aa22-7f805719d5c8
    title: >-
      Update Product (name-version:lts-cat0-product-11:1.0.0, id:
      d0bf799f-7f3a-4546-b267-a85c6a7f4b10) by user shavon0
    sent_at: '2020-06-02 22:32:28.426+00'
    generated_at: '2020-06-02 22:32:25.505109+00'
  number_of_outstanding_sent_events: 37
  number_of_outstanding_queued_events: 1
 

The result includes events that were not processed yet, as well as the last event processed. If a particular event is not listed as Sent or Queued, then that event was already processed.

Procedure

To obtain processing status information for a Gateway service, complete the following steps:

  1. Log in to your API Connect Management server as a provider organization member, by using the following command:
    apic login --server api_platform_endpoint_url --username user_id --password password --realm admin/identity_provider
    where:
    • api_platform_endpoint_url is the platform API endpoint URL.
    • user_ID is the user ID of your provider organization account, and is the same as the user ID that you use to log in to the API Manager user interface.
    • password is the password for your administrator account.
    • identity_provider is the identity provider that is used to authenticate API Manager users.
    For example:
    apic login --server platform-api.myserver.com --username myuser --password password --realm provider/myldap
    You can determine which identity provider to use in the --realm parameter by entering the following command to see a list of all available identity providers (you need to be logged in to an admin real to use this command):
    apic identity-providers:list --scope provider --server api_platform_endpoint_url --fields title,realm
    For example,
    apic identity-providers:list --scope admin --server api_platform_endpoint_url  --fields title,realm
    total_results: 1
    results:
      - title: Cloud Manager User Registry
        realm: admin/default-idp-1
    The title value should enable you to determine which identity provider to use; you can then copy the corresponding --realm parameter directly from the displayed realm value. For any identity providers that were created by your administrator after API Connect was installed, the names will have been determined at creation time. The default API Manager Local User Registry for login as a member of a provider organization is default-idp-2.

    For full details on how to log in to your management server from the CLI, see Logging in to the management server.

  2. Obtain the Gateway processing status for a Gateway service that is enabled in a catalog by running the following command:
    apic gateway-services:get --server mgmt_endpoint_url --org organization_name  gateway_service_name --fields "add(gateway_processing_status,events,webhook_state)" --output -

    where:

    • mgmt_endpoint_url is the platform API endpoint URL.
    • organization_name is the name of the provider organization that contains the catalog.
    • gateway_service_name is the name of the Gateway service whose processing status you want to obtain.
    • The --fields "add(arguments)" parameter can include either, or both, of the following arguments (separated with a comma):
      • gateway_processing_status: returns the total number of sent events, queued events, and processed events
      • events: returns lists of sent events with details about each event
      • webhook_state: this is the current state of the webhook subscription between API Manager and the gateway
    For example:
    apic gateway-services:get --server platform-api.myserver.com --org myorg my-gateway-service --fields "add(gateway_processing_status,events,webhook_state)" --output -