Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Push a Device Addition Notification

Updated on 2025-03-03 GMT+08:00

Function

After the application calls the API for creating a rule triggering condition (resource is set to device and event to create), the API for creating a rule action, and the API for modifying a rule triggering condition, and activates a rule, the platform pushes the result to the server specified by the rule when the device is added.

URI

POST /HTTP URL determined when the application creates the device addition notification rule. The AMQP channel does not require the URL.

Request Parameters

Table 1 Request body parameters

Parameter

Mandatory

Type

Description

resource

Yes

String

Parameter description: subscribed resource name. Set this parameter to device.

event

Yes

String

Parameter description: subscribed resource event. Set this parameter to create.

event_time

Yes

String

Parameter description: UTC time when the resource event was generated. The value is in the format of yyyyMMdd'T'HHmmss'Z', for example, 20151212T121212Z. If necessary, convert the time to display in the local time zone format.

event_time_ms

No

String

Parameter description: UTC time when a resource event was generated. The value in the format of yyyy-MM-dd'T'HH:mm:ss.SSS'Z', for example, 2015-12-12T12:12:12.000Z. If necessary, convert the time to display in the local time zone format.

request_id

No

String

Parameter description: message ID, which is specified by the device or generated by the platform, and is used to trace the service process.

notify_data

Yes

DeviceCreateOrUpdateNotifyData object

Parameter description: message to push.

Table 2 DeviceCreateOrUpdateNotifyData

Parameter

Mandatory

Type

Description

body

Yes

QueryDeviceBase object

Parameter description: message content.

Table 3 QueryDeviceBase

Parameter

Mandatory

Type

Description

app_id

No

String

Parameter description: resource space ID.

Maximum: 36

app_name

No

String

Parameter description: resource space name.

device_id

No

String

Parameter description: device ID, which uniquely identifies a device. The value of this parameter is specified during device registration or allocated by the platform. If the value is allocated by the platform, the value is in the format of [product_id]_[node_id].

Maximum: 256

node_id

No

String

Parameter description: device node ID. This parameter is set to the IMEI, MAC address, or serial number.

Maximum: 64

gateway_id

No

String

Parameter description: gateway ID, which is the device ID of the parent device. The gateway ID is the same as the device ID if the device is a directly connected device. If the device is an indirectly connected device, the gateway ID is the device ID of the directly connected device with which it associates.

Maximum: 256

device_name

No

String

Parameter description: device name.

Maximum: 256

node_type

No

String

Parameter description: device node type.

  • ENDPOINT: indirectly connected device

  • GATEWAY: directly connected device or gateway

  • UNKNOWN: unknown node type

description

No

String

Parameter description: device description.

Maximum: 2048

fw_version

No

String

Parameter description: firmware version of the device.

Maximum: 256

sw_version

No

String

Parameter description: software version of the device.

Maximum: 256

device_sdk_version

No

String

Parameter description: SDK version of the device.

Maximum: 256

auth_info

No

AuthInfo object

Parameter description: access authentication information about the device.

product_id

No

String

Parameter description: unique ID of the product associated with the device.

product_name

No

String

Parameter description: name of the product associated with the device.

status

No

String

Parameter description: device status.

  • ONLINE: The device is online.

  • OFFLINE: The device is offline.

  • ABNORMAL: The device is abnormal.

  • INACTIVE: The device is not activated.

  • FREEZED: The device is frozen.

create_time

No

String

Parameter description: time when a device was registered on the platform. The value is in the format of yyyyMMdd'T'HHmmss'Z', for example, 20151212T121212Z.

tags

No

Array of TagV5DTO objects

Parameter description: list of device tags.

extension_info

No

Object

Parameter description: extended information, which can be customized. If this parameter is specified for a child device during device creation, the platform will notify the gateway of the extended information through the MQTT API used for notifying a gateway of new child device connection.

Table 4 AuthInfo

Parameter

Mandatory

Type

Description

auth_type

No

String

Parameter description: authentication type. Secret authentication (SECRET) and certificate authentication (CERTIFICATES) are supported. If secret authentication is used, fill in secret. If certificate authentication is used, fill in fingerprint. If auth_type is not set, secret authentication is used by default.

secure_access

No

Boolean

Parameter description: whether the device is connected to the platform using a secure protocol. The default value is true.

  • true: The device is connected to the platform using a secure protocol.

  • false: The device is connected to the platform using an insecure protocol.

Default: true

timeout

No

Integer

Parameter description: validity period of the device verification code, in seconds. The default value is 0. If the device has not been connected to the platform within the validity period, the platform deletes the registration information of the device. If this parameter is set to 0 (recommended), the verification code is always valid. Note: This parameter is returned only when timeout is modified in the device registration or modification API.

Minimum: 0

Maximum: 2147483647

Default: 0

Table 5 TagV5DTO

Parameter

Mandatory

Type

Description

tag_key

Yes

String

Parameter description: tag key, which is unique for a resource. If the specified key already exists, the value of the existing tag is overwritten. If the specified key does not exist, a new tag is added.

tag_value

No

String

Parameter description: tag value.

Response Parameters

None

Example Requests

Example of a device addition notification.

Device addition notification.

{
  "resource" : "device",
  "event" : "create",
  "event_time" : "20151212T121212Z",
  "event_time_ms" : "2015-12-12T12:12:12.000Z",
  "request_id" : "3fe58d5e-8697-4849-a165-7db128f7e776",
  "notify_data" : {
    "body" : {
      "device_sdk_version" : "C_v0.5.0",
      "device_id" : "d4922d8a-6c8e-4396-852c-164aefa6638f",
      "create_time" : "20190303T081011Z",
      "description" : "watermeter device",
      "auth_info" : {
        "auth_type" : "SECRET",
        "secure_access" : true,
        "timeout" : 300
      },
      "product_name" : "Thermometer",
      "gateway_id" : "d4922d8a-6c8e-4396-852c-164aefa6638f",
      "sw_version" : "1.1.0",
      "tags" : [ {
        "tag_value" : "testTagValue",
        "tag_key" : "testTagName"
      } ],
      "extension_info" : {
        "aaa" : "xxx",
        "bbb" : 0
      },
      "app_name" : "testAPP01",
      "device_name" : "dianadevice",
      "node_type" : "ENDPOINT",
      "product_id" : "b640f4c203b7910fc3cbd446ed437cbd",
      "app_id" : "jeQDJQZltU8iKgFFoW060F5SGZka",
      "fw_version" : "1.1.0",
      "node_id" : "ABC123456789",
      "status" : "INACTIVE"
    }
  }
}

Example Responses

None

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback