Global Platform Stats
- get - Global System Stats
Cost 5
import { WaveShield } from "waveshield";
const waveShield = new WaveShield({
security: {
apiKeyAuth: process.env["WAVESHIELD_API_KEY_AUTH"] ?? "",
apiSecretAuth: process.env["WAVESHIELD_API_SECRET_AUTH"] ?? "",
},
});
async function run() {
const result = await waveShield.stats.get();
console.log(result);
}
run();The standalone function version of this method:
import { WaveShieldCore } from "waveshield/core.js";
import { statsGet } from "waveshield/funcs/statsGet.js";
// Use `WaveShieldCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const waveShield = new WaveShieldCore({
security: {
apiKeyAuth: process.env["WAVESHIELD_API_KEY_AUTH"] ?? "",
apiSecretAuth: process.env["WAVESHIELD_API_SECRET_AUTH"] ?? "",
},
});
async function run() {
const res = await statsGet(waveShield);
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("statsGet failed:", res.error);
}
}
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. |
Promise<operations.GetV1StatsResponse>
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.WaveShieldDefaultError | 4XX, 5XX | */* |