ComputeCatalog
Overview
Available Operations
- listAccelerators - List accelerators
- getAccelerator - Get an accelerator
- listComputeOffers - List provider offers
- listComputeProviders - List provider health
- createComputeQuote - Create a quote
listAccelerators
List accelerators
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.computeCatalog.listAccelerators({});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { computeCatalogListAccelerators } from "@meetkai/mka1/funcs/computeCatalogListAccelerators.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await computeCatalogListAccelerators(sdk, {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("computeCatalogListAccelerators failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useComputeCatalogListAccelerators,
useComputeCatalogListAcceleratorsSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchComputeCatalogListAccelerators,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateComputeCatalogListAccelerators,
invalidateAllComputeCatalogListAccelerators,
} from "@meetkai/mka1/react-query/computeCatalogListAccelerators.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListAcceleratorsRequest | ✔️ | 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.ListAcceleratorsResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
getAccelerator
Get an accelerator
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.computeCatalog.getAccelerator({
name: "<value>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { computeCatalogGetAccelerator } from "@meetkai/mka1/funcs/computeCatalogGetAccelerator.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await computeCatalogGetAccelerator(sdk, {
name: "<value>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("computeCatalogGetAccelerator failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useComputeCatalogGetAccelerator,
useComputeCatalogGetAcceleratorSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchComputeCatalogGetAccelerator,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateComputeCatalogGetAccelerator,
invalidateAllComputeCatalogGetAccelerator,
} from "@meetkai/mka1/react-query/computeCatalogGetAccelerator.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetAcceleratorRequest | ✔️ | 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.GetAcceleratorResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
listComputeOffers
Cluster administrators may always read this route. Organization administrators may read it only when provider anonymity is disabled.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.computeCatalog.listComputeOffers({});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { computeCatalogListComputeOffers } from "@meetkai/mka1/funcs/computeCatalogListComputeOffers.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await computeCatalogListComputeOffers(sdk, {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("computeCatalogListComputeOffers failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useComputeCatalogListComputeOffers,
useComputeCatalogListComputeOffersSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchComputeCatalogListComputeOffers,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateComputeCatalogListComputeOffers,
invalidateAllComputeCatalogListComputeOffers,
} from "@meetkai/mka1/react-query/computeCatalogListComputeOffers.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListComputeOffersRequest | ✔️ | 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.ListComputeOffersResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
listComputeProviders
Cluster administrators may always read this route. Organization administrators may read it only when provider anonymity is disabled.
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.computeCatalog.listComputeProviders({});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { computeCatalogListComputeProviders } from "@meetkai/mka1/funcs/computeCatalogListComputeProviders.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await computeCatalogListComputeProviders(sdk, {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("computeCatalogListComputeProviders failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Query hooks for fetching data.
useComputeCatalogListComputeProviders,
useComputeCatalogListComputeProvidersSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchComputeCatalogListComputeProviders,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateComputeCatalogListComputeProviders,
invalidateAllComputeCatalogListComputeProviders,
} from "@meetkai/mka1/react-query/computeCatalogListComputeProviders.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListComputeProvidersRequest | ✔️ | 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.ListComputeProvidersResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
createComputeQuote
Create a quote
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.computeCatalog.createComputeQuote({
computeQuoteRequest: {
compute: {
accelerator: "<value>",
ephemeralDiskGb: 986693,
gpuCount: 546670,
},
container: {
image: "https://loremflickr.com/3170/1872?lock=3147859139793822",
},
resourceType: "job",
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { computeCatalogCreateComputeQuote } from "@meetkai/mka1/funcs/computeCatalogCreateComputeQuote.js";
// Use `SDKCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const sdk = new SDKCore({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const res = await computeCatalogCreateComputeQuote(sdk, {
computeQuoteRequest: {
compute: {
accelerator: "<value>",
ephemeralDiskGb: 986693,
gpuCount: 546670,
},
container: {
image: "https://loremflickr.com/3170/1872?lock=3147859139793822",
},
resourceType: "job",
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("computeCatalogCreateComputeQuote failed:", res.error);
}
}
run();React hooks and utilities
This method can be used in React components through the following hooks and associated utilities.
Check out this guide for information about each of the utilities below and how to get started using React hooks.
import {
// Mutation hook for triggering the API call.
useComputeCatalogCreateComputeQuoteMutation
} from "@meetkai/mka1/react-query/computeCatalogCreateComputeQuote.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.CreateComputeQuoteRequest | ✔️ | 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.CreateComputeQuoteResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |