Update 'VRAHaulmkilling-API.md'

This commit is contained in:
Mark van der Wal 2021-04-11 14:44:13 +00:00
parent 5168f79d5b
commit 9cebe41857

View File

@ -65,10 +65,10 @@ Response 403 No WRITE permissions in item
Response 404 Item not found
###### Querying predefined haulmkilling agents.
A list of haulmkilling agents can be requested by getting the "vnd.farmmaps.package.vra.haulmkilling" item and reading it's data field 'agents' array content.
A list of haulmkilling agents can be requested by getting the "vnd.farmmaps.itemtype.codelist.fm005" items from farmmaps.
> Request
```javascript
GET /api/v1/items/?it=vnd.farmmaps.package.vra.haulmkilling
GET /api/v1/items/?it=vnd.farmmaps.itemtype.codelist.fm005
```
> Response 201
```javascript
@ -77,72 +77,10 @@ GET /api/v1/items/?it=vnd.farmmaps.package.vra.haulmkilling
// ....
"data":
{
"agents": [
{
"name": "spotlightplus",
"values": {
"ndvi": [
{
"max": 0.95,
"min": 0.3,
"fexp": 1.35,
"fmul": 0.3,
"option": "risk.standard"
},
{
"max": 0.9,
"min": 0.25,
"fexp": 1.39,
"fmul": 0.25,
"option": "risk.low"
},
{
"max": 1,
"min": 0.35,
"fexp": 1.3,
"fmul": 0.36,
"option": "risk.high"
}
],
"wdvi": [
{
"max": 0.95,
"min": 0.3,
"fexp": 2.97,
"fmul": 0.3,
"option": "risk.standard"
},
{
"max": 0.9,
"min": 0.25,
"fexp": 2.97,
"fmul": 0.25,
"option": "risk.low"
},
{
"max": 1,
"min": 0.35,
"fexp": 2.97,
"fmul": 0.36,
"option": "risk.high"
}
]
},
"supportedOptions": [
"risk.standard",
"risk.low",
"risk.high"
]
}
],
"validOptions": [
"risk.standard",
"risk.low",
"risk.high",
"weed",
"split.first",
"split.second"
]
"cl": "vnd.farmmaps.itemtype.codelist.ctgb",
"code": "9326",
"label": "quickdown",
"options": "risk.standard,risk.high"
}
}
```
@ -152,34 +90,8 @@ Response 401 Not authenticated
Response 403 No READ permissions in item
Response 404 Items not found
The data structure contains the haulmkilling **agents** and the **valid options** available in farmmaps.
Each agent contains a list of supported options and a key value map of a list of constants.
The key is a supported inputtype (wdvi, ndvi) and the value is a list of constant objects like so:
```javascript
{
"name": "agentName",
"values": {
"ndvi": [
{
"max": 0.9,
"min": 0.25,
"fexp": 2.97,
"fmul": 0.25,
"option": "risk.low"
},
{
"max": 0.95,
"min": 0.3,
"fexp": 1.35,
"fmul": 0.3,
"option": "risk.standard"
}
],
"wdvi": [{...}]
}
}
```
Each constant value object has an **'option'** associated with it that should also be within the **'validOptions'** list of the data structure.
An item's data property contains a single haulmkilling agent with its crop protection agent code in farmmaps.
To get additional information for a crop protection agent you can query farmmaps for the "vnd.farmmaps.itemtype.codelist.ctgb" itemtype and with a datafilter with the code specified in the haulmkilling agent item's data property as above.
###### Creating an application map with the VRAHaulmkilling task
Execute the task with the item code of the cropfield as parameter inside {code}.
@ -193,8 +105,9 @@ POST /api/v1/items/{code}/tasks
"taskType": "vnd.farmmaps.task.vrahaulmkilling",
"attributes": {
"inputCode": "{itemCode}",
"inputType": "wdvi",
"agentName": "reglone",
"inputType": "wdvi", // wdvi or ndvi only
"agentName": "quickdown", // !deprecated!
"agentCode": "9326" // This is not an item code!!!
"selectedOption": "risk.standard"
}
}
@ -205,9 +118,10 @@ POST /api/v1/items/{code}/tasks
"code": "string", // code of task operation, can be queried for status
"taskType": "vnd.farmmaps.task.vrahaulmkilling",
"attributes": {
"inputCode": "{itemCode}",
"inputType": "wdvi",
"agentName": "reglone",
"inputCode": "{itemCode}",
"inputType": "wdvi", // wdvi or ndvi only
"agentName": "quickdown", // !deprecated!
"agentCode": "9326" // This is not an item code!!!
"selectedOption": "risk.standard"
}
}
@ -218,29 +132,10 @@ Response 401 Not authenticated
Response 403 No WRITE permissions in item
Response 404 Item not found
**'inputCode'** needs to have a value that is gotten from the haulmkilling agent query.
**'agentName'** needs to have a value that is gotten from the haulmkilling agent query.
**'inputType'** needs to have a value that is gotten from the haulmkilling agent query.
**'selectedOption'** needs to have a value that is gotten from the haulmkilling agent query.
The given agent values(agentName, inputType and selectedOption) as specified above form a unique combination specifying correct agent data.
For example, the agent with **'agentName'** needs to have an entry of **'inputType'** with a constant object with the **"option"** key and value **'selectedOption'**.
```javascript
{
"name": "<agentName>",
"values": {
"<inputType>": [
{
"max": 0.9,
"min": 0.25,
"fexp": 2.97,
"fmul": 0.25,
"option": "<selectedOption>"
}
]
}
}
```
**'inputCode'**
**'agentCode'** needs to have a value that is gotten from the haulmkilling agent query. This is not an item code!!!
**'inputType'** "wdvi" or "ndvi"
**'selectedOption'** needs to have a value that is gotten from the haulmkilling agent query.
##### Optional input parameters #####
There are some optional task attribute input parameters for greater flexibility.