API Gateway Test

About this task

To ensure that the API Gateway is started & deployed, as well as the underlying load balancer or reverse proxy mappings is configured, perform the following predefined activities.

An activity consists of several tasks. Tasks are required to perform API calls via the Gateway to ensure that the deployment and configuration of the service is configured. An activity needs to be executed twice. Each execution is termed as a phase.

In Phase 1 API calls are made to the new domain as well as the old domain. API calls are made with both the old contexts pemws, mdrws, mrmws as well as the new rest context. The API calls made are as follows:
  • Get Partner
  • Get Certificate
  • Get API configuration
The phase verifies:
  • Gateway service is up and running

  • The new domain or subdomain is accessible

  • The reverse proxy or load balancer mappings for the old and new domain is correct.

In Phase 2 all API calls go to the new Gateway subdomain since the old PEM and PR API configurations are updated. Also, all API URLs contain the /rest context instead of the old pemws, mdrws, and mrmws context.

This phase verifies:
  • API configurations are pointing to the new Gateway domain or subdomain
  • The PEM and PR APIs work after changing the PEM and PR API configurations to point to the Gateway subdomain.
Once both phases are successful the API Gateway is ready to use in your deployment.
  1. Ensure that the API Gateway container is started.
  2. Gateway is running in a domain or subdomain which is different than PEM and PR.
  3. Ensure the new domain is accessible from the server where PEM Portal and Partner Repository containers are running.
  4. The reverse proxy or load balancer is configured. For more information, seeDeploy API Gateway

Procedure

  1. Import the API Gateway test activity fromPredefined activities .
  2. Create a new API configuration for API Gateway.
    If the certificate for API Gateway is different than the one used for PEM portal, then upload the new certificate in PEM portal. For more information, seeUploading a certificate
  3. Create a test partner to verify the test activity.
    If you already have an existing test partner, use the same.
  4. Edit context data of activity imported in Step 1 and specify values for following API configurations:
    • PEMAPIConfiguration -Your configuration for PEM service
    • PRAPIConfiguration- Your configuration for PR service

    • GatewayAPIConfiguration-Your configuration for the new subdomain
      Note: You need to create a subdomain.
  5. In the context data, provide a value for the PartnerKey field.
    This is a mandatory field.

Phase 1

  1. As a system admin, verify that the value of IS_API_GATEWAY_ENABLED system property is set to false. For more information, see API Gateway Deployment.
  2. Login as sponsor admin.
  3. Navigate to the Activities -> Definitions page.
  4. Start execution of the test activity definition in test mode.
  5. In the introduction dialogue task select Phase I.
  6. Verify the partner key that you earlier steps in context data. If the text box is blank, enter a partner key
  7. Click next and complete task.
Phase 2
  1. As a system admin, verify that the value of IS_API_GATEWAY_ENABLED system property to true.
  2. Login as sponsor admin.
  3. Navigate to Settings > API Configurations.
  4. Update the host and port in the PEM and PR API configurations to point to the new Gateway subdomain.
  5. Navigate to the Activities > Definitions page.
  6. Click on Save as draft for the test activity definition.
  7. Click OK to migrate the activity definition.
    Note: Before execution of the test activity, note the three APIs configuration names that were mapped in the context data.
  8. Start execution of the test activity definition in test mode
  9. In the introduction dialogue task, select Phase II.
  10. Verify the partner key.

    If the text box is blank, enter a partner key.

  11. Click next and complete task
  12. Enter the names of the three API configurations that you mapped to in the context data.
  13. Click next and wait for all tasks to complete.
  14. Start the API Configuration Validation sponsor task and click on next.

    The activity should complete successfully. If there are any failures in the tasks, seeAPI Gateway Troubleshooting .

The following are the possible errors during an activity execution.
Note: Before troubleshooting, ensure that all application containers are running, and reverse proxy or the load balancer is configured.

Phase 1 Troubleshooting Scenarios

  • Failure in Old domain New context task
    • 401 error code
      • Check the API configuration to ensure that the username and password provided is correct.
    • 404 error code
      • Check the underlying API and verify the following:
        • If the gateway container is running.
        • If the mapping is been added in reverse proxy or load balancer rules for /rest context for old domains.
    • 406 error code
      • Check API Gateway logs for errors.
    • 5xx error code
      • Check the application container logs and reverse proxy or load balancer logs for errors.

  • Failure in Old domain Old contexts task
    • HTTP 401 error code
      • Check the API configuration to ensure that the username and password provided is correct.
    • HTTP 404 error code
      • Check if Gateway container is running.
      • Check if the mapping has been added in the reverse proxy or load balancer rules for /pemws, /mrmws and /mdrws context.
    • HTTP 406 error code
      • Check the API Gateway logs.
    • HTTP 5xx error code
      • Check the application container logs.
  • Failure in the New Domain New context task
    • HTTP 401 response code
      • Check API configuration and ensure that the username and password provided are correct.
    • Invalid certificate error
      • Check if the certificate for API Gateway has been imported to the PEM portal.
      • Check if the Gateway API configuration is configured for the new domain.
      • Check if mapping has been added in reverse proxy/load balancer rules for /rest context for the new domain.
    • 406 error
      • Check API Gateway logs.
    • HTTP 5xx error code
      • Check the application container logs.

  • Failure in the New Domain Old contexts task
    • Check if the new subdomain API configuration is correct. This task ensures that the new subdomain is working as intended.
    • Check if mapping has been added in reverse proxy/load balancer rules for /pemws, /mrmws, and /mdrws context for the new domain.
    • HTTP 406 error code
      • Check API Gateway logs.
    • HTTP 5xx error code
      • Check the application container logs

Phase 2 Troubleshooting Scenarios

In case of failure in the Old domain New context, Old domain Old context, New Domain New context, or New Domain Old Context review the following:

  • HTTP 401 error code
    • Check API configuration and ensure that the username and password provided is correct.
  • Invalid certificate error
    • Check if the certificate for API Gateway has been imported to the PEM portal.
    • Check if the Gateway API configuration is configured for the new domain.
    • Check if mapping has been added in reverse proxy/load balancer rules for /rest context for the new domain.
  • HTTPS 406 error code
    • Check API Gateway logs.
  • HTTPS 5xx error
    • Check the application container logs.
  • Failure in API Configuration validation task
    • Check if the API configurations is updated to point to the Gateway subdomain.
      Note: Ensure that the PEM and PR API configurations point to the new Gateway subdomain to fix this issue.