Querying an Edge Device Template

Function

This API is used to query an edge device template.

URI

GET /v2/{project_id}/edgemgr/device_templates/{device_template_id}

Table 1 URI parameters

Parameter

Mandatory

Description

project_id

Yes

Project ID. For details about how to obtain a project ID, see Obtaining a Project ID.

device_template_id

Yes

Device template ID.

Request

None

Response

Table 2 Parameter description

Parameter

Type

Description

device_template

Table 5

Details about the edge device template.

Example response

{
    "device_template": {
        "property_visitors": {},
        "description": "This is a camera template",
        "tags": {},
        "created_at": "2019-11-07T03:20:04.041160+08:00",
        "updated_at": "2019-11-07T03:21:00.347476+08:00",
        "access_protocol": "userdefine",
        "twin": {
            "runstate": {
                "expected": {
                    "value": "running"
                },
                "optional": true,
                "metadata": {
                    "type": "string"
                }
            }
        },
        "attributes": {
            "cameraURL": {
                "optional": true,
                "value": "127.0.0.1",
                "metadata": {
                    "type": "string"
                }
            }
        },
        "project_id": "ed202955e111444e8ced21a1bd75fc59",
        "id": "42e20164-5158-4316-a821-5fe127c483b0",
        "name": "CameraTemplate"
    }
}

Error Codes

For details, see Error Codes.