4 Managing External SLAs

This chapter describes how external Service Level Agreements (SLAs) are managed and provisioned in Oracle Communications Services Gatekeeper (OCSG).

Understanding External SLAs

An external service level agreement (SLA) is equivalent to a plan in API Cloud Service. In Oracle Communications Services Gatekeeper, it is a new data entity that is referred to from group SLAs. It is stored in a database and managed from REST APIs or MBean interfaces. An application subscribes to an external SLA through createApplication and updateApplication operations.

The validity period for an external SLA, which consists of start and end dates, is attached to the SLA itself and also to its relationship to the group SLA. For example, in the first case an investor might want to offer a free service for any application but make the plan valid only through the month of February. For a scenario in which the validity period is attached to the external SLA's relationship to the group SLA, you could have the application subscribe to a plan on an application level. In this case, application A and application B might both subscribe to a plan, but application A pays quarterly (three-month period) while application B pays annually (twelve-month period).

An external SLA is constructed in three levels from root to leaves. A composed service contract can be composed of all APIs in the plan, but it can have another composition as well. Figure 4-1 illustrates the three levels of an external SLA.

Figure 4-1 The Three Levels of an External SLA

Surrounding text describes Figure 4-1 .

You can set an exemption or constraint on the leaf level in the tree, which consists of the PUT, GET, and POST verbs. An exemption cannot be set on the composed service contract level. Note that some verbs lack contract on the service contract level. For example, SLA -> API2 -> GET does not have a contract, so the leaf for this verb is actually External SLA -> API2. At API2, you can set the service type contract to exemption, but then you also must set exemption on the service contract level.

Quota usage occurs as follows: 1) for each successful transaction, the quota is consumed in all levels that are used; 2) for each transaction that has an exception in OCSG before a send request to the back-end server, no quota is consumed at any level.

Exemptions and constraints are enforced as follows. When validating the current API action, OCSG first looks at the service contract. If it's not found, OCSG goes to the parent level, which is service type contract. If that is also not found, it looks at the composed service contract to see if the API is part of the composed contract. If not, then there is no contract for this action and the request is denied.

If OCSG finds a service contract, it checks whether it's an exemption. If so, it validates the service contract but not the service type or global level.

If OCSG finds a service contract and it is a constraint, all parent contracts will also be constraints and each will be evaluated in order: 1) service contract, 2) service type contract, and 3) composed service contract.

If the request fails on any level, all budgets that have been used are returned.

The exemption is valid only with one external SLA. If there is overlap with other external SLAs or provider-group SLAs, they are treated separately. The return of used budgets applies across all levels.

Understanding SLA Overlaps

OCSG allows overlaps between external SLAs for counters but you should use caution because overlap can quickly become quite complex. Figure 4-2 illustrates one type of overlap.

Figure 4-2 Overlap Between External SLAs

Surrounding text describes Figure 4-2 .

Here two external SLAs overlap in API3 PUT. OCSG evaluates each external SLA sequentially, so restrictions from both plans are enforced. In this example, an application can subscribe to only one external SLA. Of all the external SLAs an application subscribes to, none can contain the same API, including the method.

In addition, when updating an existing external SLA, OCSG checks for API subscription overlap. If an application subscribes to the same API through different external SLAs, the update will fail.

Managing with MBean

Two new SLA types have been created to support re-use of SLAs by several applications: external and sytem:geo_external, which are managed from MBean com.bea.wlcp.wing.account.management.ServiceLevelAgreementMbean.

/**
 * Lists the external IDs for the specified SLA type.
 *
 * The following system level SLA types are valid for externals:
 * external - External SLA stored and enforced only on the local site.
 * system:geo_external - External SLA replicated and enforced on all
 * domains in a geo-redundant configuration.
 * <p><strong>Scope</strong>: Domain</p>
 *
 * @param slaType a system level application group SLA type ("external" or
 * "system:geo_external") or an SLA type defined by setupCustomSlaXSDDefinition
 * @param offset Offset within the complete resultset. Must be >= 0.
 * @param size Number of entries to return. 0 means no limit.
 * @throws InputManagementException if slaType is null or not applicable.
 * @return The application groups matching the criteria.
 */
