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.

Routing

Cloudflare API docs

List

Lists and filters private network routes in an account.

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

Get route by IP

etches routes that contain the given IP address.

php
$response = $client->tunnel()->routes()->getByIP('ACCOUNT_ID',  '10.1.0.137');

Create

Routes a private network through a Cloudflare Tunnel.

php
$response = $client->tunnel()->routes()->create('ACCOUNT_ID', '172.16.0.0/16', 'f70ff985-a4ef-4643-bbbc-4a0ed4fc8415', 'Example comment for this route.');

Details

Get a private network route in an account.

php
$response = $client->tunnel()->routes()->details('ACCOUNT_ID', 'ROUTE_ID');

Update

Updates an existing private network route in an account. The fields that are meant to be updated should be provided in the body of the request.

php
$response = $client->tunnel()->routes()->update('ACCOUNT_ID', 'ROUTE_ID', [
    'network' => '172.16.0.0/16'
]);

Delete

Delete a private network route from an account.

php
$response = $client->tunnel()->routes()->delete('ACCOUNT_ID', 'ROUTE_ID');