超分辨率模板接口

最近更新时间:2023-05-17 10:47:59

我的收藏

简介

本文档提供关于超分辨率模板接口的 API 概览和 SDK 示例代码。
API
操作描述
用于新增超分辨率模板。
用于更新超分辨率模板。

新增超分辨率模板

功能说明

用于新增超分辨率模板。

方法原型

public Guzzle\\Service\\Resource\\Model createMediaSuperResolutionTemplate(array $args = array());

请求示例

<?php

require dirname(__FILE__) . '/../vendor/autoload.php';

$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的 region 可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
$cosClient = new Qcloud\\Cos\\Client(
array(
'region' => $region,
'schema' => 'https', //协议头部,默认为 http
'credentials'=> array(
'secretId' => $secretId ,
'secretKey' => $secretKey)));
try {
$result = $cosClient->createMediaSuperResolutionTemplate(array(
'Bucket' => 'examplebucket-125000000', //存储桶名称,由 BucketName-Appid 组成,可以在 COS 控制台查看 https://console.cloud.tencent.com/cos5/bucket
'Tag' => 'SuperResolution',
'Name' => 'SuperResolution-Template-Name',
'Resolution' => '',
'EnableScaleUp' => '',
'Version' => '',
));
// 请求成功
print_r($result);
} catch (\\Exception $e) {
// 请求失败
echo($e);
}

参数说明

Request 中的具体数据描述如下:
节点名称(关键字)
父节点
描述
类型
是否必选
限制
Tag
Request
模板类型:SuperResolution
String
Name
Request
模板名称:仅支持中文、英文、数字、_、-和*
String
Resolution
Request
分辨率选项
String
sdtohd:标清到超清
hdto4k:高清到4K
EnableScaleUp
Request
自动缩放开关,默认关闭
String
true、false
Version
Request
版本, 默认值 Base
String
Base:基础版
Enhance:增强版

返回结果示例

GuzzleHttp\\Command\\Result Object
(
[Body] => GuzzleHttp\\Psr7\\Stream Object
(
[stream:GuzzleHttp\\Psr7\\Stream:private] => Resource id #88
[size:GuzzleHttp\\Psr7\\Stream:private] =>
[seekable:GuzzleHttp\\Psr7\\Stream:private] => 1
[readable:GuzzleHttp\\Psr7\\Stream:private] => 1
[writable:GuzzleHttp\\Psr7\\Stream:private] => 1
[uri:GuzzleHttp\\Psr7\\Stream:private] => php://temp
[customMetadata:GuzzleHttp\\Psr7\\Stream:private] => Array
(
)

)

[RequestId] => NjJhODc0ODdfNzgwYzdJAOIDJAOIJDIzODI=
[ContentType] => application/xml
[ContentLength] => 636
[Bucket] => examplebucket-125000000
[Location] => examplebucket-125000000.ci.ap-guangzhou.myqcloud.com/template
[Response] => Array
(
[RequestId] => NjJhODc0ODdfNzgwYzdJAOIDJAOIJDIzODI=
[Template] => Array
(
[TemplateId] => t14e9d3as8d908a90d8a455636
[Name] => SuperResolution-Template-Name
[State] => Normal
[Tag] => SuperResolution
[CreateTime] => 2022-06-14T19:44:07+0800
[UpdateTime] => 2022-06-14T19:44:07+0800
[BucketId] => examplebucket-125000000
[Category] => Custom
[SuperResolution] => Array
(
[Resolution] => sdtohd
[EnableScaleUp] => true
[Version] => Enhance
)

)

)

)

更新超分辨率模板

功能说明

用于更新超分辨率模板。

方法原型

public Guzzle\\Service\\Resource\\Model updateMediaSuperResolutionTemplate(array $args = array());

请求示例

<?php

require dirname(__FILE__) . '/../vendor/autoload.php';

$secretId = "SECRETID"; //替换为用户的 secretId,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
$secretKey = "SECRETKEY"; //替换为用户的 secretKey,请登录访问管理控制台进行查看和管理,https://console.cloud.tencent.com/cam/capi
$region = "ap-beijing"; //替换为用户的 region,已创建桶归属的 region 可以在控制台查看,https://console.cloud.tencent.com/cos5/bucket
$cosClient = new Qcloud\\Cos\\Client(
array(
'region' => $region,
'schema' => 'https', //协议头部,默认为http
'credentials'=> array(
'secretId' => $secretId ,
'secretKey' => $secretKey)));
try {
$result = $cosClient->updateMediaSuperResolutionTemplate(array(
'Bucket' => 'examplebucket-125000000', //存储桶名称,由 BucketName-Appid 组成,可以在 COS 控制台查看 https://console.cloud.tencent.com/cos5/bucket
'Key' => '', // TemplateId
'Tag' => 'SuperResolution',
'Name' => 'SuperResolution-Template-Name',
'Resolution' => '',
'EnableScaleUp' => '',
'Version' => '',
));
// 请求成功
print_r($result);
} catch (\\Exception $e) {
// 请求失败
echo($e);
}

参数说明

Request 中的具体数据描述如下:
节点名称(关键字)
父节点
描述
Tag
Request
同超分辨率模板 CreateMediaTemplate 接口中的 Request.Tag
Name
Request
同超分辨率模板 CreateMediaTemplate 接口中的 Request.Name
Resolution
Request
同超分辨率模板 CreateMediaTemplate 接口中的 Request.Resolution
EnableScaleUp
Request
同超分辨率模板 CreateMediaTemplate 接口中的 Request.EnableScaleUp
Version
Request
同超分辨率模板CreateMediaTemplate接口中的Request.Version

返回结果示例

GuzzleHttp\\Command\\Result Object
(
[Body] => GuzzleHttp\\Psr7\\Stream Object
(
[stream:GuzzleHttp\\Psr7\\Stream:private] => Resource id #88
[size:GuzzleHttp\\Psr7\\Stream:private] =>
[seekable:GuzzleHttp\\Psr7\\Stream:private] => 1
[readable:GuzzleHttp\\Psr7\\Stream:private] => 1
[writable:GuzzleHttp\\Psr7\\Stream:private] => 1
[uri:GuzzleHttp\\Psr7\\Stream:private] => php://temp
[customMetadata:GuzzleHttp\\Psr7\\Stream:private] => Array
(
)

)

[RequestId] => NjJhODc1NTBfNzgwYzdkAJOSJDOIDRkYjY=
[ContentType] => application/xml
[ContentLength] => 638
[Key] => t14e9d1151b43641455636
[Bucket] => examplebucket-125000000
[Location] => examplebucket-125000000.ci.ap-guangzhou.myqcloud.com/template/t14e9d1151b43641455636
[Response] => Array
(
[RequestId] => NjJhODc1NTBfNzgwYzdkAJOSJDOIDRkYjY=
[Template] => Array
(
[TemplateId] => t14e9d1151b43641455636
[Name] => SuperResolution-Template-Name
[State] => Normal
[Tag] => SuperResolution
[CreateTime] => 2022-06-14T19:44:07+0800
[UpdateTime] => 2022-06-14T19:47:28+0800
[BucketId] => examplebucket-125000000
[Category] => Custom
[SuperResolution] => Array
(
[Resolution] => sdtohd
[EnableScaleUp] => true
[Version] => Enhance
)

)

)

)