public String[] listExternalIdsByType(String slaType, int offset, int size)
throws InputManagementException;
 
/**
 * Loads a system level or custom SLA for the specified external id.
 *
 * The following system level SLA types are valid for the external:
 * external - External SLA stored and enforced only on the local site.
 * system:geo_external - External SLA replicated and enforced on all
 * domains in a geo-redundant configuration.
 * <p><strong>Scope</strong>: Domain</p>
 *
 * @param slaType A system level external SLA type ("external" or
 * "system:geo_external") or an SLA type defined by setupCustomSlaXSDDefinition
 * @param id The external SLA identifier.
 * @param fileContent The new service level agreement to use.
 * A Null or empty string removes the SLA.
 * @throws ManagementException Validation of service
 * level agreement failed.
 * @throws KeyNotFoundException If the group does not exist.
 * @throws InputManagementException if the slaType is null or not applicable.
 */

public void loadExternalSlaByType(String slaType, String id,
     String fileContent)
throws ManagementException, KeyNotFoundException, InputManagementException;
 
/**
 * Retrieves a system or custom Service Level Agreement for the specified external
 * id.
 *
 * The following system level SLA types are valid for external:
 * external - External SLA stored and enforced only on the local site.
 * system:geo_external - External SLA replicated and enforced on all
 * domains in a geo-redundant configuration.
 * <p><strong>Scope</strong>: Domain</p>
 *
 * @param slaType A system level external SLA type ("external" or
 * "system:geo_external") or an SLA type defined by setupCustomSlaXSDDefinition
 * @param id The external SLA identifier.
 * @throws InputManagementException if slaType is null or not applicable.
 * @return The custom Service Level Agreement.
 */
public String retrieveExternalSlaByType(String slaType, String id)
throws InputManagementException;

Listing from the Database

The wing_external_slas database table stores external SLAs. Table 4-1 describes wing_external_slas:

Table 4-1 The wing_external_slas Database Table

Field Type Null Key Default

id

varchar (255)

No

Primary

Null

sla_content

blob

Yes

 

Null

description

varchar (255)

Yes

 

Null

state

integer (10)

Yes

 

Null

stored_ts

bigint(20)

No

 

Null


The table global_wing_external_slas has the same definition.

The following example shows how to list SLAs from the MySQL console:

select sla_content from wlng_external_slas;

Understanding the XSD

There is a new XML system descriptor (XSD) for external SLAs, with three parts for the different levels:

  • service contract

    Defines the constraints and exemptions on the API resource table row level

  • service type contract

    Defines the constraints and exemptions on the API level

  • composed service contract

    Defines the constraints on the PLAN level (no exemptions on the PLAN level)

Note:

No rate or quota element means that the rate or quota is unlimited on that level (or method).

The XSD pathname is:

{SRC}\bea\modules\account\src\main\resources\sla_schema\external_sla_file.xsd

The XSD is based on the original application group SLA, which is used to support external SLA subscription in the application, with these three differences: no group ID attribute, startDate and endDate are optional, and the isExemption attribute is added.

Figure 4-3 illustrates these differences:

Figure 4-3 XSD Differences for External SLA

Surrounding text describes Figure 4-3 .

The XSDs for application and service-provider SLAs have been extended with the externalSla element so that you can embed external SLAs in application or service-provider group SLAs.

Table 4-2 describes support for external SLA elements:

Table 4-2 Support for External SLA Elements

Element Description

override and overrides

In a serviceContract, can be used to set an alternative contract during a specific time. For example, day of week, time of day, and so on.

limitExceeded (quota)

If true, traffic can continue after the quota constraint reaches its limit. The counter always calculates. Default: false.

methodAccess and blacklistedMethod (contract)

A general purpose tunneling feature. You can pass something to an action that isn't part of the interface of the API but is instead attached to the SLA. Could for instance be a price plan identifier or similar.

params and MethodParameters (contract)

Describes parameters and method parameters.

requestContext (contract)

A general purpose tunneling feature. You can pass something to an action that isn't part of the API interface but instead attached to the SLA, for instance a price plan identifier or similar.

resultRestrictions (contract)

Filter responses before returned to caller.


Subscribing to External SLAs

Currently an application subscribes to APIs by invoking the CREATE or UPDATE application REST calls. An application also has the option to subscribe to external SLAs. It can subscribe to both APIs and external SLAs or it can subscribe to only one of them. The following examples illustrate each of these cases.

External SLA only

The following example illustrates a REST createApplication statement for an external SLA only:

{
  "createApplication":{
    "application":{
      "applicationID":"leavePlanApp",
      "applicationName":"leavePlanApp",
      "description":"Plan a RESTful vacation or leave",
      "partnerName":"partner",
      "applicationAPIs":[
 
      ],
      "externalSlas":[
        {
          "id":"myCalendar"
        },
        {
          "id":"myParental"
        },
        {
          "id":"myVacation"
        }
      ],
      "trafficPassword":"d2VibG9naWMx",
      "icon":"expressive/sunny.png"
    }
  }
}

The updateApplication statement would look like this:

{
  "updateApplication":{
    "application":{
      "applicationID":"leavePlanApp",
      "applicationName":"leavePlanApp",
      "description":"Plan a RESTful vacation or leave",
      "partnerName":"partner",
      "applicationAPIs":[
 
      ],
      "externalSlas":[
        {
          "id":"myCalendar"
        },
        {
          "id":"myParental"
        },
        {
          "id":"myVacation"
        }
      ],
      "trafficPassword":"d2VibG9naWMx",
      "icon":"expressive/sunny.png"
    }
  }
}

The XML for the application group SLA looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<Sla xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="app_sla_file.xsd"
  applicationGroupID="partner-leavePlanApp">
  <externalSla>
    <id>myCalendar</id>
    <id>myParental</id>
    <id>myVacation</id>
  </externalSla>
</Sla>

API Only

The following example illustrates a REST updateApplication statement for an API only:

{
  "updateApplication":{
    "application":{
      "applicationID":"leavePlanApp",
      "applicationName":"leavePlanApp",
      "description":"Plan a RESTful vacation or leave",
      "effectiveFrom":"2016-04-15",
      "effectiveTo":"3017-01-12",
      "trafficUser":"partner_leavePlanApp",
      "appKey":"Password1",
      "partnerName":"partner",
      "quota":{
        "days":"1",
        "qtaLimit":"10000000"
      },
      "rate":{
        "reqLimit":"1500",
        "timePeriod":"1"
      },
      "applicationAPIs":[
        {
          "apiName":"ECHOServer"
        }
      ],
      "externalSlas":[
      ],
      "trafficPassword":"d2VibG9naWMx",
      "icon":"expressive/leavePlanApp.png"
    }
  }
}

The XML for the application group SLA looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<Sla xsi:noNamespaceSchemaLocation="app_sla_file.xsd"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  applicationGroupID="partner-leavePlanApp">
  <serviceContract>
    <startDate>2016-04-15+02:00</startDate>
    <endDate>3017-01-12+01:00</endDate>
    <scs>ECHOServer</scs>
    <method>POST_/echo</method>
  </serviceContract>
  <composedServiceContract>
    <composedServiceName>leavePlanApp</composedServiceName>
    <service>
      <serviceTypeName>ECHOServer</serviceTypeName>
    </service>
    <startDate>2016-04-15+02:00</startDate>
    <endDate>3017-01-12+01:00</endDate>
    <rate>
      <reqLimit>1500</reqLimit>
      <timePeriod>1000</timePeriod>
    </rate>
    <quota>
      <qtaLimit>10000000</qtaLimit>
      <days>1</days>
      <limitExceedOK>false</limitExceedOK>
    </quota>
  </composedServiceContract>
</Sla>

External SLA and API

The following example illustrates a REST updateApplication statement for an external SLA and an API:

{
"updateApplication":{
  "application":{
    "applicationID":"leavePlanApp",
    "applicationName":"leavePlanApp",
    "description":"Plan a RESTful vacation or leave",
    "effectiveFrom":"2016-04-15",
    "effectiveTo":"3017-01-12",
    "trafficUser":"partner_leavePlanApp",
    "appKey":"Password1",
    "partnerName":"partner",
    "quota":{
      "days":"1",
      "qtaLimit":"10000000"
    },
    "rate":{
      "reqLimit":"1500",
      "timePeriod":"1"
    },
    "applicationAPIs":[
      {
        "apiName":"ECHOServer"
      }
    ],
    "externalSlas":[
    ],
    "trafficPassword":"d2VibG9naWMx",
    "icon":"expressive/leavePlanApp.png"
    }
  }
}

The XML for the application group SLA looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<Sla xsi:noNamespaceSchemaLocation="app_sla_file.xsd"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  applicationGroupID="partner-leavePlanApp">
  <serviceContract>
    <startDate>2016-04-15+02:00</startDate>
    <endDate>3017-01-12+01:00</endDate>
    <scs>ECHOServer</scs>
    <method>POST_/echo</method>
  </serviceContract>
  <composedServiceContract>
    <composedServiceName>leavePlanApp</composedServiceName>
    <service>
      <serviceTypeName>ECHOServer</serviceTypeName>
    </service>
    <startDate>2016-04-15+02:00</startDate>
    <endDate>3017-01-12+01:00</endDate>
    <rate>
      <reqLimit>1500</reqLimit>
      <timePeriod>1000</timePeriod>
    </rate>
    <quota>
      <qtaLimit>10000000</qtaLimit>
      <days>1</days>
      <limitExceedOK>false</limitExceedOK>
    </quota>
  </composedServiceContract>
  <externalSla>
    <id>myCalendar</id>
    <id>myParental</id>
    <id>myVacation</id>
  </externalSla>
</Sla>

Life Cycle

An external SLA can be active or inactive and it can be in use or not in use. You can create an external SLA with the status set to active or inactive and you can change the status at any time. An application can subscribe to, and be subscribed to, an external SLA in either of these states. Table 4-3 describes the life cycle rules for an external SLA.

Table 4-3 Life Cycle Rules


Update Delete Subscription Enforce in Traffic

Active

Y

Y

Y

Y

Inactive

Y

Y

Y

-


The following rules apply:

  • Applications can subscribe to an inactive external SLA during traffic processing run time but it cannot be enforced.

  • An application is in use when one or more applications have subscribed to it.

  • An external SLA that is in use can be updated but cannot be deleted.

  • An external SLA that is not in use can be deleted whether its status is active or inactive.

Identifying the Plan

The plan ID in the EDR identifies which plan was selected to enforce for a given runtime API request.

When the PLAN is active and takes effect on the traffic per the current request, the plan ID and status occur in the EDR message as follows:

ExtSlaIds = id = plan_id0, status=ACTIVE

Using External SLA Management REST Interfaces

The existing API for creating and updating applications has been extended with the externalSLAs data element as described in chapter Subscribing/using external SLAs.

The base URL is:

pm_rest/services/prm_pm/services

Table 4-4 provides additional information regarding payload attributes:

Table 4-4 Notes on Plan Attributes

Attribute Comments

quotas

Optional. No quotas means unlimited and each unit is optional.

SECONDS, MINUTES and HOURS are supported.

All units (SECONDS, MINUTES, HOURS, DAYS, WEEKS, MONTHS, YEARS) can be applied in the API method and each is optional.

SECONDS, MINUTES, and HOURS are released by duration.

DAYS, WEEKS, MONTHS, YEARS are released by calendar at midnight for each day or Saturday (for week) or first day of month or year.

rate

Optional. The unit for timePeriod is milliseconds. If rate occurs, reqLimit and timePeriod are mandatory.

slaItem/id

Optonal. For creation, if id is not provided, one is generated in UUID format. For updating, use the value in the path.

slaItem/state

Optional. For creation, default is inactive and value is not changed for updating.

slaItem/description

Optional. Default is null.

slaItem/apis

Mandatory.

slaItem/apis/exemption

Optional. Default is false.

slaItem/apis/rate

Optional. If rate occurs, however, reqLimit and timePeriod are mandatory.

slaItem/apis/quotas

Optional. No quotas means unlimited, and each unit is optional

slaItem/apis/methods

Optional. No methods means all API methods are allowed.

slaItem/apis/methods/exemptions

Optional. Default is false.

slaItem/apis/methods/startDate

Optional. If no startDate, API's startDate is used.

slaItem/apis/methods/endDate

Optional. If no endDate, API's endDate is used.

slaItem/apis/methods/rate

Optional. If rate occurs, however, reqLimit and timePeriod are mandatory.

slaItem/apis/methods/quotas

Optional. No means unlimited and each unit is optional.

slaItem/apis/methods/scopes

Optional.


Creating a Plan

Create a plan by issuing a POST command to the URL:

partner_manager/sla/external

The following example illustrates:

POST /partner_manager/sla/external
{
  "slaItem": {
    "id": "plan_id0",
    "name": "plan_name0",
    "state": "inactive",
    "description": "desc1",
    "startDate": "2007-01-25",
    "endDate": "2097-09-25",
    "rate": {
      "reqLimit": 5000000,
      "timePeriod": 2
    },
    "quotas": [{ 
        "unit": "SECONDS",
        "qtaLimit": 2,
        "limitExceedOK": false
      }, 
      {
        "unit": "MINUTES",
        "qtaLimit": 10,
        "limitExceedOK": false
      }, 
      {
        "unit": "HOURS",
        "qtaLimit": 20,
        "limitExceedOK": false
      }, 
      {
        "qtaLimit": 5,
        "unit": DAYS,
        "limitExceedOK": false
      },
      {
        "qtaLimit": 50,
        "unit": WEEKS,
        "limitExceedOK": false
      },
      {
        "qtaLimit": 500,
        "unit": MONTHS,
        "limitExceedOK": false
      },
      {
        "qtaLimit": 5000,
        "unit": YEARS,
        "limitExceedOK": false
      }],
      "apis": [{
        "apiId": "id-test-api0",
        "exemption": false,
        "startDate": "2007-02-26",
        "endDate": "2097-08-25",
        "rate": {
          "reqLimit": 5000000,
          "timePeriod": 2
        },
        "quotas":[{
          "days": 1,
          "qtaLimit": 4,
          "limitExceedOK": false
        },
        {
          "qtaLimit": 5,
          "unit": DAYS,
          "limitExceedOK": false
        },
        {
          "qtaLimit": 50,
          "unit": WEEKS,
          "limitExceedOK": false
        },
        {  
          "qtaLimit": 500,
          "unit": MONTHS,
          "limitExceedOK": false
        },
        {  
          "qtaLimit": 5000,
          "unit": YEARS,
          "limitExceedOK": false
        }],
        "methods": [{
          "path": "GET_/getPath/*",
          "exemption": true,
          "startDate": "2007-03-25",
          "endDate": "2097-07-25",
          "rate": {
            "reqLimit": 5000000,
            "timePeriod": 2
          },
          "quotas": [{
            "days": 1,
            "taLimit": 10,
            "limitExceedOK": true
          },
          {
            "qtaLimit": 5,
            "unit": DAYS,
            "limitExceedOK": false
          },
          {
            "qtaLimit": 50,
            "unit": WEEKS,
            "limitExceedOK": false
          },
          {
            "qtaLimit": 500,
            "unit": MONTHS,
            "limitExceedOK": false
          },
          {
            "qtaLimit": 5000,
            "unit": YEARS,
            "limitExceedOK": false
          }]
        }, 
        {
          "path": "PATCH_/patchPath/*",
          "exemption": false,
          "startDate": "2007-04-25",
          "endDate": "2097-06-25",
          "rate": {
             "reqLimit": 5000000,
             "timePeriod": 2
          },
          "quotas":[{
            "days": 1,
            "qtaLimit": 12,
            "limitExceedOK": false
          }],
          "scopes": [
            {"name":"name1", "value": "value1"},
            {"name":"name2", "value": "value2"}
          ]
        }]
    }]
  }
}

A successful response returns status code 201 Created to the location:

/partner_manager/sla/external/plan_id0

Getting a Plan

To get a plan, issue a GET command to the URL /partner_manager/sla/external/id where id is the plan ID.

GET partner_manager/sla/external/plan_id0

A successful response returns a status code 200 OK with the requested plan:

{
  "slaItem": {
    "id": "plan_id0",
    "name": "plan_name0",
    "state": "inactive",
    "description": "desc1",
    "startDate": "2007-01-25",
    "endDate": "2097-09-25",
    "rate": {
      "reqLimit": 5000000,
      "timePeriod": 2
    },
    "quotas": [{
        "days": 1,
        "qtaLimit": 5,
        "limitExceedOK": false
      },
      {
        "qtaLimit": 5,
        "unit": DAYS,
        "limitExceedOK": false
      },
      {
        "qtaLimit": 50,
        "unit": WEEKS,
        "limitExceedOK": false
      },
      {
        "qtaLimit": 500,
        "unit": MONTHS,
        "limitExceedOK": false
      },
 
      {
        "qtaLimit": 5000,
        "unit": YEARS,
        "limitExceedOK": false
      }],
    "apis": [
      {
        "exemption": false,
        "apiId": "id-test-api0",
        "startDate": "2007-02-26",
        "endDate": "2097-08-25",
        "rate": {
          "reqLimit": 5000000,
          "timePeriod": 2
        },
        "quotas": [{
           "days": 1,
           "qtaLimit": 4,
           "limitExceedOK": false
        },
        {
          "qtaLimit": 5,
          "unit": DAYS,
          "limitExceedOK": false
        },
        {
          "qtaLimit": 50,
          "unit": WEEKS,
          "limitExceedOK": false
        },
        {
          "qtaLimit": 500,
          "unit": MONTHS,
          "limitExceedOK": false
        },
        {
          "qtaLimit": 5000,
          "unit": YEARS,
          "limitExceedOK": false
        }],
        "methods": [
        {
          "exemption": true,
          "path": "GET_/getPath/*",
          "startDate": "2007-03-25",
          "endDate": "2097-07-25",
          "rate": {
            "reqLimit": 5000000,
            "timePeriod": 2
          },
          "quotas": [{
            "days": 1,
            "qtaLimit": 10,
            "limitExceedOK": true
          },
          {
            "qtaLimit": 5,
            "unit": DAYS,
            "limitExceedOK": false
                  },
          {
            "qtaLimit": 50,
            "unit": WEEKS,
            "limitExceedOK": false
          },
          {
            "qtaLimit": 500,
            "unit": MONTHS,
            "limitExceedOK": false
          },
          {
            "qtaLimit": 5000,
            "unit": YEARS,
            "limitExceedOK": false
          }],
        },
        {
          "exemption": false,  
          "path": "PATCH_/patchPath/*",
          "startDate": "2007-04-25",
          "endDate": "2097-06-25",
          "rate": {
            "reqLimit": 5000000,
            "timePeriod": 2
          },
          "quotas": [{
            "days": 1,
            "qtaLimit": 12,
            "limitExceedOK": false
          }],
          "scopes": [
            {"name":"name1", "value": "value1"},
            {"name":"name2", "value": "value2"}
          ]
        }]
      }]
    }
}

Getting All Plans

To get all plans, issue a GET command to the URL /partner_manager/sla/external, as the following example shows:

