Cloudflare.HealthCheck (Cloudflare v0.5.0)

Copy Markdown View Source

Health Checks

Create Health Check

POST /zones/{zone_id}/healthchecks

Create a new health check.

Responses

200 Create Health Check response.

Data is at body["result"]

{
  "address": "*string*",
  "check_regions": [
    "*string*"
  ],
  "consecutive_fails": "*integer*",
  "consecutive_successes": "*integer*",
  "created_on": "*string*",
  "description": "*string*",
  "failure_reason": "*string*",
  "http_config": {
    "allow_insecure": "*boolean*",
    "expected_body": "*string*",
    "expected_codes": [
      "*string*"
    ],
    "follow_redirects": "*boolean*",
    "header": {},
    "method": "*string*",
    "path": "*string*",
    "port": "*integer*"
  },
  "id": "*string*",
  "interval": "*integer*",
  "modified_on": "*string*",
  "name": "*string*",
  "retries": "*integer*",
  "status": "*string*",
  "suspended": "*boolean*",
  "tcp_config": {
    "method": "*string*",
    "port": "*integer*"
  },
  "timeout": "*integer*",
  "type": "*string*"
}
4XX Create Health Check response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}

List Health Checks

GET /zones/{zone_id}/healthchecks

List configured health checks.

Responses

200 List Health Checks response

Data is at body["result"]

[
  {
    "address": "*string*",
    "check_regions": [
      "*string*"
    ],
    "consecutive_fails": "*integer*",
    "consecutive_successes": "*integer*",
    "created_on": "*string*",
    "description": "*string*",
    "failure_reason": "*string*",
    "http_config": {
      "allow_insecure": "*boolean*",
      "expected_body": "*string*",
      "expected_codes": [
        null
      ],
      "follow_redirects": "*boolean*",
      "header": {},
      "method": "*string*",
      "path": "*string*",
      "port": "*integer*"
    },
    "id": "*string*",
    "interval": "*integer*",
    "modified_on": "*string*",
    "name": "*string*",
    "retries": "*integer*",
    "status": "*string*",
    "suspended": "*boolean*",
    "tcp_config": {
      "method": "*string*",
      "port": "*integer*"
    },
    "timeout": "*integer*",
    "type": "*string*"
  }
]
4XX List Health Checks response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "result": {},
  "result_info": {
    "count": "*number*",
    "page": "*number*",
    "per_page": "*number*",
    "total_count": "*number*"
  },
  "success": "*boolean*"
}

Create Preview Health Check

POST /zones/{zone_id}/healthchecks/preview

Create a new preview health check.

Responses

200 Create Preview Health Check response.

Data is at body["result"]

{
  "address": "*string*",
  "check_regions": [
    "*string*"
  ],
  "consecutive_fails": "*integer*",
  "consecutive_successes": "*integer*",
  "created_on": "*string*",
  "description": "*string*",
  "failure_reason": "*string*",
  "http_config": {
    "allow_insecure": "*boolean*",
    "expected_body": "*string*",
    "expected_codes": [
      "*string*"
    ],
    "follow_redirects": "*boolean*",
    "header": {},
    "method": "*string*",
    "path": "*string*",
    "port": "*integer*"
  },
  "id": "*string*",
  "interval": "*integer*",
  "modified_on": "*string*",
  "name": "*string*",
  "retries": "*integer*",
  "status": "*string*",
  "suspended": "*boolean*",
  "tcp_config": {
    "method": "*string*",
    "port": "*integer*"
  },
  "timeout": "*integer*",
  "type": "*string*"
}
4XX Create Preview Health Check response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}

Health Check Preview Details

GET /zones/{zone_id}/healthchecks/preview/{healthcheck_id}

Fetch a single configured health check preview.

Responses

200 Health Check Preview Details response.

Data is at body["result"]

{
  "address": "*string*",
  "check_regions": [
    "*string*"
  ],
  "consecutive_fails": "*integer*",
  "consecutive_successes": "*integer*",
  "created_on": "*string*",
  "description": "*string*",
  "failure_reason": "*string*",
  "http_config": {
    "allow_insecure": "*boolean*",
    "expected_body": "*string*",
    "expected_codes": [
      "*string*"
    ],
    "follow_redirects": "*boolean*",
    "header": {},
    "method": "*string*",
    "path": "*string*",
    "port": "*integer*"
  },
  "id": "*string*",
  "interval": "*integer*",
  "modified_on": "*string*",
  "name": "*string*",
  "retries": "*integer*",
  "status": "*string*",
  "suspended": "*boolean*",
  "tcp_config": {
    "method": "*string*",
    "port": "*integer*"
  },
  "timeout": "*integer*",
  "type": "*string*"
}
4XX Health Check Preview Details response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}

Delete Preview Health Check

DELETE /zones/{zone_id}/healthchecks/preview/{healthcheck_id}

Delete a health check.

Responses

200 Delete Preview Health Check response.

Data is at body["result"]

{
  "id": "*string*"
}
4XX Delete Preview Health Check response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}

Update Health Check

PUT /zones/{zone_id}/healthchecks/{healthcheck_id}

Update a configured health check.

Responses

200 Update Health Check response.

Data is at body["result"]

{
  "address": "*string*",
  "check_regions": [
    "*string*"
  ],
  "consecutive_fails": "*integer*",
  "consecutive_successes": "*integer*",
  "created_on": "*string*",
  "description": "*string*",
  "failure_reason": "*string*",
  "http_config": {
    "allow_insecure": "*boolean*",
    "expected_body": "*string*",
    "expected_codes": [
      "*string*"
    ],
    "follow_redirects": "*boolean*",
    "header": {},
    "method": "*string*",
    "path": "*string*",
    "port": "*integer*"
  },
  "id": "*string*",
  "interval": "*integer*",
  "modified_on": "*string*",
  "name": "*string*",
  "retries": "*integer*",
  "status": "*string*",
  "suspended": "*boolean*",
  "tcp_config": {
    "method": "*string*",
    "port": "*integer*"
  },
  "timeout": "*integer*",
  "type": "*string*"
}
4XX Update Health Check response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}

Patch Health Check

PATCH /zones/{zone_id}/healthchecks/{healthcheck_id}

Patch a configured health check.

Responses

200 Patch Health Check response.

Data is at body["result"]

{
  "address": "*string*",
  "check_regions": [
    "*string*"
  ],
  "consecutive_fails": "*integer*",
  "consecutive_successes": "*integer*",
  "created_on": "*string*",
  "description": "*string*",
  "failure_reason": "*string*",
  "http_config": {
    "allow_insecure": "*boolean*",
    "expected_body": "*string*",
    "expected_codes": [
      "*string*"
    ],
    "follow_redirects": "*boolean*",
    "header": {},
    "method": "*string*",
    "path": "*string*",
    "port": "*integer*"
  },
  "id": "*string*",
  "interval": "*integer*",
  "modified_on": "*string*",
  "name": "*string*",
  "retries": "*integer*",
  "status": "*string*",
  "suspended": "*boolean*",
  "tcp_config": {
    "method": "*string*",
    "port": "*integer*"
  },
  "timeout": "*integer*",
  "type": "*string*"
}
4XX Patch Health Check response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}

Health Check Details

GET /zones/{zone_id}/healthchecks/{healthcheck_id}

Fetch a single configured health check.

Responses

200 Health Check Details response.

Data is at body["result"]

{
  "address": "*string*",
  "check_regions": [
    "*string*"
  ],
  "consecutive_fails": "*integer*",
  "consecutive_successes": "*integer*",
  "created_on": "*string*",
  "description": "*string*",
  "failure_reason": "*string*",
  "http_config": {
    "allow_insecure": "*boolean*",
    "expected_body": "*string*",
    "expected_codes": [
      "*string*"
    ],
    "follow_redirects": "*boolean*",
    "header": {},
    "method": "*string*",
    "path": "*string*",
    "port": "*integer*"
  },
  "id": "*string*",
  "interval": "*integer*",
  "modified_on": "*string*",
  "name": "*string*",
  "retries": "*integer*",
  "status": "*string*",
  "suspended": "*boolean*",
  "tcp_config": {
    "method": "*string*",
    "port": "*integer*"
  },
  "timeout": "*integer*",
  "type": "*string*"
}
4XX Health Check Details response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}

