Skip to content

Latest commit

 

History

History
86 lines (60 loc) · 5.62 KB

README.md

File metadata and controls

86 lines (60 loc) · 5.62 KB

Metrics

(deployments.metrics)

Overview

Available Operations

create

Add metrics to a deployment

Example Usage

import { Orq } from "@orq-ai/node";

const orq = new Orq({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const result = await orq.deployments.metrics.create({
    id: "<id>",
    requestBody: {},
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { OrqCore } from "@orq-ai/node/core.js";
import { deploymentsMetricsCreate } from "@orq-ai/node/funcs/deploymentsMetricsCreate.js";

// Use `OrqCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const orq = new OrqCore({
  apiKey: process.env["ORQ_API_KEY"] ?? "",
});

async function run() {
  const res = await deploymentsMetricsCreate(orq, {
    id: "<id>",
    requestBody: {},
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.DeploymentCreateMetricRequest ✔️ The request object to use for the request.
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.

Response

Promise<operations.DeploymentCreateMetricResponseBody>

Errors

Error Type Status Code Content Type
errors.APIError 4XX, 5XX */*