An API Plan is the contract proposal presented to consumers who are about to subscribe to
APIs. Plans are offered as tiered offerings with varying availability guarantees, SLAs or cost
structures associated with them. An API package can be associated with multiple plans at a time.
This helps the API providers in providing tiered access to their APIs to allow different service
levels and pricing plans. Though you can edit or delete a plan that has subscribers, it is
recommended to avoid doing so.
Before you begin
You must have the Manage packages and plans functional privilege to perform this task.
About this task
You can create packages and plans, associate a plan with a package, associate APIs with a package, view the list of packages, package details, and APIs and plans associated with the package in the webMethods API Gateway user interface.
Procedure
- Open the menu options and select Manage > Packages.
- Click Create in the Manage packages and plans section.
- Select Plan.
- Click Create.
- Provide the following information in the Basic information section:
- Name. Name of the API plan.
- Version. Version assigned for the API plan.
- Team. Team to which the application must be assigned to. You can select
more than one team. To remove a team, click the delete icon next to the team.
- Description. A brief description for the plan.
- Icon. An icon that is displayed for the plan. Click
Browse and select the required image to be displayed as the icon for the
plan. The icon size should not be more than 100 KB.
You can save the API package at this point and add the plans at a later time. The above
fields are basic fields, provided by webMethods API Gateway. You can add additional information in the
Additional information section.
- Click Additional information to create custom fields for your
plan.
You can use these fields to extend meta data for Packages to store additional
(billing/consumer related) data. For example, you can have a field called plan type. This field can
have values called prepaid and postpaid. You can categorize all the plans as either prepaid or
postpaid plans.
- Click Add field to create a new custom field.
- (Optional) Click Add to add multiple custom fields.
- Provide the following information
- Name. Name of the custom field.
- Field value. Value for the custom field.
- Description. A brief description for the custom field.
- Click Save.
- Click Pricing in the left navigation pane.
- Provide the following information in the Pricing section
- Cost. Specifies the cost for the plan.
- Terms. Specifies the terms of conditions for the pricing.
- License. Specifies the license information.
You can save the plan at this point and provide traffic optimization configurations at a later
time.
- Click Continue to Quality of Service.
- Click + Add Rule.
- Provide the following information in the Create rule section
- Maximum request count. Specifies the maximum number of requests handled.
Value provided should be an integer.
- Interval. Specifies the value for the interval for which the maximum
request count is handled. Value provided should be an integer.
- Interval unit. Specifies the unit of measurement of the time interval.
For example:
- Click Ok.
This creates the rule and displays it in
the Configured rules table. Click + Add rule to add more rules. You can edit
or delete the rules by clicking the edit and the delete icons respectively.
At a later time, when
this plan is applied to an API through a package, the rules that you configured for this plan are
enforced on the applied API.
- Click Quota and provide the following information in the Quota
settings section.
- Maximum request quota. Specifies the maximum number of requests handled.
Value provided should be an integer.
- Block on breach. When selected it specifies that the access to the API is
blocked when there is a rule violation. By default, this option is not selected.
- Interval. Specifies the value for the interval for which the maximum
request quota is handled. Value provided should be an integer.
- Interval unit. Specifies the unit of measurement of the time interval.
For example:
Important: In case of a server crash or restart, the quota status is determined by
the value set in the
pgmen.quotaSurvival.addLostIntervals property and works as follows.
- If the property is set to false, remaining time in quota is retained even after a restart or
crash. For example, If quota is of 60 minutes and 7 minutes was used before the server crash or
restart, then quota remaining time of 53 minutes is retained after server crash or restart, if the
property is set to false.
- If the property is set to true, and if the sum of time between server shutdown and restart and
quota elapsed time does not exceed the interval of the subscription, the quota usage value is
retained. In this case the remaining quota time is calculated as {current interval cycle - (elapsed
time + (start time - shutdown time))}. For example, if the current subscription duration is 1 month
and if the server starts on the 10th day of the cycle and restarts on the 12th day of the cycle, the
remaining quota time is calculated as {30 - (10 + (12-10))} = 18 days.
- If the property is set to true, and if the sum of time between server shutdown and restart and
quota elapsed time exceeds the interval of the subscription, a new interval is created. Quota usage
value is not retained in this case.
- Click Save.
The plan is created and listed in the list
of plans.