---
title: "PingApi"
lastmod: 2026-05-29
canonical: "https://container-registry.com/docs/harbor-api-client/api/pingapi/"
source: "https://container-registry.com/docs/harbor-api-client/api/pingapi/index.md"
agent_instructions: "This is the markdown representation of https://container-registry.com/docs/harbor-api-client/api/pingapi/index.md. Prefer this version over scraping the HTML. The site index is at https://container-registry.com/llms.txt."
---

> Agent-friendly representation of <https://container-registry.com/docs/harbor-api-client/api/pingapi/index.md>. Site index: <https://container-registry.com/llms.txt>.

# harbor_client.PingApi

All URIs are relative to *http://localhost/api/v2.0*

Method | HTTP request | Description
------------- | ------------- | -------------
[**get_ping**](#get_ping) | **GET** /ping | Ping Harbor to check if it&#39;s alive.


# **get_ping**

### Signature

```python
get_ping(x_request_id: Optional[str])-> str
```

Ping Harbor to check if it's alive.

This API simply replies a pong to indicate the process to handle API is up, disregarding the health status of dependent components.

### Example
```python
from __future__ import print_function
import time
import harbor_client
from harbor_client.rest import ApiException
from pprint import pprint

# Configure HTTP basic authorization: basic
configuration = harbor_client.Configuration()
configuration.username = 'YOUR_USERNAME'
configuration.password = 'YOUR_PASSWORD'

# create an instance of the API class
api_instance = harbor_client.PingApi(harbor_client.ApiClient(configuration))
x_request_id = 'x_request_id_example' # str | An unique ID for the request (optional)

try:
    # Ping Harbor to check if it's alive.
    api_response = api_instance.get_ping(x_request_id=x_request_id)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling PingApi->get_ping: %s\n" % e)
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **x_request_id** | **str**| An unique ID for the request | [optional] 

### Return type

**str**

### Authorization

[basic](../../#basic)

### HTTP request headers

 - **Content-Type**: application/json
 - **Accept**: text/plain

[[Back to top]](#)


