设备接入 IOTDA-更新指定id的预调配模板信息:请求示例

时间:2024-06-28 09:24:33

请求示例

  • 更新预调配模板

    PUT https://{endpoint}/v5/iot/{project_id}/provisioning-templates/{template_id}
    
    {
      "description" : "myTemplate",
      "template_body" : {
        "parameters" : {
          "iotda::certificate::country" : {
            "type" : "String"
          },
          "iotda::certificate::organization" : {
            "type" : "String"
          },
          "iotda::certificate::organizational_unit" : {
            "type" : "String"
          },
          "iotda::certificate::distinguished_name_qualifier" : {
            "type" : "String"
          },
          "iotda::certificate::state_name" : {
            "type" : "String"
          },
          "iotda::certificate::common_name" : {
            "type" : "String"
          },
          "iotda::certificate::serial_number" : {
            "type" : "String"
          }
        },
        "resources" : {
          "device" : {
            "device_name" : {
              "ref" : "iotda::certificate::organization"
            },
            "node_id" : {
              "ref" : "iotda::certificate::common_name"
            },
            "product_id" : {
              "ref" : "iotda::certificate::organization"
            },
            "tags" : [ {
              "tag_key" : {
                "ref" : "iotda::certificate::organization"
              },
              "tag_value" : {
                "ref" : "iotda::certificate::organizational_unit"
              }
            } ]
          },
          "policy" : {
            "policy_ids" : [ "5c90fa7d3c4e4405e8525079" ]
          }
        }
      }
    }
  • 更新预调配模板-部分参数自定义

    PUT https://{endpoint}/v5/iot/{project_id}/provisioning-templates/{template_id}
    
    {
      "description" : "myTemplate2",
      "template_body" : {
        "parameters" : {
          "iotda::certificate::country" : {
            "type" : "String"
          },
          "iotda::certificate::organization" : {
            "type" : "String"
          },
          "iotda::certificate::organizational_unit" : {
            "type" : "String"
          },
          "iotda::certificate::distinguished_name_qualifier" : {
            "type" : "String"
          },
          "iotda::certificate::state_name" : {
            "type" : "String"
          },
          "iotda::certificate::common_name" : {
            "type" : "String"
          },
          "iotda::certificate::serial_number" : {
            "type" : "String"
          }
        },
        "resources" : {
          "device" : {
            "device_name" : {
              "ref" : "iotda::certificate::organization"
            },
            "node_id" : {
              "ref" : "iotda::certificate::common_name"
            },
            "product_id" : "642bf260f2f9030e44210d8d",
            "tags" : [ {
              "tag_key" : "myTagKey",
              "tag_value" : "myTagValue"
            } ]
          },
          "policy" : {
            "policy_ids" : [ "5c90fa7d3c4e4405e8525079" ]
          }
        }
      }
    }
support.huaweicloud.com/api-iothub/UpdateProvisioningTemplate.html