5.237 Accounting Liens

The resource and services described in this topic are deprecated and may be removed in a future release. Use the comparable resource and services in MAM Web Services instead.

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

Supported methods

Resource GET PUT POST DELETE
/rest/accounting/liens Get All Liens -- -- --
/rest/accounting/liens/<id> Get Single Lien -- -- --

This topic contains these sections:

5.237.1 Getting Liens

The HTTP GET method is used to retrieve Lien information.

Quick reference

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

5.237.1.A Get All Liens

URLs and parameters

GET http://localhost:8080/mws/rest/accounting/liens?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 action as defined MAM user. proxy-user=amy
active No Boolean -- Lists only active or non-active liens. 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 syntax. Besides allowing queries specifying a simple field value (e.g. query={field:value}), you may use comparison operators of the form: query={field:{op:value}} where op may be one of the following:

  • $eq - equal to
  • $gt - greater than
  • $gte - greater than or equal to
  • $lt - less than
  • $lte - less than or equal to
  • $ne - not equal to
query={"allocations.fund":2}
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/liens?api-version=3&proxy-user=amy&filter={"account":"chemistry"}&fields=instance,amount&active=true&pretty=true
------------------------------------

{
  "totalCount": 2,
  "resultCount": 2,
  "results":   [
        {
      "instance": "job.1",
      "amount": 57600
    },
        {
      "instance": "job.2",
      "amount": 40762
    }
  ]
}

5.237.1.B Get Single Lien

URLs and parameters

GET http://localhost:8080/mws/rest/accounting/liens/<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 -- Lists only active or non-active liens. 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/liens/1?api-version=3&proxy-user=amy&pretty=true
------------------------------------

{
  "id": 1,
  "instance": "job.1",
  "usageRecord": 1,
  "startTime": "2013-08-21 16:45:57 UTC",
  "endTime": "2013-08-21 17:45:57 UTC",
  "duration": 3600,
  "description": "",
  "amount": 57600,
  "allocations": [  {
    "id": 2,
    "fund": 2,
    "amount": 57600
  }]
}

Related Topics 

© 2016 Adaptive Computing