Delete Health Check

DELETE /zones/{zone_id}/healthchecks/{healthcheck_id}

Delete a health check.

Responses

200 Delete Health Check response.

Data is at body["result"]

{
  "id": "*string*"
}
4XX Delete Health Check response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}

Create Health Check

POST /zones/{zone_id}/smart_shield/healthchecks

Create a new health check.

Responses

200 Create Health Check response.

Data is at body["result"]

{
  "address": "*string*",
  "check_regions": [
    "*string*"
  ],
  "consecutive_fails": "*integer*",
  "consecutive_successes": "*integer*",
  "created_on": "*string*",
  "description": "*string*",
  "failure_reason": "*string*",
  "http_config": {
    "allow_insecure": "*boolean*",
    "expected_body": "*string*",
    "expected_codes": [
      "*string*"
    ],
    "follow_redirects": "*boolean*",
    "header": {},
    "method": "*string*",
    "path": "*string*",
    "port": "*integer*"
  },
  "id": "*string*",
  "interval": "*integer*",
  "modified_on": "*string*",
  "name": "*string*",
  "retries": "*integer*",
  "status": "*string*",
  "suspended": "*boolean*",
  "tcp_config": {
    "method": "*string*",
    "port": "*integer*"
  },
  "timeout": "*integer*",
  "type": "*string*"
}
4XX Create Health Check response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}

List Health Checks

GET /zones/{zone_id}/smart_shield/healthchecks

List configured health checks.

Responses

200 List Health Checks response

Data is at body["result"]

[
  {
    "address": "*string*",
    "check_regions": [
      "*string*"
    ],
    "consecutive_fails": "*integer*",
    "consecutive_successes": "*integer*",
    "created_on": "*string*",
    "description": "*string*",
    "failure_reason": "*string*",
    "http_config": {
      "allow_insecure": "*boolean*",
      "expected_body": "*string*",
      "expected_codes": [
        null
      ],
      "follow_redirects": "*boolean*",
      "header": {},
      "method": "*string*",
      "path": "*string*",
      "port": "*integer*"
    },
    "id": "*string*",
    "interval": "*integer*",
    "modified_on": "*string*",
    "name": "*string*",
    "retries": "*integer*",
    "status": "*string*",
    "suspended": "*boolean*",
    "tcp_config": {
      "method": "*string*",
      "port": "*integer*"
    },
    "timeout": "*integer*",
    "type": "*string*"
  }
]
4XX List Health Checks response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "result": {},
  "result_info": {
    "count": "*number*",
    "page": "*number*",
    "per_page": "*number*",
    "total_count": "*number*"
  },
  "success": "*boolean*"
}

Update Health Check

PUT /zones/{zone_id}/smart_shield/healthchecks/{healthcheck_id}

Update a configured health check.

Responses

200 Update Health Check response.

Data is at body["result"]

{
  "address": "*string*",
  "check_regions": [
    "*string*"
  ],
  "consecutive_fails": "*integer*",
  "consecutive_successes": "*integer*",
  "created_on": "*string*",
  "description": "*string*",
  "failure_reason": "*string*",
  "http_config": {
    "allow_insecure": "*boolean*",
    "expected_body": "*string*",
    "expected_codes": [
      "*string*"
    ],
    "follow_redirects": "*boolean*",
    "header": {},
    "method": "*string*",
    "path": "*string*",
    "port": "*integer*"
  },
  "id": "*string*",
  "interval": "*integer*",
  "modified_on": "*string*",
  "name": "*string*",
  "retries": "*integer*",
  "status": "*string*",
  "suspended": "*boolean*",
  "tcp_config": {
    "method": "*string*",
    "port": "*integer*"
  },
  "timeout": "*integer*",
  "type": "*string*"
}
4XX Update Health Check response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}

Patch Health Check

PATCH /zones/{zone_id}/smart_shield/healthchecks/{healthcheck_id}

Patch a configured health check.

Responses

200 Patch Health Check response.

Data is at body["result"]

