Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Example REQUEST

GET /usageManagement/usage/1234/fields=date,usageType,usageDescription
Accept: application/json

Example RESPONSE

200

Content-Type: application/json

{
            "id": "1234",
            "href": " http://serverlocation:port/usageManagement/usage/1234",

            "date": "2013-05-31T09:00:00+00:01",
            "type": "VOICE",
            "description": "Description for individual usage content"
}

Example REQUEST B

GET /usageManagementi/usage/?fields=date,usageType,status,ratedProductUsage.taxIncludedRatingAmount& ratedProductUsage.taxIncludedRatingAmount.gt=10
Accept: application/json

Example RESPONSE B

200

Content-Type: application/json

 

{
            "id": "1234",
            "href": " http://serverlocation:port/usageManagement/usage/1234",

            "date": " 2013-04-19T16:42:23-04:00",
            "type": "VOICE",
            "status": "rated",
            "ratedProductUsage": [
                        {
                                    "taxIncludedRatingAmount": "12.00"
                        }
            ]
}


All standard error codes apply.

...

GET usageManagement/usageSpecification/{ID}?{attributeSelector}&{attributeFilter} Example REQUEST

GET usageManagement/usageSpecification/22
Accept: application/json

Example RESPONSE

200

Content-Type: application/json

{
            "id": "234",
            "href": " http://serverlocation:port/usageManagement/usageSpecification/234",
            "name": "CloudCpuSpec",
            "description": "Spec for cloud CPU usage",
            "validFor": {
                        "startDateTime": "2013-04-19T16:42:23-04:00",
                        "endDateTime": "2099-06-19T00:00:00-04:00"
            },
            "usageSpecCharacteristic": [
                        {
                                    "name": "poolNumber",
                                    "description": "the number of the pool",
                                    "configurable": "true",
                                    "usageSpecCharacteristicValue": [
                                                {
                                                            "valueType": "number",
                                                            "default": "false",
                                                            "value": "",
                                                            "valueFrom": "0",
                                                            "valueTo": ""
                                                }
                                    ]
                        }, {
                                    "name": "characteristicType",
                                    "description": "sub-type of the characteristic",
                                    "configurable": "true",
                                    "usageSpecCharacteristicValue": [
                                                {
                                                            "valueType": "string",
                                                            "default": "false",
                                                            "value": "Reserved",
                                                            "valueFrom": "",
                                                            "valueTo": ""
                                                }, {
                                                            "valueType": "string",
                                                            "default": "false",
                                                            "value": "Reserved Gold",
                                                            "valueFrom": "",
                                                            "valueTo": ""
                                                }, {
                                                            "valueType": "string",
                                                            "default": "false",
                                                            "value": "Reserved Silver",
                                                            "valueFrom": "",
                                                            "valueTo": ""
                                                }, {
                                                            "valueType": "string",
                                                            "default": "false",
                                                            "value": "Reserved Bronze",
                                                            "valueFrom": "",
                                                            "valueTo": ""
                                                }, {
                                                            "valueType": "string",
                                                            "default": "false",
                                                            "value": "Burst",
                                                            "valueFrom": "",
                                                            "valueTo": ""
                                                }
                                    ]
                        }, {
                                    "name": "value",
                                    "description": "value of the usage specified by the unit",
                                    "configurable": "true",
                                    "usageSpecCharacteristicValue": [
                                                {
                                                            "valueType": "number",
                                                            "default": "false",
                                                            "value": "",
                                                            "valueFrom": "0",
                                                            "valueTo": ""
                                                }
                                    ]
                        }, {
                                    "name": "unit",
                                    "description": "unit of measure",
                                    "configurable": "true",
                                    "usageSpecCharacteristicValue": [
                                                {
                                                            "valueType": "string",
                                                            "default": "false",
                                                            "value": "GHz",
                                                            "valueFrom": "",
                                                            "valueTo": ""
                                                }, {
                                                            "valueType": "string",
                                                            "default": "false",
                                                            "value": "Number of vCPU",
                                                            "valueFrom": "",
                                                            "valueTo": ""
                                                }
                                    ]
                        }
            ]
}

Example REQUEST B

GET usageManagement/usageSpecification/?name="cloudCpuSpec"
Accept: application/json

Example RESPONSE B

200
Content-Type: application/json

(same as above)

...

Rule name

Rule/Pre Condition/Side Effects/Post Conditions

usageCharacteristic

name and value are mandatory

relatedParty

role and party are mandatory startDateTime is not mandatory but has a default value -> it is set to sysdate by default

ratedProductUsage

When a usage record is created with a status of rated or billed, the following attributes are mandatory:
"ratingDate", "taxIncludedRatingAmount", "taxExcludedRatingAmount, "taxRate", "currencyCode ", "productRef"

ratedProductUsage

When a usage record is created with a status of rated or billed, the following default values apply:
"usageRatingTag": "Usage",
"isBilled": "False",
"ratingAmountType": "Total",
"isTaxExempt": "false",
"offerTariffType": "Normal"

Create a usage

REQUEST

POST usageManagement/usage

Content-type: application/json

 

{          "date": "2013-04-19T16:42:23-04:00",
            "type": "VOICE",
            "description": "Description for individual usage content",
            "status": "rated",
            "usageSpecification": {
                        "id": "22",
                        "href": "http://serverlocation:port/usageManagement/usageSpecification/22",
                        "name": "Voice usage specification"
            },
            "usageCharacteristic": [
                        {
                                    "name": "originatingCountryCode",
                                    "value": "43"
                        }, {
                                    "name": "originatingNumber",
                                    "value": "676123456789"
                        }, {
                                    "name": "destinationCountryCode",
                                    "value": "49"
                        }, {
                                    "name": "destinationNumber",
                                    "value": "170123456789"
                        }, {
                                    "name": "duration",
                                    "value": "20"
                        }, {
                                    "name": "unit",
                                    "value": "SEC"
                        }, {
                                    "name": "startDateTime",
                                    "value": "2013-04-19T16:42:23-04:00"
                        }, {
                                    "name": "endDateTime",
                                    "value": "2013-04-19T16:42:23-04:00"
                        }
            ],
            "relatedParty": [
                        {
                                    "role": "serviceProvider",
                                    "id": "1",
                                    "href": "http://serverlocation:port/partyManagement/organization/1"
                        }, {
                                    "role": "customer",
                                    "id": "45",
                                    "ref": "http://serverlocation:port/partyManagement/individual/45"
                        }
            ],
            "ratedProductUsage ": [
                        {
                                    "ratingDate": "2013-04-19T16:42:23-04:00",
                                    "usageRatingTag": "Usage",
                                    "ratingAmountType": "Total",
                                    "taxIncludedRatingAmount": "12.00",
                                    "taxExcludedRatingAmount": "10.00",
                                    "taxRate": "20",
                                    "isTaxExempt": "false",
                                    "offerTariffType": "Normal",
                                    "bucketValueConvertedInAmount": "",
                                    "currencyCode": "EUR"
                        }
            ]
}

RESPONSE

201
Content-Type: application/json

WHOLE RECORD with ID, href

...

Rule name

Rule/Pre Condition/Side Effects/Post Conditions

usageSpecCharacteristic

name and usageSpecCharacteristicValue are mandatory

usageSpecCharacteristicValue

valueType is mandatory

