阅读本文,您可以获取 PHP SDK 域名管理的接口调用示例,实现快速开发。
说明
本文的调用示例包含接口的部分参数。由于参数间可能存在互斥关系,在调用时,请您参考注释,进行调整。
调用接口前,请先完成 PHP SDK 的安装及初始化操作。
本节为您介绍域名管理相关接口的功能和调用示例。
您可以调用 AddDomainV1 接口新增域名。详细的参数说明可参见 AddDomainV1 接口文档。
接口调用示例如下所示。
<?php include_once(__DIR__ . '/../../../../vendor/autoload.php'); use Volc\Service\ImageX\V2\Imagex; $client = Imagex::getInstance(); // call below method if you dont set ak and sk in ~/.volc/config $client->setAccessKey("ak"); $client->setSecretKey("sk"); $query = []; $body = []; $response = $client->addDomainV1($query, $body); print_r($response);
您可以调用 DelDomain 接口删除域名。详细的参数说明可参见 DelDomain 接口文档。
接口调用示例如下所示。
<?php include_once(__DIR__ . '/../../../../vendor/autoload.php'); use Volc\Service\ImageX\V2\Imagex; $client = Imagex::getInstance(); // call below method if you dont set ak and sk in ~/.volc/config $client->setAccessKey("ak"); $client->setSecretKey("sk"); $query = []; $body = []; $response = $client->delDomain($query, $body); print_r($response);
您可以调用 UpdateImageDomainConfig 接口更新域名配置。详细的参数说明可参见 UpdateImageDomainConfig 接口文档。
接口调用示例如下所示。
<?php include_once(__DIR__ . '/../../../../vendor/autoload.php'); use Volc\Service\ImageX\V2\Imagex; $client = Imagex::getInstance(); // call below method if you dont set ak and sk in ~/.volc/config $client->setAccessKey("ak"); $client->setSecretKey("sk"); $query = []; $body = []; $response = $client->updateImageDomainConfig($query, $body); print_r($response);
您可以调用 UpdateResponseHeader 接口更新响应头配置。详细的参数说明可参见 UpdateResponseHeader 接口文档。
接口调用示例如下所示。
<?php include_once(__DIR__ . '/../../../../vendor/autoload.php'); use Volc\Service\ImageX\V2\Imagex; $client = Imagex::getInstance(); // call below method if you dont set ak and sk in ~/.volc/config $client->setAccessKey("ak"); $client->setSecretKey("sk"); $query = []; $body = []; $response = $client->updateResponseHeader($query, $body); print_r($response);
您可以调用 SetDefaultDomain 接口更新默认域名配置。详细的参数说明可参见 SetDefaultDomain 接口文档。
接口调用示例如下所示。
<?php include_once(__DIR__ . '/../../../../vendor/autoload.php'); use Volc\Service\ImageX\V2\Imagex; $client = Imagex::getInstance(); // call below method if you dont set ak and sk in ~/.volc/config $client->setAccessKey("ak"); $client->setSecretKey("sk"); $body = []; $response = $client->setDefaultDomain($body); print_r($response);
您可以调用 UpdateRefer 接口更新 Referer 防盗链配置。详细的参数说明可参见 UpdateRefer 接口文档。
接口调用示例如下所示。
<?php include_once(__DIR__ . '/../../../../vendor/autoload.php'); use Volc\Service\ImageX\V2\Imagex; $client = Imagex::getInstance(); // call below method if you dont set ak and sk in ~/.volc/config $client->setAccessKey("ak"); $client->setSecretKey("sk"); $query = []; $body = []; $response = $client->updateRefer($query, $body); print_r($response);
您可以调用 UpdateHttps 接口更新 https 配置。详细的参数说明可参见 UpdateHttps 接口文档。
接口调用示例如下所示。
<?php include_once(__DIR__ . '/../../../../vendor/autoload.php'); use Volc\Service\ImageX\V2\Imagex; $client = Imagex::getInstance(); // call below method if you dont set ak and sk in ~/.volc/config $client->setAccessKey("ak"); $client->setSecretKey("sk"); $query = []; $body = []; $response = $client->updateHttps($query, $body); print_r($response);
您可以调用 UpdateImageDomainIPAuth 接口更新 IP 黑白名单配置。详细的参数说明可参见 UpdateImageDomainIPAuth 接口文档。
接口调用示例如下所示。
<?php include_once(__DIR__ . '/../../../../vendor/autoload.php'); use Volc\Service\ImageX\V2\Imagex; $client = Imagex::getInstance(); // call below method if you dont set ak and sk in ~/.volc/config $client->setAccessKey("ak"); $client->setSecretKey("sk"); $query = []; $body = []; $response = $client->updateImageDomainIPAuth($query, $body); print_r($response);
您可以调用 UpdateImageDomainUaAccess 接口更新 UA 黑白名单配置。详细的参数说明可参见 UpdateImageDomainUaAccess 接口文档。
接口调用示例如下所示。
<?php include_once(__DIR__ . '/../../../../vendor/autoload.php'); use Volc\Service\ImageX\V2\Imagex; $client = Imagex::getInstance(); // call below method if you dont set ak and sk in ~/.volc/config $client->setAccessKey("ak"); $client->setSecretKey("sk"); $query = []; $body = []; $response = $client->updateImageDomainUaAccess($query, $body); print_r($response);
您可以调用 UpdateImageDomainAreaAccess 接口更新地域访问限制配置。详细的参数说明可参见 UpdateImageDomainAreaAccess 接口文档。
接口调用示例如下所示。
<?php include_once(__DIR__ . '/../../../../vendor/autoload.php'); use Volc\Service\ImageX\V2\Imagex; $client = Imagex::getInstance(); // call below method if you dont set ak and sk in ~/.volc/config $client->setAccessKey("ak"); $client->setSecretKey("sk"); $query = []; $body = []; $response = $client->updateImageDomainAreaAccess($query, $body); print_r($response);
您可以调用 UpdateDomainAdaptiveFmt 接口更新域名自适应格式配置。详细的参数说明可参见 UpdateDomainAdaptiveFmt 接口文档。
接口调用示例如下所示。
<?php include_once(__DIR__ . '/../../../../vendor/autoload.php'); use Volc\Service\ImageX\V2\Imagex; $client = Imagex::getInstance(); // call below method if you dont set ak and sk in ~/.volc/config $client->setAccessKey("ak"); $client->setSecretKey("sk"); $query = []; $body = []; $response = $client->updateDomainAdaptiveFmt($query, $body); print_r($response);
您可以调用 UpdateSlimConfig 接口更新集智瘦身配置。详细的参数说明可参见 UpdateSlimConfig 接口文档。
接口调用示例如下所示。
<?php include_once(__DIR__ . '/../../../../vendor/autoload.php'); use Volc\Service\ImageX\V2\Imagex; $client = Imagex::getInstance(); // call below method if you dont set ak and sk in ~/.volc/config $client->setAccessKey("ak"); $client->setSecretKey("sk"); $query = []; $body = []; $response = $client->updateSlimConfig($query, $body); print_r($response);
您可以调用 UpdateAdvance 接口更新域名高级配置。详细的参数说明可参见 UpdateAdvance 接口文档。
接口调用示例如下所示。
<?php include_once(__DIR__ . '/../../../../vendor/autoload.php'); use Volc\Service\ImageX\V2\Imagex; $client = Imagex::getInstance(); // call below method if you dont set ak and sk in ~/.volc/config $client->setAccessKey("ak"); $client->setSecretKey("sk"); $query = []; $body = []; $response = $client->updateAdvance($query, $body); print_r($response);
您可以调用 UpdateImageDomainBandwidthLimit 接口更新带宽限制配置。详细的参数说明可参见 UpdateImageDomainBandwidthLimit 接口文档。
接口调用示例如下所示。
<?php include_once(__DIR__ . '/../../../../vendor/autoload.php'); use Volc\Service\ImageX\V2\Imagex; $client = Imagex::getInstance(); // call below method if you dont set ak and sk in ~/.volc/config $client->setAccessKey("ak"); $client->setSecretKey("sk"); $query = []; $body = []; $response = $client->updateImageDomainBandwidthLimit($query, $body); print_r($response);
您可以调用 UpdateImageDomainDownloadSpeedLimit 接口更新下载限速配置。详细的参数说明可参见 UpdateImageDomainDownloadSpeedLimit 接口文档。
接口调用示例如下所示。
<?php include_once(__DIR__ . '/../../../../vendor/autoload.php'); use Volc\Service\ImageX\V2\Imagex; $client = Imagex::getInstance(); // call below method if you dont set ak and sk in ~/.volc/config $client->setAccessKey("ak"); $client->setSecretKey("sk"); $query = []; $body = []; $response = $client->updateImageDomainDownloadSpeedLimit($query, $body); print_r($response);
您可以调用 GetDomainConfig 接口获取域名配置。详细的参数说明可参见 GetDomainConfig 接口文档。
接口调用示例如下所示。
<?php include_once(__DIR__ . '/../../../../vendor/autoload.php'); use Volc\Service\ImageX\V2\Imagex; $client = Imagex::getInstance(); // call below method if you dont set ak and sk in ~/.volc/config $client->setAccessKey("ak"); $client->setSecretKey("sk"); $query = []; $response = $client->getDomainConfig($query); print_r($response);
您可以调用 GetServiceDomains 接口获取服务下全部域名。详细的参数说明可参见 GetServiceDomains 接口文档。
接口调用示例如下所示。
<?php include_once(__DIR__ . '/../../../../vendor/autoload.php'); use Volc\Service\ImageX\V2\Imagex; $client = Imagex::getInstance(); // call below method if you dont set ak and sk in ~/.volc/config $client->setAccessKey("ak"); $client->setSecretKey("sk"); $query = []; $response = $client->getServiceDomains($query); print_r($response);
您可以调用 GetResponseHeaderValidateKeys 接口获取响应头允许的 Key 列表。详细的参数说明可参见 GetResponseHeaderValidateKeys 接口文档。
接口调用示例如下所示。
<?php include_once(__DIR__ . '/../../../../vendor/autoload.php'); use Volc\Service\ImageX\V2\Imagex; $client = Imagex::getInstance(); // call below method if you dont set ak and sk in ~/.volc/config $client->setAccessKey("ak"); $client->setSecretKey("sk"); $response = $client->getResponseHeaderValidateKeys(); print_r($response);