{
  "address": "*string*",
  "check_regions": [
    "*string*"
  ],
  "consecutive_fails": "*integer*",
  "consecutive_successes": "*integer*",
  "created_on": "*string*",
  "description": "*string*",
  "failure_reason": "*string*",
  "http_config": {
    "allow_insecure": "*boolean*",
    "expected_body": "*string*",
    "expected_codes": [
      "*string*"
    ],
    "follow_redirects": "*boolean*",
    "header": {},
    "method": "*string*",
    "path": "*string*",
    "port": "*integer*"
  },
  "id": "*string*",
  "interval": "*integer*",
  "modified_on": "*string*",
  "name": "*string*",
  "retries": "*integer*",
  "status": "*string*",
  "suspended": "*boolean*",
  "tcp_config": {
    "method": "*string*",
    "port": "*integer*"
  },
  "timeout": "*integer*",
  "type": "*string*"
}
4XX Patch Health Check response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}

Health Check Details

GET /zones/{zone_id}/smart_shield/healthchecks/{healthcheck_id}

Fetch a single configured health check.

Responses

200 Health Check Details response.

Data is at body["result"]

{
  "address": "*string*",
  "check_regions": [
    "*string*"
  ],
  "consecutive_fails": "*integer*",
  "consecutive_successes": "*integer*",
  "created_on": "*string*",
  "description": "*string*",
  "failure_reason": "*string*",
  "http_config": {
    "allow_insecure": "*boolean*",
    "expected_body": "*string*",
    "expected_codes": [
      "*string*"
    ],
    "follow_redirects": "*boolean*",
    "header": {},
    "method": "*string*",
    "path": "*string*",
    "port": "*integer*"
  },
  "id": "*string*",
  "interval": "*integer*",
  "modified_on": "*string*",
  "name": "*string*",
  "retries": "*integer*",
  "status": "*string*",
  "suspended": "*boolean*",
  "tcp_config": {
    "method": "*string*",
    "port": "*integer*"
  },
  "timeout": "*integer*",
  "type": "*string*"
}
4XX Health Check Details response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}

Delete Health Check

DELETE /zones/{zone_id}/smart_shield/healthchecks/{healthcheck_id}

Delete a health check.

Responses

200 Delete Health Check response.

Data is at body["result"]

{
  "id": "*string*"
}
4XX Delete Health Check response failure.
{
  "errors": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "messages": [
    {
      "code": "*integer*",
      "message": "*string*"
    }
  ],
  "result": {},
  "success": "*boolean*"
}

Summary

Functions

client(opts \\ [])

create(body, opts \\ [])

@spec create(
  body :: Restlax.Resource.action_body(),
  opts :: Restlax.Resource.action_options()
) ::
  {:ok, map()} | {:error, term()}

create!(body, opts \\ [])

@spec create!(
  body :: Restlax.Resource.action_body(),
  opts :: Restlax.Resource.action_options()
) ::
  map() | no_return()

delete(id, opts \\ [])

@spec delete(id :: term(), opts :: Restlax.Resource.action_options()) ::
  {:ok, map()} | {:error, term()}

delete!(id, opts \\ [])

@spec delete!(id :: term(), opts :: Restlax.Resource.action_options()) ::
  map() | no_return()

index(opts \\ [])

@spec index(opts :: Restlax.Resource.action_options()) ::
  {:ok, map()} | {:error, term()}

index!(opts \\ [])

@spec index!(opts :: Restlax.Resource.action_options()) :: map() | no_return()

path_for(id, opts \\ [])

@spec path_for(term(), [{:action, String.t()}]) :: String.t()

show(id, opts \\ [])

@spec show(id :: term(), opts :: Restlax.Resource.action_options()) ::
  {:ok, map()} | {:error, term()}

show!(id, opts \\ [])

@spec show!(id :: term(), opts :: Restlax.Resource.action_options()) ::
  map() | no_return()

update(id, body, opts \\ [])

@spec update(
  id :: term(),
  body :: Restlax.Resource.action_body(),
  opts :: Restlax.Resource.action_options()
) :: {:ok, map()} | {:error, term()}

update!(id, body, opts \\ [])

@spec update!(
  id :: term(),
  body :: Restlax.Resource.action_body(),
  opts :: Restlax.Resource.action_options()
) :: map() | no_return()