(data.healthCheck)
- dataHealthCheck - Get the health of the service
Get the health of the service
import { AvaCloudSDK } from "@avalabs/avacloud-sdk";
const avaCloudSDK = new AvaCloudSDK({
apiKey: "<YOUR_API_KEY_HERE>",
chainId: "43114",
network: "mainnet",
});
async function run() {
const result = await avaCloudSDK.data.healthCheck.dataHealthCheck();
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { AvaCloudSDKCore } from "@avalabs/avacloud-sdk/core.js";
import { dataHealthCheckDataHealthCheck } from "@avalabs/avacloud-sdk/funcs/dataHealthCheckDataHealthCheck.js";
// Use `AvaCloudSDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const avaCloudSDK = new AvaCloudSDKCore({
apiKey: "<YOUR_API_KEY_HERE>",
chainId: "43114",
network: "mainnet",
});
async function run() {
const res = await dataHealthCheckDataHealthCheck(avaCloudSDK);
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body , are allowed. |
options.retries |
RetryConfig | ➖ | Enables retrying HTTP requests under certain failure conditions. |
options.serverURL |
string | ➖ | An optional server URL to use. |
Promise<operations.DataHealthCheckResponseBody>
Error Type | Status Code | Content Type |
---|---|---|
errors.DataHealthCheckResponseBody | 503 | application/json |
errors.SDKError | 4XX, 5XX | */* |