Вход на сайт

Просмотр новости

Найдите то, что Вас интересует

byteplus_sdk/byteplus-php-sdk-v2

Дата публикации: 03-08-2026 13:37:01



Основное содержимое страницы с новостью.

Maintainers

a25d464ccde8b6de259c82dedadfc25a4603e954a5a3e5261319e5056c825173?s=48&d=identicon

v1.0.3 2026-08-03 09:32 UTC

This package is auto-updated.

Last update: 2026-08-03 13:38:27 UTC


README

中文 | English

Requirements

PHP 5.5 and later

Installation & UsageComposer

To install the bindings via Composer, add the following to composer.json:

{
  "require": {
    "byteplus_sdk/byteplus-php-sdk-v2": "v1.0.0"
  }
}

Then run composer install

Getting Started

Please follow the installation procedure

SDK 详细使用文档(凭证配置、Endpoint、Transport、超时、重试、异常处理、Debug)请参考:SDK 接入文档

Endpoint 设置

如果您要自定义SDK的Endpoint,可以按照以下示例代码设置:

$config = \Byteplus\Common\Configuration::getDefaultConfiguration()
    ->setAk("Your AK")
    ->setSk("Your SK")
    ->setRegion("cn-beijing")
    ->setHost("ecs.cn-beijing-autodriving.byteplusapi.com");

Byteplus标准的Endpoint规则说明:

Regional 服务 Global 服务
{service}.{region}.byteplusapi.com
例如:云服务ecs在cn-beijing-autodriving Region域名为: ecs.cn-beijing-autodriving.byteplusapi.com
{service}.byteplusapi.com
例如:访问控制iam为Global服务,域名为:iam.byteplusapi.com

注:

  • Service中存在_符号时,Endpoint时需转为-符号。存在大写字母时需转成小写。
SDK 示例
<?php
require_once(__DIR__ . '/vendor/autoload.php');

$config = \Byteplus\Common\Configuration::getDefaultConfiguration()
    ->setAk("Your AK")
    ->setSk("Your SK")
    ->setRegion("cn-beijing");

$apiInstance = new \Byteplus\Vpc\Api\VPCApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);

$body = new \Byteplus\Vpc\Model\CreateVpcRequest();
$body->setClientToken("token-123456789")
    ->setCidrBlock("192.168.0.0/16")
    ->setDnsServers(array("10.0.0.1", "10.1.1.2"));

try {
    $result = $apiInstance->createVpc($body);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling VPCApi->createVpc: ', $e->getMessage(), PHP_EOL;
}

?>
Security and privacy

This project takes security seriously. For vulnerability reporting and supported versions, see SECURITY.md

Схожие новости

#Наименование новостиТональностьИнформативностьДата публикации
1shelfwatch/shelfwatch01003-08-2026
2djeventplannerhub/djep-php-sdk018.3303-08-2026
3jcolombo/optmyzr-api-php013.6103-08-2026
4package-of-yii/collection04003-08-2026
5snowman/ai08.103-08-2026
6lumnd/platophp017.6903-08-2026
7lace/framework01003-08-2026
8phpwind/phpwind01003-08-2026
9wallet/wallet (2.22.1)017.6928-07-2026
10ecomhouse/quantityswitch024.2903-08-2026

Классификация: Пресс-релизы. Схожих патентов: 0. Схожих новостей: 10. Тональность: 0. Информативность: 10. Источник: packagist.org.