Deploying PingIntelligence policies in Akana API gateway is divided into three parts:

  • Adding an input script (config.js).
  • Adding PingIntelligence policy and applying the policy to APIs.
  • Adding RetainerHeader policy and applying the policy to APIs.

    Complete the following steps to download and extract the PingIntelligence policy:
    1. Download the PingIntelligence policy.
    2. Extract the policies by using the following command.

      # tar –zxvf <<file name>>

      For example,

      # tar –zxvf pi-api-akana-policy-4.1.1.tar.gz

Add Input script

Complete the following steps to add input script to API gateway:

  1. Login to Akana Policy Manager, navigate to the Tenant and click Scripts.
  2. Click Add Script.
  3. Enter Script Name and Script Description, and click Next.

  4. Select JavaScript as Language from the list.
  5. Copy the contents of config.js script provided by PingIntelligence and paste them into the Source.

  6. Substitute the values of ‘Service_QName’, ‘Interface_Name’, and ‘Operation_Name’ that were captured in Capture ASE details step.This needs to be performed for both primary and secondary ASE nodes. The below table lists the variables in config.js that needs to be populated.
    Variable Purpose
    ase_token Variable to hold ASE sideband authentication token.
    primary_ase_service Service QName for primary ASE.
    primary_ase_interface Interface name for primary ASE.
    primary_ase_request_operation Operation Name for posting Request Metadata in primary ASE.
    primary_ase_response_operation Operation Name for posting Response Metadata in primary ASE.
    secondry_ase_service Service QName for secondary ASE
    secondary_ase_interface Interface name for secondary ASE
    secondary_ase_request_operation Operation Name for posting Request Metadata in secondary ASE.
    secondary_ase_response_operation Operation Name for posting Response Metadata in secondary ASE.

    Here is a sample substitution snippet for reference:

    var ase_token = "ASE-Token-123";
    /*Primary ASE Configuration*/
    var primary_ase_service = "{pi-as-ase-primary_0.0.0}svc_314492f1-ecdc-4184-93a0-57ee2258154b.smshargi.sandbox";
    var primary_ase_interface = "{pi-as-ase-primary_0.0.0}pi-as-ase-primary_PortType_0";
    var primary_ase_request_operation = "postRequestMetadata";
    var primary_ase_response_operation = "postResponseMetadata";
    /************************/
    /*Secondary ASE Configuration*/
    var secondry_ase_service = "{pi-as-ase-primary_0.0.0}svc_314492f1-ecdc-4184-93a0-57ee2258154b.smshargi.sandbox";
    var secondary_ase_interface = "{pi-as-ase-primary_0.0.0}pi-as-ase-primary_PortType_0";
    var secondary_ase_request_operation = "postRequestMetadata";
    var secondary_ase_response_operation = "postResponseMetadata";
    
    
  7. Click Finish, and then click Close.

Add PingIntelligence policy

Complete the following steps to add a PingIntelligence policy to Akana gateway:

  1. Login to Akana Policy Manager and navigate to the Tenant. Under Policies click Operational Policies.
  2. Select Add Policy option. Select Policy Type as Private Operational Script Policy from the list and click Next.


  3. Provide Policy Name and Description, click Finish and then click Close.

  4. Navigate to Workbench.
  5. In the Private Operational Script Policy section, select the policy name and click Modify.

  6. Click on Imports. Select the script added in Add Input Script step above and import it by clicking <<.
  7. Select JavaScript as language Language from the list.
  8. Copy the contents of pi_policy.js script and paste them into Expression in Source.

  9. Click Finish and then click Close.
  10. In the WorkFlow Actions click Activate Policy to activate the PingIntelligence policy.

Apply the PingIntelligence policy to APIs

The PingIntelligence Policy can be applied at tenant level, org level and at individual API level. The following steps explain the process of adding a policy at API level.

  1. Login to Akana Portal.
  2. To apply policy at per API level:
    1. Click on the API name.
    2. In the left window pane, click Implementation on the left pane.

    3. Click API implementation name icon. Possible values for API implementation could be (Live/Sandbox/Development).
    4. Click Edit in Policies section.

    5. Find the PingIntelligence Policy in Available Policies pane Click Attach under PingIntelligence policy.
    6. Click Save.


Add RetainHeader policy

Complete the following steps to add RetainHeader Policy to Akana Gateway:

  1. Login to Akana Policy Manager and navigate to the Tenant. Under Policies click Operational Policies.
  2. Select Add Policy option. Select Policy Type as Private Operational Script Policy from the list and click Next.

  3. Provide Policy Name and Description, click Finish and then click Close.
  4. Navigate to Workbench.
  5. In the Private Operational Script Policy section, select the policy name and click Modify.

  6. Select JavaScript as language in ScriptLanguage from the list.
  7. Copy the contents of retain-header-policy.js script and paste them into Expression .
  8. Select Pre-policy auditing from Function.
  9. Click Finish and then click Close.
  10. In the WorkFlow Actions click Activate Policy to activate the RetainHeader policy.

Apply the RetainHeader policy to APIs

The RetainHeader Policy can be applied at tenant level, org level and at individual API level. The following steps explain the process of adding a policy at API level.

  1. Login to Akana Portal.
  2. To apply policy at per API level:
    1. Click on the API name.
    2. In the left window pane, click Implementation on the left pane.

    3. Click API implementation name icon. Possible values for API implementation could be (Live/Sandbox/Development).
    4. Click Edit in Policies section.

    5. Find the RetainHeader Policy in Available Policies pane Click Attach under RetainHeader Policy.
    6. Click Save.