Note: This library is under active development as I expand it to cover Cloudflare API. Consider the public API of this package a little unstable as I work towards a v1.0. See Coverage.

Virtual Networks

Cloudflare API docs

List

Lists and filters virtual networks in an account.

php
$response = $client->tunnel()->virtualNetworks()->list('ACCOUNT_ID');

Create

Adds a new virtual network to an account.

php
$response = $client->tunnel()->virtualNetworks()->create('ACCOUNT_ID', 'us-east-1-vpc', true, 'Optional remark describing the virtual network.');

Details

Get a virtual network.

php
$response = $client->tunnel()->virtualNetworks()->details('ACCOUNT_ID', 'VIRTUAL_NETWORK_ID');

Update

Updates an existing virtual network.

php
$response = $client->tunnel()->virtualNetworks()->update('ACCOUNT_ID', 'VIRTUAL_NETWORK_ID', [
    'name' => 'us-east-1-vpc'
]);

Delete

Delete an existing virtual network.

php
$response = $client->tunnel()->virtualNetworks()->delete('ACCOUNT_ID', 'VIRTUAL_NETWORK_ID');