Sensor Mappings - Create Or Update
Create a sensor mapping entity.
PATCH {endpoint}/sensor-mappings/{sensorMappingId}?api-version=2023-11-01-preview
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
endpoint
|
path | True |
string uri |
The host name of the namespace, e.g. admaInstanceName.farmbeats.azure.net |
sensor
|
path | True |
string |
Id of the sensor mapping. |
api-version
|
query | True |
string |
The requested API version |
Request Header
Media Types: "application/merge-patch+json"
Name | Required | Type | Description |
---|---|---|---|
Authorization | True |
string |
Please provide a valid bearer token for authorized API calls. Note that you might need to clear your browser cache if you tried un-authenticated calls before. |
Request Body
Media Types: "application/merge-patch+json"
Name | Required | Type | Description |
---|---|---|---|
associatedResource | True |
Schema for storing resource type and resource id. |
|
description |
string |
Textual description of the resource. |
|
name |
string |
Name to identify resource. |
|
partyId |
string |
Id of the associated party. |
|
properties |
|
A collection of key value pairs that belongs to the resource. Each pair must not have a key greater than 50 characters and must not have a value greater than 150 characters. Note: A maximum of 25 key value pairs can be provided for a resource and only string, numeral and datetime (yyyy-MM-ddTHH:mm:ssZ) values are supported. |
|
sensorId |
string |
Id of the associated sensor. |
|
sensorPartnerId |
string |
Id of the associated sensor partner. |
|
status |
string |
Status of the resource. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Success |
|
201 Created |
Created |
|
Other Status Codes |
Error Headers x-ms-error-code: string |
Security
Authorization
Please provide a valid bearer token for authorized API calls. Note that you might need to clear your browser cache if you tried un-authenticated calls before.
Type:
apiKey
In:
header
Examples
SensorMappings_CreateOrUpdate
Sample request
PATCH {endpoint}/sensor-mappings/sm124?api-version=2023-11-01-preview
{
"sensorId": "s124",
"sensorPartnerId": "sp1",
"partyId": "aksaxena-party",
"associatedResource": {
"type": "Field",
"id": "Field123"
},
"status": "sensor map created",
"name": "my new sensor map",
"description": "description for mapping",
"properties": {
"key1": "value1",
"key2": 123.45
}
}
Sample response
{
"sensorId": "s124",
"sensorPartnerId": "sp1",
"partyId": "aksaxena-party",
"associatedResource": {
"type": "Field",
"id": "Field123"
},
"id": "sm124",
"status": "sensor map created",
"createdDateTime": "2022-01-24T06:40:48Z",
"modifiedDateTime": "2022-01-24T06:41:05Z",
"eTag": "0501f236-0000-0700-0000-61ee4a010000",
"name": "my new sensor map",
"description": "description for mapping",
"properties": {
"key1": "value1",
"key2": 123.45
}
}
{
"sensorId": "s124",
"sensorPartnerId": "sp1",
"partyId": "aksaxena-party",
"associatedResource": {
"type": "Field",
"id": "Field123"
},
"id": "sm124",
"status": "sensor map created",
"createdDateTime": "2022-01-24T06:40:48Z",
"modifiedDateTime": "2022-01-24T06:40:48Z",
"eTag": "05018f35-0000-0700-0000-61ee49f00000",
"name": "my new sensor map",
"description": "description for mapping",
"properties": {
"key1": "value1",
"key2": 123.45
}
}
Definitions
Name | Description |
---|---|
Error |
An error from the Azure AgPlatform service. |
Error |
An error response from the Azure AgPlatform service. See https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses for ErrorResponse reference document. |
Farm |
Resource Type. |
Geo |
Schema for storing resource type and resource id. |
Inner |
Inner error containing list of errors.See https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object for InnerError reference document. |
Sensor |
SensorMapping API model. |
Error
An error from the Azure AgPlatform service.
Name | Type | Description |
---|---|---|
code |
string |
Server-defined set of error codes. |
details |
Error[] |
Array of details about specific errors that led to this reported error. |
innererror |
Inner error containing list of errors.See https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object for InnerError reference document. |
|
message |
string |
Human-readable representation of the error. |
target |
string |
Target of the error. |
ErrorResponse
An error response from the Azure AgPlatform service. See https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses for ErrorResponse reference document.
Name | Type | Description |
---|---|---|
error |
An error from the Azure AgPlatform service. |
|
traceId |
string |
Unique trace Id. |
FarmHierarchyGeoResourceType
Resource Type.
Name | Type | Description |
---|---|---|
ApplicationData |
string |
|
Field |
string |
|
HarvestData |
string |
|
PlantTissueAnalysis |
string |
|
PlantingData |
string |
|
Prescription |
string |
|
SeasonalField |
string |
|
TillageData |
string |
|
Zone |
string |
GeoResource
Schema for storing resource type and resource id.
Name | Type | Description |
---|---|---|
id |
string |
Resource Id. |
type |
Resource Type. |
InnerError
Inner error containing list of errors.See https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object for InnerError reference document.
Name | Type | Description |
---|---|---|
code |
string |
Specific error code than was provided by the containing error. |
innererror |
Inner error containing list of errors.See https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object for InnerError reference document. |
SensorMapping
SensorMapping API model.
Name | Type | Description |
---|---|---|
associatedResource |
Schema for storing resource type and resource id. |
|
createdBy |
string |
Created by user/tenant id. |
createdDateTime |
string |
Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ. |
description |
string |
Textual description of the resource. |
eTag |
string |
The ETag value to implement optimistic concurrency. |
id |
string |
Id of the resource. |
modifiedBy |
string |
Modified by user/tenant id. |
modifiedDateTime |
string |
Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ. |
name |
string |
Name to identify resource. |
partyId |
string |
Id of the associated party. |
properties |
|
A collection of key value pairs that belongs to the resource. Each pair must not have a key greater than 50 characters and must not have a value greater than 150 characters. Note: A maximum of 25 key value pairs can be provided for a resource and only string, numeral and datetime (yyyy-MM-ddTHH:mm:ssZ) values are supported. |
sensorId |
string |
Id of the associated sensor. |
sensorPartnerId |
string |
Id of the associated sensor partner. |
status |
string |
Status of the resource. |