Sensor Data Models - Create Or Update
Create a sensor data model entity.
PATCH {endpoint}/sensor-partners/{sensorPartnerId}/sensor-data-models/{sensorDataModelId}?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 data model.  | 
				
| 
						 sensor 
					 | 
					path | True | 
			 string  | 
					
						 Id of the sensor partner.  | 
				
| 
						 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 | 
|---|---|---|---|
| measures | True | 
			 
				
		<string, 
		Sensor  | 
	
		 Map of sensor type to sensor measures.  | 
| description | 
			 string minLength: 0maxLength: 500  | 
	
		 Textual description of the resource.  | 
|
| manufacturer | 
			 string minLength: 0maxLength: 100  | 
	
		 Sensor manufacturer.  | 
|
| name | 
			 string minLength: 0maxLength: 100  | 
	
		 Name to identify resource.  | 
|
| productCode | 
			 string minLength: 0maxLength: 100  | 
	
		 Sensor productCode.  | 
|
| 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.  | 
|
| status | 
			 string minLength: 0maxLength: 100  | 
	
		 Status of the resource.  | 
|
| type | 
			 string minLength: 0maxLength: 100  | 
	
		 Type of sensor.  | 
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
SensorDataModels_CreateOrUpdate   
			Sample request
PATCH {endpoint}/sensor-partners/sp1/sensor-data-models/sdm124?api-version=2023-11-01-preview
{
  "type": "Sensor",
  "manufacturer": "Some sensor manufacturer",
  "productCode": "soil m",
  "measures": {
    "soilMoisture": {
      "description": "measures soil moisture",
      "dataType": "Bool",
      "type": "sm",
      "unit": "none",
      "properties": {
        "abc": "def",
        "elevation": 5
      }
    }
  },
  "status": "new",
  "name": "my sdm for soil moisture",
  "description": "description goes here",
  "properties": {
    "key1": "value1",
    "key2": 123.45
  }
}
Sample response
{
  "type": "Sensor",
  "manufacturer": "Some sensor manufacturer",
  "productCode": "soil m",
  "measures": {
    "soilMoisture": {
      "description": "measures soil moisture",
      "dataType": "Bool",
      "type": "sm",
      "unit": "none",
      "properties": {
        "abc": "def",
        "elevation": 5
      }
    }
  },
  "sensorPartnerId": "sp1",
  "id": "sdm124",
  "status": "new",
  "createdDateTime": "2022-01-24T06:12:15Z",
  "modifiedDateTime": "2022-01-24T06:12:42Z",
  "eTag": "040161a2-0000-0700-0000-61ee435a0000",
  "name": "my sdm for soil moisture",
  "description": "description goes here",
  "properties": {
    "key1": "value1",
    "key2": 123.45
  }
}
						
							{
  "type": "Sensor",
  "manufacturer": "Some sensor manufacturer",
  "productCode": "soil m",
  "measures": {
    "soilMoisture": {
      "description": "measures soil moisture",
      "dataType": "Bool",
      "type": "sm",
      "unit": "none",
      "properties": {
        "abc": "def",
        "elevation": 5
      }
    }
  },
  "sensorPartnerId": "sp1",
  "id": "sdm124",
  "status": "new",
  "createdDateTime": "2022-01-24T06:12:15Z",
  "modifiedDateTime": "2022-01-24T06:12:15Z",
  "eTag": "040158a0-0000-0700-0000-61ee433f0000",
  "name": "my sdm for soil moisture",
  "description": "description goes here",
  "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.  | 
					
| 
							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 | 
						
							 SensorModel API model.  | 
					
| 
							Sensor | 
						
							 Sensor model measure details.  | 
					
| 
							Sensor | 
						
							 Sensor measure data type.  | 
					
Error
An error from the Azure AgPlatform service.
| Name | Type | Description | 
|---|---|---|
| code | 
			 string minLength: 1 | 
	
		 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 minLength: 1 | 
	
		 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.  | 
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.  | 
SensorDataModel  
			
			SensorModel API model.
| Name | Type | Description | 
|---|---|---|
| createdBy | 
			 string  | 
	
		 Created by user/tenant id.  | 
| createdDateTime | 
			 string (date-time)  | 
	
		 Date-time when resource was created, sample format: yyyy-MM-ddTHH:mm:ssZ.  | 
| description | 
			 string minLength: 0maxLength: 500  | 
	
		 Textual description of the resource.  | 
| eTag | 
			 string  | 
	
		 The ETag value to implement optimistic concurrency.  | 
| id | 
			 string  | 
	
		 Id of the resource.  | 
| manufacturer | 
			 string minLength: 0maxLength: 100  | 
	
		 Sensor manufacturer.  | 
| measures | 
			 
				
		<string, 
		Sensor  | 
	
		 Map of sensor type to sensor measures.  | 
| modifiedBy | 
			 string  | 
	
		 Modified by user/tenant id.  | 
| modifiedDateTime | 
			 string (date-time)  | 
	
		 Date-time when resource was last modified, sample format: yyyy-MM-ddTHH:mm:ssZ.  | 
| name | 
			 string minLength: 0maxLength: 100  | 
	
		 Name to identify resource.  | 
| productCode | 
			 string minLength: 0maxLength: 100  | 
	
		 Sensor productCode.  | 
| 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.  | 
| sensorPartnerId | 
			 string  | 
	
		 Id of the associated sensor partner.  | 
| status | 
			 string minLength: 0maxLength: 100  | 
	
		 Status of the resource.  | 
| type | 
			 string minLength: 0maxLength: 100  | 
	
		 Type of sensor.  | 
SensorDataModelMeasure   
			
			Sensor model measure details.
| Name | Type | Description | 
|---|---|---|
| dataType | 
			
	minLength: 2 maxLength: 100  | 
	
		 Sensor measure data type.  | 
| description | 
			 string minLength: 0maxLength: 500  | 
	
		 Description of sensor measure.  | 
| properties | 
			 
  | 
	
		 A collection of key value pairs for sensor data model. 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 model and only string, numeral and datetime (yyyy-MM-ddTHH:mm:ssZ) values are supported.  | 
| type | 
			 string minLength: 0maxLength: 100  | 
	
		 Measurement type of sensor data.  | 
| unit | 
			 string minLength: 0maxLength: 100  | 
	
		 Unit of sensor measure.  | 
SensorDataType  
			
			Sensor measure data type.
| Value | Description | 
|---|---|
| Bool | |
| Double | |
| DateTime | |
| Long | |
| String |