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.

Deployments

Deployments track the version(s) of your Worker that are actively serving traffic. A deployment can consist of one or two versions of a Worker.

Cloudflare API docs

List

List of Worker Deployments. The first deployment in the list is the latest deployment actively serving traffic.

php
$response = $client->workers()->deployments()->get('account_id', 'script_name');

Create

Deployments configure how Worker Versions are deployed to traffic. A deployment can consist of one or two versions of a Worker.

php
$values = [
    'strategy' => 'percentage',
    'versions' => [
        [
            'percentage' => '100',
            'version_id' => 'bcf48806-b317-4351-9ee7-36e7d557d4de'
        ]
    ]
];

$response = $client->workers()->deployments()->create('account_id', 'script_name', $values);
Table of Contents