# Endpoint Healthchecks ## List Endpoint Health Checks `diagnostics.endpoint_healthchecks.list(EndpointHealthcheckListParams**kwargs) -> EndpointHealthcheckListResponse` **get** `/accounts/{account_id}/diagnostics/endpoint-healthchecks` List Endpoint Health Checks. ### Parameters - `account_id: str` Identifier ### Returns - `class EndpointHealthcheckListResponse: …` - `check_type: Literal["icmp"]` type of check to perform - `"icmp"` - `endpoint: str` the IP address of the host to perform checks against - `id: Optional[str]` UUID. - `name: Optional[str]` Optional name associated with this check ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) endpoint_healthchecks = client.diagnostics.endpoint_healthchecks.list( account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(endpoint_healthchecks.id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "check_type": "icmp", "endpoint": "203.0.113.1", "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "name": "My Endpoint" } } ``` ## Endpoint Health Check `diagnostics.endpoint_healthchecks.create(EndpointHealthcheckCreateParams**kwargs) -> EndpointHealthcheckCreateResponse` **post** `/accounts/{account_id}/diagnostics/endpoint-healthchecks` Create Endpoint Health Check. ### Parameters - `account_id: str` Identifier - `check_type: Literal["icmp"]` type of check to perform - `"icmp"` - `endpoint: str` the IP address of the host to perform checks against - `name: Optional[str]` Optional name associated with this check ### Returns - `class EndpointHealthcheckCreateResponse: …` - `check_type: Literal["icmp"]` type of check to perform - `"icmp"` - `endpoint: str` the IP address of the host to perform checks against - `id: Optional[str]` UUID. - `name: Optional[str]` Optional name associated with this check ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) endpoint_healthcheck = client.diagnostics.endpoint_healthchecks.create( account_id="023e105f4ecef8ad9ca31a8372d0c353", check_type="icmp", endpoint="203.0.113.1", ) print(endpoint_healthcheck.id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "check_type": "icmp", "endpoint": "203.0.113.1", "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "name": "My Endpoint" } } ``` ## Get Endpoint Health Check `diagnostics.endpoint_healthchecks.get(strid, EndpointHealthcheckGetParams**kwargs) -> EndpointHealthcheckGetResponse` **get** `/accounts/{account_id}/diagnostics/endpoint-healthchecks/{id}` Get a single Endpoint Health Check. ### Parameters - `account_id: str` Identifier - `id: str` UUID. ### Returns - `class EndpointHealthcheckGetResponse: …` - `check_type: Literal["icmp"]` type of check to perform - `"icmp"` - `endpoint: str` the IP address of the host to perform checks against - `id: Optional[str]` UUID. - `name: Optional[str]` Optional name associated with this check ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) endpoint_healthcheck = client.diagnostics.endpoint_healthchecks.get( id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(endpoint_healthcheck.id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "check_type": "icmp", "endpoint": "203.0.113.1", "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "name": "My Endpoint" } } ``` ## Delete Endpoint Health Check `diagnostics.endpoint_healthchecks.delete(strid, EndpointHealthcheckDeleteParams**kwargs) -> EndpointHealthcheckDeleteResponse` **delete** `/accounts/{account_id}/diagnostics/endpoint-healthchecks/{id}` Delete Endpoint Health Check. ### Parameters - `account_id: str` Identifier - `id: str` UUID. ### Returns - `class EndpointHealthcheckDeleteResponse: …` - `errors: List[Error]` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[ErrorSource]` - `pointer: Optional[str]` - `messages: List[Message]` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[MessageSource]` - `pointer: Optional[str]` - `success: Literal[true]` Whether the API call was successful. - `true` ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) endpoint_healthcheck = client.diagnostics.endpoint_healthchecks.delete( id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", ) print(endpoint_healthcheck.errors) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true } ``` ## Update Endpoint Health Check `diagnostics.endpoint_healthchecks.update(strid, EndpointHealthcheckUpdateParams**kwargs) -> EndpointHealthcheckUpdateResponse` **put** `/accounts/{account_id}/diagnostics/endpoint-healthchecks/{id}` Update a Endpoint Health Check. ### Parameters - `account_id: str` Identifier - `id: str` UUID. - `check_type: Literal["icmp"]` type of check to perform - `"icmp"` - `endpoint: str` the IP address of the host to perform checks against - `name: Optional[str]` Optional name associated with this check ### Returns - `class EndpointHealthcheckUpdateResponse: …` - `check_type: Literal["icmp"]` type of check to perform - `"icmp"` - `endpoint: str` the IP address of the host to perform checks against - `id: Optional[str]` UUID. - `name: Optional[str]` Optional name associated with this check ### Example ```python import os from cloudflare import Cloudflare client = Cloudflare( api_token=os.environ.get("CLOUDFLARE_API_TOKEN"), # This is the default and can be omitted ) endpoint_healthcheck = client.diagnostics.endpoint_healthchecks.update( id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415", account_id="023e105f4ecef8ad9ca31a8372d0c353", check_type="icmp", endpoint="203.0.113.1", ) print(endpoint_healthcheck.id) ``` #### Response ```json { "errors": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "messages": [ { "code": 1000, "message": "message", "documentation_url": "documentation_url", "source": { "pointer": "pointer" } } ], "success": true, "result": { "check_type": "icmp", "endpoint": "203.0.113.1", "id": "f174e90a-fafe-4643-bbbc-4a0ed4fc8415", "name": "My Endpoint" } } ``` ## Domain Types ### Endpoint Healthcheck - `class EndpointHealthcheck: …` - `check_type: Literal["icmp"]` type of check to perform - `"icmp"` - `endpoint: str` the IP address of the host to perform checks against - `name: Optional[str]` Optional name associated with this check ### Endpoint Healthcheck List Response - `class EndpointHealthcheckListResponse: …` - `check_type: Literal["icmp"]` type of check to perform - `"icmp"` - `endpoint: str` the IP address of the host to perform checks against - `id: Optional[str]` UUID. - `name: Optional[str]` Optional name associated with this check ### Endpoint Healthcheck Create Response - `class EndpointHealthcheckCreateResponse: …` - `check_type: Literal["icmp"]` type of check to perform - `"icmp"` - `endpoint: str` the IP address of the host to perform checks against - `id: Optional[str]` UUID. - `name: Optional[str]` Optional name associated with this check ### Endpoint Healthcheck Get Response - `class EndpointHealthcheckGetResponse: …` - `check_type: Literal["icmp"]` type of check to perform - `"icmp"` - `endpoint: str` the IP address of the host to perform checks against - `id: Optional[str]` UUID. - `name: Optional[str]` Optional name associated with this check ### Endpoint Healthcheck Delete Response - `class EndpointHealthcheckDeleteResponse: …` - `errors: List[Error]` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[ErrorSource]` - `pointer: Optional[str]` - `messages: List[Message]` - `code: int` - `message: str` - `documentation_url: Optional[str]` - `source: Optional[MessageSource]` - `pointer: Optional[str]` - `success: Literal[true]` Whether the API call was successful. - `true` ### Endpoint Healthcheck Update Response - `class EndpointHealthcheckUpdateResponse: …` - `check_type: Literal["icmp"]` type of check to perform - `"icmp"` - `endpoint: str` the IP address of the host to perform checks against - `id: Optional[str]` UUID. - `name: Optional[str]` Optional name associated with this check