\Qiniu\CdnCdnManager

Summary

Methods
Properties
Constants
__construct()
refreshUrls()
refreshDirs()
refreshUrlsAndDirs()
getCdnRefreshList()
prefetchUrls()
getCdnPrefetchList()
getBandwidthData()
getFluxData()
getCdnLogList()
createTimestampAntiLeechUrl()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
post()
$auth
$server
N/A

Properties

$auth

$auth

$server

$server

Methods

__construct()

__construct(\Qiniu\Auth  $auth) : mixed

Parameters

\Qiniu\Auth $auth

Returns

mixed —

refreshUrls()

refreshUrls(array  $urls) : array

Parameters

array $urls

待刷新的文件链接数组

Returns

array —

refreshDirs()

refreshDirs(array  $dirs) : array

Parameters

array $dirs

待刷新的文件链接数组

Returns

array —

目前客户默认没有目录刷新权限,刷新会有400038报错,参考:https://developer.qiniu.com/fusion/api/1229/cache-refresh 需要刷新目录请工单联系技术支持 https://support.qiniu.com/tickets/category

refreshUrlsAndDirs()

refreshUrlsAndDirs(array  $urls, array  $dirs) : array

Parameters

array $urls

待刷新的文件链接数组

array $dirs

待刷新的目录链接数组

Returns

array —

刷新的请求回复和错误,参考 examples/cdn_manager.php 代码

getCdnRefreshList()

getCdnRefreshList(string  $requestId = null, string  $isDir = null, array  $urls = array(), string  $state = null, int  $pageNo, int  $pageSize = 100, string  $startTime = null, string  $endTime = null) : array

查询 CDN 刷新记录

Parameters

string $requestId

指定要查询记录所在的刷新请求id

string $isDir

指定是否查询目录,取值为 yes/no,默认不填则为两种类型记录都查询

array $urls

要查询的url列表,每个url可以是文件url,也可以是目录url

string $state

指定要查询记录的状态,取值processing/success/failure

int $pageNo

要求返回的页号,默认为0

int $pageSize

要求返回的页长度,默认为100

string $startTime

指定查询的开始日期,格式2006-01-01

string $endTime

指定查询的结束日期,格式2006-01-01

Returns

array —

prefetchUrls()

prefetchUrls(array  $urls) : array

Parameters

array $urls

待预取的文件链接数组

Returns

array —

预取的请求回复和错误,参考 examples/cdn_manager.php 代码

getCdnPrefetchList()

getCdnPrefetchList(string  $requestId = null, array  $urls = array(), string  $state = null, int  $pageNo, int  $pageSize = 100, string  $startTime = null, string  $endTime = null) : array

查询 CDN 预取记录

Parameters

string $requestId

指定要查询记录所在的刷新请求id

array $urls

要查询的url列表,每个url可以是文件url,也可以是目录url

string $state

指定要查询记录的状态,取值processing/success/failure

int $pageNo

要求返回的页号,默认为0

int $pageSize

要求返回的页长度,默认为100

string $startTime

指定查询的开始日期,格式2006-01-01

string $endTime

指定查询的结束日期,格式2006-01-01

Returns

array —

getBandwidthData()

getBandwidthData(array  $domains, string  $startDate, string  $endDate, string  $granularity) : array

Parameters

array $domains

待获取带宽数据的域名数组

string $startDate

开始的日期,格式类似 2017-01-01

string $endDate

结束的日期,格式类似 2017-01-01

string $granularity

获取数据的时间间隔,可以是 5min, hour 或者 day

Returns

array —

带宽数据和错误信息,参考 examples/cdn_manager.php 代码

getFluxData()

getFluxData(array  $domains, string  $startDate, string  $endDate, string  $granularity) : array

Parameters

array $domains

待获取流量数据的域名数组

string $startDate

开始的日期,格式类似 2017-01-01

string $endDate

结束的日期,格式类似 2017-01-01

string $granularity

获取数据的时间间隔,可以是 5min, hour 或者 day

Returns

array —

流量数据和错误信息,参考 examples/cdn_manager.php 代码

getCdnLogList()

getCdnLogList(array  $domains, string  $logDate) : array

Parameters

array $domains

待获取日志下载链接的域名数组

string $logDate

获取指定日期的日志下载链接,格式类似 2017-01-01

Returns

array —

日志下载链接数据和错误信息,参考 examples/cdn_manager.php 代码

createTimestampAntiLeechUrl()

createTimestampAntiLeechUrl(string  $rawUrl, string  $encryptKey, string  $durationInSeconds) : string

构建时间戳防盗链鉴权的访问外链

Parameters

string $rawUrl

需要签名的资源url

string $encryptKey

时间戳防盗链密钥

string $durationInSeconds

链接的有效期(以秒为单位)

Returns

string —

带鉴权信息的资源外链,参考 examples/cdn_timestamp_antileech.php 代码

post()

post(mixed  $url, mixed  $body) : mixed

Parameters

mixed $url
mixed $body

Returns

mixed —