Create a usage rule definition
This POST
operation adds a usage rule definition to an existing plan definition by using the usageRuleDefinitions
endpoint as well as a JSON
payload creating the usage rule. If successful, you receive an HTTP response code of 201
and a JSON
response containing the new usage rule definition information.
See HTTP response codes for other response codes. |
POST /pcc/spcm/planDefinitions/<planDefinitionId>/usageRuleDefinitions + JSON payload
HEADER INFO
tenant: <tenantName>
authorisation: HTTP Basic Auth
content-type: application/hal+JSON
accept: application/hal+JSON
permissions: SPCM_PLAN_DEFINITION_CREATE_PERMISSION
URL parameters
There are is one mandatory parameter.
Parameter | Type | Description |
---|---|---|
|
integer |
A unique identifier for a plan definition which was assigned by the server upon creating the plan definition. |
JSON payload
{
"name": "fairUsageRule",
"summary": null,
"threshold": 100,
"maxDeactivationPeriod": null,
"updateType": "NONE"
}
JSON response
The following example shows a JSON
response when creating a new usage rule definition with the name fairUsageRule
. Note the id
of 730
which is auto-assigned.
{
"id": 730,
"name": "fairUsageRule",
"summary": null,
"threshold": 100,
"maxDeactivationPeriod": null,
"updateType": "NONE",
"_links": {
"pccProfiles": {
"href": "http://localhost:8080/spcm-rest-ws/pcc/spcm/planDefinitions/167/usageRuleDefinitions/730/pccProfiles"
},
"usageCounterDefinitions": {
"href": "http://localhost:8080/spcm-rest-ws/pcc/spcm/planDefinitions/167/usageRuleDefinitions/730/usageCounterDefinition"
},
"self": {
"href": "http://localhost:8080/spcm-rest-ws/pcc/spcm/planDefinitions/
167/usageRuleDefinitions/730"
}
}
}
Usage rule definition type descriptions
Field | Type | Description | ||
---|---|---|---|---|
|
integer |
The unique identifier for the usage rule. This is assigned by the server upon creation.
|
||
|
string |
The name of the usage rule.
|
||
|
integer |
The threshold (in bytes) at which the rule is violated.
|
||
|
string |
A summary of the usage rule definition. |
||
|
string |
The maximum period of time that which a subscriber can deactivate a usage rule. Format:
|
||
|
enum |
Specifies the update type. possible values
|
HTTP response codes
Code | Description | ||||
---|---|---|---|---|---|
|
success!
|
||||
|
Multistatus response
|
||||
|
malformed request |
||||
|
unauthorised; bad username or password |
||||
|
forbidden; user does not have appropriate privileges |
||||
|
usage rule definition not found |
||||
|
conflict with target resource
|
||||
|
failed validation; this typically means that a property was not set or a value is out of range. example
|
||||
|
failed processing (after passing validation). example
|
||||
|
internal error example
|
||||
|
request rejected due to overload |