Using the Service Level Enforcement Policy

Learn how to enable and configure the error message returned to the consumer when an SLA (service level agreement) is violated.

For information about using policies in the context of the developer portal, see Business Policies.


Table of Contents

  1. Introduction
  2. Creating a Service Level Enforcement policy
  3. Configuring a Service Level Enforcement policy
  4. Activating a policy
  5. Attaching a policy
  6. Testing the Policy and Viewing Monitoring Data
  7. Service Level Enforcement Policy: use cases for Policy Manager
  8. Service Level Enforcement Policy: use cases for the Akana API Platform (Community Manager)

Introduction

The Service Level Enforcement Policy is a Quality of Service (QoS) policy that allows you to enable and configure the error message content, and the HTTP response code, that are returned to the consumer when an SLA is violated.

The Service Level Enforcement Policy works in conjunction with a Service Level Policy. You define a Service Level Policy and specify each service level condition and alert code; then, you define a Service Level Enforcement Policy and specify the error message that will be displayed when the specified service level condition is violated.

This policy only applies to the following Service Level rules:

  • Usage Count
  • Total Request Message Size
  • Total Response Message Size

When the Service Level Policy and Service Level Enforcement Policy are attached to the same Organization/Service/Contract, and the Service Level Policy is violated, the messages are rejected and the error message that you configured is returned.

back to top

Creating a Service Level Enforcement policy

The first step in creating a policy is to define the basic policy information.

To add a Quality of Service (QoS) policy

  1. Go to Workbench > Browse > Organization, and select Policies > QoS Policies. The Policies Summary is displayed.
  2. Click Add Policy.
  3. Choose the policy type and click Next.
  4. Specify a name (required) and description (optional) and click Finish. At the Completion Summary, click Close. The Add Policy Wizard creates a draft policy instance that you can then configure on the Policy Details page.

For more information, see Add Policy.

back to top

Configuring a Service Level Enforcement policy

To configure your Service Level Enforcement policy, follow the steps below.

To configure a Service Level Enforcement policy

  1. Create the policy as covered above.
  2. At the Policies Summary page, in the Service Level Enforcement Policy section, click Modify. The Modify Service Level Enforcement Policy page appears, as shown below.

    QoS Service Level Enforcement policy: Modify page

  3. Specify values for the following:
    • Consumer Fault Message: The error message returned to the consumer when an SLA is violated.
    • HTTP result code: The HTTP response code returned to the consumer when a message is rejected because the SLA was violated.
  4. When done, click Finish.
  5. At the Completion Summary page, click Close.

Back to top

Activating a policy

When you create and configure a policy, the policy is in Draft state. When the policy configuration is complete, activate the policy: click Activate Policy and then confirm. See Activate a Policy.

A policy in Draft state is not available for general use. Once you activate the policy, it is in Active state and is available for use.

Back to top

Attaching a policy

To use the Service Level Enforcement policy, go to the Policies folder in the respective organization and attach the policy to a web service, binding, or binding operation.

Back to top

Testing the Policy and Viewing Monitoring Data

After you've attached the Service Level Enforcement Policy to a web service, operation, or binding, send a request to your service and go to the Services > Monitoring section to view the results for Logs, Real Time Charts, and Historical Charts.

Back to top


Service Level Enforcement Policy: use cases for Policy Manager

This section provides a list of Policy Manager-specific usage scenarios for the Service Level Enforcement Policy.

It includes:

  1. Scenario 1: Block Request to Service
  2. Scenario 2: SLA Clear Alert
  3. Scenario 3: SLA Reset
  4. Timeline

Scenario 1: Block Request to Service

Block request to service for 15 minutes after 300 requests SLA has been violated. In this scenario, a fault message is returned to the app. The message that's returned is the one defined in the Service Level Enforcement Policy.

  1. Create a physical service in the Policy Manager Management Console using Create Physical Service.
  2. Provide service details and finish the wizard.
  3. Using Virtualize Service, virtualize and host the physical service on Network Director (ND1), and assign a name (for example, Vs1).
  4. Navigate to Organization > Policies > QoS Policies and use Add Policy to create a Service Level Enforcement Policy.
  5. Configure the Service Level Enforcement Policy and define a custom Fault message that reflects the use case scenario purpose.
  6. Next, use Add Policy and create a Service Level Policy.
  7. Configure this policy as per the use case with a Custom alert for Usage Count > 300 in a 15-minute interval.
  8. Attach the Service Level Enforcement policy and Service Level policy to the Vs1 service in the Service Details > Policy Attachments > QoS section.

  9. Send more than 300 requests to Vs1 from the application/client.
  10. The first 300 requests will be successful. Subsequent requests will fail and generate the custom Fault message defined in the Service Level Enforcement Policy.

Scenario 2: SLA Clear Alert

