All URIs are relative to https://api.timeweb.cloud, except if the operation defines another base path.
Method | HTTP request | Description |
---|---|---|
createVPC() | POST /api/v2/vpcs | Создание VPC |
deleteVPC() | DELETE /api/v1/vpcs/{vpc_id} | Удаление VPC по ID сети |
getVPC() | GET /api/v2/vpcs/{vpc_id} | Получение VPC |
getVPCPorts() | GET /api/v1/vpcs/{vpc_id}/ports | Получение списка портов для VPC |
getVPCServices() | GET /api/v2/vpcs/{vpc_id}/services | Получение списка сервисов в VPC |
getVPCs() | GET /api/v2/vpcs | Получение списка VPCs |
updateVPCs() | PATCH /api/v2/vpcs/{vpc_id} | Изменение VPC по ID сети |
createVPC($create_vpc): \OpenAPI\Client\Model\CreateVPC201Response
Создание VPC
Чтобы создать создать VPC, отправьте POST-запрос в /api/v2/vpcs
, задав необходимые атрибуты.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\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
);
$create_vpc = new \OpenAPI\Client\Model\CreateVpc(); // \OpenAPI\Client\Model\CreateVpc
try {
$result = $apiInstance->createVPC($create_vpc);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling VPCApi->createVPC: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
create_vpc | \OpenAPI\Client\Model\CreateVpc |
\OpenAPI\Client\Model\CreateVPC201Response
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
deleteVPC($vpc_id)
Удаление VPC по ID сети
Чтобы удалить VPC, отправьте DELETE-запрос на /api/v1/vpcs/{vpc_id}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\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
);
$vpc_id = network-1234567890; // string | ID сети
try {
$apiInstance->deleteVPC($vpc_id);
} catch (Exception $e) {
echo 'Exception when calling VPCApi->deleteVPC: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
vpc_id | string | ID сети |
void (empty response body)
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getVPC($vpc_id): \OpenAPI\Client\Model\CreateVPC201Response
Получение VPC
Чтобы отобразить информацию об отдельном VPC, отправьте запрос GET на api/v2/vpcs/{vpc_id}
.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\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
);
$vpc_id = network-1234567890; // string | ID сети
try {
$result = $apiInstance->getVPC($vpc_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling VPCApi->getVPC: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
vpc_id | string | ID сети |
\OpenAPI\Client\Model\CreateVPC201Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getVPCPorts($vpc_id): \OpenAPI\Client\Model\GetVPCPorts200Response
Получение списка портов для VPC
Чтобы получить список портов для VPC, отправьте GET-запрос на /api/v1/vpcs/{vpc_id}/ports
.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\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
);
$vpc_id = network-1234567890; // string | ID сети
try {
$result = $apiInstance->getVPCPorts($vpc_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling VPCApi->getVPCPorts: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
vpc_id | string | ID сети |
\OpenAPI\Client\Model\GetVPCPorts200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getVPCServices($vpc_id): \OpenAPI\Client\Model\GetVPCServices200Response
Получение списка сервисов в VPC
Чтобы получить список сервисов, отправьте GET-запрос на /api/v2/vpcs/{vpc_id}/services
.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\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
);
$vpc_id = network-1234567890; // string | ID сети
try {
$result = $apiInstance->getVPCServices($vpc_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling VPCApi->getVPCServices: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
vpc_id | string | ID сети |
\OpenAPI\Client\Model\GetVPCServices200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
getVPCs(): \OpenAPI\Client\Model\GetVPCs200Response
Получение списка VPCs
Чтобы получить список VPCs, отправьте GET-запрос на /api/v2/vpcs
.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\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
);
try {
$result = $apiInstance->getVPCs();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling VPCApi->getVPCs: ', $e->getMessage(), PHP_EOL;
}
This endpoint does not need any parameter.
\OpenAPI\Client\Model\GetVPCs200Response
- Content-Type: Not defined
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
updateVPCs($vpc_id, $update_vpc): \OpenAPI\Client\Model\CreateVPC201Response
Изменение VPC по ID сети
Чтобы изменить VPC, отправьте PATCH-запрос на /api/v2/vpcs/{vpc_id}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure Bearer (JWT) authorization: Bearer
$config = OpenAPI\Client\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new OpenAPI\Client\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
);
$vpc_id = network-1234567890; // string | ID сети
$update_vpc = new \OpenAPI\Client\Model\UpdateVpc(); // \OpenAPI\Client\Model\UpdateVpc
try {
$result = $apiInstance->updateVPCs($vpc_id, $update_vpc);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling VPCApi->updateVPCs: ', $e->getMessage(), PHP_EOL;
}
Name | Type | Description | Notes |
---|---|---|---|
vpc_id | string | ID сети | |
update_vpc | \OpenAPI\Client\Model\UpdateVpc |
\OpenAPI\Client\Model\CreateVPC201Response
- Content-Type:
application/json
- Accept:
application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]