视频边缘智能服务Maven集成。

<dependency>
    <groupId>com.aliyun</groupId>
    <artifactId>aliyun-java-sdk-linkvisual</artifactId>
    <version>1.1.1</version>
</dependency>
		

物联网平台云端SDK集成(获取iotId)

详情请参见物联网平台云端SDK

视频边缘智能服务云端调用demo下载

详情请参见下载demo

初始化SDK

        String accessKeyID = "<your accessKey>";
        String accessKeySecret = "<your accessSecret>";
        String regionId = "cn-shanghai";
        DefaultProfile.addEndpoint(regionId, regionId, "linkvisual", "linkvisual.cn-shanghai.aliyuncs.com");
        IClientProfile profile = DefaultProfile.getProfile(regionId, accessKeyID, accessKeySecret);
        //初始化client
        client = new DefaultAcsClient(profile);
			

依赖公共包

    <dependency>
        <groupId>com.aliyun</groupId>
        <artifactId>aliyun-java-sdk-core</artifactId>
        <version>4.1.1</version>
    </dependency>
			

发起调用

以调用创建时间模板为例。

    //创建时间模板的请求
    CreateTimeTemplateRequest request = new CreateTimeTemplateRequest();
    request.setName(templateName);
    request.setAllDay(allDay);

    //创建时间模板的回复
    try {
        CreateTimeTemplateResponse response = (CreateTimeTemplateResponse) executeTest(request);
        if (null == response) {
            return;
        }
        if (response.getSuccess() == false) {
            System.out.print(response.toString());
            return;
        }
        String timeTemplateId = response.getData();
        System.out.print(timeTemplateId);
    } catch (Exception e) {
        e.printStackTrace();
    }