Cloudflare\User\LoadBalancers\Monitors::create PHP Метод

create() публичный Метод

Create a monitor Create a configured monitor
public create ( string $expected, string $type, string $expected_codes, string | null $method = null, string | null $path = null, integer | null $interval = null, integer | null $retries = null, array | null $headers = null, integer | null $probe_timeout = null, string | null $description = null )
$expected string A case-insensitive substring to match in the body of the probe response to declare an origin as up
$type string Monitor type
$expected_codes string The expected HTTP response code or code range for the probe
$method string | null The HTTP method for the probe
$path string | null The endpoint path to probe
$interval integer | null The interval in seconds for each PoP to send a probe request
$retries integer | null The number of retries before declaring the origins to be dead
$headers array | null The HTTP headers to use in the probe
$probe_timeout integer | null Timeout in seconds for each probe request
$description string | null Object description
    public function create($expected, $type, $expected_codes, $method = null, $path = null, $interval = null, $retries = null, $headers = null, $probe_timeout = null, $description = null)
    {
        $data = ['expected' => $expected, 'type' => $type, 'expected_codes' => $expected_codes, 'method' => $method, 'path' => $path, 'interval' => $interval, 'retries' => $retries, 'headers' => $headers, 'probe_timeout' => $probe_timeout, 'description' => $description];
        return $this->post('/user/load_balancers/monitors', $data);
    }