你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Sensors - List

返回传感器资源的分页列表。

GET {endpoint}/sensor-partners/{sensorPartnerId}/sensors?api-version=2023-11-01-preview
GET {endpoint}/sensor-partners/{sensorPartnerId}/sensors?sensorDataModelIds={sensorDataModelIds}&sensorMappingIds={sensorMappingIds}&deviceIds={deviceIds}&ids={ids}&names={names}&propertyFilters={propertyFilters}&statuses={statuses}&minCreatedDateTime={minCreatedDateTime}&maxCreatedDateTime={maxCreatedDateTime}&minLastModifiedDateTime={minLastModifiedDateTime}&maxLastModifiedDateTime={maxLastModifiedDateTime}&maxPageSize={maxPageSize}&skipToken={skipToken}&api-version=2023-11-01-preview

URI 参数

名称 必需 类型 说明
endpoint
path True

string

uri

命名空间的主机名,例如 admaInstanceName.farmbeats.azure.net

sensorPartnerId
path True

string

关联的传感器合作伙伴的 ID。

api-version
query True

string

请求的 API 版本

deviceIds
query

string[]

设备的 ID。

ids
query

string[]

资源的 ID。

maxCreatedDateTime
query

string

date-time

资源的最大创建日期 (非独占) 。

maxLastModifiedDateTime
query

string

date-time

资源的上次修改日期上限 (非独占) 。

maxPageSize
query

integer

int32

(非独占) 所需的项目数上限。 最小值 = 10,最大值 = 1000,默认值 = 50。

minCreatedDateTime
query

string

date-time

资源的最小创建日期 (非独占) 。

minLastModifiedDateTime
query

string

date-time

资源的上次修改日期的最小 ((含) )。

names
query

string[]

资源的名称。

propertyFilters
query

string[]

筛选 Properties 对象中的键值对。 例如 “{testKey} eq {testValue}”。

sensorDataModelIds
query

string[]

传感器数据模型的 ID。

sensorMappingIds
query

string[]

传感器映射的 ID。

skipToken
query

string

跳过用于获取下一组结果的令牌。

statuses
query

string[]

资源的状态。

请求头

名称 必需 类型 说明
Authorization True

string

请为授权的 API 调用提供有效的持有者令牌。 请注意,如果之前尝试过未经身份验证的调用,则可能需要清除浏览器缓存。

响应

名称 类型 说明
200 OK

SensorListResponse

Success

Other Status Codes

ErrorResponse

错误

Headers

x-ms-error-code: string

安全性

Authorization

请为授权的 API 调用提供有效的持有者令牌。 请注意,如果之前尝试过未经身份验证的调用,则可能需要清除浏览器缓存。

Type: apiKey
In: header

示例

Sensors_List

Sample Request

GET {endpoint}/sensor-partners/sp1/sensors?api-version=2023-11-01-preview

Sample Response

{
  "value": [
    {
      "sensorDataModelId": "sdm124",
      "integrationId": "string",
      "hardwareId": "SMHD-456",
      "deviceId": "d124",
      "type": "SM",
      "location": {
        "latitude": 23.5,
        "longitude": 42.7
      },
      "port": {
        "name": "measure",
        "type": "digital"
      },
      "sensorPartnerId": "sp1",
      "id": "s124",
      "status": "sm created",
      "createdDateTime": "2022-01-24T06:27:05Z",
      "modifiedDateTime": "2022-01-24T06:27:31Z",
      "eTag": "04019fed-0000-0700-0000-61ee46d30000",
      "name": "my new sm",
      "description": "description for sensor goes here",
      "properties": {
        "key1": "value1",
        "key2": 123.45
      }
    }
  ],
  "skipToken": "skipToken",
  "nextLink": "https://{{resourceName}}.farmbeats.azure.net/sensor-partners/{{sensorPartnerId}}/device-data-models?api-version={{apiVersion}}&skipToken=%5b%7b%22token%22%3a%22%2bRID%3a%7e23TRC%3a10%23ISA%3d%22%2c%22range%22%3a%7b%22min%22%3a%22%22%2c%22max%22%3a%22FF%22%7d%7d%5d"
}

定义

名称 说明
Error

Azure AgPlatform 服务出错。

ErrorResponse

来自 Azure AgPlatform 服务的错误响应。 请参阅 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses ErrorResponse 参考文档。

InnerError

包含错误列表的内部错误。有关 InnerError 参考文档,请参阅 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object

Location

位置模型类。

Port

用于存储端口值的架构。

Sensor

传感器 API 模型。

SensorListResponse

分页响应包含请求的对象列表和用于获取下一组结果的 URL 链接。

Error

Azure AgPlatform 服务出错。

名称 类型 说明
code

string

服务器定义的错误代码集。

details

Error[]

有关导致此报告错误的特定错误的详细信息数组。

innererror

InnerError

包含错误列表的内部错误。有关 InnerError 参考文档,请参阅 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object

message

string

错误的用户可读表示形式。

target

string

错误的目标。

ErrorResponse

来自 Azure AgPlatform 服务的错误响应。 请参阅 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#7102-error-condition-responses ErrorResponse 参考文档。

名称 类型 说明
error

Error

Azure AgPlatform 服务出错。

traceId

string

唯一跟踪 ID。

InnerError

包含错误列表的内部错误。有关 InnerError 参考文档,请参阅 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object

名称 类型 说明
code

string

包含的错误提供的特定错误代码。

innererror

InnerError

包含错误列表的内部错误。有关 InnerError 参考文档,请参阅 https://github.com/Microsoft/api-guidelines/blob/vNext/Guidelines.md#innererror--object

Location

位置模型类。

名称 类型 说明
latitude

number

位置的纬度。

longitude

number

位置的经度。

Port

用于存储端口值的架构。

名称 类型 说明
name

string

端口的名称。

type

string

端口数字/模拟的类型。

Sensor

传感器 API 模型。

名称 类型 说明
createdBy

string

由用户/租户 ID 创建。

createdDateTime

string

创建资源的日期时间,示例格式:yyyy-MM-ddTHH:mm:ssZ。

depthInMeters

number[]

每个传感器度量值的深度(以米为单位)。 像传感器湿度在 2 米, 4 米, 6 米。

description

string

资源的文本说明。

deviceId

string

关联设备的 ID。

eTag

string

实现乐观并发的 ETag 值。

hardwareId

string

关联硬件的 ID。

id

string

资源的 ID。

integrationId

string

设备的集成 ID。

location

Location

位置模型类。

modifiedBy

string

由用户/租户 ID 修改。

modifiedDateTime

string

上次修改资源的日期时间,示例格式:yyyy-MM-ddTHH:mm:ssZ。

name

string

用于标识资源的名称。

port

Port

用于存储端口值的架构。

properties

属于资源的键值对的集合。 每对的键不能超过 50 个字符,并且值不能大于 150 个字符。 注意:最多可以为资源提供 25 个键值对,并且仅支持字符串、数字和 datetime (yyyy-MM-ddTHH:mm:ssZ) 值。

sensorDataModelId

string

关联的传感器数据模型的 ID。

sensorPartnerId

string

关联的传感器合作伙伴的 ID。

status

string

资源的状态。

type

string

传感器的类型。

SensorListResponse

分页响应包含请求的对象列表和用于获取下一组结果的 URL 链接。

名称 类型 说明
nextLink

string

列表中下一页结果的继续链接(绝对 URI)。

skipToken

string

用于检索下一页的令牌。 如果为 null,则没有其他页。

value

Sensor[]

请求的对象列表。