다음을 통해 공유


Sensor Data Models - Create Or Update

센서 데이터 모델 엔터티를 만듭니다.

PATCH {endpoint}/sensor-partners/{sensorPartnerId}/sensor-data-models/{sensorDataModelId}?api-version=2023-11-01-preview

URI 매개 변수

Name In(다음 안에) 필수 형식 Description
endpoint
path True

string (uri)

네임스페이스의 호스트 이름(예: admaInstanceName.farmbeats.azure.net

sensorDataModelId
path True

string

센서 데이터 모델의 ID입니다.

sensorPartnerId
path True

string

센서 파트너의 ID입니다.

api-version
query True

string

요청된 API 버전

요청 헤더

Media Types: "application/merge-patch+json"

Name 필수 형식 Description
Authorization True

string

권한 있는 API 호출에 유효한 전달자 토큰을 제공하세요. 이전에 인증되지 않은 호출을 시도한 경우 브라우저 캐시를 지워야 할 수 있습니다.

요청 본문

Media Types: "application/merge-patch+json"

Name 필수 형식 Description
measures True

<string,  SensorDataModelMeasure>

센서 형식을 센서 측정값에 매핑합니다.

description

string

minLength: 0
maxLength: 500

리소스에 대한 텍스트 설명입니다.

manufacturer

string

minLength: 0
maxLength: 100

센서 제조업체.

name

string

minLength: 0
maxLength: 100

리소스를 식별하는 이름입니다.

productCode

string

minLength: 0
maxLength: 100

센서 productCode.

properties

리소스에 속하는 키 값 쌍의 컬렉션입니다. 각 쌍에는 50자보다 큰 키가 없어야 하며 150자보다 큰 값은 없어야 합니다. 참고: 리소스에 대해 최대 25개의 키 값 쌍을 제공할 수 있으며 문자열, 숫자 및 datetime(yyyy-MM-ddTHH:mm:ssZ) 값만 지원됩니다.

status

string

minLength: 0
maxLength: 100

리소스의 상태입니다.

type

string

minLength: 0
maxLength: 100

센서의 유형입니다.

응답

Name 형식 Description
200 OK

SensorDataModel

성공

201 Created

SensorDataModel

생성됨

Other Status Codes

ErrorResponse

오류

헤더

x-ms-error-code: string

보안

Authorization

권한 있는 API 호출에 유효한 전달자 토큰을 제공하세요. 이전에 인증되지 않은 호출을 시도한 경우 브라우저 캐시를 지워야 할 수 있습니다.

형식: apiKey
In(다음 안에): header

예제

SensorDataModels_CreateOrUpdate

샘플 요청

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
  }
}

샘플 응답

{
  "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
  }
}

정의

Name Description
Error

Azure AgPlatform 서비스의 오류입니다.

ErrorResponse

Azure AgPlatform 서비스의 오류 응답입니다. ErrorResponse 참조 문서는 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses 참조하세요.

InnerError

오류 목록을 포함하는 내부 오류입니다. InnerError 참조 문서에 대한 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object 참조하세요.

SensorDataModel

SensorModel API 모델.

SensorDataModelMeasure

센서 모델 측정 세부 정보입니다.

SensorDataType

센서 측정 데이터 형식입니다.

Error

Azure AgPlatform 서비스의 오류입니다.

Name 형식 Description
code

string

minLength: 1

서버에서 정의한 오류 코드 집합입니다.

details

Error[]

이 보고된 오류로 이어진 특정 오류에 대한 세부 정보 배열입니다.

innererror

InnerError

오류 목록을 포함하는 내부 오류입니다. InnerError 참조 문서에 대한 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object 참조하세요.

message

string

minLength: 1

사람이 읽을 수 있는 오류 표현입니다.

target

string

오류의 대상입니다.

ErrorResponse

Azure AgPlatform 서비스의 오류 응답입니다. ErrorResponse 참조 문서는 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses 참조하세요.

Name 형식 Description
error

Error

Azure AgPlatform 서비스의 오류입니다.

traceId

string

고유 추적 ID입니다.

InnerError

오류 목록을 포함하는 내부 오류입니다. InnerError 참조 문서에 대한 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object 참조하세요.

Name 형식 Description
code

string

포함된 오류에서 제공한 것보다 구체적인 오류 코드입니다.

innererror

InnerError

오류 목록을 포함하는 내부 오류입니다. InnerError 참조 문서에 대한 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object 참조하세요.

SensorDataModel

SensorModel API 모델.

Name 형식 Description
createdBy

string

사용자/테넌트 ID로 생성됩니다.

createdDateTime

string (date-time)

리소스를 만든 날짜-시간 샘플 형식: yyyy-MM-ddTHH:mm:ssZ.

description

string

minLength: 0
maxLength: 500

리소스에 대한 텍스트 설명입니다.

eTag

string

낙관적 동시성을 구현하는 ETag 값입니다.

id

string

리소스의 ID입니다.

manufacturer

string

minLength: 0
maxLength: 100

센서 제조업체.

measures

<string,  SensorDataModelMeasure>

센서 형식을 센서 측정값에 매핑합니다.

modifiedBy

string

사용자/테넌트 ID로 수정되었습니다.

modifiedDateTime

string (date-time)

리소스가 마지막으로 수정된 날짜-시간, 샘플 형식: yyyy-MM-ddTHH:mm:ssZ.

name

string

minLength: 0
maxLength: 100

리소스를 식별하는 이름입니다.

productCode

string

minLength: 0
maxLength: 100

센서 productCode.

properties

리소스에 속하는 키 값 쌍의 컬렉션입니다. 각 쌍에는 50자보다 큰 키가 없어야 하며 150자보다 큰 값은 없어야 합니다. 참고: 리소스에 대해 최대 25개의 키 값 쌍을 제공할 수 있으며 문자열, 숫자 및 datetime(yyyy-MM-ddTHH:mm:ssZ) 값만 지원됩니다.

sensorPartnerId

string

연결된 센서 파트너의 ID입니다.

status

string

minLength: 0
maxLength: 100

리소스의 상태입니다.

type

string

minLength: 0
maxLength: 100

센서의 유형입니다.

SensorDataModelMeasure

센서 모델 측정 세부 정보입니다.

Name 형식 Description
dataType

SensorDataType

minLength: 2
maxLength: 100

센서 측정 데이터 형식입니다.

description

string

minLength: 0
maxLength: 500

센서 측정값에 대한 설명입니다.

properties

센서 데이터 모델에 대한 키 값 쌍의 컬렉션입니다. 각 쌍에는 50자보다 큰 키가 없어야 하며 150자보다 큰 값은 없어야 합니다. 참고: 모델에 대해 최대 25개의 키 값 쌍을 제공할 수 있으며 문자열, 숫자 및 datetime(yyyy-MM-ddTHH:mm:ssZ) 값만 지원됩니다.

type

string

minLength: 0
maxLength: 100

센서 데이터의 측정 유형입니다.

unit

string

minLength: 0
maxLength: 100

센서 측정 단위입니다.

SensorDataType

센서 측정 데이터 형식입니다.

Description
Bool
DateTime
Double
Long
String