Moab Web Services > Resources > Accounting > Accounting Quotes

Accounting Quotes

This section describes the services available through Moab Web Services for interacting with the Quote 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: Quotes reference contains the type and description of the default fields for the Quotes object.

Supported methods

Resource GET PUT POST DELETE
/rest/accounting/quotes Get All Quotes -- -- --
/rest/accounting/quotes/<id> Get Single Quote -- -- --

This topic contains these sections:

Getting Quotes

The HTTP GET method is used to retrieve Quote information.

Quick reference

GET http://localhost:8080/mws/rest/accounting/quotes?api-version=3
GET http://localhost:8080/mws/rest/accounting/quotes/<id>?api-version=3

Get All Quotes

URLs and parameters

GET http://localhost:8080/mws/rest/accounting/quotes?api-version=3&proxy-user=<user>[&active=true][&filter=<filter_options>[&filter-type=<filter_type>]][&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 actions as defined MAM user. proxy-user=amy
active No Boolean true or false Lists only active or non-active quotes. active=true
filter No JSON -- Query funds based on defined MAM filter. filter={"account":"chemistry"}
filter-type No String -- Query funds based on defined MAM filter type. filter-type=NonExclusive
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={"instance":"job.1"}
fields No String -- Comma-separated list of field names to display. fields=id,instance,amount
sort No JSON -- Sort the results. Use 1 for ascending and -1 for descending. Should be used in conjunction with the fields parameter. sort={"instance":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/quotes?api-version=3&proxy-user=amy&filter={"account":"chemistry"}&fields=usageRecord,amount&active=true&pretty=true
------------------------------------

{
  "totalCount": 1,
  "resultCount": 1,
  "results": [  {
    "usageRecord": 1,
    "amount": 57600
  }]
}

Get Single Quote

URLs and parameters

GET http://localhost:8080/mws/rest/accounting/quotes/<id>?api-version=3&proxy-user=<user>[&active=(true|false)][&fields=<fields_to_display>|&show-all=(true|false)]
Parameter Required Type Valid values Description Example
id Yes String -- The unique identifier of the object. --
proxy-user Yes String -- Perform action as defined MAM user. proxy-user=amy
active No Boolean true or false Lists only active or non-active quotes. active=true
fields No String -- Comma-separated list of field names to display. fields=id,name,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/quotes/1?api-version=3&proxy-user=amy&pretty=true
------------------------------------

{
  "id": 1,
  "amount": 57600,
  "pinned": true,
  "instance": "",
  "usageRecord": 1,
  "startTime": "2013-08-21 16:45:57 UTC",
  "endTime": "2013-08-21 17:57:57 UTC",
  "duration": 3600,
  "description": "",
  "chargeRates": [  {
    "name": "Processors",
    "value": "",
    "amount": "1/s"
  }]
}

Related Topics 

© 2015 Adaptive Computing