Get usage rule definition

This GET operation retrieves usage rule definitions associated with a specific planDefinitionId. In order to get a specific usage rule definition, you need to pass the usageRuleDefinitionId after the usageRuleDefinitions endpoint. Otherwise, all usage rule definitions associated with the plan definition are returned. If successful, you receive an HTTP response code of 200 and a JSON response containing the usage rule definition(s).

See HTTP response codes for other response codes.

GET /pcc/spcm/planDefinitions/<planDefinitionId>/usageRuleDefinitions/<usageRuleDefinitionId>


HEADER INFO

tenant: <tenantName>

authorisation: HTTP Basic Auth

accept: application/hal+JSON

permissions: SPCM_PLAN_DEFINITION_READ_PERMISSION

URL parameters

There are two mandatory parameters.

Parameter Type Description

planDefinitionId

integer

A unique identifier for a plan definition which was assigned by the server upon creating the plan definition.

usageRuleDefinitionId

integer

The id of the usage rule definition.


JSON response

The following example shows a JSON response when retrieving a usage rule definition with the id 730 passed as usageRuleDefinitionId in the URL request.

{
    "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

id

integer

The unique identifier for the usage rule. This is assigned by the server upon creation.

mandatory (on update)

name

string

The name of the usage rule.

mandatory

threshold

integer

The threshold (in bytes) at which the rule is violated.

mandatory

summary

string

A summary of the usage rule definition.

maxDeactivationPeriod

string

The maximum period of time that which a subscriber can deactivate a usage rule. Format: Xminute,Xhour,Xday,Xweek,Xmonth

mandatory if updateType is ALL.

updateType

enum

Specifies the update type.

possible values
  • all = rule can be updated

  • none = rule cannot be updated

HTTP response codes

Code Description

200

success!

207

Multistatus response

Check out HTTP statuses for more details.
This is not applicable to all operations.

400

malformed request

401

unauthorised; bad username or password

403

forbidden; user does not have appropriate privileges

404

usage rule definition not found

409

conflict with target resource

This often occurs if the item already exists, such as a plan, group, or name.
This is not applicable to all operations.

412

failed validation; this typically means that a property was not set or a value is out of range.

example
HTTP 412
{
  "errors" : [
        {
          "field" : "name",
          "description" : "name is mandatory"
        }
    ]
}

422

failed processing (after passing validation).

example
HTTP 422
{
    "message": "Subscriber max plan count exceeded",
    "errorCode": 1
}

500

internal error

503

request rejected due to overload