GET /partner_manager/sla/external

A successful response returns a status code 200 OK with all plans:

{
  "slaitems": {
    "items": [
      {
        "id": "plan_id0",
        "description": "desc1"
      }
    ],
    "hasMore": false
  }
}

Updating a Plan

To update a plan, issue a PUT command to the following URL, where id is the plan ID:

/partner_manager/sla/external/id

The following example illustrates. A successful response returns the status code 204 No Content.

PUT /partner_manager/sla/external/plan_id0
{
  "slaItem": {
    "id": "plan_id0",
    "name": "plan_name0",
    "state": "inactive",
    "description": "desc1",
    "startDate": "2007-01-25",
    "endDate": "2097-09-25",
    "rate": {
      "reqLimit": 5000000,
      "timePeriod": 2
    },
    "quotas": [{
      "days": 1,
      "qtaLimit": 5,
      "limitExceedOK": false
    },
    {
      "qtaLimit": 5,
      "unit": DAYS,
      "limitExceedOK": false
    },
    {
      "qtaLimit": 50,
      "unit": WEEKS,
      "limitExceedOK": false
    },
    {
      "qtaLimit": 500,
      "unit": MONTHS,
      "limitExceedOK": false
    },
    {
      "qtaLimit": 5000,
      "unit": YEARS,
      "limitExceedOK": false
    }],
    "apis": [{
      "apiId": "id-test-api0",
      "exemption": false,
      "startDate": "2007-02-26",
      "endDate": "2097-08-25",
      "rate": {
        "reqLimit": 5000000,
        "timePeriod": 2
      },
      "quotas":[{
        "days": 1,
        "qtaLimit": 4,
        "limitExceedOK": false
      },
      {
        "qtaLimit": 5,
        "unit": DAYS,
        "limitExceedOK": false
      },
      {
        "qtaLimit": 50,
        "unit": WEEKS,
        "limitExceedOK": false
      },
      {
        "qtaLimit": 500,
        "unit": MONTHS,
        "limitExceedOK": false
      },
      {
        "qtaLimit": 5000,
        "unit": YEARS,
        "limitExceedOK": false
          }],
      "methods": [{
        "path": "GET_/getPath/*",
        "exemption": true,
        "startDate": "2007-03-25",
        "endDate": "2097-07-25",
        "rate": {
          "reqLimit": 5000000,
          "timePeriod": 2
        },
        "quotas":[ {
          "days": 1,
          "qtaLimit": 10,
          "limitExceedOK": true
        },
        {
          "qtaLimit": 5,
          "unit": DAYS,
          "limitExceedOK": false
        },
        {
          "qtaLimit": 50,
          "unit": WEEKS,
          "limitExceedOK": false
        },
        {
          "qtaLimit": 500,
          "unit": MONTHS,
          "limitExceedOK": false
        },
        {
          "qtaLimit": 5000,
          "unit": YEARS,
          "limitExceedOK": false
        }]
      }, 
          {
        "path": "PATCH_/patchPath/*",
        "exemption": false,
        "startDate": "2007-04-25",
        "endDate": "2097-06-25",
        "rate": {
          "reqLimit": 5000000,
          "timePeriod": 2
        },
        "quotas":[ {
          "days": 1,
          "qtaLimit": 12,
          "limitExceedOK": false
        }]
      }]
    }]
  }
}

Deleting a Plan

To delete a plan, issue a DELETE command to the URL /partner_manager/sla/external/id where id is the plan ID. The following example illustrates how to delete a plan:

DELETE /partner_manager/sla/external/plan_id0

A successful outcome returns a status 200 OK along with the deleted plan. See "Getting a Plan" for an example of the returned plan.

Updating a Plan State

Update a plan state by issuing a PUT statement to the URL /partner_manager/sla/external/id/state, where id is the plan ID. The following example illustrates how to update a plan state:

PUT /partner_manager/sla/external/plan_id0/state
{
        "slaItem": {
    "state": "active"
  }
}