全部产品

云剪辑工程管理

本篇文档提供了Python SDK云剪辑工程管理模块相关功能的API调用示例。主要包含创建云剪辑工程、获取单个云剪辑工程、修改云剪辑工程、删除云剪辑工程、搜索云剪辑工程。

初始化客户端

使用前请先初始化客户端,请参见初始化

创建云剪辑工程

调用CreateEditingProject接口,完成创建云剪辑工程的功能。

接口参数和返回字段请参见创建云剪辑工程。调用示例如下:

from alibabacloud_ice20201109.models import CreateEditingProjectRequest

def create_editing_project(client):
    request = CreateEditingProjectRequest()
    request.title = '测试工程名字'
    request.description = '测试工程描述'
    request.timeline = "{\"VideoTracks\":[{\"VideoTrackClips\":[{\"MediaId\":\"****81539d420bb04d8ac4f48f2c****\"},{\"MediaId\":\"****20b48fb04483915d4f2cd8ac****\"}]}]}"
    request.cover_url = 'http://xxxx/coverUrl.jpg'
    response = client.create_editing_project(request)
    print(response)
    print('request id:', response.body.request_id)
    print('project:', response.body.project)

if __name__ == '__main__':
    client = init_ice_client_ak('<your-access-key>', '<your-access-secret>')
    create_editing_project(client)

获取单个云剪辑工程

调用GetEditingProject接口,完成获取单个云剪辑工程的功能。

接口参数和返回字段请参见获取单个云剪辑工程。调用示例如下:

from alibabacloud_ice20201109.models import GetEditingProjectRequest

def get_editing_project(client):
    request = GetEditingProjectRequest()
    request.project_id = '<your-project-id>'
    response = client.get_editing_project(request)
    print(response)
    print('request id:', response.body.request_id)
    print('project:', response.body.project)

if __name__ == '__main__':
    client = init_ice_client_ak('<your-access-key>', '<your-access-secret>')
    get_editing_project(client)

修改云剪辑工程

调用UpdateEditingProject接口,完成修改云剪辑工程的功能。

接口参数和返回字段请参见修改云剪辑工程。调用示例如下:

from alibabacloud_ice20201109.models import UpdateEditingProjectRequest

def update_editing_project(client):
    request = UpdateEditingProjectRequest()
    request.project_id = '<your-project-id>'
    request.timeline = "{\"VideoTracks\":[{\"VideoTrackClips\":[{\"MediaId\":\"****81539d420bb04d8ac4f48f2c****\"},{\"MediaId\":\"****20b48fb04483915d4f2cd8ac****\"}]}]}"
    response = client.update_editing_project(request)
    print(response)
    print('request id:', response.body.request_id)

if __name__ == '__main__':
    client = init_ice_client_ak('<your-access-key>', '<your-access-secret>')
    update_editing_project(client)

删除云剪辑工程

调用DeleteEditingProjects接口,完成删除云剪辑工程的功能。

接口参数和返回字段请参见删除云剪辑工程。调用示例如下:

from alibabacloud_ice20201109.models import DeleteEditingProjectsRequest

def delete_editing_projects(client):
    request = DeleteEditingProjectsRequest()
    request.project_ids = '<your-project-id-1>, <your-project-id-2>'
    response = client.delete_editing_projects(request)
    print(response)
    print('request id:', response.body.request_id)
    print('ignored list:', response.body.ignored_list)

if __name__ == '__main__':
    client = init_ice_client_ak('<your-access-key>', '<your-access-secret>')
    delete_editing_projects(client)
    

搜索云剪辑工程

调用SearchEditingProject接口,完成搜索云剪辑工程的功能。

接口参数和返回字段请参见搜索云剪辑工程。调用示例如下:

from alibabacloud_ice20201109.models import SearchEditingProjectRequest

def search_editing_project(client):
    request = SearchEditingProjectRequest()
    request.max_results = 10
    response = client.search_editing_project(request)
    print(response)
    print('request id:', response.body.request_id)
    print('project list:', response.body.project_list)
    print('next token', response.body.next_token)
    print('max results', response.body.max_results)
    print('total count', response.body.total_count)

if __name__ == '__main__':
    client = init_ice_client_ak('<your-access-key>', '<your-access-secret>')
    search_editing_project(client)