[

Example REQUEST

POST usageManagement/usageSpecification/

Accept: application/json

 

{{
            "id": "22",
            "href": "http://serverlocation:port/usageManagement/usageSpecification/22",
            "name": "VoiceSpec",
            "description": "Spec for voice calls usage",
            "validFor": {
                        "startDateTime": "2013-04-19T16:42:23-04:00",
                        "endDateTime": "2099-06-19T00:00:00-04:00"
            },
            "usageSpecCharacteristic": [
                        {
                                    "name": "originatingCountryCode",
                                    "description": "country code of the caller",
                                    "configurable": "true",
                                    "usageSpecCharacteristicValue": [
                                                {
                                                            "valueType": "number",
                                                            "default": "false",
                                                            "value": "",
                                                            "valueFrom": "",
                                                            "valueTo": ""
                                                }
                                    ]
                        }, {
                                    "name": "originatingNumber",
                                    "description": "phone number of the caller",
                                    "configurable": "true",
                                    "usageSpecCharacteristicValue": [
                                                {
                                                            "valueType": "string",
                                                            "default": "false",
                                                            "value": "",
                                                            "valueFrom": "",
                                                            "valueTo": ""
                                                }
                                    ]
                        }, {
                                    "name": "destinationCountryCode",
                                    "description": "country code of the called party",
                                    "configurable": "true",
                                    "usageSpecCharacteristicValue": [
                                                {
                                                            "valueType": "number",
                                                            "default": "false",
                                                            "value": "",
                                                            "valueFrom": "",
                                                            "valueTo": ""
                                                }
                                    ]
                        }, {
                                    "name": "destinationNumber",
                                    "description": "phone number of the called party",
                                    "configurable": "true",
                                    "usageSpecCharacteristicValue": [
                                                {
                                                            "valueType": "string",
                                                            "default": "false",
                                                            "value": "",
                                                            "valueFrom": "",
                                                            "valueTo": ""
                                                }
                                    ]
                        }, {
                                    "name": "duration",
                                    "description": "duration of the call",
                                    "configurable": "true",
                                    "usageSpecCharacteristicValue": [
                                                {
                                                            "valueType": "number",
                                                            "default": "false",
                                                            "value": "",
                                                            "valueFrom": "0",
                                                            "valueTo": ""
                                                }
                                    ]
                        }, {
                                    "name": "unit",
                                    "description": "unit of the duration",
                                    "configurable": "true",
                                    "usageSpecCharacteristicValue": [
                                                {
                                                            "valueType": "number",
                                                            "default": "false",
                                                            "value": "SEC",
                                                            "valueFrom": "",
                                                            "valueTo": ""
                                                }
                                    ]
                        }, {
                                    "name": "startDateTime",
                                    "description": "startdate and starttime of the call",
                                    "configurable": "true",
                                    "usageSpecCharacteristicValue": [
                                                {
                                                            "valueType": "dateTime",
                                                            "default": "false",
                                                            "value": "",
                                                            "valueFrom": "",
                                                            "valueTo": ""
                                                }
                                    ]
                        }, {
                                    "name": "endDateTime",
                                    "description": "enddate and endtime of the call",
                                    "configurable": "true",
                                    "usageSpecCharacteristicValue":

[
                                                {
                                                            "valueType": "dateTime",
                                                            "default": "false",
                                                            "value": "",
                                                            "valueFrom": "",
                                                            "valueTo": ""
                                                }
                                    ]
                        }
            ]
}

Example RESPONSE

201
Content-Type: application/json

(whole record, including ID,href)

...

REQUEST A – "rate" a single usage record

PATCH usageManagement/usage/1234/

Content-type: application/json

 

{
            "status": "rated",
            "ratedProductUsage": [
                        {
                                    "ratingDate": "2013-04-19T16:42:23-04:00",
                                    "taxIncludedRatingAmount": 22.00,
                                    "taxExcludedRatingAmount": 20.00,
                                    "taxRate": 10,
                                    "currencyCode": "CAD"
                        }
            ]
}

RESPONSE

201
Content-Type: application/json

WHOLE RECORD including ID

...

REQUEST

POST ../usageManagement/importJob
Content-type: application/json

{
"url": "ftp://ftp.myUsage.com/usage/54"
}

RESPONSE

201

Content-Type: application/json

Location: ../usageManagement/importJob/54

 

 

{
        "id": "54",
        "href": "http:/api/usageManagement/importJob/54",
        "status": "running",
        "path": "usageManagement/",
        "content-type": "application/json",
        "errorLog": "",
        "creationDate": "2013-04-19T16:42:23-04:00",

        "url": "ftp://ftp.myUsage.com/usage/54"

            }   

 

Anchor
_Toc404174512
_Toc404174512
Anchor
_Toc405208290
_Toc405208290
POST usageManagement/exportJob

...

/54

REQUEST

POST ../usageManagement/exportJob
Content-type: application/json

{
}

RESPONSE

201

Content-Type: application/json

Location: ../usageManagement/exportJob

/54

 

 

{
        "id": "54",
        "href": "http:/api/usageManagement/exportJob/54",
        "status": "running",
        "path": "usageManagement/",
        "content-type": "application/json",
        "errorLog": "",
        "creationDate": "2013-04-19T16:42:23-04:00",
        "completionDate": "2013-04-21T16:42:23-04:00",
        "url": "ftp://ftp.myUsage.com/usage/54"
    }   

 

Anchor
_Toc404174513
_Toc404174513
Anchor
_Toc405208291
_Toc405208291
GET usageManagement/exportJob

...

REQUEST

GET ../usageManagement/exportJob/54
Content-type: application/json

{
}

RESPONSE

200

Content-Type: application/json

 

{
        "id": "54",
        "href": "http:/api/usageManagement/exportJob/54",
        "status": "running",
        "path": "usageManagement/",
        "content-type": "application/json",
        "errorLog": "",
        "creationDate": "2013-04-19T16:42:23-04:00",
        "completionDate": "2013-04-21T16:42:23-04:00",
        "url": "ftp://ftp.myUsage.com/usage/54"
    }   

 

Anchor
_Toc404174514
_Toc404174514
Anchor
_Toc405208292
_Toc405208292
GET usageManagement/IMPORTJob

...

REQUEST

GET ../usageManagement/importJob/54
Content-type: application/json

{
}

RESPONSE

200

Content-Type: application/json

 

{
        "id": "54",
        "href": "http:/api/usageManagement/importJob/54",
        "status": "running",
        "path": "usageManagement/",
        "content-type": "application/json",
        "errorLog": "",
        "creationDate": "2013-04-19T16:42:23-04:00",
        "completionDate": "2013-04-21T16:42:23-04:00",
        "url": "ftp://ftp.myUsage.com/usage/54"
    }   

 

© TM Forum 2015. All Rights Reserved.