minirplus / volcengine-php-sdk
v1.0.47-patch-1
2025-03-04 02:13 UTC
Requires
- php: >=5.5
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^7.0
This package is not auto-updated.
Last update: 2026-08-05 07:17:04 UTC
README
set require guzzle to 7
Requirements
PHP 5.5 and later
Installation & Usage
Composer
To install the bindings via Composer, add the following to composer.json:
composer require minirplus/volcengine-php-sdk
Then run composer install
Getting Started
Please follow the installation procedure and then run the following:
<?php require_once(__DIR__ . '/vendor/autoload.php'); $config = \Volcengine\Common\Configuration::getDefaultConfiguration() ->setAk("Your AK") ->setSk("Your SK") ->setRegion("cn-beijing"); $apiInstance = new \Volcengine\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 \Volcengine\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; } ?>