Skip to content

img0

Admin API - Rating Plan

Create rating plan (shell)

create_rating.txt

{
    "currency": "USD",
    "id": "engineering",
    "mapRules": {
        "BI": {
            "ruleclassType": "BYTES_IN",
            "rules": [
                {
                    "first": "0",
                    "second": "0"
                }
            ]
        },
        "BO": {
            "ruleclassType": "BYTES_OUT",
            "rules": [
                {
                    "first": "0",
                    "second": "0"
                }
            ]
        },
        "HD": {
            "ruleclassType": "HTTP_DELETE",
            "rules": [
                {
                    "first": "0",
                    "second": "0"
                }
            ]
        },
        "HG": {
            "ruleclassType": "HTTP_GET",
            "rules": [
                {
                    "first": "0",
                    "second": "0"
                }
            ]
        },
        "HP": {
            "ruleclassType": "HTTP_PUT",
            "rules": [
                {
                    "first": "0",
                    "second": "0"
                }
            ]
        },
        "SB": {
            "ruleclassType": "STORAGE_BYTE",
            "rules": [
                {
                    "first": "1",
                    "second": "2"
                },
                {
                    "first": "10",
                    "second": "1.5"
                },
                {
                    "first": "11",
                    "second": "1"
                }
            ]
        }
    },
    "name": "Engineering-RP"
}

Info

The rating plan payload contains a number of areas of note, and all need to be included, but not all need to used
"currency": "USD", (Set the Currency for the rating plan)
"id": "engineering", (Give the rating plan a name)
This is followed by a number of map rules, each with a Key Pair called first: and second:
First: (The set limit),
second: the price within this limit.


Instructions

Use the supplied payload to create a Ratings policy called engineering with the Billing policy for Storage Bytes described in the previous slide.

curl -X PUT -H "Content-Type: application/json" -k -u sysadmin:$auth_pass -d @create_rating.txt https://localhost:19443/ratingPlan

Instructions

Check the rating plan from the CLI using

curl -s -X GET -k -u sysadmin:$auth_pass https://localhost:19443/ratingPlan?ratingPlanId=engineering | python -mjson.tool
or the CMC