Skip to content

omnidns/cloudflare API reference

Floor
Provider · Omnidns
Version
1.x
Conformance suite
not wired
Verified for real
Verified in part
Licence
MIT
composer require omnidns/cloudflare:1.x-dev

Read from the package's own PHP files at the commit 369cd6e3629c: its namespaces, classes, interfaces and enums, their public constants, properties and methods with their PHPDoc, and the options its factories take. Nothing of it is run.

Omnidns\Cloudflare

  • CloudflareFactory class

    Cloudflare, from its options:

    3 options · 1 method

  • CloudflareProvider class

    Cloudflare's API v4: a zone's records through cloudflare/sdk (its DNS and Zones endpoints), each with its id and "proxied" kept in its options so an update leaves the proxy as it was; the Registrar's domains of an account, read through the same adapter. Cloudflare's API neither checks nor registers a domain, and a zone's name servers are Cloudflare's own: no AvailabilityInterface, RegistrarInterface, NameserversInterface here.

    10 methods

Omnidns\Cloudflare

CloudflareFactory class

final class CloudflareFactory extends ProviderFactory CloudflareFactory.php:23

Cloudflare, from its options:

token an API token (required) with Zone:Read and DNS:Edit on the zones it manages, and Account Registrar:Read for the Registrar's domains account_id the account whose Registrar domains are read (DomainsInterface); empty: no domains base_uri https://api.cloudflare.com/client/v4/

cloudflare/sdk sends the calls, through its Guzzle adapter - or the adapter given to this factory (a test's, a proxy's).

Options

OptionDefault
account_id''
base_uri'https://api.cloudflare.com/client/v4/'
tokenrequired

CloudflareFactory::__construct()

public function __construct(readonly ?Adapter $adapter = null)

CloudflareProvider class

final class CloudflareProvider implements DnsInterface, DomainsInterface CloudflareProvider.php:30

Cloudflare's API v4: a zone's records through cloudflare/sdk (its DNS and Zones endpoints), each with its id and "proxied" kept in its options so an update leaves the proxy as it was; the Registrar's domains of an account, read through the same adapter. Cloudflare's API neither checks nor registers a domain, and a zone's name servers are Cloudflare's own: no AvailabilityInterface, RegistrarInterface, NameserversInterface here.

CloudflareProvider::__construct()

public function __construct(readonly Adapter $adapter, readonly ?string $accountId = null)

CloudflareProvider::getName()

public function getName(): string

CloudflareProvider::getTitle()

public function getTitle(): string

CloudflareProvider::capabilities()

public function capabilities(): Capabilities

CloudflareProvider::records()

public function records(string $zone, ?string $type = null, ?string $name = null): array

CloudflareProvider::add()

public function add(string $zone, Record $record): Record

CloudflareProvider::update()

public function update(string $zone, Record $current, Record $new): Record

CloudflareProvider::delete()

public function delete(string $zone, Record $record): void

CloudflareProvider::domains()

public function domains(): array

CloudflareProvider::domain()

public function domain(string $domain): DomainInfo