DataPower API Gateway
only

Reviewing a gateway's processing status

Review the processing status for the Gateway services that are enabled in your API Connect Catalogs and Spaces.

About this task

Sometimes you might want to check the status of an API event that is being processed by the gateway. For example, you might want to ensure that a Product was published before and is available on the gateway before you invoke one of its APIs. Or perhaps it appears that API events are being processed too slowly and you want to see if all of the events for a particular gateway service are affected.

You can review a gateway's processing status in the API 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.
  • Processing information is collected for each Catalog. If you view information for a particular Space, the display shows the results for the entire Catalog instead.

You can view the gateway processing status using the UI or the CLI.

Using the UI to view the gateway processing status

About this task

Use the API Manager user interface to view the processing status for all of the gateway services associated with a particular Catalog or Space.

Procedure

  1. Open the Gateway services page:
    1. Log in to API Manager.
    2. In the navigation pane, click Manage icon Manage.
    3. Select a Catalog.
    4. Click the Catalog settings tab.
    5. On the Settings page, click Gateway services.

      A list of all of the gateway services for the selected Catalog, including all of its Spaces, displays the gateway type and its endpoint URL. In addition, a status icon displays for each service name to provide a quick indication of that service's current status:

      • Normal status icon Normal: 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

      You can view details about a service's status to gain insight into possible issues.

  2. On the Gateway services page, click Options menu next to a service and select View gateway processing status.

    The Gateway processing status page displays a list of the events that were sent to the gateway. 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.

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.
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 mgmt_endpoint_url --username user_id --password password --realm provider/identity_provider
    where:
    • mgmt_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 do not need to be logged in to use this command):
    apic identity-providers:list --scope provider --server mgmt_endpoint_url --fields title,realm
    For example,
    apic identity-providers:list --scope provider --server myserver.com --fields title,realm 
    total_results: 2
    results:
      - title: API Manager Local User Registry
        realm: provider/default-idp-2
      - title: Corporate LDAP user registry
        realm: provider/corporate-ldap
    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 configured-gateway-services:get --server mgmt_endpoint_url --scope catalog --org organization_name --catalog catalog_name gateway_service_name --fields "add(gateway_processing_status)" --output -

    where:

    • mgmt_endpoint_url is the platform API endpoint URL.
    • The --scope scope parameter specifies catalog as the scope of the request.
    • organization_name is the name of the provider organization that contains the Catalog.
    • catalog_name is the name of the Catalog in which the Gateway service is enabled.
    • 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
    For example:
    apic configured-gateway-services:get --server platform-api.myserver.com --scope catalog --org myorg --catalog sandbox my-gateway-service --fields "add(gateway_processing_status)" --output -