ComputeServices
Overview
Available Operations
- listServices - List services
- createService - Create a service
- getService - Get a service
- listServiceEvents - List service events
- listServiceInstances - List observed service instances
- listServiceLogs - List service logs
- terminateService - Terminate a service
listServices
List services
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.computeServices.listServices({});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { computeServicesListServices } from "@meetkai/mka1/funcs/computeServicesListServices.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 computeServicesListServices(sdk, {});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("computeServicesListServices 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.
useComputeServicesListServices,
useComputeServicesListServicesSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchComputeServicesListServices,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateComputeServicesListServices,
invalidateAllComputeServicesListServices,
} from "@meetkai/mka1/react-query/computeServicesListServices.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListServicesRequest | ✔️ | 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.ListServicesResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
createService
Create a service
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.computeServices.createService({
idempotencyKey: "<value>",
computeResourceCreate: {
compute: {
accelerator: "<value>",
ephemeralDiskGb: 709572,
gpuCount: 103964,
},
container: {
image: "https://loremflickr.com/676/3598?lock=35726374653792",
scriptB64: "<value>",
},
},
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { computeServicesCreateService } from "@meetkai/mka1/funcs/computeServicesCreateService.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 computeServicesCreateService(sdk, {
idempotencyKey: "<value>",
computeResourceCreate: {
compute: {
accelerator: "<value>",
ephemeralDiskGb: 709572,
gpuCount: 103964,
},
container: {
image: "https://loremflickr.com/676/3598?lock=35726374653792",
scriptB64: "<value>",
},
},
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("computeServicesCreateService 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.
useComputeServicesCreateServiceMutation
} from "@meetkai/mka1/react-query/computeServicesCreateService.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.CreateServiceRequest | ✔️ | 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.CreateServiceResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
getService
Get a service
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.computeServices.getService({
id: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { computeServicesGetService } from "@meetkai/mka1/funcs/computeServicesGetService.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 computeServicesGetService(sdk, {
id: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("computeServicesGetService 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.
useComputeServicesGetService,
useComputeServicesGetServiceSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchComputeServicesGetService,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateComputeServicesGetService,
invalidateAllComputeServicesGetService,
} from "@meetkai/mka1/react-query/computeServicesGetService.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.GetServiceRequest | ✔️ | 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.GetServiceResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
listServiceEvents
List service events
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.computeServices.listServiceEvents({
id: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { computeServicesListServiceEvents } from "@meetkai/mka1/funcs/computeServicesListServiceEvents.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 computeServicesListServiceEvents(sdk, {
id: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("computeServicesListServiceEvents 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.
useComputeServicesListServiceEvents,
useComputeServicesListServiceEventsSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchComputeServicesListServiceEvents,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateComputeServicesListServiceEvents,
invalidateAllComputeServicesListServiceEvents,
} from "@meetkai/mka1/react-query/computeServicesListServiceEvents.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListServiceEventsRequest | ✔️ | 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.ListServiceEventsResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
listServiceInstances
List observed service instances
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.computeServices.listServiceInstances({
id: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { computeServicesListServiceInstances } from "@meetkai/mka1/funcs/computeServicesListServiceInstances.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 computeServicesListServiceInstances(sdk, {
id: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("computeServicesListServiceInstances 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.
useComputeServicesListServiceInstances,
useComputeServicesListServiceInstancesSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchComputeServicesListServiceInstances,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateComputeServicesListServiceInstances,
invalidateAllComputeServicesListServiceInstances,
} from "@meetkai/mka1/react-query/computeServicesListServiceInstances.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListServiceInstancesRequest | ✔️ | 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.ListServiceInstancesResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
listServiceLogs
List service logs
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.computeServices.listServiceLogs({
id: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { computeServicesListServiceLogs } from "@meetkai/mka1/funcs/computeServicesListServiceLogs.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 computeServicesListServiceLogs(sdk, {
id: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("computeServicesListServiceLogs 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.
useComputeServicesListServiceLogs,
useComputeServicesListServiceLogsSuspense,
// Utility for prefetching data during server-side rendering and in React
// Server Components that will be immediately available to client components
// using the hooks.
prefetchComputeServicesListServiceLogs,
// Utilities to invalidate the query cache for this query in response to
// mutations and other user actions.
invalidateComputeServicesListServiceLogs,
invalidateAllComputeServicesListServiceLogs,
} from "@meetkai/mka1/react-query/computeServicesListServiceLogs.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.ListServiceLogsRequest | ✔️ | 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.ListServiceLogsResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |
terminateService
Terminate a service
Example Usage
import { SDK } from "@meetkai/mka1";
const sdk = new SDK({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await sdk.computeServices.terminateService({
id: "<id>",
});
console.log(result);
}
run();Standalone function
The standalone function version of this method:
import { SDKCore } from "@meetkai/mka1/core.js";
import { computeServicesTerminateService } from "@meetkai/mka1/funcs/computeServicesTerminateService.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 computeServicesTerminateService(sdk, {
id: "<id>",
});
if (res.ok) {
const { value: result } = res;
console.log(result);
} else {
console.log("computeServicesTerminateService 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.
useComputeServicesTerminateServiceMutation
} from "@meetkai/mka1/react-query/computeServicesTerminateService.js";Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request | operations.TerminateServiceRequest | ✔️ | 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.TerminateServiceResponse>
Errors
| Error Type | Status Code | Content Type |
|---|---|---|
| errors.APIError | 4XX, 5XX | */* |