Tag操作

更新时间: 2024-08-08 10:20:20

创建Tag

删除Tag

获取Tag

创建Tag

public void testCreatTag() {
        IAcsClient client = IAcsClientUtil.getiAcsClient();
        CreateTagRequest request = new CreateTagRequest();
        try {
            request.setTagName("testtag123567");
            CreateTagResponse httpResponse = client.getAcsResponse(request);
            System.out.println("------testCreatTag------" + JSON.toJSONString(httpResponse));
        } catch (ServerException e) {
            e.printStackTrace();
        } catch (ClientException e) {
            e.printStackTrace();
        }
    }

删除Tag

public void testDeleteTag() {
        IAcsClient client = IAcsClientUtil.getiAcsClient();
        DeleteTagRequest request = new DeleteTagRequest();
        try {
            request.setTagId(24911);
            DeleteTagResponse httpResponse = client.getAcsResponse(request);
            System.out.println("------testDeleteTag------" + JSON.toJSONString(httpResponse));
        } catch (ServerException e) {
            e.printStackTrace();
        } catch (ClientException e) {
            e.printStackTrace();
        }
    }

获取Tag

public void testQueryTagByParam() {
        IAcsClient client = IAcsClientUtil.getiAcsClient();
        QueryTagByParamRequest request = new QueryTagByParamRequest();
        try {
            request.setKeyWord("testtag1235");
            QueryTagByParamResponse httpResponse = client.getAcsResponse(request);
            System.out.println("------testQueryTagByParam------" + JSON.toJSONString(httpResponse));
        } catch (ServerException e) {
            e.printStackTrace();
        } catch (ClientException e) {
            e.printStackTrace();
        }
    }
上一篇: 发送数据信息 下一篇: 视频专区