Resources

Prev Next

Resources

/v1/resources/{networkid}

List of Resource Definitions

Example for calling:

http://server/v1/resources?id=1 - retrieves resource definition having id = 1
http://server/v1/resources?resource_setid=2 - retrieves resource definition assigned to the resource set where set id = 2
http://server/v1/resources?network_id=9 - retrieves resource definitions assigned to the network having network id = 9
http://server/v1/resources - retrieves all resource definitions

Allowed Methods:

[GET]
API Controller: resource_def

Description:

Lists all resource definitions for the supplied network_id.

Request Fields:

Name Type Description Notes
id integer Id of the resource definition [Optional] Returns all resource definitions if missing
resource_setid integer Id of the resource set, related to the resource definition [Optional] Returns all resource definitions if missing
network_id integer Id of the network, related to the resource definition [Optional] Returns all resource definitions if missing
owner integer owner of the resource set Relates to "SafranWebApiOwnerVerificationDuringApiCalls" in "Application Settings"
  1. When "SafranWebApiOwnerVerificationDuringApiCalls" is in use, one of the Ids is mandatory.
  2. When "SafranWebApiOwnerVerificationDuringApiCalls" is in use, and using id - all ids must relate to a resource set with the same owner.
  3. Combining the ID's in one call is not supported.

Response Fields:

Name Type Description Notes
id integer Unique resource_def Id
name string Resource code/name
description string Resource description
network_id string Relation to resource set
resource_type integer Resource type (1=qty, 2=cost)
cost_rate float Unit cost rate for resource type=1
parent integer Used for hierarchical structure


Sample JSON Response
[
  {
    "id": 1,
    "name": "res_s01",
    "description": "Resource S 01",
    "resource_set_id": 1,
    "resource_type": 1,
    "parent": 0
    },
  {
    "id": 2,
    "name": "res_s02",
    "description": "Resource S 02",
    "resource_set_id": 1,
    "resource_type": 1,
    "parent": 0
    }
]