SLA generates a clear alert and sends an email to alert the administrator(s) after the App has been denied access for 15 minutes.

  1. Create a physical service in the Policy Manager Management Console using Create Physical Service.
  2. Provide service details and finish the wizard.
  3. Using Virtualize Service, virtualize and host the physical service on Network Director (ND1), and assign a name (for example, Vs1).
  4. Navigate to Organization > Policies > QOS Policies and use Add Policy to create a Service Level Enforcement Policy.
  5. Configure the Service Level Enforcement Policy as per the use case a with a custom Fault message.
  6. Navigate to Organization > Policies > QOS Policies and use Add Policy to create a Service Level Policy.
  7. Configure the Service Level Policy as per the use case with a custom alert for Usage Count > 300 in a 15-minute interval.
  8. Activate the policies in the Service Level Enforcement Policy and Service Level Policy in the Policy Workflow portlet and attach them to the Vs1 service in the Service Details > Policy Attachments > QoS section.
  9. Send more than 300 requests to Vs1 from the application/client.
  10. The first 300 requests will be successful. Subsequent requests will fail and generate the custom Fault message defined in the Service Level Enforcement Policy.
  11. After the alert is generated, if the SLA is not violated again, a clear alert will be generated.
  12. If the alert is configured with an email, it will be sent to the assigned users when triggered.

Scenario 3: SLA Reset

SLA has been reset and the App can send to the API.

  1. Create a physical service in the Policy Manager Management Console using Create Physical Service.
  2. Provide service details and finish the wizard
  3. Using Virtualize Service, virtualize and host the physical service on Network Director (ND1), and assign a name (for example, Vs1),
  4. Navigate to Organization > Policies > QOS Policies and use Add Policy to create a Service Level Enforcement Policy.
  5. Configure the Service Level Enforcement Policy as per the use case a custom Fault message
  6. Navigate to Organization > Policies > QOS Policies and use Add Policy to create a Service Level Policy.
  7. Configure the Service Level Policy as per the use case with custom alert for Usage Count > 300 in 15-minute intervals.
  8. Activate the policies in the Service Level Enforcement Policy and Service Level Policy in the Policy Workflow portlet and attach them to the Vs1 service in the Service Details > Policy Attachments > QoS section.
  9. Send more than 300 requests to Vs1 from the application/client.
  10. The first 300 requests will be successful. Subsequent requests will fail and generate the custom Fault message defined in the Service Level Enforcement Policy.
  11. After the alert is generated, if the SLA is not violated again, a clear alert will be generated.
  12. After clear alert is generated the requests should be successful until it violates the SLA again.

Timeline

Back to top

Service Level Enforcement Policy: use cases for the Akana API Platform (Community Manager)

This section provides a list of Community Manager-specific usage scenarios for the Service Level Enforcement Policy.

It includes:

  1. Overview
  2. Add / Configure Service Level Enforcement Policy
  3. Scenario 1: Verify Service Level Enforcement Policy Alerts at the Service Level
  4. Scenario 2: Verify Service Level Enforcement Policy Alerts at the Contract Level
  5. Scenario 3: Verify Service Level Enforcement Policy Alerts at the License > Term Level

Overview

The Service Level Enforcement Policy allows you to enable and configure the error message returned to the consumer when their SLA is violated. It works in conjunction with the Service Level Policy.

If you are using a Service Level Enforcement Policy with Community Manager, you must first add the policy to the Community Manager Tenant Organization in Policy Manager. Once that's done, it will be available for selection in the developer portal.

The policy only applies to the following Service Level Policy rules:

  • Usage Count
  • Total Request Message Size
  • Total Response Message Size

Add / Configure Service Level Enforcement Policy

  1. In the Policy Manager Management Console, go to the Tenant Organization, choose Policies > QoS Policies, and then click Add Policy.

  2. Specify Policy Name, Policy Type (Service Level Enforcement Policy), click Finish, and then click Close.

  3. On the Service Level Enforcement Policy Details screen, click Modify.

  4. Configure error message as shown below, then Finish.

  5. Activate the policy.

Scenario 1: Verify Service Level Enforcement Policy Alerts at the Service Level

  1. Launch Community Manager.
  2. Go to API Details > Edit API > Proxy Section > Advanced Options and attach the following policies:
  3. In Quality of Service Policies section, attach Service Level Enforcement Policy.
  4. In Operational Policies section, attach Atmosphere Application Security Policy (No Signature) and Detailed Auditing.

  5. Go to the app that's connected with the above API. Go to Test client and send more than 5 requests (as Service Level Policy rule is configured with Usage Count > 5).
  6. When the SLA is violated, the error message configured in the Service Level Enforcement Policy will display.

Scenario 2: Verify Service Level Enforcement Policy Alerts at the Contract Level

  1. Launch Community Manager.
  2. While requesting API Access, select the Service Level Enforcement Policy and Service Level Policy checkbox and finish the process. Make sure the contract is activated.

  3. Go to App > Test Client and send more than 5 requests.
  4. You will see an error message after there are more than 5 successful requests.

  5. You will see a Service Level Policy alert also in the Community Manager Dashboard. Once it is cleared, then requests will be successful.

Scenario 3: Verify Service Level Enforcement Policy Alerts at the License > Term Level

  1. To verify this policy, you'll need to set up scope mapping for an API. Assuming that a license is already added as part of the Service Level Policy Configuration, complete the following steps:
  2. Go to Edit License and attach the Service Level Enforcement Policy and Service Level Policy.

  3. Use this License >Scope for scope mapping of an API.

  4. Now go to the app that's connected to the API. go to Test Client and send more than 5 requests. Once the SLA is violated, you will see an error message. The specific message is configured in the Service Level Enforcement Policy.

  5. Go to App > Monitoring > Logs. You will see an error record along the lines of the below.

  6. Once SLA is cleared, requests will be successful.

Back to top