Resources
  • 01 Oct 2024
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Resources

  • Dark
    Light
  • PDF

Article summary

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:

NameTypeDescriptionNotes
idintegerId of the resource definition[Optional] Returns all resource definitions if missing
resource_setidintegerId of the resource set, related to the resource definition[Optional] Returns all resource definitions if missing
network_idintegerId of the network, related to the resource definition[Optional] Returns all resource definitions if missing
ownerintegerowner of the resource setRelates 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:

NameTypeDescriptionNotes
idintegerUnique resource_def Id
namestringResource code/name
descriptionstringResource description
network_idstringRelation to resource set
resource_typeintegerResource type (1=qty, 2=cost)
cost_ratefloatUnit cost rate for resource type=1
parentintegerUsed 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
    }
]


Was this article helpful?

ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence