(Click to open topic with navigation)
This section describes the services available through Moab Web Services for interacting with the ChargeRate object in Moab Accounting Manager. It contains the URLs, request bodies, and responses delivered to and from MWS as an intermediary for MAM.
The Fields: Charge Rates reference contains the type and description of the default fields for the ChargeRates object.
Resource | GET | PUT | POST | DELETE |
---|---|---|---|---|
/rest/accounting/charge-rates | Get All Charge Rates | -- | -- | -- |
/rest/accounting/charge-rates/<name>/<value> | Get Single Charge Rate | -- | -- | -- |
/rest/accounting/charge-rates/<name> | Get Single Charge Rate | -- | -- | -- |
This topic contains these sections:
The HTTP GET method is used to retrieve ChargeRate information.
Quick reference
GET http://localhost:8080/mws/rest/accounting/charge-rates?api-version=3 GET http://localhost:8080/mws/rest/accounting/charge-rates?api-version=3/<name>[/<value>]
URLs and parameters
GET http://localhost:8080/mws/rest/accounting/charge-rates?api-version=3&proxy-user=<user>[&query=<query_conditions>][&fields=<fields_to_display>[&sort=<fields_to_sort>]|&show-all=(true|false)]
Parameter | Required | Type | Valid values | Description | Example |
---|---|---|---|---|---|
proxy-user | Yes | String | -- | Perform action as defined MAM user. | proxy-user=amy |
query | No | JSON | -- |
Results are restricted to those having the specified field values. The query parameter does not support the full Mongo query syntax. Only querying for a simple, non-nested JSON object is allowed. |
query={"name":"QualityOfService"} |
fields | No | String | -- | Comma-separated list of field names to display. | fields=id,organization |
sort | No | JSON | -- | Sort the results. Use 1 for ascending and -1 for descending. Should be used in conjunction with the fields parameter. | sort={"organization":1} |
show-all | No | Boolean | true or false | true shows all fields including metadata and hidden fields. Default is false. | show-all=true |
See Global URL Parameters for available URL parameters.
Sample response
GET http://localhost:8080/mws/rest/accounting/charge-rates?api-version=3&proxy-user=moab&pretty=true
------------------------------------
{
"totalCount": 4,
"resultCount": 4,
"results": [
{
"name": "Processors",
"value": "",
"amount": "1/s",
"description": "1 credit per processor-second"
},
{
"name": "QualityOfService",
"value": "high",
"amount": "*2",
"description": "Charge double for high QOS"
},
{
"name": "QualityOfService",
"value": "low",
"amount": "*.5",
"description": "Charge half for low QOS"
},
{
"name": "QualityOfService",
"value": "",
"amount": "*1",
"description": "No extra charge for \"normal\" QOSes"
}
]
}
A regular charge rate is uniquely specified by both its name and its value. A default charge rate has a null value and is uniquely specified by only its name.
URLs and parameters
GET http://localhost:8080/mws/rest/accounting/charge-rates?api-version=3/<name>[/<value>]?proxy-user=<user>[&fields=<fields_to_display>|&show-all=(true|false)]
Parameter | Required | Type | Valid values | Description | Example |
---|---|---|---|---|---|
name | Yes | String | -- | The name of the charge rate. | -- |
value | No | String | -- | The value of the charge rate. | -- |
fields | No | String | -- | Comma-separated list of field names to display. | fields=name,value,amount |
show-all | No | Boolean | true or false | true shows all fields including metadata and hidden fields. Default is false. | show-all=true |
See Global URL Parameters for available URL parameters.
Sample response
GET http://localhost:8080/mws/rest/accounting/charge-rates/QualityOfService/high?api-version=3&proxy-user=moab&pretty=true
------------------------------------
{
"name": "QualityOfService",
"value": "high",
"amount": "*2",
"description": "Charge double for high QOS"
}
Related Topics